native-fn 1.1.9 → 1.2.1
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/README.md +488 -146
- package/dist/index.d.ts +138 -119
- package/dist/native.cjs +661 -565
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +661 -565
- package/dist/native.umd.js +661 -565
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/appearance/index.cjs +8 -3
- package/dist/plugin/appearance/index.mjs +8 -3
- package/dist/plugin/appearance/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/appearance/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/appearance/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/appearance/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/appearance/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/appearance/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/appearance/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/appearance/src/types/subscription-manager.d.ts +1 -1
- package/dist/plugin/badge/index.cjs +2 -2
- package/dist/plugin/badge/index.d.ts +1 -1
- package/dist/plugin/badge/index.mjs +2 -2
- package/dist/plugin/badge/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/badge/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/badge/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/badge/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/badge/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/badge/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/badge/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/badge/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/badge/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/badge/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/badge/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/badge/src/types/subscription-manager.d.ts +1 -1
- package/dist/plugin/battery/index.cjs +3 -3
- package/dist/plugin/battery/index.d.ts +1 -1
- package/dist/plugin/battery/index.mjs +3 -3
- package/dist/plugin/battery/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/battery/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/battery/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/battery/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/battery/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/battery/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/battery/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/battery/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/battery/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/battery/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/battery/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/battery/src/types/subscription-manager.d.ts +1 -1
- package/dist/plugin/clipboard/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/clipboard/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/clipboard/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/clipboard/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/clipboard/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/clipboard/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/clipboard/src/types/subscription-manager.d.ts +1 -1
- package/dist/plugin/dimension/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/dimension/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/dimension/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/dimension/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/dimension/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/dimension/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/dimension/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/dimension/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/dimension/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/dimension/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/dimension/src/types/subscription-manager.d.ts +1 -1
- package/dist/plugin/fullscreen/index.cjs +539 -266
- package/dist/plugin/fullscreen/index.d.ts +20 -10
- package/dist/plugin/fullscreen/index.mjs +539 -266
- package/dist/plugin/fullscreen/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/fullscreen/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/fullscreen/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/fullscreen/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/fullscreen/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/fullscreen/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/fullscreen/src/types/subscription-manager.d.ts +1 -1
- package/dist/plugin/geolocation/index.cjs +6 -0
- package/dist/plugin/geolocation/index.d.ts +1 -1
- package/dist/plugin/geolocation/index.mjs +6 -0
- package/dist/plugin/geolocation/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/geolocation/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/geolocation/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/geolocation/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/geolocation/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/geolocation/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/geolocation/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/geolocation/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/geolocation/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/geolocation/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/geolocation/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/geolocation/src/types/subscription-manager.d.ts +1 -1
- package/dist/plugin/notification/index.cjs +6 -0
- package/dist/plugin/notification/index.mjs +6 -0
- package/dist/plugin/notification/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/notification/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/notification/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/notification/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/notification/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/notification/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/notification/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/notification/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/notification/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/notification/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/notification/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/notification/src/types/subscription-manager.d.ts +1 -1
- package/dist/plugin/open/index.cjs +128 -123
- package/dist/plugin/open/index.d.ts +35 -35
- package/dist/plugin/open/index.mjs +128 -123
- package/dist/plugin/open/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/open/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/open/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/open/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/open/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/open/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/open/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/open/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/open/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/open/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/open/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/open/src/types/subscription-manager.d.ts +1 -1
- package/dist/plugin/permission/index.cjs +6 -0
- package/dist/plugin/permission/index.d.ts +1 -0
- package/dist/plugin/permission/index.mjs +6 -0
- package/dist/plugin/permission/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/permission/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/permission/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/permission/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/permission/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/permission/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/permission/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/permission/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/permission/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/permission/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/permission/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/permission/src/types/subscription-manager.d.ts +1 -1
- package/dist/plugin/pip/index.cjs +651 -268
- package/dist/plugin/pip/index.d.ts +22 -12
- package/dist/plugin/pip/index.mjs +651 -268
- package/dist/plugin/pip/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/pip/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/pip/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/pip/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/pip/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/pip/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/pip/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/pip/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/pip/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/pip/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/pip/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/pip/src/types/subscription-manager.d.ts +1 -1
- package/dist/plugin/platform/index.cjs +8 -3
- package/dist/plugin/platform/index.d.ts +5 -5
- package/dist/plugin/platform/index.mjs +8 -3
- package/dist/plugin/platform/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/platform/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/platform/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/platform/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/platform/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/platform/src/types/subscription-manager.d.ts +1 -1
- package/dist/plugin/theme/index.cjs +8 -3
- package/dist/plugin/theme/index.mjs +8 -3
- package/dist/plugin/theme/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/theme/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/theme/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/theme/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/theme/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/theme/src/types/subscription-manager.d.ts +1 -1
- package/dist/plugin/vibration/index.cjs +5 -5
- package/dist/plugin/vibration/index.d.ts +1 -1
- package/dist/plugin/vibration/index.mjs +5 -5
- package/dist/plugin/vibration/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/vibration/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/vibration/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/vibration/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/vibration/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/plugin/vibration/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/vibration/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/vibration/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/vibration/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/vibration/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/plugin/vibration/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/vibration/src/types/subscription-manager.d.ts +1 -1
- package/dist/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +15 -6
- package/dist/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/src/plugin/open/types/open.d.ts +1 -1
- package/dist/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/src/plugin/pip/types/pip.d.ts +14 -5
- package/dist/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/src/types/subscription-manager.d.ts +1 -1
- package/package.json +21 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare interface SubscriptionManager<T, U> {
|
|
2
2
|
emit: (value: U) => void;
|
|
3
|
-
subscribe: (
|
|
3
|
+
subscribe: (listener: (value: U) => void, options?: AddEventListenerOptions) => () => void;
|
|
4
4
|
}
|
|
@@ -85,16 +85,19 @@ function createCustomError(name, Base) {
|
|
|
85
85
|
var NotSupportedError = createCustomError('NotSupportedError');
|
|
86
86
|
|
|
87
87
|
var Vibration = {
|
|
88
|
-
run: run,
|
|
89
|
-
stop: stop,
|
|
90
88
|
get supported() {
|
|
91
89
|
return supported();
|
|
92
90
|
},
|
|
91
|
+
run: run,
|
|
92
|
+
stop: stop,
|
|
93
93
|
Constants: {},
|
|
94
94
|
Errors: {
|
|
95
95
|
NotSupportedError: NotSupportedError,
|
|
96
96
|
},
|
|
97
97
|
};
|
|
98
|
+
function supported() {
|
|
99
|
+
return typeof globalThis.navigator.vibrate !== 'undefined';
|
|
100
|
+
}
|
|
98
101
|
function run(pattern) {
|
|
99
102
|
if (supported())
|
|
100
103
|
return globalThis.navigator.vibrate(pattern);
|
|
@@ -103,8 +106,5 @@ function run(pattern) {
|
|
|
103
106
|
function stop() {
|
|
104
107
|
return this.run(0);
|
|
105
108
|
}
|
|
106
|
-
function supported() {
|
|
107
|
-
return typeof globalThis.navigator.vibrate !== 'undefined';
|
|
108
|
-
}
|
|
109
109
|
|
|
110
110
|
module.exports = Vibration;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare const NotSupportedError: ErrorConstructor;
|
|
2
2
|
|
|
3
3
|
declare interface VibrationInstance {
|
|
4
|
+
get supported(): boolean;
|
|
4
5
|
run(pattern: number | number[]): boolean;
|
|
5
6
|
stop(): boolean;
|
|
6
|
-
get supported(): boolean;
|
|
7
7
|
Constants: {};
|
|
8
8
|
Errors: {
|
|
9
9
|
NotSupportedError: typeof NotSupportedError;
|
|
@@ -83,16 +83,19 @@ function createCustomError(name, Base) {
|
|
|
83
83
|
var NotSupportedError = createCustomError('NotSupportedError');
|
|
84
84
|
|
|
85
85
|
var Vibration = {
|
|
86
|
-
run: run,
|
|
87
|
-
stop: stop,
|
|
88
86
|
get supported() {
|
|
89
87
|
return supported();
|
|
90
88
|
},
|
|
89
|
+
run: run,
|
|
90
|
+
stop: stop,
|
|
91
91
|
Constants: {},
|
|
92
92
|
Errors: {
|
|
93
93
|
NotSupportedError: NotSupportedError,
|
|
94
94
|
},
|
|
95
95
|
};
|
|
96
|
+
function supported() {
|
|
97
|
+
return typeof globalThis.navigator.vibrate !== 'undefined';
|
|
98
|
+
}
|
|
96
99
|
function run(pattern) {
|
|
97
100
|
if (supported())
|
|
98
101
|
return globalThis.navigator.vibrate(pattern);
|
|
@@ -101,8 +104,5 @@ function run(pattern) {
|
|
|
101
104
|
function stop() {
|
|
102
105
|
return this.run(0);
|
|
103
106
|
}
|
|
104
|
-
function supported() {
|
|
105
|
-
return typeof globalThis.navigator.vibrate !== 'undefined';
|
|
106
|
-
}
|
|
107
107
|
|
|
108
108
|
export { Vibration as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
2
|
export declare interface BadgeInstance {
|
|
3
|
+
get supported(): boolean;
|
|
3
4
|
set(contents: number): Promise<void>;
|
|
4
5
|
clear(): Promise<void>;
|
|
5
|
-
get supported(): boolean;
|
|
6
6
|
Constants: {};
|
|
7
7
|
Errors: {
|
|
8
8
|
NotSupportedError: typeof NotSupportedError;
|
|
@@ -16,8 +16,8 @@ export interface BatteryManager extends EventTarget {
|
|
|
16
16
|
onlevelchange: ((this: BatteryManager, ev: Event) => any) | null;
|
|
17
17
|
}
|
|
18
18
|
export declare interface BatteryInstance {
|
|
19
|
-
get value(): Promise<BatteryManager>;
|
|
20
19
|
get supported(): boolean;
|
|
20
|
+
get value(): Promise<BatteryManager>;
|
|
21
21
|
onChange(listener: (battery: BatteryManager) => void, options?: AddEventListenerOptions): () => void;
|
|
22
22
|
Constants: {};
|
|
23
23
|
Errors: {
|
|
@@ -7,7 +7,6 @@ declare global {
|
|
|
7
7
|
webkitDisplayingFullscreen?: boolean;
|
|
8
8
|
onwebkitbeginfullscreen?: ((this: HTMLVideoElement, ev: Event) => any) | null;
|
|
9
9
|
onwebkitendfullscreen?: ((this: HTMLVideoElement, ev: Event) => any) | null;
|
|
10
|
-
[key: symbol]: boolean | undefined;
|
|
11
10
|
}
|
|
12
11
|
interface Document {
|
|
13
12
|
readonly fullscreenEnabled: boolean;
|
|
@@ -32,6 +31,7 @@ declare global {
|
|
|
32
31
|
mozRequestFullScreen?: () => Promise<void>;
|
|
33
32
|
msRequestFullscreen?: () => Promise<void>;
|
|
34
33
|
}
|
|
34
|
+
var __nativeFnFsBridgeKey__: symbol | undefined;
|
|
35
35
|
}
|
|
36
|
-
declare const
|
|
37
|
-
export default
|
|
36
|
+
declare const Fullscreen: FullscreenInstance;
|
|
37
|
+
export default Fullscreen;
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
|
+
import { InvalidStateError } from "../../../errors/invalid-state-error";
|
|
2
3
|
export declare interface FullscreenInstance {
|
|
3
|
-
supported: boolean;
|
|
4
|
-
element: Element | null;
|
|
5
|
-
|
|
4
|
+
get supported(): boolean;
|
|
5
|
+
get element(): Element | null;
|
|
6
|
+
get isActive(): boolean;
|
|
6
7
|
request(target?: Element, options?: FullscreenOptions): Promise<void>;
|
|
7
|
-
exit(): Promise<void>;
|
|
8
8
|
toggle(target?: Element, options?: FullscreenOptions): Promise<void>;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
exit(): Promise<void>;
|
|
10
|
+
onChange(listener: (payload: FullscreenEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
11
|
+
onChange(target: Element, listener: (payload: FullscreenEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
12
|
+
onError(listener: (payload: FullscreenEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
13
|
+
onChange(target: Element, listener: (payload: FullscreenEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
11
14
|
Constants: {};
|
|
12
15
|
Errors: {
|
|
13
16
|
NotSupportedError: typeof NotSupportedError;
|
|
17
|
+
InvalidStateError: typeof InvalidStateError;
|
|
14
18
|
};
|
|
15
19
|
}
|
|
20
|
+
export declare interface FullscreenEventPayload {
|
|
21
|
+
nativeEvent: Event;
|
|
22
|
+
element: Element;
|
|
23
|
+
isActive: boolean;
|
|
24
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
2
|
import { PermissionNotGrantedError } from "../../../errors/permission-not-granted-error";
|
|
3
3
|
export declare interface GeolocationInstance {
|
|
4
|
-
get value(): Promise<GeolocationCoordinates>;
|
|
5
4
|
get supported(): boolean;
|
|
5
|
+
get value(): Promise<GeolocationCoordinates>;
|
|
6
6
|
onChange(listener: (coordinates: GeolocationCoordinates) => void, options?: AddEventListenerOptions): () => void;
|
|
7
7
|
Constants: {};
|
|
8
8
|
Errors: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppOpenState, CameraType, CaptureType, DirectoryExploreMode, ExplorerStartIn, SettingType } from "../constants";
|
|
2
|
-
import { OS } from "../../platform
|
|
2
|
+
import { OS } from "../../platform";
|
|
3
3
|
import { URLOpenError } from "../errors/url-open-error";
|
|
4
4
|
import { UserCancelledError } from "../errors/user-cancel-error";
|
|
5
5
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PermissionState, PermissionType } from "../constants";
|
|
2
2
|
export declare interface PermissionInstance {
|
|
3
|
+
get supported(): boolean;
|
|
3
4
|
request(type: PermissionType): Promise<PermissionState>;
|
|
4
5
|
check(type: PermissionType): Promise<PermissionState>;
|
|
5
6
|
Constants: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { PipInstance } from "../types";
|
|
2
2
|
declare global {
|
|
3
3
|
interface HTMLVideoElement {
|
|
4
|
-
webkitSupportsPresentationMode
|
|
5
|
-
webkitSetPresentationMode
|
|
4
|
+
webkitSupportsPresentationMode?(mode: string): boolean;
|
|
5
|
+
webkitSetPresentationMode?(mode: string): void;
|
|
6
6
|
webkitPresentationMode?: string;
|
|
7
|
-
onwebkitpresentationmodechanged?: ((this:
|
|
8
|
-
[key: symbol]: boolean | undefined;
|
|
7
|
+
onwebkitpresentationmodechanged?: ((this: Element, ev: Event) => any) | null;
|
|
9
8
|
}
|
|
9
|
+
var __nativeFnPipBridgeKey__: symbol | undefined;
|
|
10
10
|
}
|
|
11
|
-
declare const
|
|
12
|
-
export default
|
|
11
|
+
declare const Pip: PipInstance;
|
|
12
|
+
export default Pip;
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
|
+
import { InvalidStateError } from "../../../errors/invalid-state-error";
|
|
2
3
|
export declare interface PipInstance {
|
|
3
|
-
supported: boolean;
|
|
4
|
-
element: HTMLVideoElement | null;
|
|
5
|
-
|
|
4
|
+
get supported(): boolean;
|
|
5
|
+
get element(): HTMLVideoElement | null;
|
|
6
|
+
get isActive(): boolean;
|
|
6
7
|
request(target?: HTMLVideoElement): Promise<void>;
|
|
7
8
|
exit(): Promise<void>;
|
|
8
9
|
toggle(target?: HTMLVideoElement): Promise<void>;
|
|
9
|
-
onChange(listener: (
|
|
10
|
-
|
|
10
|
+
onChange(listener: (payload: PipEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
11
|
+
onChange(target: HTMLVideoElement, listener: (payload: PipEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
12
|
+
onError(listener: (payload: PipEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
13
|
+
onError(target: HTMLVideoElement, listener: (payload: PipEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
11
14
|
Constants: {};
|
|
12
15
|
Errors: {
|
|
13
16
|
NotSupportedError: typeof NotSupportedError;
|
|
17
|
+
InvalidStateError: typeof InvalidStateError;
|
|
14
18
|
};
|
|
15
19
|
}
|
|
20
|
+
export declare interface PipEventPayload {
|
|
21
|
+
nativeEvent: Event;
|
|
22
|
+
element: HTMLVideoElement;
|
|
23
|
+
isActive: boolean;
|
|
24
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
2
|
export declare interface VibrationInstance {
|
|
3
|
+
get supported(): boolean;
|
|
3
4
|
run(pattern: number | number[]): boolean;
|
|
4
5
|
stop(): boolean;
|
|
5
|
-
get supported(): boolean;
|
|
6
6
|
Constants: {};
|
|
7
7
|
Errors: {
|
|
8
8
|
NotSupportedError: typeof NotSupportedError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare interface SubscriptionManager<T, U> {
|
|
2
2
|
emit: (value: U) => void;
|
|
3
|
-
subscribe: (
|
|
3
|
+
subscribe: (listener: (value: U) => void, options?: AddEventListenerOptions) => () => void;
|
|
4
4
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
2
|
export declare interface BadgeInstance {
|
|
3
|
+
get supported(): boolean;
|
|
3
4
|
set(contents: number): Promise<void>;
|
|
4
5
|
clear(): Promise<void>;
|
|
5
|
-
get supported(): boolean;
|
|
6
6
|
Constants: {};
|
|
7
7
|
Errors: {
|
|
8
8
|
NotSupportedError: typeof NotSupportedError;
|
|
@@ -16,8 +16,8 @@ export interface BatteryManager extends EventTarget {
|
|
|
16
16
|
onlevelchange: ((this: BatteryManager, ev: Event) => any) | null;
|
|
17
17
|
}
|
|
18
18
|
export declare interface BatteryInstance {
|
|
19
|
-
get value(): Promise<BatteryManager>;
|
|
20
19
|
get supported(): boolean;
|
|
20
|
+
get value(): Promise<BatteryManager>;
|
|
21
21
|
onChange(listener: (battery: BatteryManager) => void, options?: AddEventListenerOptions): () => void;
|
|
22
22
|
Constants: {};
|
|
23
23
|
Errors: {
|
|
@@ -7,7 +7,6 @@ declare global {
|
|
|
7
7
|
webkitDisplayingFullscreen?: boolean;
|
|
8
8
|
onwebkitbeginfullscreen?: ((this: HTMLVideoElement, ev: Event) => any) | null;
|
|
9
9
|
onwebkitendfullscreen?: ((this: HTMLVideoElement, ev: Event) => any) | null;
|
|
10
|
-
[key: symbol]: boolean | undefined;
|
|
11
10
|
}
|
|
12
11
|
interface Document {
|
|
13
12
|
readonly fullscreenEnabled: boolean;
|
|
@@ -32,6 +31,7 @@ declare global {
|
|
|
32
31
|
mozRequestFullScreen?: () => Promise<void>;
|
|
33
32
|
msRequestFullscreen?: () => Promise<void>;
|
|
34
33
|
}
|
|
34
|
+
var __nativeFnFsBridgeKey__: symbol | undefined;
|
|
35
35
|
}
|
|
36
|
-
declare const
|
|
37
|
-
export default
|
|
36
|
+
declare const Fullscreen: FullscreenInstance;
|
|
37
|
+
export default Fullscreen;
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
|
+
import { InvalidStateError } from "../../../errors/invalid-state-error";
|
|
2
3
|
export declare interface FullscreenInstance {
|
|
3
|
-
supported: boolean;
|
|
4
|
-
element: Element | null;
|
|
5
|
-
|
|
4
|
+
get supported(): boolean;
|
|
5
|
+
get element(): Element | null;
|
|
6
|
+
get isActive(): boolean;
|
|
6
7
|
request(target?: Element, options?: FullscreenOptions): Promise<void>;
|
|
7
|
-
exit(): Promise<void>;
|
|
8
8
|
toggle(target?: Element, options?: FullscreenOptions): Promise<void>;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
exit(): Promise<void>;
|
|
10
|
+
onChange(listener: (payload: FullscreenEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
11
|
+
onChange(target: Element, listener: (payload: FullscreenEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
12
|
+
onError(listener: (payload: FullscreenEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
13
|
+
onChange(target: Element, listener: (payload: FullscreenEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
11
14
|
Constants: {};
|
|
12
15
|
Errors: {
|
|
13
16
|
NotSupportedError: typeof NotSupportedError;
|
|
17
|
+
InvalidStateError: typeof InvalidStateError;
|
|
14
18
|
};
|
|
15
19
|
}
|
|
20
|
+
export declare interface FullscreenEventPayload {
|
|
21
|
+
nativeEvent: Event;
|
|
22
|
+
element: Element;
|
|
23
|
+
isActive: boolean;
|
|
24
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
2
|
import { PermissionNotGrantedError } from "../../../errors/permission-not-granted-error";
|
|
3
3
|
export declare interface GeolocationInstance {
|
|
4
|
-
get value(): Promise<GeolocationCoordinates>;
|
|
5
4
|
get supported(): boolean;
|
|
5
|
+
get value(): Promise<GeolocationCoordinates>;
|
|
6
6
|
onChange(listener: (coordinates: GeolocationCoordinates) => void, options?: AddEventListenerOptions): () => void;
|
|
7
7
|
Constants: {};
|
|
8
8
|
Errors: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppOpenState, CameraType, CaptureType, DirectoryExploreMode, ExplorerStartIn, SettingType } from "../constants";
|
|
2
|
-
import { OS } from "../../platform
|
|
2
|
+
import { OS } from "../../platform";
|
|
3
3
|
import { URLOpenError } from "../errors/url-open-error";
|
|
4
4
|
import { UserCancelledError } from "../errors/user-cancel-error";
|
|
5
5
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PermissionState, PermissionType } from "../constants";
|
|
2
2
|
export declare interface PermissionInstance {
|
|
3
|
+
get supported(): boolean;
|
|
3
4
|
request(type: PermissionType): Promise<PermissionState>;
|
|
4
5
|
check(type: PermissionType): Promise<PermissionState>;
|
|
5
6
|
Constants: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { PipInstance } from "../types";
|
|
2
2
|
declare global {
|
|
3
3
|
interface HTMLVideoElement {
|
|
4
|
-
webkitSupportsPresentationMode
|
|
5
|
-
webkitSetPresentationMode
|
|
4
|
+
webkitSupportsPresentationMode?(mode: string): boolean;
|
|
5
|
+
webkitSetPresentationMode?(mode: string): void;
|
|
6
6
|
webkitPresentationMode?: string;
|
|
7
|
-
onwebkitpresentationmodechanged?: ((this:
|
|
8
|
-
[key: symbol]: boolean | undefined;
|
|
7
|
+
onwebkitpresentationmodechanged?: ((this: Element, ev: Event) => any) | null;
|
|
9
8
|
}
|
|
9
|
+
var __nativeFnPipBridgeKey__: symbol | undefined;
|
|
10
10
|
}
|
|
11
|
-
declare const
|
|
12
|
-
export default
|
|
11
|
+
declare const Pip: PipInstance;
|
|
12
|
+
export default Pip;
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
|
+
import { InvalidStateError } from "../../../errors/invalid-state-error";
|
|
2
3
|
export declare interface PipInstance {
|
|
3
|
-
supported: boolean;
|
|
4
|
-
element: HTMLVideoElement | null;
|
|
5
|
-
|
|
4
|
+
get supported(): boolean;
|
|
5
|
+
get element(): HTMLVideoElement | null;
|
|
6
|
+
get isActive(): boolean;
|
|
6
7
|
request(target?: HTMLVideoElement): Promise<void>;
|
|
7
8
|
exit(): Promise<void>;
|
|
8
9
|
toggle(target?: HTMLVideoElement): Promise<void>;
|
|
9
|
-
onChange(listener: (
|
|
10
|
-
|
|
10
|
+
onChange(listener: (payload: PipEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
11
|
+
onChange(target: HTMLVideoElement, listener: (payload: PipEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
12
|
+
onError(listener: (payload: PipEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
13
|
+
onError(target: HTMLVideoElement, listener: (payload: PipEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
11
14
|
Constants: {};
|
|
12
15
|
Errors: {
|
|
13
16
|
NotSupportedError: typeof NotSupportedError;
|
|
17
|
+
InvalidStateError: typeof InvalidStateError;
|
|
14
18
|
};
|
|
15
19
|
}
|
|
20
|
+
export declare interface PipEventPayload {
|
|
21
|
+
nativeEvent: Event;
|
|
22
|
+
element: HTMLVideoElement;
|
|
23
|
+
isActive: boolean;
|
|
24
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
2
|
export declare interface VibrationInstance {
|
|
3
|
+
get supported(): boolean;
|
|
3
4
|
run(pattern: number | number[]): boolean;
|
|
4
5
|
stop(): boolean;
|
|
5
|
-
get supported(): boolean;
|
|
6
6
|
Constants: {};
|
|
7
7
|
Errors: {
|
|
8
8
|
NotSupportedError: typeof NotSupportedError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare interface SubscriptionManager<T, U> {
|
|
2
2
|
emit: (value: U) => void;
|
|
3
|
-
subscribe: (
|
|
3
|
+
subscribe: (listener: (value: U) => void, options?: AddEventListenerOptions) => () => void;
|
|
4
4
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "native-fn",
|
|
3
|
-
"version": "1.1
|
|
4
|
-
"description": " ",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "TypeScript library bridging Web APIs to native device capabilities — Picture-in-Picture, Fullscreen, Clipboard, Geolocation, Battery, Notifications, Vibration, Platform detection, and more.",
|
|
5
|
+
"author": "Park Jungyoung <qkrwnss0509@gmail.com> (https://github.com/pjy0509)",
|
|
5
6
|
"type": "module",
|
|
6
7
|
|
|
7
8
|
"main": "dist/native.cjs",
|
|
@@ -133,7 +134,6 @@
|
|
|
133
134
|
"build": "rollup -c"
|
|
134
135
|
},
|
|
135
136
|
|
|
136
|
-
"author": "pjy",
|
|
137
137
|
"license": "MIT",
|
|
138
138
|
|
|
139
139
|
"repository": {
|
|
@@ -142,17 +142,25 @@
|
|
|
142
142
|
},
|
|
143
143
|
"homepage": "https://pjy0509.github.io/example/native-fn/",
|
|
144
144
|
"keywords": [
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
145
|
+
"native-fn",
|
|
146
|
+
"picture-in-picture",
|
|
147
|
+
"pip",
|
|
148
|
+
"fullscreen",
|
|
149
|
+
"clipboard",
|
|
150
|
+
"geolocation",
|
|
151
|
+
"battery",
|
|
152
|
+
"notification",
|
|
153
|
+
"vibration",
|
|
154
|
+
"app-badge",
|
|
155
|
+
"safe-area-inset",
|
|
156
|
+
"deep-link",
|
|
157
|
+
"file-picker",
|
|
158
|
+
"share-api",
|
|
159
|
+
"browser-detection",
|
|
160
|
+
"webview",
|
|
161
|
+
"pwa",
|
|
162
|
+
"os-detection",
|
|
150
163
|
"appearance",
|
|
151
|
-
"engine",
|
|
152
|
-
"messenger",
|
|
153
|
-
"os",
|
|
154
|
-
"theme",
|
|
155
|
-
"theme color",
|
|
156
164
|
"theme-color"
|
|
157
165
|
],
|
|
158
166
|
"devDependencies": {
|