Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb265bd

Browse files
Tronix117rigor789
authored andcommitted
fix(typings): add proper typings (nativescript-vue#289)
* fix(typings): were not implemented correctlyTypings should not declare a module wereas they are already in the concerned moduleReusing Vue way of doing typings, and separating constructor from body to have better overriding capabilities* fix: remove $run() and fix typo in comment
1 parenta953db5 commitbb265bd

File tree

1 file changed

+57
-22
lines changed

1 file changed

+57
-22
lines changed

‎index.d.ts

Lines changed: 57 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,58 @@
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
2344
}
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;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp