|
1 |
| -// Typings for NativeScript-Vue |
2 |
| -declare module'nativescript-vue'{ |
3 |
| -// import vue.js typings |
4 |
| -importVuefrom'vue'; |
5 |
| - |
6 |
| -// creat a nativescript vue class that extends vue.js |
7 |
| -classNativeScriptVueextendsVue{ |
8 |
| -/** |
9 |
| - * Registers NativeScript Plugin. |
10 |
| - *@param elementName Name of the element to use in your template |
11 |
| - *@param resolver function to register the element |
12 |
| - *@param meta meta associated with the element |
13 |
| - */ |
14 |
| -staticregisterElement(elementName:string,resolver:Function,meta?:any):void; |
15 |
| - |
16 |
| -/** |
17 |
| - * starts the nativescript application |
18 |
| - */ |
19 |
| -$run():void |
20 |
| -} |
21 |
| - |
22 |
| -export=NativeScriptVue; |
| 1 | +// import vue.js typings |
| 2 | +// import Vue from 'vue'; |
| 3 | +import{Vue,VueConstructor}from'vue/types/vue' |
| 4 | +import{Page,NavigationEntry,Size}from'tns-core-modules/ui/frame/frame' |
| 5 | +import{View}from'tns-core-modules/ui/core/view' |
| 6 | + |
| 7 | +exporttypenavigateTo=( |
| 8 | +component:VueConstructor, |
| 9 | +options?:NavigationEntry, |
| 10 | +cb?:()=>Page, |
| 11 | +)=>Promise<Page>; |
| 12 | + |
| 13 | +exportinterfaceModalOptions{ |
| 14 | +context?:any; |
| 15 | +fullscreen?:boolean; |
| 16 | +} |
| 17 | + |
| 18 | +// create a nativescript vue class that extends vue.js |
| 19 | +exportinterfaceNativeScriptVue<V=View>extendsVue{ |
| 20 | +nativeView:V |
| 21 | + |
| 22 | +$navigateTo:navigateTo |
| 23 | +$navigateBack:()=>void |
| 24 | + |
| 25 | +$modal?:{close:(data?)=>Promise<typeofdata>}; |
| 26 | + |
| 27 | +/** |
| 28 | + * Open a modal using a component |
| 29 | + *@param {typeof Vue} component |
| 30 | + *@param {ModalOptions} options |
| 31 | + *@returns {any} |
| 32 | + */ |
| 33 | +$showModal:(component:typeofVue,options?:ModalOptions)=>Promise<any>; |
| 34 | + |
| 35 | +/** |
| 36 | + * starts the nativescript application |
| 37 | + */ |
| 38 | +$start:()=>void |
| 39 | +} |
| 40 | + |
| 41 | +exportinterfaceNativeScriptVueConstructorextendsVueConstructor<NativeScriptVue>{ |
| 42 | +navigateTo:navigateTo |
| 43 | +navigateBack:()=>void |
23 | 44 | }
|
| 45 | + |
| 46 | +exportconstNativeScriptVue:NativeScriptVueConstructor |
| 47 | + |
| 48 | +exportdefaultNativeScriptVue; |
| 49 | + |
| 50 | +// export as namespace NativeScriptVue; |
| 51 | + |
| 52 | +/** |
| 53 | + * Registers NativeScript Plugin. |
| 54 | + *@param elementName Name of the element to use in your template |
| 55 | + *@param resolver function to register the element |
| 56 | + *@param meta meta associated with the element |
| 57 | + */ |
| 58 | +exportfunctionregisterElement(elementName:string,resolver:Function,meta?:any):void; |