Closed ignaciolarranaga closed 7 years ago
Just found it is already done.
Just for reference you have to add the dependency to tns-platform-declarations (npm install tns-platform-declarations --save-dev
) ot your project and latter add the following to references.d.ts:
/// <reference path="node_modules/tns-platform-declarations/android.d.ts" />
/// <reference path="node_modules/tns-platform-declarations/ios.d.ts" />
Just to add that you can generate ios.d.ts
and android.d.ts
files manually. To generate ios.d.ts
run the following command in your project directory:
TNS_TYPESCRIPT_DECLARATIONS_PATH="$(pwd)/typings" tns build ios [--for-device] [--release]
This will create typings
folder under your project directory containing typescript definitions for iOS native APIs. Manually generating definitions for Android is in experimental state. You can find how to generate Android type definitions here.
Right now when you are programming with the native APIs for iOS and Android there is no intellisense on the available classes or the methods they provide, it would be a nice to have.
For example if I type "PH" that suggest me that there is a class PHAsset on iOS Photo framework, and if I type "PHAsset." that shows me the methods it contains.