native-fn 1.0.26 → 1.0.28
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 +22 -192
- package/dist/index.d.ts +18 -27
- package/dist/native.cjs +27 -1400
- package/dist/native.min.cjs +1 -0
- package/dist/native.min.mjs +1 -0
- package/dist/native.mjs +27 -1400
- package/dist/native.umd.js +27 -1400
- package/dist/native.umd.min.js +1 -0
- package/dist/plugin/app/index.cjs +1025 -0
- package/dist/plugin/app/index.d.ts +86 -0
- package/dist/plugin/app/index.min.cjs +1 -0
- package/dist/plugin/app/index.min.mjs +1 -0
- package/dist/plugin/app/index.mjs +1023 -0
- package/dist/plugin/app/index.umd.js +1031 -0
- package/dist/plugin/app/index.umd.min.js +1 -0
- package/dist/plugin/app/src/constants/platform.d.ts +35 -0
- package/dist/plugin/app/src/constants/user-agent.d.ts +1 -0
- package/dist/plugin/app/src/plugin/app/cores/app.d.ts +3 -0
- package/dist/plugin/app/src/plugin/app/index.d.ts +5 -0
- package/dist/plugin/app/src/plugin/app/types/app.d.ts +54 -0
- package/dist/plugin/app/src/plugin/app/types/appModule.d.ts +54 -0
- package/dist/plugin/app/src/plugin/app/types/index.d.ts +1 -0
- package/dist/plugin/app/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/app/src/plugin/platform/cores/platform.d.ts +3 -0
- package/dist/plugin/app/src/plugin/platform/index.d.ts +5 -0
- package/dist/plugin/app/src/plugin/platform/types/index.d.ts +1 -0
- package/dist/{src → plugin/app/src/plugin/platform}/types/platform.d.ts +1 -1
- package/dist/plugin/app/src/plugin/platform/types/platformModule.d.ts +13 -0
- package/dist/{src → plugin/app/src/plugin/theme}/constants/theme.d.ts +1 -1
- package/dist/plugin/app/src/plugin/theme/cores/theme.d.ts +3 -0
- package/dist/plugin/app/src/plugin/theme/index.d.ts +5 -0
- package/dist/plugin/app/src/plugin/theme/types/color.d.ts +17 -0
- package/dist/{src → plugin/app/src/plugin/theme}/types/easing-syntax.d.ts +1 -1
- package/dist/plugin/app/src/plugin/theme/types/index.d.ts +3 -0
- package/dist/{src → plugin/app/src/plugin/theme}/types/theme.d.ts +4 -4
- package/dist/plugin/app/src/plugin/theme/types/themeModule.d.ts +24 -0
- package/dist/{src → plugin/app/src/plugin/theme}/utils/parse-color.d.ts +1 -1
- package/dist/{src → plugin/app/src/plugin/theme}/utils/parse-easing-function.d.ts +1 -1
- package/dist/plugin/app/src/types/index.d.ts +1 -0
- package/dist/plugin/app/src/types/native.d.ts +14 -0
- package/dist/plugin/app/src/utils/assign.d.ts +1 -0
- package/dist/plugin/app/src/utils/create-custom-error.d.ts +1 -0
- package/dist/plugin/platform/index.cjs +171 -0
- package/dist/plugin/platform/index.d.ts +51 -0
- package/dist/plugin/platform/index.min.cjs +1 -0
- package/dist/plugin/platform/index.min.mjs +1 -0
- package/dist/plugin/platform/index.mjs +169 -0
- package/dist/plugin/platform/index.umd.js +177 -0
- package/dist/plugin/platform/index.umd.min.js +1 -0
- package/dist/plugin/platform/src/constants/platform.d.ts +35 -0
- package/dist/plugin/platform/src/constants/user-agent.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/app/constants/app.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/app/cores/app.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/app/index.d.ts +5 -0
- package/dist/plugin/platform/src/plugin/app/types/app.d.ts +54 -0
- package/dist/plugin/platform/src/plugin/app/types/appModule.d.ts +54 -0
- package/dist/plugin/platform/src/plugin/app/types/index.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/app/utils/try-open-url.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/platform/cores/platform.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/platform/index.d.ts +5 -0
- package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/platform/types/platformModule.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/theme/constants/theme.d.ts +16 -0
- package/dist/plugin/platform/src/plugin/theme/cores/theme.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/theme/errors/easing-error.d.ts +6 -0
- package/dist/plugin/platform/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/theme/index.d.ts +5 -0
- package/dist/plugin/platform/src/plugin/theme/types/color.d.ts +17 -0
- package/dist/plugin/platform/src/plugin/theme/types/easing-syntax.d.ts +16 -0
- package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +24 -0
- package/dist/plugin/platform/src/plugin/theme/types/themeModule.d.ts +24 -0
- package/dist/plugin/platform/src/plugin/theme/utils/parse-color.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
- package/dist/plugin/platform/src/types/index.d.ts +1 -0
- package/dist/plugin/platform/src/types/native.d.ts +14 -0
- package/dist/plugin/platform/src/utils/assign.d.ts +1 -0
- package/dist/plugin/platform/src/utils/create-custom-error.d.ts +1 -0
- package/dist/plugin/theme/index.cjs +810 -0
- package/dist/plugin/theme/index.d.ts +75 -0
- package/dist/plugin/theme/index.min.cjs +1 -0
- package/dist/plugin/theme/index.min.mjs +1 -0
- package/dist/plugin/theme/index.mjs +808 -0
- package/dist/plugin/theme/index.umd.js +816 -0
- package/dist/plugin/theme/index.umd.min.js +1 -0
- package/dist/plugin/theme/src/constants/platform.d.ts +35 -0
- package/dist/plugin/theme/src/constants/user-agent.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/app/constants/app.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/app/cores/app.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/theme/src/plugin/app/index.d.ts +5 -0
- package/dist/plugin/theme/src/plugin/app/types/app.d.ts +54 -0
- package/dist/plugin/theme/src/plugin/app/types/appModule.d.ts +54 -0
- package/dist/plugin/theme/src/plugin/app/types/index.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/app/utils/try-open-url.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/platform/cores/platform.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/platform/index.d.ts +5 -0
- package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/platform/types/platformModule.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/theme/constants/theme.d.ts +16 -0
- package/dist/plugin/theme/src/plugin/theme/cores/theme.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/theme/errors/easing-error.d.ts +6 -0
- package/dist/plugin/theme/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/theme/src/plugin/theme/index.d.ts +5 -0
- package/dist/plugin/theme/src/plugin/theme/types/color.d.ts +17 -0
- package/dist/plugin/theme/src/plugin/theme/types/easing-syntax.d.ts +16 -0
- package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +24 -0
- package/dist/plugin/theme/src/plugin/theme/types/themeModule.d.ts +24 -0
- package/dist/plugin/theme/src/plugin/theme/utils/parse-color.d.ts +2 -0
- package/dist/plugin/theme/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
- package/dist/plugin/theme/src/types/index.d.ts +1 -0
- package/dist/plugin/theme/src/types/native.d.ts +14 -0
- package/dist/plugin/theme/src/utils/assign.d.ts +1 -0
- package/dist/plugin/theme/src/utils/create-custom-error.d.ts +1 -0
- package/dist/src/plugin/app/constants/app.d.ts +13 -0
- package/dist/src/plugin/app/cores/app.d.ts +3 -0
- package/dist/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/src/plugin/app/index.d.ts +5 -0
- package/dist/src/plugin/app/types/app.d.ts +54 -0
- package/dist/src/plugin/app/types/appModule.d.ts +54 -0
- package/dist/src/plugin/app/types/index.d.ts +1 -0
- package/dist/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
- package/dist/src/plugin/app/utils/try-open-url.d.ts +1 -0
- package/dist/src/plugin/platform/cores/platform.d.ts +3 -0
- package/dist/src/plugin/platform/index.d.ts +5 -0
- package/dist/src/plugin/platform/types/index.d.ts +1 -0
- package/dist/src/plugin/platform/types/platform.d.ts +13 -0
- package/dist/src/plugin/platform/types/platformModule.d.ts +13 -0
- package/dist/src/plugin/theme/constants/theme.d.ts +16 -0
- package/dist/src/plugin/theme/cores/theme.d.ts +3 -0
- package/dist/src/plugin/theme/errors/easing-error.d.ts +6 -0
- package/dist/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
- package/dist/src/plugin/theme/index.d.ts +5 -0
- package/dist/src/plugin/theme/types/color.d.ts +17 -0
- package/dist/src/plugin/theme/types/easing-syntax.d.ts +16 -0
- package/dist/src/plugin/theme/types/index.d.ts +3 -0
- package/dist/src/plugin/theme/types/theme.d.ts +24 -0
- package/dist/src/plugin/theme/types/themeModule.d.ts +24 -0
- package/dist/src/plugin/theme/utils/parse-color.d.ts +2 -0
- package/dist/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
- package/dist/src/types/index.d.ts +1 -5
- package/dist/src/types/native.d.ts +14 -0
- package/dist/src/utils/assign.d.ts +1 -0
- package/package.json +8 -5
- package/dist/src/cores/app.d.ts +0 -3
- package/dist/src/cores/platform.d.ts +0 -3
- package/dist/src/cores/theme.d.ts +0 -3
- package/dist/src/types/app.d.ts +0 -44
- package/dist/src/types/color.d.ts +0 -17
- package/dist/src/utils/freeze-deep.d.ts +0 -1
- /package/dist/{src → plugin/app/src/plugin/app}/constants/app.d.ts +0 -0
- /package/dist/{src → plugin/app/src/plugin/app}/errors/url-open-error.d.ts +0 -0
- /package/dist/{src → plugin/app/src/plugin/app}/utils/try-open-url.d.ts +0 -0
- /package/dist/{src → plugin/app/src/plugin/theme}/errors/easing-error.d.ts +0 -0
- /package/dist/{src → plugin/app/src/plugin/theme}/errors/unsupported-color-error.d.ts +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare interface CubicBezierParams {
|
|
2
|
+
x1: number;
|
|
3
|
+
y1: number;
|
|
4
|
+
x2: number;
|
|
5
|
+
y2: number;
|
|
6
|
+
}
|
|
7
|
+
export declare interface LinearPoint {
|
|
8
|
+
position: number;
|
|
9
|
+
value: number;
|
|
10
|
+
}
|
|
11
|
+
export declare type CubicBezierSyntax = `cubic-bezier(${string})`;
|
|
12
|
+
export declare type LinearSyntax = `linear(${string})`;
|
|
13
|
+
export declare type StepSyntax = `steps(${string})`;
|
|
14
|
+
export declare type EasingSyntax = CubicBezierSyntax | LinearSyntax | StepSyntax;
|
|
15
|
+
export declare type EasingFunction = (t: number) => number;
|
|
16
|
+
export declare type EasingKeyword = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'step-start' | 'step-end';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Appearances } from '../constants/theme';
|
|
2
|
+
import type { EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
3
|
+
import type { Color } from '../types/color';
|
|
4
|
+
export declare interface ListenerEntry {
|
|
5
|
+
fn: (appearance: Appearances) => any;
|
|
6
|
+
capture: boolean;
|
|
7
|
+
once: boolean;
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
}
|
|
10
|
+
export declare interface Theme {
|
|
11
|
+
setThemeColor: (color: Color, options?: SetThemeColorOptions) => Promise<string | undefined>;
|
|
12
|
+
getThemeColor: () => Color | undefined;
|
|
13
|
+
removeThemeColor: (appearance?: ThemeColorMetaAppearanceKeys) => void;
|
|
14
|
+
detectAppearance: () => Promise<Appearances>;
|
|
15
|
+
onAppearanceChange: (listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions) => () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare type ThemeColorMetaAppearanceKeys = 'default' | 'dark' | 'light';
|
|
18
|
+
export declare type ThemeColorMetaGroup = Partial<Record<ThemeColorMetaAppearanceKeys, HTMLMetaElement>>;
|
|
19
|
+
export declare interface SetThemeColorOptions {
|
|
20
|
+
appearance?: ThemeColorMetaAppearanceKeys;
|
|
21
|
+
duration?: number;
|
|
22
|
+
easingFunction?: EasingSyntax | EasingKeyword;
|
|
23
|
+
defaultColor?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Appearances } from '../constants/theme';
|
|
2
|
+
import type { EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
3
|
+
import type { Color } from '../types/color';
|
|
4
|
+
export declare interface ListenerEntry {
|
|
5
|
+
fn: (appearance: Appearances) => any;
|
|
6
|
+
capture: boolean;
|
|
7
|
+
once: boolean;
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
}
|
|
10
|
+
export declare type ThemeColorMetaAppearanceKeys = 'default' | 'dark' | 'light';
|
|
11
|
+
export declare type ThemeColorMetaGroup = Partial<Record<ThemeColorMetaAppearanceKeys, HTMLMetaElement>>;
|
|
12
|
+
export declare interface SetThemeColorOptions {
|
|
13
|
+
appearance?: ThemeColorMetaAppearanceKeys;
|
|
14
|
+
duration?: number;
|
|
15
|
+
easingFunction?: EasingSyntax | EasingKeyword;
|
|
16
|
+
defaultColor?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare interface ThemeModule {
|
|
19
|
+
setThemeColor: (color: Color, options?: SetThemeColorOptions) => Promise<string | undefined>;
|
|
20
|
+
getThemeColor: () => Color | undefined;
|
|
21
|
+
removeThemeColor: (appearance?: ThemeColorMetaAppearanceKeys) => void;
|
|
22
|
+
detectAppearance: () => Promise<Appearances>;
|
|
23
|
+
onAppearanceChange: (listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions) => () => void;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './native';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare interface NativePlugin<T> {
|
|
2
|
+
installed: boolean;
|
|
3
|
+
name: string;
|
|
4
|
+
module: T;
|
|
5
|
+
constants: Record<string, any>;
|
|
6
|
+
errors: Record<string, ErrorConstructor>;
|
|
7
|
+
}
|
|
8
|
+
export declare interface NativeBase {
|
|
9
|
+
Version: string;
|
|
10
|
+
Constants: Record<string, any>;
|
|
11
|
+
Errors: Record<string, ErrorConstructor>;
|
|
12
|
+
extends: <T>(plugin: NativePlugin<T>) => Native;
|
|
13
|
+
}
|
|
14
|
+
export declare type Native = NativeBase & Record<Exclude<string, keyof NativeBase>, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function assign(...args: any[]): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function createCustomError(name: string, Base?: ErrorConstructor): ErrorConstructor;
|