native-fn 1.0.90 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +751 -4
- package/dist/native.cjs +3509 -1995
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +3509 -1995
- package/dist/native.umd.js +3509 -1995
- package/dist/native.umd.min.js +1 -1
- package/dist/src/constants/index.d.ts +1 -0
- package/dist/src/errors/not-supported-error.d.ts +2 -0
- package/dist/src/errors/permission-not-granted-error.d.ts +2 -0
- package/dist/src/plugin/app/constants/index.d.ts +8 -0
- package/dist/src/plugin/app/cores/index.d.ts +0 -1
- package/dist/src/plugin/app/types/app.d.ts +53 -5
- package/dist/src/plugin/appearance/constants/index.d.ts +1 -4
- package/dist/src/plugin/appearance/cores/index.d.ts +2 -2
- package/dist/src/plugin/appearance/types/appearance.d.ts +2 -2
- package/dist/src/plugin/appearance/types/appearanceInstance.d.ts +9 -0
- package/dist/src/plugin/badge/cores/index.d.ts +3 -0
- package/dist/src/plugin/badge/index.d.ts +3 -0
- package/dist/src/plugin/badge/types/badge.d.ts +10 -0
- package/dist/src/plugin/badge/types/index.d.ts +1 -0
- package/dist/src/plugin/battery/cores/index.d.ts +3 -0
- package/dist/src/plugin/battery/index.d.ts +3 -0
- package/dist/src/plugin/battery/types/battery.d.ts +26 -0
- package/dist/src/plugin/battery/types/index.d.ts +1 -0
- package/dist/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/src/plugin/clipboard/types/clipboard.d.ts +1 -1
- package/dist/src/plugin/dimension/constants/index.d.ts +42 -2
- package/dist/src/plugin/dimension/cores/index.d.ts +2 -2
- package/dist/src/plugin/dimension/types/dimensions.d.ts +24 -3
- package/dist/src/plugin/dimension/utils/create-env-observer.d.ts +24 -0
- package/dist/src/plugin/fullscreen/cores/index.d.ts +4 -2
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +8 -5
- package/dist/src/plugin/geolocation/constants/index.d.ts +2 -0
- package/dist/src/plugin/geolocation/cores/index.d.ts +3 -0
- package/dist/src/plugin/geolocation/index.d.ts +3 -0
- package/dist/src/plugin/geolocation/types/geolocation.d.ts +12 -0
- package/dist/src/plugin/geolocation/types/index.d.ts +1 -0
- package/dist/src/plugin/notification/cores/index.d.ts +3 -0
- package/dist/src/plugin/notification/index.d.ts +3 -0
- package/dist/src/plugin/notification/types/index.d.ts +1 -0
- package/dist/src/plugin/notification/types/notification.d.ts +27 -0
- package/dist/src/plugin/open/constants/index.d.ts +28 -0
- package/dist/src/plugin/open/cores/index.d.ts +55 -0
- package/dist/src/plugin/open/errors/not-supported-error.d.ts +2 -0
- package/dist/src/plugin/open/errors/url-open-error.d.ts +2 -0
- package/dist/src/plugin/open/errors/user-cancel-error.d.ts +2 -0
- package/dist/src/plugin/open/index.d.ts +3 -0
- package/dist/src/plugin/open/types/index.d.ts +1 -0
- package/dist/src/plugin/open/types/open.d.ts +187 -0
- package/dist/src/plugin/permission/constants/index.d.ts +22 -0
- package/dist/src/plugin/permission/cores/index.d.ts +3 -0
- package/dist/src/plugin/permission/index.d.ts +3 -0
- package/dist/src/plugin/permission/types/index.d.ts +1 -0
- package/dist/src/plugin/permission/types/permission.d.ts +10 -0
- package/dist/src/plugin/pip/cores/index.d.ts +12 -0
- package/dist/src/plugin/pip/index.d.ts +3 -0
- package/dist/src/plugin/pip/types/index.d.ts +1 -0
- package/dist/src/plugin/pip/types/pip.d.ts +15 -0
- package/dist/src/plugin/platform/constants/index.d.ts +0 -1
- package/dist/src/plugin/platform/cores/index.d.ts +15 -2
- package/dist/src/plugin/platform/types/platform.d.ts +12 -3
- package/dist/src/plugin/pwa/cores/index.d.ts +3 -0
- package/dist/src/plugin/pwa/index.d.ts +3 -0
- package/dist/src/plugin/pwa/types/index.d.ts +1 -0
- package/dist/src/plugin/pwa/types/pwa.d.ts +8 -0
- package/dist/src/plugin/speech/cores/index.d.ts +53 -0
- package/dist/src/plugin/speech/index.d.ts +3 -0
- package/dist/src/plugin/speech/types/index.d.ts +1 -0
- package/dist/src/plugin/speech/types/speech.d.ts +9 -0
- package/dist/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/src/plugin/theme/types/theme.d.ts +1 -1
- package/dist/src/plugin/vibration/cores/index.d.ts +3 -0
- package/dist/src/plugin/vibration/index.d.ts +3 -0
- package/dist/src/plugin/vibration/types/index.d.ts +1 -0
- package/dist/src/plugin/vibration/types/vibration.d.ts +9 -0
- package/dist/src/types/event-listener.d.ts +35 -0
- package/dist/src/types/index.d.ts +3 -0
- package/dist/src/types/listener-entry.d.ts +0 -1
- package/dist/src/types/native.d.ts +30 -16
- package/dist/src/types/subscription-manager.d.ts +4 -0
- package/dist/src/utils/create-env-observer.d.ts +8 -0
- package/dist/src/utils/create-hidden-element.d.ts +1 -1
- package/dist/src/utils/create-subscription-manager.d.ts +2 -0
- package/dist/src/utils/defer.d.ts +1 -0
- package/dist/src/utils/event-listener.d.ts +3 -0
- package/dist/src/utils/keys.d.ts +1 -0
- package/dist/src/utils/now.d.ts +1 -0
- package/dist/src/utils/pad-start.d.ts +1 -0
- package/dist/src/utils/random-string.d.ts +1 -0
- package/dist/src/utils/set-style.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,751 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
declare enum Appearances {
|
|
2
|
+
Unknown = "unknown",
|
|
3
|
+
Light = "light",
|
|
4
|
+
Dark = "dark"
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
declare interface AppearanceInstance {
|
|
8
|
+
get value(): Appearances;
|
|
9
|
+
onChange(listener: (appearance: Appearances) => void, options?: AddEventListenerOptions): () => void;
|
|
10
|
+
Constants: {
|
|
11
|
+
Appearances: typeof Appearances;
|
|
12
|
+
};
|
|
13
|
+
Errors: {};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare const Appearance: AppearanceInstance;
|
|
17
|
+
|
|
18
|
+
declare const NotSupportedError: ErrorConstructor;
|
|
19
|
+
|
|
20
|
+
declare interface BadgeInstance {
|
|
21
|
+
set(contents: number): Promise<void>;
|
|
22
|
+
clear(): Promise<void>;
|
|
23
|
+
get supported(): boolean;
|
|
24
|
+
Constants: {};
|
|
25
|
+
Errors: {
|
|
26
|
+
NotSupportedError: typeof NotSupportedError;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare const Badge: BadgeInstance;
|
|
31
|
+
|
|
32
|
+
declare interface ClipboardInstance {
|
|
33
|
+
copy(item: any): Promise<boolean>;
|
|
34
|
+
paste(): Promise<string>;
|
|
35
|
+
Constants: {};
|
|
36
|
+
Errors: {};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare const Clipboard: ClipboardInstance;
|
|
40
|
+
|
|
41
|
+
declare enum Orientation {
|
|
42
|
+
Portrait = "portrait",
|
|
43
|
+
Landscape = "landscape",
|
|
44
|
+
Unknown = "unknown"
|
|
45
|
+
}
|
|
46
|
+
declare const ENV_PRESETS: {
|
|
47
|
+
readonly 'safe-area-inset': {
|
|
48
|
+
readonly top: "safe-area-inset-top";
|
|
49
|
+
readonly right: "safe-area-inset-right";
|
|
50
|
+
readonly bottom: "safe-area-inset-bottom";
|
|
51
|
+
readonly left: "safe-area-inset-left";
|
|
52
|
+
};
|
|
53
|
+
readonly 'safe-area-max-inset': {
|
|
54
|
+
readonly top: "safe-area-max-inset-top";
|
|
55
|
+
readonly right: "safe-area-max-inset-right";
|
|
56
|
+
readonly bottom: "safe-area-max-inset-bottom";
|
|
57
|
+
readonly left: "safe-area-max-inset-left";
|
|
58
|
+
};
|
|
59
|
+
readonly 'titlebar-area': {
|
|
60
|
+
readonly x: "titlebar-area-x";
|
|
61
|
+
readonly y: "titlebar-area-y";
|
|
62
|
+
readonly width: "titlebar-area-width";
|
|
63
|
+
readonly height: "titlebar-area-height";
|
|
64
|
+
};
|
|
65
|
+
readonly 'keyboard-inset': {
|
|
66
|
+
readonly top: "keyboard-inset-top";
|
|
67
|
+
readonly right: "keyboard-inset-right";
|
|
68
|
+
readonly bottom: "keyboard-inset-bottom";
|
|
69
|
+
readonly left: "keyboard-inset-left";
|
|
70
|
+
readonly width: "keyboard-inset-width";
|
|
71
|
+
readonly height: "keyboard-inset-height";
|
|
72
|
+
};
|
|
73
|
+
readonly 'viewport-segment': {
|
|
74
|
+
readonly width: "viewport-segment-width";
|
|
75
|
+
readonly height: "viewport-segment-height";
|
|
76
|
+
readonly top: "viewport-segment-top";
|
|
77
|
+
readonly right: "viewport-segment-right";
|
|
78
|
+
readonly bottom: "viewport-segment-bottom";
|
|
79
|
+
readonly left: "viewport-segment-left";
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
type EnvironmentPresetKey = keyof typeof ENV_PRESETS;
|
|
84
|
+
type EnvironmentPresetAttr<K extends EnvironmentPresetKey> = keyof typeof ENV_PRESETS[K];
|
|
85
|
+
type EnvironmentPresetValues<K extends EnvironmentPresetKey> = {
|
|
86
|
+
[P in EnvironmentPresetAttr<K>]: number;
|
|
87
|
+
};
|
|
88
|
+
declare interface DimensionInstance {
|
|
89
|
+
get value(): Dimensions;
|
|
90
|
+
environment: Environment;
|
|
91
|
+
onChange(listener: (dimension: Dimensions) => void, options?: AddEventListenerOptions): () => void;
|
|
92
|
+
Constants: {
|
|
93
|
+
Orientation: typeof Orientation;
|
|
94
|
+
};
|
|
95
|
+
Errors: {};
|
|
96
|
+
}
|
|
97
|
+
declare interface Dimensions {
|
|
98
|
+
outerWidth: number;
|
|
99
|
+
outerHeight: number;
|
|
100
|
+
innerWidth: number;
|
|
101
|
+
innerHeight: number;
|
|
102
|
+
scale: number;
|
|
103
|
+
orientation: Orientation;
|
|
104
|
+
}
|
|
105
|
+
declare interface EnvironmentPreset<K extends EnvironmentPresetKey> {
|
|
106
|
+
get value(): EnvironmentPresetValues<K>;
|
|
107
|
+
onChange(listener: (value: EnvironmentPresetValues<K>) => void, options?: AddEventListenerOptions): () => void;
|
|
108
|
+
}
|
|
109
|
+
declare interface Environment {
|
|
110
|
+
safeAreaInset: EnvironmentPreset<'safe-area-inset'>;
|
|
111
|
+
safeAreaMaxInset: EnvironmentPreset<'safe-area-max-inset'>;
|
|
112
|
+
keyboardInset: EnvironmentPreset<'keyboard-inset'>;
|
|
113
|
+
titlebarArea: EnvironmentPreset<'titlebar-area'>;
|
|
114
|
+
viewportSegment: EnvironmentPreset<'viewport-segment'>;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
declare const Dimension: DimensionInstance;
|
|
118
|
+
|
|
119
|
+
declare interface FullscreenInstance {
|
|
120
|
+
supported: boolean;
|
|
121
|
+
element: Element | null;
|
|
122
|
+
isFullscreen: boolean;
|
|
123
|
+
request(target?: Element, options?: FullscreenOptions): Promise<void>;
|
|
124
|
+
exit(): Promise<void>;
|
|
125
|
+
toggle(target?: Element, options?: FullscreenOptions): Promise<void>;
|
|
126
|
+
onChange(listener: (event: Event) => void, options?: AddEventListenerOptions): () => void;
|
|
127
|
+
onError(listener: (event: Event) => void, options?: AddEventListenerOptions): () => void;
|
|
128
|
+
Constants: {};
|
|
129
|
+
Errors: {
|
|
130
|
+
NotSupportedError: typeof NotSupportedError;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
declare global {
|
|
135
|
+
interface HTMLVideoElement {
|
|
136
|
+
webkitEnterFullscreen?: () => void;
|
|
137
|
+
webkitExitFullscreen?: () => void;
|
|
138
|
+
webkitSupportsFullscreen?: boolean;
|
|
139
|
+
webkitDisplayingFullscreen?: boolean;
|
|
140
|
+
onwebkitbeginfullscreen?: ((this: HTMLVideoElement, ev: Event) => any) | null;
|
|
141
|
+
onwebkitendfullscreen?: ((this: HTMLVideoElement, ev: Event) => any) | null;
|
|
142
|
+
__fsBridged__?: boolean;
|
|
143
|
+
}
|
|
144
|
+
interface Document {
|
|
145
|
+
readonly fullscreenEnabled: boolean;
|
|
146
|
+
fullscreenElement?: Element | null;
|
|
147
|
+
exitFullscreen: () => Promise<void>;
|
|
148
|
+
readonly webkitFullscreenEnabled?: boolean;
|
|
149
|
+
webkitFullscreenElement?: Element | null;
|
|
150
|
+
webkitCurrentFullScreenElement?: Element | null;
|
|
151
|
+
webkitExitFullscreen?: () => Promise<void>;
|
|
152
|
+
webkitCancelFullScreen?: () => Promise<void>;
|
|
153
|
+
readonly mozFullScreenEnabled?: boolean;
|
|
154
|
+
mozFullScreenElement?: Element | null;
|
|
155
|
+
mozCancelFullScreen?: () => Promise<void>;
|
|
156
|
+
readonly msFullscreenEnabled?: boolean;
|
|
157
|
+
msFullscreenElement?: Element | null;
|
|
158
|
+
msExitFullscreen?: () => Promise<void>;
|
|
159
|
+
}
|
|
160
|
+
interface Element {
|
|
161
|
+
requestFullscreen: (options?: FullscreenOptions) => Promise<void>;
|
|
162
|
+
webkitRequestFullscreen?: (options?: FullscreenOptions) => Promise<void>;
|
|
163
|
+
webkitRequestFullScreen?: (options?: FullscreenOptions) => Promise<void>;
|
|
164
|
+
mozRequestFullScreen?: () => Promise<void>;
|
|
165
|
+
msRequestFullscreen?: () => Promise<void>;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
declare const Fullscreen: FullscreenInstance;
|
|
169
|
+
|
|
170
|
+
declare const PermissionNotGrantedError: ErrorConstructor;
|
|
171
|
+
|
|
172
|
+
declare interface GeolocationInstance {
|
|
173
|
+
get value(): Promise<GeolocationCoordinates>;
|
|
174
|
+
get supported(): boolean;
|
|
175
|
+
onChange(listener: (coordinates: GeolocationCoordinates) => void, options?: AddEventListenerOptions): () => void;
|
|
176
|
+
Constants: {};
|
|
177
|
+
Errors: {
|
|
178
|
+
NotSupportedError: typeof NotSupportedError;
|
|
179
|
+
PermissionNotGrantedError: typeof PermissionNotGrantedError;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
declare const Geolocation: GeolocationInstance;
|
|
184
|
+
|
|
185
|
+
interface NotificationOptions {
|
|
186
|
+
title: string;
|
|
187
|
+
badge?: string;
|
|
188
|
+
body?: string;
|
|
189
|
+
data?: any;
|
|
190
|
+
dir?: NotificationDirection;
|
|
191
|
+
icon?: string;
|
|
192
|
+
lang?: string;
|
|
193
|
+
requireInteraction?: boolean;
|
|
194
|
+
silent?: boolean | null;
|
|
195
|
+
tag?: string;
|
|
196
|
+
onClick?: ((this: Notification, ev: Event) => any);
|
|
197
|
+
onClose?: ((this: Notification, ev: Event) => any);
|
|
198
|
+
onError?: ((this: Notification, ev: Event) => any);
|
|
199
|
+
onShow?: ((this: Notification, ev: Event) => any);
|
|
200
|
+
}
|
|
201
|
+
declare interface NotificationInstance {
|
|
202
|
+
send(options: NotificationOptions): Promise<Notification>;
|
|
203
|
+
get supported(): boolean;
|
|
204
|
+
Constants: {};
|
|
205
|
+
Errors: {
|
|
206
|
+
NotSupportedError: typeof NotSupportedError;
|
|
207
|
+
PermissionNotGrantedError: typeof PermissionNotGrantedError;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
declare const Notification$1: NotificationInstance;
|
|
212
|
+
|
|
213
|
+
declare enum AppOpenState {
|
|
214
|
+
Scheme = 0,
|
|
215
|
+
Universal = 1,
|
|
216
|
+
Intent = 2,
|
|
217
|
+
Fallback = 3,
|
|
218
|
+
Store = 4
|
|
219
|
+
}
|
|
220
|
+
declare enum SettingType {
|
|
221
|
+
General = "general",
|
|
222
|
+
Network = "network",
|
|
223
|
+
Display = "display",
|
|
224
|
+
Appearance = "appearance",
|
|
225
|
+
Accessibility = "accessibility",
|
|
226
|
+
Battery = "battery",
|
|
227
|
+
Datetime = "datetime",
|
|
228
|
+
Language = "language",
|
|
229
|
+
Accounts = "accounts",
|
|
230
|
+
Storage = "storage"
|
|
231
|
+
}
|
|
232
|
+
declare enum CameraType {
|
|
233
|
+
Image = "image",
|
|
234
|
+
Video = "video"
|
|
235
|
+
}
|
|
236
|
+
declare enum CaptureType {
|
|
237
|
+
User = "user",
|
|
238
|
+
Environment = "environment"
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
declare interface PlatformInstance {
|
|
242
|
+
get userAgent(): string;
|
|
243
|
+
set userAgent(value: any);
|
|
244
|
+
get os(): NameVersionPair<OS>;
|
|
245
|
+
get engine(): NameVersionPair<Engines>;
|
|
246
|
+
get browser(): NameVersionPair<Browsers>;
|
|
247
|
+
get device(): Devices;
|
|
248
|
+
get locale(): Locale;
|
|
249
|
+
get gpu(): GPU;
|
|
250
|
+
get isNode(): boolean;
|
|
251
|
+
get isStandalone(): boolean;
|
|
252
|
+
get isWebview(): boolean;
|
|
253
|
+
Constants: {
|
|
254
|
+
OS: typeof OS;
|
|
255
|
+
Engines: typeof Engines;
|
|
256
|
+
Browsers: typeof Browsers;
|
|
257
|
+
Devices: typeof Devices;
|
|
258
|
+
};
|
|
259
|
+
Errors: {};
|
|
260
|
+
}
|
|
261
|
+
declare interface NameVersionPair<T> {
|
|
262
|
+
name: T;
|
|
263
|
+
version: string;
|
|
264
|
+
}
|
|
265
|
+
declare interface Locale {
|
|
266
|
+
language: string | null;
|
|
267
|
+
languages: string[];
|
|
268
|
+
timezone: string | null;
|
|
269
|
+
offset: number;
|
|
270
|
+
isRTL: boolean;
|
|
271
|
+
}
|
|
272
|
+
interface GPUAdapterInfo {
|
|
273
|
+
readonly vendor?: string;
|
|
274
|
+
readonly architecture?: string;
|
|
275
|
+
readonly device?: string;
|
|
276
|
+
readonly description?: string;
|
|
277
|
+
}
|
|
278
|
+
declare type GPU = Writeable<GPUAdapterInfo> & {
|
|
279
|
+
webglRenderer: string;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
declare enum OS {
|
|
283
|
+
Unknown = "Unknown",
|
|
284
|
+
Android = "Android",
|
|
285
|
+
iOS = "iOS",
|
|
286
|
+
Windows = "Windows",
|
|
287
|
+
MacOS = "MacOS"
|
|
288
|
+
}
|
|
289
|
+
declare enum Devices {
|
|
290
|
+
Unknown = "Unknown",
|
|
291
|
+
Mobile = "Mobile",
|
|
292
|
+
Desktop = "Desktop"
|
|
293
|
+
}
|
|
294
|
+
declare enum Engines {
|
|
295
|
+
Unknown = "Unknown",
|
|
296
|
+
EdgeHTML = "EdgeHTML",
|
|
297
|
+
ArkWeb = "ArkWeb",
|
|
298
|
+
Blink = "Blink",
|
|
299
|
+
Presto = "Presto",
|
|
300
|
+
WebKit = "WebKit",
|
|
301
|
+
Trident = "Trident",
|
|
302
|
+
NetFront = "NetFront",
|
|
303
|
+
KHTML = "KHTML",
|
|
304
|
+
Tasman = "Tasman",
|
|
305
|
+
Gecko = "Gecko"
|
|
306
|
+
}
|
|
307
|
+
declare enum Browsers {
|
|
308
|
+
Unknown = "Unknown",
|
|
309
|
+
Chrome = "Chrome",
|
|
310
|
+
Safari = "Safari",
|
|
311
|
+
Edge = "Edge",
|
|
312
|
+
Firefox = "Firefox",
|
|
313
|
+
Opera = "Opera",
|
|
314
|
+
IE = "IE",
|
|
315
|
+
SamsungInternet = "SamsungInternet"
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
declare const URLOpenError: ErrorConstructor;
|
|
319
|
+
|
|
320
|
+
declare const UserCancelledError: ErrorConstructor;
|
|
321
|
+
|
|
322
|
+
declare interface AppInfo {
|
|
323
|
+
scheme?: URLCandidate;
|
|
324
|
+
fallback?: URLCandidateOrFallback;
|
|
325
|
+
timeout?: number;
|
|
326
|
+
allowAppStore?: boolean;
|
|
327
|
+
allowWebStore?: boolean;
|
|
328
|
+
}
|
|
329
|
+
declare interface PackageName {
|
|
330
|
+
packageName?: string;
|
|
331
|
+
}
|
|
332
|
+
declare interface ProductId {
|
|
333
|
+
productId?: string;
|
|
334
|
+
}
|
|
335
|
+
declare interface BundleId {
|
|
336
|
+
bundleId?: string;
|
|
337
|
+
}
|
|
338
|
+
declare interface TrackId {
|
|
339
|
+
trackId?: string;
|
|
340
|
+
}
|
|
341
|
+
declare interface AndroidAppInfo extends AppInfo, PackageName {
|
|
342
|
+
intent?: URLCandidate;
|
|
343
|
+
}
|
|
344
|
+
declare interface IOSAppInfo extends AppInfo, BundleId, TrackId {
|
|
345
|
+
universal?: URLCandidate;
|
|
346
|
+
}
|
|
347
|
+
declare interface WindowsAppInfo extends AppInfo, PackageName, ProductId {
|
|
348
|
+
}
|
|
349
|
+
declare interface MacOSAppInfo extends AppInfo, BundleId, TrackId {
|
|
350
|
+
}
|
|
351
|
+
declare interface AppOpenOptions {
|
|
352
|
+
[OS.Android]?: AndroidAppInfo;
|
|
353
|
+
['android']?: AndroidAppInfo;
|
|
354
|
+
[OS.iOS]?: IOSAppInfo;
|
|
355
|
+
['ios']?: IOSAppInfo;
|
|
356
|
+
[OS.Windows]?: WindowsAppInfo;
|
|
357
|
+
['windows']?: WindowsAppInfo;
|
|
358
|
+
[OS.MacOS]?: MacOSAppInfo;
|
|
359
|
+
['macos']?: MacOSAppInfo;
|
|
360
|
+
}
|
|
361
|
+
interface Contact {
|
|
362
|
+
name?: string;
|
|
363
|
+
email?: string;
|
|
364
|
+
tel?: string;
|
|
365
|
+
address?: string;
|
|
366
|
+
icon?: Blob[];
|
|
367
|
+
}
|
|
368
|
+
interface ContactOptions {
|
|
369
|
+
multiple?: boolean;
|
|
370
|
+
}
|
|
371
|
+
type FileExtension = `.${string}`;
|
|
372
|
+
type FileMimeType = `${string}/${string}`;
|
|
373
|
+
interface FileOptions {
|
|
374
|
+
multiple?: boolean;
|
|
375
|
+
accept?: (FileExtension | FileMimeType)[];
|
|
376
|
+
id?: string;
|
|
377
|
+
startIn?: 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos';
|
|
378
|
+
}
|
|
379
|
+
interface DirectoryOptions {
|
|
380
|
+
mode?: 'read' | 'readwrite';
|
|
381
|
+
id?: string;
|
|
382
|
+
startIn?: 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos';
|
|
383
|
+
}
|
|
384
|
+
interface FileWithPath {
|
|
385
|
+
file: File;
|
|
386
|
+
relativePath: string;
|
|
387
|
+
}
|
|
388
|
+
interface CameraOptions {
|
|
389
|
+
type?: CameraType;
|
|
390
|
+
capture?: CaptureType;
|
|
391
|
+
}
|
|
392
|
+
interface CalendarOptions {
|
|
393
|
+
title?: string;
|
|
394
|
+
description?: string;
|
|
395
|
+
location?: string;
|
|
396
|
+
allDay?: boolean;
|
|
397
|
+
startDate: Date;
|
|
398
|
+
endDate: Date;
|
|
399
|
+
alarm?: CalendarAlarmOptions[];
|
|
400
|
+
recur?: CalendarRecurOptions;
|
|
401
|
+
}
|
|
402
|
+
type CalendarAlarmOptions = {
|
|
403
|
+
description?: string;
|
|
404
|
+
} & CalendarAlarmTrigger;
|
|
405
|
+
type CalendarAlarmTrigger = {
|
|
406
|
+
datetime?: Date;
|
|
407
|
+
repeat?: never;
|
|
408
|
+
repeatDuration?: never;
|
|
409
|
+
before?: never;
|
|
410
|
+
weeks?: never;
|
|
411
|
+
days?: never;
|
|
412
|
+
hours?: never;
|
|
413
|
+
minutes?: never;
|
|
414
|
+
seconds?: never;
|
|
415
|
+
} | {
|
|
416
|
+
datetime?: never;
|
|
417
|
+
repeat?: number;
|
|
418
|
+
repeatDuration?: number;
|
|
419
|
+
before?: boolean;
|
|
420
|
+
weeks?: number;
|
|
421
|
+
days?: number;
|
|
422
|
+
hours?: number;
|
|
423
|
+
minutes?: number;
|
|
424
|
+
seconds?: number;
|
|
425
|
+
};
|
|
426
|
+
type CalendarRecurWeekDay = 'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA' | 'SU';
|
|
427
|
+
type CalendarRecurDayValue = CalendarRecurWeekDay | `${number}${CalendarRecurWeekDay}`;
|
|
428
|
+
type CalendarRecurOptions = {
|
|
429
|
+
frequency: 'SECONDLY' | 'MINUTELY' | 'HOURLY' | 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY';
|
|
430
|
+
interval?: number;
|
|
431
|
+
byMonth?: number[];
|
|
432
|
+
byWeekNo?: number[];
|
|
433
|
+
byYearDay?: number[];
|
|
434
|
+
byMonthDay?: number[];
|
|
435
|
+
byDay?: CalendarRecurDayValue[];
|
|
436
|
+
byHour?: number[];
|
|
437
|
+
byMinute?: number[];
|
|
438
|
+
bySecond?: number[];
|
|
439
|
+
bySetPos?: number[];
|
|
440
|
+
weekStart?: CalendarRecurWeekDay;
|
|
441
|
+
} & CalendarRecurLimit;
|
|
442
|
+
type CalendarRecurLimit = {
|
|
443
|
+
count: number;
|
|
444
|
+
until?: never;
|
|
445
|
+
} | {
|
|
446
|
+
count?: never;
|
|
447
|
+
until: Date;
|
|
448
|
+
} | {
|
|
449
|
+
count?: never;
|
|
450
|
+
until?: never;
|
|
451
|
+
};
|
|
452
|
+
declare type URLCandidate = URL | string;
|
|
453
|
+
declare type URLCandidateOrFallback = URLCandidate | (() => any);
|
|
454
|
+
declare interface TelephoneOptions {
|
|
455
|
+
to?: string | string[];
|
|
456
|
+
}
|
|
457
|
+
declare interface MessageOptions extends TelephoneOptions {
|
|
458
|
+
body?: string;
|
|
459
|
+
}
|
|
460
|
+
declare interface MailOptions extends MessageOptions {
|
|
461
|
+
cc?: string | string[];
|
|
462
|
+
bcc?: string | string[];
|
|
463
|
+
subject?: string;
|
|
464
|
+
}
|
|
465
|
+
declare interface OpenInstance {
|
|
466
|
+
app(options: AppOpenOptions): Promise<AppOpenState>;
|
|
467
|
+
telephone(options: TelephoneOptions): Promise<void>;
|
|
468
|
+
message(options: MessageOptions): Promise<void>;
|
|
469
|
+
mail(options: MailOptions): Promise<void>;
|
|
470
|
+
file(options?: FileOptions): Promise<File[]>;
|
|
471
|
+
directory(options?: DirectoryOptions): Promise<FileWithPath[]>;
|
|
472
|
+
setting(type: SettingType): Promise<void>;
|
|
473
|
+
camera(options?: CameraOptions): Promise<File[]>;
|
|
474
|
+
contact(options?: ContactOptions): Promise<Contact[]>;
|
|
475
|
+
share(options: ShareData): Promise<void>;
|
|
476
|
+
calendar(options: CalendarOptions): void;
|
|
477
|
+
supported: {
|
|
478
|
+
get intent(): boolean;
|
|
479
|
+
get universal(): boolean;
|
|
480
|
+
get setting(): boolean;
|
|
481
|
+
get directory(): boolean;
|
|
482
|
+
get camera(): boolean;
|
|
483
|
+
get contact(): boolean;
|
|
484
|
+
get share(): boolean;
|
|
485
|
+
get calendar(): boolean;
|
|
486
|
+
};
|
|
487
|
+
Constants: {
|
|
488
|
+
AppOpenState: typeof AppOpenState;
|
|
489
|
+
SettingType: typeof SettingType;
|
|
490
|
+
CameraType: typeof CameraType;
|
|
491
|
+
CaptureType: typeof CaptureType;
|
|
492
|
+
};
|
|
493
|
+
Errors: {
|
|
494
|
+
URLOpenError: typeof URLOpenError;
|
|
495
|
+
NotSupportedError: typeof NotSupportedError;
|
|
496
|
+
UserCancelledError: typeof UserCancelledError;
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
declare global {
|
|
501
|
+
interface Document {
|
|
502
|
+
webkitVisibilityState?: 'hidden' | 'visible';
|
|
503
|
+
mozVisibilityState?: 'hidden' | 'visible';
|
|
504
|
+
msVisibilityState?: 'hidden' | 'visible';
|
|
505
|
+
webkitHidden?: boolean;
|
|
506
|
+
mozHidden?: boolean;
|
|
507
|
+
msHidden?: boolean;
|
|
508
|
+
}
|
|
509
|
+
interface Navigator {
|
|
510
|
+
contacts?: ContactsManager;
|
|
511
|
+
}
|
|
512
|
+
interface FileSystemDirectoryHandle {
|
|
513
|
+
entries(): AsyncIterator<[string, FileSystemHandle]>;
|
|
514
|
+
}
|
|
515
|
+
var showOpenFilePicker: (options?: OpenFilePickerOptions) => Promise<FileSystemFileHandle[]>;
|
|
516
|
+
var showDirectoryPicker: (options?: OpenDirectoryPickerOptions) => Promise<FileSystemDirectoryHandle>;
|
|
517
|
+
var cordova: object | undefined;
|
|
518
|
+
}
|
|
519
|
+
interface AsyncIterator<T, TReturn = any, TNext = undefined> {
|
|
520
|
+
next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
|
|
521
|
+
return?(value?: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
|
|
522
|
+
throw?(e?: any): Promise<IteratorResult<T, TReturn>>;
|
|
523
|
+
}
|
|
524
|
+
type IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>;
|
|
525
|
+
interface IteratorYieldResult<TYield> {
|
|
526
|
+
done?: false;
|
|
527
|
+
value: TYield;
|
|
528
|
+
}
|
|
529
|
+
interface IteratorReturnResult<TReturn> {
|
|
530
|
+
done: true;
|
|
531
|
+
value: TReturn;
|
|
532
|
+
}
|
|
533
|
+
interface OpenFilePickerOptions {
|
|
534
|
+
excludeAcceptAllOption?: boolean;
|
|
535
|
+
id?: string;
|
|
536
|
+
multiple?: boolean;
|
|
537
|
+
startIn?: 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos';
|
|
538
|
+
types?: {
|
|
539
|
+
description?: string;
|
|
540
|
+
accept: Record<string, string[]>;
|
|
541
|
+
}[];
|
|
542
|
+
}
|
|
543
|
+
interface OpenDirectoryPickerOptions {
|
|
544
|
+
id?: string;
|
|
545
|
+
mode?: 'read' | 'readwrite';
|
|
546
|
+
startIn?: 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos';
|
|
547
|
+
}
|
|
548
|
+
interface ContactsManager {
|
|
549
|
+
select(properties: string[], options?: Record<string, any>): Promise<Contact[]>;
|
|
550
|
+
getProperties(): Promise<string[]>;
|
|
551
|
+
}
|
|
552
|
+
declare const Open: OpenInstance;
|
|
553
|
+
|
|
554
|
+
declare global {
|
|
555
|
+
interface Navigator {
|
|
556
|
+
userAgent?: string;
|
|
557
|
+
userAgentData?: UserAgentData;
|
|
558
|
+
language?: string;
|
|
559
|
+
languages?: readonly string[];
|
|
560
|
+
browserLanguage?: string;
|
|
561
|
+
systemLanguage?: string;
|
|
562
|
+
userLanguage?: string;
|
|
563
|
+
standalone?: boolean;
|
|
564
|
+
gpu?: WebGPU;
|
|
565
|
+
}
|
|
566
|
+
interface NodeProcessVersions {
|
|
567
|
+
node?: string;
|
|
568
|
+
chrome?: string;
|
|
569
|
+
}
|
|
570
|
+
interface NodeProcess {
|
|
571
|
+
versions?: NodeProcessVersions;
|
|
572
|
+
type?: string;
|
|
573
|
+
platform?: string;
|
|
574
|
+
getSystemVersion?(): string;
|
|
575
|
+
}
|
|
576
|
+
var process: NodeProcess | undefined;
|
|
577
|
+
namespace Intl {
|
|
578
|
+
const Locale: {
|
|
579
|
+
new (tag: string): IntlLocale;
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
interface IntlLocale {
|
|
584
|
+
getTextInfo?(): IntlLocaleTextInfo;
|
|
585
|
+
textInfo: IntlLocaleTextInfo;
|
|
586
|
+
}
|
|
587
|
+
interface IntlLocaleTextInfo {
|
|
588
|
+
direction: 'rtl' | 'ltr';
|
|
589
|
+
}
|
|
590
|
+
interface ModernUserAgentDataBrand {
|
|
591
|
+
brand: string;
|
|
592
|
+
version: string;
|
|
593
|
+
}
|
|
594
|
+
type UserAgentDataBrand = ModernUserAgentDataBrand | string | null | undefined;
|
|
595
|
+
interface UserAgentDataValues {
|
|
596
|
+
brands?: UserAgentDataBrand[];
|
|
597
|
+
fullVersionList?: UserAgentDataBrand[];
|
|
598
|
+
platformVersion?: string | null | undefined;
|
|
599
|
+
platform?: string | null | undefined;
|
|
600
|
+
mobile?: boolean;
|
|
601
|
+
}
|
|
602
|
+
interface UserAgentData {
|
|
603
|
+
getHighEntropyValues?(hints: string[]): Promise<UserAgentDataValues>;
|
|
604
|
+
}
|
|
605
|
+
interface WebGPU {
|
|
606
|
+
requestAdapter(options?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
|
|
607
|
+
}
|
|
608
|
+
interface GPURequestAdapterOptions {
|
|
609
|
+
powerPreference?: GPUPowerPreference;
|
|
610
|
+
forceFallbackAdapter?: boolean;
|
|
611
|
+
}
|
|
612
|
+
type GPUPowerPreference = "low-power" | "high-performance";
|
|
613
|
+
interface GPUAdapter {
|
|
614
|
+
readonly info: GPUAdapterInfo;
|
|
615
|
+
}
|
|
616
|
+
declare const Platform: PlatformInstance;
|
|
617
|
+
|
|
618
|
+
declare interface ThemeInstance {
|
|
619
|
+
get value(): string | undefined;
|
|
620
|
+
set value(color: string | undefined);
|
|
621
|
+
Constants: {};
|
|
622
|
+
Errors: {};
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
declare const Theme: ThemeInstance;
|
|
626
|
+
|
|
627
|
+
declare interface VibrationInstance {
|
|
628
|
+
run(pattern: number | number[]): boolean;
|
|
629
|
+
get supported(): boolean;
|
|
630
|
+
Constants: {};
|
|
631
|
+
Errors: {
|
|
632
|
+
NotSupportedError: typeof NotSupportedError;
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
declare const Vibration: VibrationInstance;
|
|
637
|
+
|
|
638
|
+
declare global {
|
|
639
|
+
interface Navigator {
|
|
640
|
+
getUserMedia?(constraints?: MediaStreamConstraints): Promise<MediaStream>;
|
|
641
|
+
webkitGetUserMedia?(constraints: MediaStreamConstraints, successCallback: (stream: MediaStream) => void, errorCallback: (error: DOMException) => void): void;
|
|
642
|
+
mozGetUserMedia?(constraints: MediaStreamConstraints, successCallback: (stream: MediaStream) => void, errorCallback: (error: DOMException) => void): void;
|
|
643
|
+
msGetUserMedia?(constraints: MediaStreamConstraints, successCallback: (stream: MediaStream) => void, errorCallback: (error: DOMException) => void): void;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
declare enum PermissionType {
|
|
647
|
+
Notification = "notifications",
|
|
648
|
+
Geolocation = "geolocation",
|
|
649
|
+
Camera = "camera",
|
|
650
|
+
Microphone = "microphone",
|
|
651
|
+
MIDI = "midi"
|
|
652
|
+
}
|
|
653
|
+
declare enum PermissionState {
|
|
654
|
+
Grant = "grant",
|
|
655
|
+
Denied = "denied",
|
|
656
|
+
Prompt = "prompt",
|
|
657
|
+
Unsupported = "unsupported"
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
declare interface PermissionInstance {
|
|
661
|
+
request(type: PermissionType): Promise<PermissionState>;
|
|
662
|
+
check(type: PermissionType): Promise<PermissionState>;
|
|
663
|
+
Constants: {
|
|
664
|
+
PermissionType: typeof PermissionType;
|
|
665
|
+
PermissionState: typeof PermissionState;
|
|
666
|
+
};
|
|
667
|
+
Errors: {};
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
declare const Permission: PermissionInstance;
|
|
671
|
+
|
|
672
|
+
declare interface PipInstance {
|
|
673
|
+
supported: boolean;
|
|
674
|
+
element: HTMLVideoElement | null;
|
|
675
|
+
isPip: boolean;
|
|
676
|
+
request(target?: HTMLVideoElement): Promise<void>;
|
|
677
|
+
exit(): Promise<void>;
|
|
678
|
+
toggle(target?: HTMLVideoElement): Promise<void>;
|
|
679
|
+
onChange(listener: (event: Event) => void, options?: AddEventListenerOptions): () => void;
|
|
680
|
+
onError(listener: (event: Event) => void, options?: AddEventListenerOptions): () => void;
|
|
681
|
+
Constants: {};
|
|
682
|
+
Errors: {
|
|
683
|
+
NotSupportedError: typeof NotSupportedError;
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
declare global {
|
|
688
|
+
interface HTMLVideoElement {
|
|
689
|
+
webkitSupportsPresentationMode?: (mode: string) => boolean;
|
|
690
|
+
webkitSetPresentationMode?: (mode: string) => void;
|
|
691
|
+
webkitPresentationMode?: string;
|
|
692
|
+
onwebkitpresentationmodechanged?: ((this: HTMLVideoElement, ev: Event) => any) | null;
|
|
693
|
+
__pipBridged__?: boolean;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
declare const Pip: PipInstance;
|
|
697
|
+
|
|
698
|
+
declare global {
|
|
699
|
+
interface Navigator {
|
|
700
|
+
getBattery(): Promise<BatteryManager>;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
interface BatteryManager extends EventTarget {
|
|
704
|
+
readonly charging: boolean;
|
|
705
|
+
readonly chargingTime: number;
|
|
706
|
+
readonly dischargingTime: number;
|
|
707
|
+
readonly level: number;
|
|
708
|
+
onChange: ((this: BatteryManager, ev: Event) => any) | null;
|
|
709
|
+
onchargingchange: ((this: BatteryManager, ev: Event) => any) | null;
|
|
710
|
+
onchargingtimechange: ((this: BatteryManager, ev: Event) => any) | null;
|
|
711
|
+
ondischargingtimechange: ((this: BatteryManager, ev: Event) => any) | null;
|
|
712
|
+
onlevelchange: ((this: BatteryManager, ev: Event) => any) | null;
|
|
713
|
+
}
|
|
714
|
+
declare interface BatteryInstance {
|
|
715
|
+
get value(): Promise<BatteryManager>;
|
|
716
|
+
get supported(): boolean;
|
|
717
|
+
onChange(listener: (battery: BatteryManager) => void, options?: AddEventListenerOptions): () => void;
|
|
718
|
+
Constants: {};
|
|
719
|
+
Errors: {
|
|
720
|
+
NotSupportedError: typeof NotSupportedError;
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
declare const Battery: BatteryInstance;
|
|
725
|
+
|
|
726
|
+
declare interface NativeInstance {
|
|
727
|
+
version: string;
|
|
728
|
+
appearance: typeof Appearance;
|
|
729
|
+
badge: typeof Badge;
|
|
730
|
+
battery: typeof Battery;
|
|
731
|
+
clipboard: typeof Clipboard;
|
|
732
|
+
dimension: typeof Dimension;
|
|
733
|
+
fullscreen: typeof Fullscreen;
|
|
734
|
+
geolocation: typeof Geolocation;
|
|
735
|
+
notification: typeof Notification$1;
|
|
736
|
+
open: typeof Open;
|
|
737
|
+
permission: typeof Permission;
|
|
738
|
+
platform: typeof Platform;
|
|
739
|
+
pip: typeof Pip;
|
|
740
|
+
theme: typeof Theme;
|
|
741
|
+
vibration: typeof Vibration;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
type Writeable<T> = {
|
|
745
|
+
-readonly [P in keyof T]: T[P];
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
declare const Native: NativeInstance;
|
|
749
|
+
|
|
750
|
+
export { Native as default };
|
|
751
|
+
export type { NativeInstance };
|