native-fn 1.0.80 → 1.0.82
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/native.cjs +1 -1
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +1 -1
- package/dist/native.umd.js +1 -1
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +126 -8
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +126 -8
- package/dist/plugin/app/index.umd.js +126 -8
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/plugin/app/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/app/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/app/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/app/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +7 -2
- package/dist/plugin/appearance/index.cjs +149 -53
- package/dist/plugin/appearance/index.d.ts +1 -1
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +149 -53
- package/dist/plugin/appearance/index.umd.js +149 -53
- package/dist/plugin/appearance/index.umd.min.js +1 -1
- package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/appearance/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +7 -2
- package/dist/plugin/clipboard/index.cjs +126 -8
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +126 -8
- package/dist/plugin/clipboard/index.umd.js +126 -8
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/clipboard/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +7 -2
- package/dist/plugin/dimension/index.cjs +13 -0
- package/dist/plugin/dimension/index.d.ts +27 -0
- package/dist/plugin/dimension/index.min.cjs +1 -0
- package/dist/plugin/dimension/index.min.mjs +1 -0
- package/dist/plugin/dimension/index.mjs +11 -0
- package/dist/plugin/dimension/index.umd.js +19 -0
- package/dist/plugin/dimension/index.umd.min.js +1 -0
- package/dist/plugin/dimension/src/errors/plugin-not-extended-error.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/app/cores/index.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/app/index.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/app/types/app.d.ts +54 -0
- package/dist/plugin/dimension/src/plugin/app/types/index.d.ts +16 -0
- package/dist/plugin/dimension/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/appearance/index.d.ts +8 -0
- package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/clipboard/index.d.ts +5 -0
- package/dist/plugin/dimension/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/clipboard/types/clipboard.d.ts +4 -0
- package/dist/plugin/dimension/src/plugin/clipboard/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/index.d.ts +5 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/types/fullscreen.d.ts +10 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/dimension/src/plugin/platform/cores/index.d.ts +45 -0
- package/dist/plugin/dimension/src/plugin/platform/index.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/platform/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +43 -0
- package/dist/plugin/dimension/src/plugin/theme/constants/index.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/theme/index.d.ts +5 -0
- package/dist/plugin/dimension/src/plugin/theme/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/theme/types/theme.d.ts +4 -0
- package/dist/plugin/dimension/src/types/event-listener-util.d.ts +11 -0
- package/dist/plugin/dimension/src/types/index.d.ts +1 -0
- package/dist/plugin/dimension/src/types/native.d.ts +27 -0
- package/dist/plugin/dimension/src/utils/assign.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/compare-version.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/create-custom-error.d.ts +6 -0
- package/dist/plugin/dimension/src/utils/create-hidden-element.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/dispatch-click-event.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/dimension/src/utils/get-topmost-window.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/is-secure-context.d.ts +1 -0
- package/dist/plugin/fullscreen/index.cjs +142 -21
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +142 -21
- package/dist/plugin/fullscreen/index.umd.js +142 -21
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +7 -2
- package/dist/plugin/platform/index.cjs +126 -8
- package/dist/plugin/platform/index.d.ts +8 -3
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +126 -8
- package/dist/plugin/platform/index.umd.js +126 -8
- package/dist/plugin/platform/index.umd.min.js +1 -1
- package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/platform/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +7 -2
- package/dist/plugin/theme/index.cjs +126 -8
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +126 -8
- package/dist/plugin/theme/index.umd.js +126 -8
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/theme/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/theme/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +7 -2
- package/dist/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/src/plugin/dimension/index.d.ts +4 -0
- package/dist/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/src/plugin/platform/types/platform.d.ts +7 -2
- package/package.json +15 -15
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AppInstance } from "../types";
|
|
2
|
+
declare global {
|
|
3
|
+
interface Document {
|
|
4
|
+
webkitVisibilityState?: 'hidden' | 'visible';
|
|
5
|
+
mozVisibilityState?: 'hidden' | 'visible';
|
|
6
|
+
msVisibilityState?: 'hidden' | 'visible';
|
|
7
|
+
webkitHidden?: boolean;
|
|
8
|
+
mozHidden?: boolean;
|
|
9
|
+
msHidden?: boolean;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
declare const App: AppInstance;
|
|
13
|
+
export default App;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NativePlugin } from "../../types";
|
|
2
|
+
import type { AppInstance } from "./types";
|
|
3
|
+
import { AppOpenState, MessengerType } from "./constants";
|
|
4
|
+
import { URLOpenError } from "./errors/url-open-error";
|
|
5
|
+
export * from "./types";
|
|
6
|
+
declare const NativeAppPlugin: NativePlugin<'App', AppInstance, {
|
|
7
|
+
AppOpenState: typeof AppOpenState;
|
|
8
|
+
Messengers: typeof MessengerType;
|
|
9
|
+
}, {
|
|
10
|
+
URLOpenError: typeof URLOpenError;
|
|
11
|
+
}>;
|
|
12
|
+
export default NativeAppPlugin;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { AppOpenState, MessengerType } from "../constants";
|
|
2
|
+
import { OS } from "../../platform/constants";
|
|
3
|
+
export declare interface AppInfo {
|
|
4
|
+
scheme?: URLCandidate;
|
|
5
|
+
fallback?: URLCandidateOrFallback;
|
|
6
|
+
timeout?: number;
|
|
7
|
+
allowAppStore?: boolean;
|
|
8
|
+
allowWebStore?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare interface AndroidAppInfo extends AppInfo {
|
|
11
|
+
packageName?: string;
|
|
12
|
+
intent?: URLCandidate;
|
|
13
|
+
}
|
|
14
|
+
export declare interface IOSAppInfo extends MacOSAppInfo {
|
|
15
|
+
universal?: URLCandidate;
|
|
16
|
+
}
|
|
17
|
+
export declare interface WindowsAppInfo extends AppInfo {
|
|
18
|
+
productId?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare interface MacOSAppInfo extends AppInfo {
|
|
21
|
+
bundleId?: string;
|
|
22
|
+
trackId?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare interface StoreInfo {
|
|
25
|
+
appStore?: string;
|
|
26
|
+
webStore?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare interface AppOpenOptions {
|
|
29
|
+
[OS.Android]?: AndroidAppInfo;
|
|
30
|
+
['android']?: AndroidAppInfo;
|
|
31
|
+
[OS.iOS]?: IOSAppInfo;
|
|
32
|
+
['ios']?: IOSAppInfo;
|
|
33
|
+
[OS.Windows]?: WindowsAppInfo;
|
|
34
|
+
['windows']?: WindowsAppInfo;
|
|
35
|
+
[OS.MacOS]?: MacOSAppInfo;
|
|
36
|
+
['mac']?: MacOSAppInfo;
|
|
37
|
+
}
|
|
38
|
+
export declare type URLCandidate = URL | string;
|
|
39
|
+
export declare type URLCandidateOrFallback = URLCandidate | (() => any);
|
|
40
|
+
export declare type URLStringOrFallback = string | (() => any);
|
|
41
|
+
export declare type Stringifiable = string | number | boolean | HTMLElement | null | undefined;
|
|
42
|
+
export declare type StringifiableSequence = Stringifiable[] | NodeList | NodeListOf<Node> | HTMLCollectionBase;
|
|
43
|
+
export declare type MessengerOpenOptions = {
|
|
44
|
+
to?: Stringifiable | StringifiableSequence;
|
|
45
|
+
cc?: Stringifiable | StringifiableSequence;
|
|
46
|
+
bcc?: Stringifiable | StringifiableSequence;
|
|
47
|
+
subject?: Stringifiable;
|
|
48
|
+
body?: Stringifiable;
|
|
49
|
+
} | HTMLFormElement | FormData;
|
|
50
|
+
export declare type Messenger = Record<MessengerType, (options: MessengerOpenOptions) => Promise<void>>;
|
|
51
|
+
export declare interface AppInstance {
|
|
52
|
+
open(options: AppOpenOptions): Promise<AppOpenState>;
|
|
53
|
+
messenger: Messenger;
|
|
54
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from "./app";
|
|
2
|
+
import type { AppInstance } from "./";
|
|
3
|
+
import { AppOpenState, MessengerType } from "../constants";
|
|
4
|
+
import { URLOpenError } from "../errors/url-open-error";
|
|
5
|
+
declare module 'native-fn' {
|
|
6
|
+
interface NativePlugins {
|
|
7
|
+
App: AppInstance;
|
|
8
|
+
}
|
|
9
|
+
interface NativeConstants {
|
|
10
|
+
AppOpenState: typeof AppOpenState;
|
|
11
|
+
Messengers: typeof MessengerType;
|
|
12
|
+
}
|
|
13
|
+
interface NativeErrors {
|
|
14
|
+
URLOpenError: typeof URLOpenError;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ListenerEntry } from "../types";
|
|
2
|
+
export declare enum Appearances {
|
|
3
|
+
Unknown = "unknown",
|
|
4
|
+
Light = "light",
|
|
5
|
+
Dark = "dark"
|
|
6
|
+
}
|
|
7
|
+
export declare const MEDIA_QUERY_LIST: MediaQueryList;
|
|
8
|
+
export declare const SUPPORT_PREFERS_COLOR_SCHEME: boolean;
|
|
9
|
+
export declare const CONTEXT: CanvasRenderingContext2D | null;
|
|
10
|
+
export declare const SVG_PIXEL_DATA_URL: string;
|
|
11
|
+
export declare const ENTRIES: ListenerEntry[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NativePlugin } from "../../types";
|
|
2
|
+
import { AppearanceInstance } from "./types";
|
|
3
|
+
import { Appearances } from "./constants";
|
|
4
|
+
export * from "./types";
|
|
5
|
+
declare const NativeAppearancePlugin: NativePlugin<'Appearance', AppearanceInstance, {
|
|
6
|
+
Appearances: typeof Appearances;
|
|
7
|
+
}, {}>;
|
|
8
|
+
export default NativeAppearancePlugin;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Appearances } from "../constants";
|
|
2
|
+
export declare interface ListenerEntry {
|
|
3
|
+
fn: (appearance: Appearances) => any;
|
|
4
|
+
capture: boolean;
|
|
5
|
+
once: boolean;
|
|
6
|
+
signal?: AbortSignal;
|
|
7
|
+
}
|
|
8
|
+
export declare interface AppearanceInstance {
|
|
9
|
+
get value(): Appearances;
|
|
10
|
+
set value(appearances: Exclude<Appearances, Appearances.Unknown>);
|
|
11
|
+
onchange(listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions): () => void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./appearance";
|
|
2
|
+
import type { AppearanceInstance } from "./appearance";
|
|
3
|
+
import { Appearances } from "../constants";
|
|
4
|
+
declare module 'native-fn' {
|
|
5
|
+
interface NativePlugins {
|
|
6
|
+
Appearance: AppearanceInstance;
|
|
7
|
+
}
|
|
8
|
+
interface NativeConstants {
|
|
9
|
+
Appearances: typeof Appearances;
|
|
10
|
+
}
|
|
11
|
+
interface NativeErrors {
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Appearances } from "../constants";
|
|
2
|
+
import { NativeModule } from "../../../types";
|
|
3
|
+
export declare interface ListenerEntry {
|
|
4
|
+
fn: (appearance: Appearances) => any;
|
|
5
|
+
capture: boolean;
|
|
6
|
+
once: boolean;
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
export declare interface AppearanceInstance extends NativeModule {
|
|
10
|
+
get value(): Appearances;
|
|
11
|
+
set value(appearances: Exclude<Appearances, Appearances.Unknown>);
|
|
12
|
+
onchange(listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions): () => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DimensionInstance } from "./dimension";
|
|
2
|
+
import Dimension from "../cores";
|
|
3
|
+
export * from "./dimension";
|
|
4
|
+
declare module 'native-fn' {
|
|
5
|
+
interface NativePlugins {
|
|
6
|
+
Dimension: DimensionInstance;
|
|
7
|
+
}
|
|
8
|
+
interface NativeConstants {
|
|
9
|
+
Dimension: typeof Dimension;
|
|
10
|
+
}
|
|
11
|
+
interface NativeErrors {
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FullscreenInstance } from "../types";
|
|
2
|
+
declare const Fullscreen: FullscreenInstance;
|
|
3
|
+
declare global {
|
|
4
|
+
interface HTMLVideoElement {
|
|
5
|
+
webkitEnterFullscreen?: () => void;
|
|
6
|
+
webkitExitFullscreen?: () => void;
|
|
7
|
+
webkitSupportsFullscreen?: boolean;
|
|
8
|
+
webkitDisplayingFullscreen?: boolean;
|
|
9
|
+
__fsBridged__?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface Document {
|
|
12
|
+
readonly fullscreenEnabled: boolean;
|
|
13
|
+
fullscreenElement?: Element | null;
|
|
14
|
+
exitFullscreen: () => Promise<void>;
|
|
15
|
+
readonly webkitFullscreenEnabled?: boolean;
|
|
16
|
+
webkitFullscreenElement?: Element | null;
|
|
17
|
+
webkitCurrentFullScreenElement?: Element | null;
|
|
18
|
+
webkitExitFullscreen?: () => Promise<void>;
|
|
19
|
+
webkitCancelFullScreen?: () => Promise<void>;
|
|
20
|
+
readonly mozFullScreenEnabled?: boolean;
|
|
21
|
+
mozFullScreenElement?: Element | null;
|
|
22
|
+
mozCancelFullScreen?: () => Promise<void>;
|
|
23
|
+
readonly msFullscreenEnabled?: boolean;
|
|
24
|
+
msFullscreenElement?: Element | null;
|
|
25
|
+
msExitFullscreen?: () => Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
interface Element {
|
|
28
|
+
requestFullscreen: (options?: FullscreenOptions) => Promise<void>;
|
|
29
|
+
webkitRequestFullscreen?: (options?: FullscreenOptions) => Promise<void>;
|
|
30
|
+
webkitRequestFullScreen?: (options?: FullscreenOptions) => Promise<void>;
|
|
31
|
+
mozRequestFullScreen?: () => Promise<void>;
|
|
32
|
+
msRequestFullscreen?: () => Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export default Fullscreen;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare interface FullscreenInstance {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
element: any;
|
|
4
|
+
isFullscreen: boolean;
|
|
5
|
+
request(target?: any, options?: FullscreenOptions): Promise<void>;
|
|
6
|
+
exit(): Promise<void>;
|
|
7
|
+
toggle(target?: any, options?: FullscreenOptions): Promise<void>;
|
|
8
|
+
onchange(handler: (event: Event) => void): () => void;
|
|
9
|
+
onerror(handler: (event: Event) => void): () => void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare enum OS {
|
|
2
|
+
Unknown = "Unknown",
|
|
3
|
+
Android = "Android",
|
|
4
|
+
iOS = "iOS",
|
|
5
|
+
Windows = "Windows",
|
|
6
|
+
MacOS = "MacOS"
|
|
7
|
+
}
|
|
8
|
+
export declare enum Devices {
|
|
9
|
+
Unknown = "Unknown",
|
|
10
|
+
Mobile = "Mobile",
|
|
11
|
+
Desktop = "Desktop"
|
|
12
|
+
}
|
|
13
|
+
export declare enum Engines {
|
|
14
|
+
Unknown = "Unknown",
|
|
15
|
+
EdgeHTML = "EdgeHTML",
|
|
16
|
+
ArkWeb = "ArkWeb",
|
|
17
|
+
Blink = "Blink",
|
|
18
|
+
Presto = "Presto",
|
|
19
|
+
WebKit = "WebKit",
|
|
20
|
+
Trident = "Trident",
|
|
21
|
+
NetFront = "NetFront",
|
|
22
|
+
KHTML = "KHTML",
|
|
23
|
+
Tasman = "Tasman",
|
|
24
|
+
Gecko = "Gecko"
|
|
25
|
+
}
|
|
26
|
+
export declare enum Browsers {
|
|
27
|
+
Unknown = "Unknown",
|
|
28
|
+
Chrome = "Chrome",
|
|
29
|
+
Safari = "Safari",
|
|
30
|
+
Edge = "Edge",
|
|
31
|
+
Firefox = "Firefox",
|
|
32
|
+
Opera = "Opera",
|
|
33
|
+
IE = "IE",
|
|
34
|
+
SamsungInternet = "SamsungInternet"
|
|
35
|
+
}
|
|
36
|
+
export declare enum CrossPlatformFramework {
|
|
37
|
+
Unknown = "Unknown",
|
|
38
|
+
ReactNative = "ReactNative",
|
|
39
|
+
Electron = "Electron",
|
|
40
|
+
Cordova = "Cordova"
|
|
41
|
+
}
|
|
42
|
+
export declare const USER_AGENT: string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { PlatformInstance } from "../types";
|
|
2
|
+
declare global {
|
|
3
|
+
var cordova: string | undefined;
|
|
4
|
+
var device: CordovaDevice | undefined;
|
|
5
|
+
interface Navigator {
|
|
6
|
+
userAgent?: string;
|
|
7
|
+
userAgentData?: UserAgentData;
|
|
8
|
+
language?: string;
|
|
9
|
+
languages?: readonly string[];
|
|
10
|
+
browserLanguage?: string;
|
|
11
|
+
systemLanguage?: string;
|
|
12
|
+
userLanguage?: string;
|
|
13
|
+
connection?: NavigatorConnection;
|
|
14
|
+
mozConnection?: NavigatorConnection;
|
|
15
|
+
webkitConnection?: NavigatorConnection;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
interface NavigatorConnection {
|
|
19
|
+
effectiveType?: 'slow-2g' | '2g' | '3g' | '4g';
|
|
20
|
+
type?: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other';
|
|
21
|
+
downlink?: number;
|
|
22
|
+
rtt?: number;
|
|
23
|
+
saveData?: boolean;
|
|
24
|
+
}
|
|
25
|
+
interface CordovaDevice {
|
|
26
|
+
platform: string;
|
|
27
|
+
version: string;
|
|
28
|
+
}
|
|
29
|
+
interface ModernUserAgentDataBrand {
|
|
30
|
+
brand: string;
|
|
31
|
+
version: string;
|
|
32
|
+
}
|
|
33
|
+
type UserAgentDataBrand = ModernUserAgentDataBrand | string | null | undefined;
|
|
34
|
+
interface UserAgentDataValues {
|
|
35
|
+
brands?: UserAgentDataBrand[];
|
|
36
|
+
fullVersionList?: UserAgentDataBrand[];
|
|
37
|
+
platformVersion?: string | null | undefined;
|
|
38
|
+
platform?: string | null | undefined;
|
|
39
|
+
mobile?: boolean;
|
|
40
|
+
}
|
|
41
|
+
interface UserAgentData {
|
|
42
|
+
getHighEntropyValues?(hints: string[]): Promise<UserAgentDataValues>;
|
|
43
|
+
}
|
|
44
|
+
declare const Platform: PlatformInstance;
|
|
45
|
+
export default Platform;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NativePlugin } from "../../types";
|
|
2
|
+
import { PlatformInstance } from "./types";
|
|
3
|
+
import { Browsers, CrossPlatformFramework, Devices, Engines, OS } from "./constants";
|
|
4
|
+
export * from "./types";
|
|
5
|
+
declare const NativePlatformPlugin: NativePlugin<'Platform', PlatformInstance, {
|
|
6
|
+
OS: typeof OS;
|
|
7
|
+
Devices: typeof Devices;
|
|
8
|
+
Engines: typeof Engines;
|
|
9
|
+
Browsers: typeof Browsers;
|
|
10
|
+
CrossPlatformFramework: typeof CrossPlatformFramework;
|
|
11
|
+
}, {}>;
|
|
12
|
+
export default NativePlatformPlugin;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Browsers, CrossPlatformFramework, Devices, Engines, OS } from "../constants";
|
|
2
|
+
export declare interface PlatformInstance {
|
|
3
|
+
os: NameVersionPair<OS>;
|
|
4
|
+
engine: NameVersionPair<Engines>;
|
|
5
|
+
browser: NameVersionPair<Browsers>;
|
|
6
|
+
device: Devices;
|
|
7
|
+
crossPlatformFramework: CrossPlatformFramework;
|
|
8
|
+
network: Network;
|
|
9
|
+
locale: Locale;
|
|
10
|
+
dimension: Dimension;
|
|
11
|
+
renderer: string;
|
|
12
|
+
userAgent: string;
|
|
13
|
+
readyState: 'loading' | 'complete';
|
|
14
|
+
isNode: boolean;
|
|
15
|
+
isStandalone: boolean;
|
|
16
|
+
isWebview: boolean;
|
|
17
|
+
onready(callback: (platform: PlatformInstance) => void): void;
|
|
18
|
+
}
|
|
19
|
+
export declare interface NameVersionPair<T> {
|
|
20
|
+
name: T;
|
|
21
|
+
version: string;
|
|
22
|
+
}
|
|
23
|
+
export declare interface Network {
|
|
24
|
+
isOnline: boolean | null;
|
|
25
|
+
effectiveType: 'slow-2g' | '2g' | '3g' | '4g' | null;
|
|
26
|
+
type: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | null;
|
|
27
|
+
downlink: number | null;
|
|
28
|
+
rtt: number | null;
|
|
29
|
+
saveData: boolean | null;
|
|
30
|
+
}
|
|
31
|
+
export declare interface Dimension {
|
|
32
|
+
outerWidth: number;
|
|
33
|
+
outerHeight: number;
|
|
34
|
+
innerWidth: number;
|
|
35
|
+
innerHeight: number;
|
|
36
|
+
scale: number;
|
|
37
|
+
}
|
|
38
|
+
export declare interface Locale {
|
|
39
|
+
language: string;
|
|
40
|
+
languages: string[];
|
|
41
|
+
timezone: string;
|
|
42
|
+
timezoneOffset: number;
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare interface EventListenerUtil {
|
|
2
|
+
useStd: boolean;
|
|
3
|
+
add<T extends EventTarget | undefined, E extends Event = Event>(target: T, eventListenerOptions: EventListenerOptions<NonNullable<T>, E>): void;
|
|
4
|
+
remove<T extends EventTarget | undefined, E extends Event = Event>(target: T, eventListenerOptions: EventListenerOptions<NonNullable<T>, E>): void;
|
|
5
|
+
withVender(target: any, type?: string): string;
|
|
6
|
+
}
|
|
7
|
+
export declare interface EventListenerOptions<T extends EventTarget = EventTarget, E extends Event = Event> {
|
|
8
|
+
type?: string | undefined;
|
|
9
|
+
callback: ((this: T, event: E) => void) | EventListenerObject | null;
|
|
10
|
+
options?: AddEventListenerOptions | boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./native";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PluginNotExtendedError } from "../errors/plugin-not-extended-error";
|
|
2
|
+
export declare interface NativePlugins {
|
|
3
|
+
}
|
|
4
|
+
export declare interface NativeConstants extends Record<string, any> {
|
|
5
|
+
}
|
|
6
|
+
export declare interface NativeErrors extends Record<string, ErrorConstructor> {
|
|
7
|
+
PluginNotExtendedError: typeof PluginNotExtendedError;
|
|
8
|
+
}
|
|
9
|
+
export declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
|
|
10
|
+
installed: boolean;
|
|
11
|
+
name: Key;
|
|
12
|
+
module: Module;
|
|
13
|
+
Constants: Constants;
|
|
14
|
+
Errors: Errors;
|
|
15
|
+
}
|
|
16
|
+
export declare type ExtendedNativeBase<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = NativeBase<NativePlugins & {
|
|
17
|
+
[Plugin in Key]: Module;
|
|
18
|
+
}, NativeConstants & Constants, NativeErrors & Errors>;
|
|
19
|
+
export declare type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
|
|
20
|
+
Version: string;
|
|
21
|
+
Constants: AssignedConstants;
|
|
22
|
+
Errors: AssignedErrors;
|
|
23
|
+
extends: <Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>>(this: NativeBase<Plugins, AssignedConstants, AssignedErrors>, plugin: NativePlugin<Key, Module, Constants, Errors>) => NativeBase<Plugins & {
|
|
24
|
+
[Plugin in Key]: Module;
|
|
25
|
+
}, AssignedConstants & Constants, AssignedErrors & Errors>;
|
|
26
|
+
} & NativePlugins;
|
|
27
|
+
export type NativeInstance = NativeBase<NativePlugins, NativeConstants, NativeErrors>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function assign(...args: any[]): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function compareVersion(lhs: string, rhs: string): -1 | 0 | 1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function createHiddenElement<K extends keyof HTMLElementTagNameMap>(tagName: K, focusable?: boolean): HTMLElementTagNameMap[K] | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function dispatchClickEvent(element: HTMLElement, view?: WindowProxy): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getTopmostWindow(): WindowProxy;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isSecureContext(): boolean;
|