IMA SDK के साथ TypeScript का इस्तेमाल करना
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
TypeScript, ऑब्जेक्ट-ओरिएंटेड प्रोग्रामिंग भाषा है. इसमें डेटा टाइप के लिए, टाइप के नाम का इस्तेमाल किया जाता है. यह भाषा, JavaScript में कंपाइल होती है. TypeScript, JavaScript का सुपरसेट है. यह JavaScript की सभी सुविधाओं के साथ-साथ, स्टैटिक टाइपिंग की सुविधा भी देता है. हालांकि, स्टैटिक टाइपिंग का इस्तेमाल करना ज़रूरी नहीं है.
TypeScript टूल की मदद से, उन गड़बड़ियों का पता लगाया जा सकता है और उन्हें रोका जा सकता है जो शायद आपको सामान्य JavaScript में न दिखें.
अपनी प्रोफ़ाइल बनाना शुरू करें
DefinitelyTyped एक ओपन सोर्स प्रोजेक्ट है. इसमें IMA SDK लाइब्रेरी के साथ-साथ कई पैकेज के लिए, टाइप एलान फ़ाइलों की रिपॉज़िटरी बनाई जाती है. @types/google_interactive_media_ads_types पैकेज से, npm की मदद से IMA टाइप इंस्टॉल किए जा सकते हैं.
npm install --save-dev @types/google_interactive_media_ads_types
इंस्टॉल करने के बाद, आपके पास अपने कोड में google.ima
ऑब्जेक्ट से एक्सपोज़ किए गए सभी टाइप का ऐक्सेस होता है. Visual Studio Code जैसे सोर्स कोड एडिटर में, IMA के तरीकों और प्रॉपर्टी के लिए, कोड पूरा होने और कॉन्टेंट असिस्ट की सुविधा का भी फ़ायदा लिया जा सकता है.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-10 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-10 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eTypeScript is a strongly typed, object-oriented programming language that compiles to JavaScript and supports all of JavaScript's features plus optional static typing.\u003c/p\u003e\n"],["\u003cp\u003eTypeScript tooling helps in detecting and preventing bugs that might go unnoticed in plain JavaScript.\u003c/p\u003e\n"],["\u003cp\u003eDefinitelyTyped is an open-source project containing type declaration files for various packages, including the IMA SDK library.\u003c/p\u003e\n"],["\u003cp\u003eInstalling the IMA types using npm from the @types/google-interactive-media-ads package gives you access to all types exposed by the google.ima object.\u003c/p\u003e\n"],["\u003cp\u003eAfter installation, source code editors with features like code completion and content assist can be used to take full advantage of IMA methods and properties.\u003c/p\u003e\n"]]],[],null,["# Use TypeScript with the IMA SDK\n\n[TypeScript](//www.typescriptlang.org/) is a strongly typed, object-oriented\nprogramming language that compiles to JavaScript. TypeScript is a superset of\nJavaScript, and supports all of JavaScript's features plus optional\n[static typing](//en.wikipedia.org/wiki/Type_system#STATIC).\n[TypeScript tooling](http://www.typescriptlang.org/docs/handbook/2/basic-types.html#types-for-tooling)\ncan help detect and prevent bugs that you might not notice in plain JavaScript.\n\nGet started\n-----------\n\n[DefinitelyTyped](//github.com/DefinitelyTyped/DefinitelyTyped) is an open\nsource project that maintains a repository of type\n[declaration files](//www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)\nfor many packages, including the IMA SDK library. You can install the IMA types\nwith [npm](//docs.npmjs.com/about-npm) from the\n[@types/google_interactive_media_ads_types](//www.npmjs.com/package/@types/google_interactive_media_ads_types)\npackage. \n\n npm install --save-dev @types/google_interactive_media_ads_types\n\nAfter installation, you have access to all of the types exposed by the\n[`google.ima`](/interactive-media-ads/docs/sdks/html5/client-side/reference/ts)\nobject in your own code. You can also take advantage of code completion and\ncontent assist for IMA methods and properties in source code editors that have\nthose features, for example, [Visual Studio Code](https://code.visualstudio.com/docs/languages/typescript)."]]