mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
- add `objc-x86_64` architecture typings
- remove `objc-i386` architecture typings
- add `vector` typings
- change
```
(method) NSArray<ObjectType>.arrayWithArray<{}>(array: NSArray<{}>): NSArray<{}>
```
to
```
(method) NSArray<ObjectType>.arrayWithArray<string>(array: string[] | NSArray<string>): NSArray<string>
```
* Export typings on for iOS 11 x86_64
* fix: Export typings with fixed NSArray parameters
* Export typescript declarations for iOS 11.4
* Update reference path with the new typings folder
* feat: Create a script for auto typings generation
* Export typings on for iOS 11 x86_64
* fix: Export typings with fixed NSArray parameters
* Export typescript declarations for iOS 11.4
* Update reference path with the new typings folder
* feat: Create a script for auto typings generation
* chore: update .gitignore and .npmignore
* fix: Update constructor methods accepting NSArray parameters
* chore: Update manual changes flag for typings generation
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.