Use TypeScript with the IMA SDK
TypeScript is a strongly typed, object-oriented
programming language that compiles to JavaScript. TypeScript is a superset of
JavaScript, and supports all of JavaScript's features plus optional
static typing.
TypeScript tooling
can help detect and prevent bugs that you might not notice in plain JavaScript.
Get started
DefinitelyTyped is an open
source project that maintains a repository of type
declaration files
for many packages, including the IMA SDK library. You can install the IMA types
with npm from the
@types/google-interactive-media-ads
package.
npm install --save-dev @types/google-interactive-media-ads
After installation, you have access to all of the types exposed by the
google.ima
object in your own code. You can also take advantage of code completion and
content assist for IMA methods and properties in source code editors that have
those features, for example, Visual Studio Code.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-14 UTC.
[null,null,["Last updated 2025-01-14 UTC."],[[["TypeScript is a strongly typed, object-oriented programming language that compiles to JavaScript and supports all of JavaScript's features plus optional static typing."],["TypeScript tooling helps in detecting and preventing bugs that might go unnoticed in plain JavaScript."],["DefinitelyTyped is an open-source project containing type declaration files for various packages, including the IMA SDK library."],["Installing 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."],["After installation, source code editors with features like code completion and content assist can be used to take full advantage of IMA methods and properties."]]],[]]