O'Reilly logo

NativeScript for Angular Mobile Development by Nathanael J. Anderson, Nathan Walker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up native API type checking and generate AudioKit TypeScript definitions

The first thing we want to do is install tns-platform-declarations:

npm i tns-platform-declarations --save-dev

Now, we create a new file in the root of the project called references.d.ts with the following contents:

/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />

This provides us with full type checking and intellisense support for iOS and Android APIs.

We now want to generate typings for the AudioKit framework itself. We can execute this command to generate the typings for the included AudioKit.framework:

TNS_TYPESCRIPT_DECLARATIONS_PATH="$(pwd)/typings" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required