Files
NativeScript/tns-platform-declarations
Vasil Chimev 17e0dcc5ed chore: add npm version script (#6168)
* chore: update versions

* Update README.md

* docs: add changelog for 4.2.0 (#6165)

* chore: update versions

* chore: update versions

* chore: set versions of packages to 4.2.0

The versions of packages to reflect in `master` to reflect the `latest` official release in `npm`.
Bumping up versions will execute in CI job through the `npm --no-git-tag-version version minor` command.
This is to unify the release process across the `NativeScript`, `nativescript-angular` and `nativescript-dev-webpack` repositories.

* chore: add npm version script

* docs: add release section to CONTRIBUTING.md

* chore: update npm version script

* chore(deps): update to widgets@next

* chore(deps): update to widgets@next

* docs(CONTRIBUTING): update Releasing new versions section

Add a note that these instructions concern NativeScript Core Team Members.
2018-08-09 11:11:46 +03:00
..
2016-09-27 09:48:22 +03:00
2018-08-08 15:16:02 +03:00

This plugin contains type information about the native platforms as exposed by the NativeScript framework.

Offically supported entry points:

  • android.d.ts - For android SDK and runtime types.
  • ios.d.ts - For iOS SDK and runtime types.

Using the declarations may conflict with DOM typings, consider using TypeScript 2.x.x and the following settings in your tsconfig.json:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "experimentalDecorators": true,
        "lib": [
            "es6",
            "dom"
        ]
    }
}

Create reference.d.tsand add the following content:

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

By default the android.d.ts file contains the typings for android API level 17. If your application has a higher minimum API level you can reference that level instead:

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

d.ts files require a lot of memory and CPU. Consider adding skipLibCheck option to tsconfig file.

Generate android .d.ts files

  • To generate android dependencies use android-dts-generator with the appropriate android version and android support jars
  • To regenerate android-*.d.ts file use the android-dts-generator passing the corresponding android jar (described here)
  • More details for using the android-dts-generator can be found in this article.