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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { SpeechInstance } from "../types";
|
|
2
|
+
declare const Speech: SpeechInstance;
|
|
3
|
+
interface SpeechRecognition extends EventTarget {
|
|
4
|
+
lang: string;
|
|
5
|
+
continuous: boolean;
|
|
6
|
+
interimResults: boolean;
|
|
7
|
+
maxAlternatives: number;
|
|
8
|
+
processLocally?: boolean;
|
|
9
|
+
onaudiostart: ((this: SpeechRecognition, ev: Event) => any) | null;
|
|
10
|
+
onaudioend: ((this: SpeechRecognition, ev: Event) => any) | null;
|
|
11
|
+
onend: ((this: SpeechRecognition, ev: Event) => any) | null;
|
|
12
|
+
onerror: ((this: SpeechRecognition, ev: SpeechRecognitionErrorEvent) => any) | null;
|
|
13
|
+
onnomatch: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;
|
|
14
|
+
onresult: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;
|
|
15
|
+
onsoundstart: ((this: SpeechRecognition, ev: Event) => any) | null;
|
|
16
|
+
onsoundend: ((this: SpeechRecognition, ev: Event) => any) | null;
|
|
17
|
+
onspeechstart: ((this: SpeechRecognition, ev: Event) => any) | null;
|
|
18
|
+
onspeechend: ((this: SpeechRecognition, ev: Event) => any) | null;
|
|
19
|
+
onstart: ((this: SpeechRecognition, ev: Event) => any) | null;
|
|
20
|
+
start(audioTrack?: MediaStreamTrack): void;
|
|
21
|
+
stop(): void;
|
|
22
|
+
abort(): void;
|
|
23
|
+
addEventListener(type: "audiostart" | "audioend" | "end" | "error" | "nomatch" | "result" | "soundstart" | "soundend" | "speechstart" | "speechend" | "start", listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
24
|
+
removeEventListener(type: "audiostart" | "audioend" | "end" | "error" | "nomatch" | "result" | "soundstart" | "soundend" | "speechstart" | "speechend" | "start", listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
25
|
+
}
|
|
26
|
+
interface SpeechRecognitionConstructor {
|
|
27
|
+
new (): SpeechRecognition;
|
|
28
|
+
available?: (options?: {
|
|
29
|
+
langs?: string[];
|
|
30
|
+
processLocally?: boolean;
|
|
31
|
+
}) => Promise<boolean>;
|
|
32
|
+
install?: (options?: {
|
|
33
|
+
langs?: string[];
|
|
34
|
+
}) => Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
interface SpeechRecognitionEvent extends Event {
|
|
37
|
+
readonly resultIndex: number;
|
|
38
|
+
readonly results: SpeechRecognitionResultList;
|
|
39
|
+
}
|
|
40
|
+
interface SpeechRecognitionErrorEvent extends Event {
|
|
41
|
+
readonly error: string;
|
|
42
|
+
readonly message: string;
|
|
43
|
+
}
|
|
44
|
+
declare global {
|
|
45
|
+
var webkitSpeechRecognition: SpeechRecognitionConstructor;
|
|
46
|
+
var SpeechRecognition: SpeechRecognitionConstructor;
|
|
47
|
+
interface HTMLAudioElement {
|
|
48
|
+
captureStream?(): MediaStream;
|
|
49
|
+
mozCaptureStream?(): MediaStream;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
declare const SpeechRecognition: SpeechRecognitionConstructor;
|
|
53
|
+
export default Speech;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./speech";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
|
+
export declare interface SpeechInstance {
|
|
3
|
+
tts(text: string, language?: string): Promise<Blob>;
|
|
4
|
+
stt(blob: Blob, language?: string): Promise<string>;
|
|
5
|
+
Constants: {};
|
|
6
|
+
Errors: {
|
|
7
|
+
NotSupportedError: typeof NotSupportedError;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const Theme:
|
|
1
|
+
import type { ThemeInstance } from "../types";
|
|
2
|
+
declare const Theme: ThemeInstance;
|
|
3
3
|
export default Theme;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./vibration";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
|
+
export declare interface VibrationInstance {
|
|
3
|
+
run(pattern: number | number[]): boolean;
|
|
4
|
+
get supported(): boolean;
|
|
5
|
+
Constants: {};
|
|
6
|
+
Errors: {
|
|
7
|
+
NotSupportedError: typeof NotSupportedError;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type EventTargetLike = EventTarget & {
|
|
2
|
+
attachEvent?(type: string, listener: (event: Event) => void): void;
|
|
3
|
+
detachEvent?(type: string, listener: (event: Event) => void): void;
|
|
4
|
+
webkitEnterFullscreen?(): void;
|
|
5
|
+
media?: string;
|
|
6
|
+
matches?: boolean | ((selectors: string) => boolean);
|
|
7
|
+
addListener?(callback: MediaQueryListCallback | null): void;
|
|
8
|
+
removeListener?(callback: MediaQueryListCallback | null): void;
|
|
9
|
+
};
|
|
10
|
+
export type MediaQueryListCallback = ((this: MediaQueryList, ev: MediaQueryListEvent) => any);
|
|
11
|
+
export type AnyCallback = EventListenerOrEventListenerObject | MediaQueryListCallback;
|
|
12
|
+
export declare interface EventListenerOptions<E extends Event = Event> {
|
|
13
|
+
type?: string;
|
|
14
|
+
callback: EventListenerOrEventListenerObject | MediaQueryListCallback | ((this: any, event: E) => void);
|
|
15
|
+
options?: AddEventListenerOptions | boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface EventListenerInstance {
|
|
18
|
+
useStd: boolean;
|
|
19
|
+
add<E extends Event = Event>(target: EventTargetLike | undefined, eventListenerOptions: EventListenerOptions<E>): void;
|
|
20
|
+
remove<E extends Event = Event>(target: EventTargetLike | undefined, eventListenerOptions: EventListenerOptions<E>): void;
|
|
21
|
+
}
|
|
22
|
+
export type IEWrapper = (event: Event) => void;
|
|
23
|
+
export type IEWrapperRecord = {
|
|
24
|
+
target: EventTarget;
|
|
25
|
+
type: string;
|
|
26
|
+
callback: AnyCallback;
|
|
27
|
+
wrapper: IEWrapper;
|
|
28
|
+
};
|
|
29
|
+
export type MediaQueryListWrapper = (this: MediaQueryList, ev: MediaQueryListEvent) => void;
|
|
30
|
+
export type MediaQueryListWrapperRecord = {
|
|
31
|
+
target: MediaQueryList;
|
|
32
|
+
type: string;
|
|
33
|
+
callback: AnyCallback;
|
|
34
|
+
wrapper: MediaQueryListWrapper;
|
|
35
|
+
};
|
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import AppearanceInstance from "../plugin/appearance";
|
|
2
|
+
import BadgeInstance from "../plugin/badge";
|
|
3
|
+
import ClipboardInstance from "../plugin/clipboard";
|
|
4
|
+
import DimensionInstance from "../plugin/dimension";
|
|
5
|
+
import FullscreenInstance from "../plugin/fullscreen";
|
|
6
|
+
import GeoLocationInstance from "../plugin/geolocation";
|
|
7
|
+
import NotificationInstance from "../plugin/notification";
|
|
8
|
+
import OpenInstance from "../plugin/open";
|
|
9
|
+
import PlatformInstance from "../plugin/platform";
|
|
10
|
+
import ThemeInstance from "../plugin/theme";
|
|
11
|
+
import VibrationInstance from "../plugin/vibration";
|
|
12
|
+
import PermissionInstance from "../plugin/permission";
|
|
13
|
+
import PipInstance from "../plugin/pip";
|
|
14
|
+
import BatteryInstance from "../plugin/battery";
|
|
15
|
+
export declare interface NativeInstance {
|
|
16
|
+
version: string;
|
|
17
|
+
appearance: typeof AppearanceInstance;
|
|
18
|
+
badge: typeof BadgeInstance;
|
|
19
|
+
battery: typeof BatteryInstance;
|
|
20
|
+
clipboard: typeof ClipboardInstance;
|
|
21
|
+
dimension: typeof DimensionInstance;
|
|
22
|
+
fullscreen: typeof FullscreenInstance;
|
|
23
|
+
geolocation: typeof GeoLocationInstance;
|
|
24
|
+
notification: typeof NotificationInstance;
|
|
25
|
+
open: typeof OpenInstance;
|
|
26
|
+
permission: typeof PermissionInstance;
|
|
27
|
+
platform: typeof PlatformInstance;
|
|
28
|
+
pip: typeof PipInstance;
|
|
29
|
+
theme: typeof ThemeInstance;
|
|
30
|
+
vibration: typeof VibrationInstance;
|
|
17
31
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EnvironmentPresetKey, EnvironmentPresetValues } from "../plugin/dimension";
|
|
2
|
+
type ChangeCallback<K extends EnvironmentPresetKey> = (values: EnvironmentPresetValues<K>) => void;
|
|
3
|
+
export type EnvObserver<K extends EnvironmentPresetKey> = {
|
|
4
|
+
get(): EnvironmentPresetValues<K>;
|
|
5
|
+
onChange(callback: ChangeCallback<K>, options?: AddEventListenerOptions): () => void;
|
|
6
|
+
};
|
|
7
|
+
export default function createEnvObserver<K extends EnvironmentPresetKey>(preset: K): EnvObserver<K>;
|
|
8
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function createHiddenElement<K extends keyof HTMLElementTagNameMap>(tagName: K, focusable?: boolean): HTMLElementTagNameMap[K]
|
|
1
|
+
export default function createHiddenElement<K extends keyof HTMLElementTagNameMap>(tagName: K, focusable?: boolean): HTMLElementTagNameMap[K];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function defer(task: () => void): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function keys(object: object): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function now(): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function padStart(string: any, length: number, pad: string): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function randomString(length: number): string;
|