-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
interfaces.ts
112 lines (108 loc) · 3.04 KB
/
interfaces.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
export interface PluginConfig {
/**
* Plugin name, this should match the class name
*/
pluginName: string;
/**
* Plugin NPM package name
*/
plugin: string;
/**
* Plugin object reference
*/
pluginRef?: string;
/**
* Github repository URL
*/
repo?: string;
/**
* Custom install command
*/
install?: string;
/**
* Available installation variables
*/
installVariables?: string[];
/**
* Supported platforms
*/
platforms?: string[];
[key: string]: any;
}
export interface CordovaOptions {
destruct?: boolean;
/**
* If the method-name of the cordova plugin is different from the wrappers one, it can be defined here
*/
methodName?: string;
/**
* Set to true if the wrapped method is a sync function
*/
sync?: boolean;
/**
* Callback order. Set to reverse if the success/error callbacks are the first 2 arguments that the wrapped method
* takes.
*/
callbackOrder?: 'reverse';
/**
* Callback style
*/
callbackStyle?: 'node' | 'object';
/**
* Set a custom index for the success callback function. This doesn't work if callbackOrder or callbackStyle are set.
*/
successIndex?: number;
/**
* Set a custom index for the error callback function. This doesn't work if callbackOrder or callbackStyle are set.
*/
errorIndex?: number;
/**
* Success function property name. This must be set if callbackStyle is set to object.
*/
successName?: string;
/**
* Error function property name. This must be set if callbackStyle is set to object.
*/
errorName?: string;
/**
* Set to true to return an observable
*/
observable?: boolean;
/**
* If observable is set to true, this can be set to a different function name that will cancel the observable.
*/
clearFunction?: string;
/**
* This can be used if clearFunction is set. Set this to true to call the clearFunction with the same arguments used
* in the initial function.
*/
clearWithArgs?: boolean;
/**
* Creates an observable that wraps a global event. Replaces document.addEventListener
*/
eventObservable?: boolean;
/**
* Event name, this must be set if eventObservable is set to true
*/
event?: string;
/**
* Element to attach the event listener to, this is optional, defaults to `window`
*/
element?: any;
/**
* Set to true if the wrapped method returns a promise
*/
otherPromise?: boolean;
/**
* Supported platforms
*/
platforms?: string[];
}
export declare const Plugin: (config: PluginConfig) => ClassDecorator;
export declare const Cordova: (config?: CordovaOptions) => MethodDecorator;
export declare const CordovaProperty: () => PropertyDecorator;
export declare const CordovaInstance: (config?: CordovaOptions) => MethodDecorator;
export declare const InstanceProperty: () => PropertyDecorator;
export declare const CordovaCheck: (config?: CordovaOptions) => MethodDecorator;
export declare const InstanceCheck: (config?: CordovaOptions) => MethodDecorator;
export declare const CordovaFunctionOverride: () => MethodDecorator;