native-fn 1.0.27 → 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/dist/index.d.ts +19 -4
- package/dist/native.cjs +2 -2
- package/dist/native.mjs +2 -2
- package/dist/native.umd.js +2 -2
- package/dist/plugin/app/index.cjs +1 -1
- package/dist/plugin/app/index.d.ts +86 -4
- package/dist/plugin/app/index.mjs +1 -1
- package/dist/plugin/app/index.umd.js +1 -1
- package/dist/plugin/app/src/plugin/app/cores/app.d.ts +2 -2
- package/dist/plugin/app/src/plugin/app/index.d.ts +3 -3
- 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 -1
- package/dist/plugin/app/src/plugin/app/utils/event-listener-utils.d.ts +1 -1
- package/dist/plugin/app/src/plugin/platform/cores/platform.d.ts +2 -2
- package/dist/plugin/app/src/plugin/platform/index.d.ts +3 -3
- package/dist/plugin/app/src/plugin/platform/types/index.d.ts +1 -1
- package/dist/plugin/app/src/plugin/platform/types/platformModule.d.ts +13 -0
- package/dist/plugin/app/src/plugin/theme/constants/theme.d.ts +1 -1
- package/dist/plugin/app/src/plugin/theme/cores/theme.d.ts +2 -2
- package/dist/plugin/app/src/plugin/theme/index.d.ts +3 -3
- package/dist/plugin/app/src/plugin/theme/types/index.d.ts +1 -1
- package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/app/src/plugin/theme/types/themeModule.d.ts +24 -0
- package/dist/plugin/app/src/plugin/theme/utils/parse-color.d.ts +1 -1
- package/dist/plugin/app/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
- package/dist/plugin/platform/index.cjs +1 -1
- package/dist/plugin/platform/index.d.ts +51 -4
- package/dist/plugin/platform/index.mjs +1 -1
- package/dist/plugin/platform/index.umd.js +1 -1
- package/dist/plugin/platform/src/plugin/app/cores/app.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/app/index.d.ts +3 -3
- 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 -1
- package/dist/plugin/platform/src/plugin/app/utils/event-listener-utils.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/platform/cores/platform.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/platform/index.d.ts +3 -3
- package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/platform/types/platformModule.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/theme/constants/theme.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/theme/cores/theme.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/theme/index.d.ts +3 -3
- package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +2 -2
- 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 +1 -1
- package/dist/plugin/platform/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
- package/dist/plugin/theme/index.cjs +1 -1
- package/dist/plugin/theme/index.d.ts +75 -4
- package/dist/plugin/theme/index.mjs +1 -1
- package/dist/plugin/theme/index.umd.js +1 -1
- package/dist/plugin/theme/src/plugin/app/cores/app.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/app/index.d.ts +3 -3
- 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 -1
- package/dist/plugin/theme/src/plugin/app/utils/event-listener-utils.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/platform/cores/platform.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/platform/index.d.ts +3 -3
- package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/platform/types/platformModule.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/theme/constants/theme.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/theme/cores/theme.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/theme/index.d.ts +3 -3
- package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +2 -2
- 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 +1 -1
- package/dist/plugin/theme/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
- package/dist/src/plugin/app/cores/app.d.ts +2 -2
- package/dist/src/plugin/app/index.d.ts +3 -3
- package/dist/src/plugin/app/types/appModule.d.ts +54 -0
- package/dist/src/plugin/app/types/index.d.ts +1 -1
- package/dist/src/plugin/app/utils/event-listener-utils.d.ts +1 -1
- package/dist/src/plugin/platform/cores/platform.d.ts +2 -2
- package/dist/src/plugin/platform/index.d.ts +3 -3
- package/dist/src/plugin/platform/types/index.d.ts +1 -1
- package/dist/src/plugin/platform/types/platformModule.d.ts +13 -0
- package/dist/src/plugin/theme/constants/theme.d.ts +1 -1
- package/dist/src/plugin/theme/cores/theme.d.ts +2 -2
- package/dist/src/plugin/theme/index.d.ts +3 -3
- package/dist/src/plugin/theme/types/index.d.ts +1 -1
- package/dist/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/src/plugin/theme/types/themeModule.d.ts +24 -0
- package/dist/src/plugin/theme/utils/parse-color.d.ts +1 -1
- package/dist/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
- package/package.json +7 -5
|
@@ -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
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RGBA } from '../types/color';
|
|
1
|
+
import type { RGBA } from '../types/color';
|
|
2
2
|
export default function parseColor(color: string): RGBA;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { EasingFunction, EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
1
|
+
import type { EasingFunction, EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
2
2
|
export default function parseEasingFunction(easingFunction: EasingSyntax | EasingKeyword): EasingFunction;
|
|
@@ -1,4 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
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
|
+
|
|
9
|
+
type SystemColor = 'ActiveBorder' | 'ActiveCaption' | 'AppWorkspace' | 'Background' | 'ButtonHighlight' | 'ButtonShadow' | 'CaptionText' | 'InactiveBorder' | 'InactiveCaption' | 'InactiveCaptionText' | 'InfoBackground' | 'InfoText' | 'Menu' | 'MenuText' | 'Scrollbar' | 'ThreeDDarkShadow' | 'ThreeDFace' | 'ThreeDHighlight' | 'ThreeDLightShadow' | 'ThreeDShadow' | 'Window' | 'WindowFrame' | 'WindowText';
|
|
10
|
+
type DeprecatedSystemColor = 'ActiveText' | 'ButtonBorder' | 'ButtonFace' | 'ButtonText' | 'Canvas' | 'CanvasText' | 'Field' | 'FieldText' | 'GrayText' | 'Highlight' | 'HighlightText' | 'LinkText' | 'Mark' | 'MarkText' | 'SelectedItem' | 'SelectedItemText' | 'VisitedText';
|
|
11
|
+
type NamedColor = 'aliceblue' | 'antiquewhite' | 'aqua' | 'aquamarine' | 'azure' | 'beige' | 'bisque' | 'black' | 'blanchedalmond' | 'blue' | 'blueviolet' | 'brown' | 'burlywood' | 'cadetblue' | 'chartreuse' | 'chocolate' | 'coral' | 'cornflowerblue' | 'cornsilk' | 'crimson' | 'cyan' | 'darkblue' | 'darkcyan' | 'darkgoldenrod' | 'darkgray' | 'darkgreen' | 'darkgrey' | 'darkkhaki' | 'darkmagenta' | 'darkolivegreen' | 'darkorange' | 'darkorchid' | 'darkred' | 'darksalmon' | 'darkseagreen' | 'darkslateblue' | 'darkslategray' | 'darkslategrey' | 'darkturquoise' | 'darkviolet' | 'deeppink' | 'deepskyblue' | 'dimgray' | 'dimgrey' | 'dodgerblue' | 'firebrick' | 'floralwhite' | 'forestgreen' | 'fuchsia' | 'gainsboro' | 'ghostwhite' | 'gold' | 'goldenrod' | 'gray' | 'green' | 'greenyellow' | 'grey' | 'honeydew' | 'hotpink' | 'indianred' | 'indigo' | 'ivory' | 'khaki' | 'lavender' | 'lavenderblush' | 'lawngreen' | 'lemonchiffon' | 'lightblue' | 'lightcoral' | 'lightcyan' | 'lightgoldenrodyellow' | 'lightgray' | 'lightgreen' | 'lightgrey' | 'lightpink' | 'lightsalmon' | 'lightseagreen' | 'lightskyblue' | 'lightslategray' | 'lightslategrey' | 'lightsteelblue' | 'lightyellow' | 'lime' | 'limegreen' | 'linen' | 'magenta' | 'maroon' | 'mediumaquamarine' | 'mediumblue' | 'mediumorchid' | 'mediumpurple' | 'mediumseagreen' | 'mediumslateblue' | 'mediumspringgreen' | 'mediumturquoise' | 'mediumvioletred' | 'midnightblue' | 'mintcream' | 'mistyrose' | 'moccasin' | 'navajowhite' | 'navy' | 'oldlace' | 'olive' | 'olivedrab' | 'orange' | 'orangered' | 'orchid' | 'palegoldenrod' | 'palegreen' | 'paleturquoise' | 'palevioletred' | 'papayawhip' | 'peachpuff' | 'peru' | 'pink' | 'plum' | 'powderblue' | 'purple' | 'rebeccapurple' | 'red' | 'rosybrown' | 'royalblue' | 'saddlebrown' | 'salmon' | 'sandybrown' | 'seagreen' | 'seashell' | 'sienna' | 'silver' | 'skyblue' | 'slateblue' | 'slategray' | 'slategrey' | 'snow' | 'springgreen' | 'steelblue' | 'tan' | 'teal' | 'thistle' | 'tomato' | 'turquoise' | 'violet' | 'wheat' | 'white' | 'whitesmoke' | 'yellow' | 'yellowgreen';
|
|
12
|
+
type RGBColor = `rgb(${string})`;
|
|
13
|
+
type RGBAColor = `rgba(${string})`;
|
|
14
|
+
type HSLColor = `hsl(${string})`;
|
|
15
|
+
type HSLAColor = `hsla(${string})`;
|
|
16
|
+
type HEXColor = `#${string}`;
|
|
17
|
+
type Color = 'currentColor' | 'transparent' | SystemColor | DeprecatedSystemColor | NamedColor | RGBColor | RGBAColor | HSLColor | HSLAColor | HEXColor | string;
|
|
18
|
+
declare interface RGB {
|
|
19
|
+
red: number;
|
|
20
|
+
green: number;
|
|
21
|
+
blue: number;
|
|
22
|
+
}
|
|
23
|
+
declare interface RGBA extends RGB {
|
|
24
|
+
alpha: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare interface CubicBezierParams {
|
|
28
|
+
x1: number;
|
|
29
|
+
y1: number;
|
|
30
|
+
x2: number;
|
|
31
|
+
y2: number;
|
|
32
|
+
}
|
|
33
|
+
declare interface LinearPoint {
|
|
34
|
+
position: number;
|
|
35
|
+
value: number;
|
|
36
|
+
}
|
|
37
|
+
declare type CubicBezierSyntax = `cubic-bezier(${string})`;
|
|
38
|
+
declare type LinearSyntax = `linear(${string})`;
|
|
39
|
+
declare type StepSyntax = `steps(${string})`;
|
|
40
|
+
declare type EasingSyntax = CubicBezierSyntax | LinearSyntax | StepSyntax;
|
|
41
|
+
declare type EasingFunction = (t: number) => number;
|
|
42
|
+
declare type EasingKeyword = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'step-start' | 'step-end';
|
|
43
|
+
|
|
44
|
+
declare enum Appearances {
|
|
45
|
+
Unknown = "unknown",
|
|
46
|
+
Light = "light",
|
|
47
|
+
Dark = "dark"
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare interface ListenerEntry {
|
|
51
|
+
fn: (appearance: Appearances) => any;
|
|
52
|
+
capture: boolean;
|
|
53
|
+
once: boolean;
|
|
54
|
+
signal?: AbortSignal;
|
|
55
|
+
}
|
|
56
|
+
declare type ThemeColorMetaAppearanceKeys = 'default' | 'dark' | 'light';
|
|
57
|
+
declare type ThemeColorMetaGroup = Partial<Record<ThemeColorMetaAppearanceKeys, HTMLMetaElement>>;
|
|
58
|
+
declare interface SetThemeColorOptions {
|
|
59
|
+
appearance?: ThemeColorMetaAppearanceKeys;
|
|
60
|
+
duration?: number;
|
|
61
|
+
easingFunction?: EasingSyntax | EasingKeyword;
|
|
62
|
+
defaultColor?: string;
|
|
63
|
+
}
|
|
64
|
+
declare interface ThemeModule {
|
|
65
|
+
setThemeColor: (color: Color, options?: SetThemeColorOptions) => Promise<string | undefined>;
|
|
66
|
+
getThemeColor: () => Color | undefined;
|
|
67
|
+
removeThemeColor: (appearance?: ThemeColorMetaAppearanceKeys) => void;
|
|
68
|
+
detectAppearance: () => Promise<Appearances>;
|
|
69
|
+
onAppearanceChange: (listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions) => () => void;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare const ThemePlugin: NativePlugin<ThemeModule>;
|
|
73
|
+
|
|
74
|
+
export { ThemePlugin as default };
|
|
75
|
+
export type { Color, CubicBezierParams, CubicBezierSyntax, DeprecatedSystemColor, EasingFunction, EasingKeyword, EasingSyntax, HEXColor, HSLAColor, HSLColor, LinearPoint, LinearSyntax, ListenerEntry, NamedColor, RGB, RGBA, RGBAColor, RGBColor, SetThemeColorOptions, StepSyntax, SystemColor, ThemeColorMetaAppearanceKeys, ThemeColorMetaGroup, ThemeModule };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const App:
|
|
1
|
+
import type { AppModule } from '../types/appModule';
|
|
2
|
+
declare const App: AppModule;
|
|
3
3
|
export default App;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NativePlugin } from
|
|
2
|
-
import
|
|
1
|
+
import type { NativePlugin } from '../../types';
|
|
2
|
+
import type { AppModule } from "./types";
|
|
3
3
|
export * from './types';
|
|
4
|
-
declare const AppPlugin: NativePlugin<
|
|
4
|
+
declare const AppPlugin: NativePlugin<AppModule>;
|
|
5
5
|
export default AppPlugin;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { OS } from '../../../constants/platform';
|
|
2
|
+
import { AppOpenState, Messengers } from '../constants/app';
|
|
3
|
+
export declare interface EventListenerUtil {
|
|
4
|
+
useStd: boolean;
|
|
5
|
+
add: (target: any, eventListenerOptions: EventListenerOptions) => void;
|
|
6
|
+
remove: (target: any, eventListenerOptions: EventListenerOptions) => void;
|
|
7
|
+
withVender: (target: any, type?: string) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare interface EventListenerOptions {
|
|
10
|
+
type?: string;
|
|
11
|
+
callback: EventListenerOrEventListenerObject | null;
|
|
12
|
+
options?: AddEventListenerOptions | boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare interface AppInfo {
|
|
15
|
+
scheme?: URLCandidate;
|
|
16
|
+
fallback?: URLCandidate | (() => any);
|
|
17
|
+
timeout?: number;
|
|
18
|
+
allowWebStore?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare interface AndroidAppInfo extends AppInfo {
|
|
21
|
+
packageName?: string;
|
|
22
|
+
intent?: URLCandidate;
|
|
23
|
+
}
|
|
24
|
+
export declare interface IOSAppInfo extends MacOSAppInfo {
|
|
25
|
+
universal?: URLCandidate;
|
|
26
|
+
}
|
|
27
|
+
export declare interface WindowsAppInfo extends AppInfo {
|
|
28
|
+
productId?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare interface MacOSAppInfo extends AppInfo {
|
|
31
|
+
bundleId?: string;
|
|
32
|
+
trackId?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare interface AppOpenOptions {
|
|
35
|
+
[OS.Android]?: AndroidAppInfo;
|
|
36
|
+
[OS.iOS]?: IOSAppInfo;
|
|
37
|
+
[OS.Windows]?: WindowsAppInfo;
|
|
38
|
+
[OS.MacOS]?: MacOSAppInfo;
|
|
39
|
+
}
|
|
40
|
+
export declare type URLCandidate = URL | string;
|
|
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<Messengers, (options: MessengerOpenOptions, self?: WindowProxy) => Promise<void>>;
|
|
51
|
+
export declare interface AppModule {
|
|
52
|
+
open: (options: AppOpenOptions, target?: WindowProxy) => Promise<AppOpenState>;
|
|
53
|
+
messenger: Messenger;
|
|
54
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './appModule';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const Platform:
|
|
1
|
+
import type { PlatformModule } from '../types/platformModule';
|
|
2
|
+
declare const Platform: PlatformModule;
|
|
3
3
|
export default Platform;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NativePlugin } from
|
|
2
|
-
import
|
|
1
|
+
import type { NativePlugin } from '../../types';
|
|
2
|
+
import type { PlatformModule } from "./types";
|
|
3
3
|
export * from './types';
|
|
4
|
-
declare const PlatformPlugin: NativePlugin<
|
|
4
|
+
declare const PlatformPlugin: NativePlugin<PlatformModule>;
|
|
5
5
|
export default PlatformPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './platformModule';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Devices, Engines, OS } from '../../../constants/platform';
|
|
2
|
+
export declare interface PlatformModule {
|
|
3
|
+
os: OS;
|
|
4
|
+
device: Devices;
|
|
5
|
+
engine: Engines;
|
|
6
|
+
osVersion: string;
|
|
7
|
+
engineVersion: string;
|
|
8
|
+
renderer: string;
|
|
9
|
+
isWebview: boolean;
|
|
10
|
+
isStandalone: boolean;
|
|
11
|
+
isMobile: boolean;
|
|
12
|
+
isDesktop: boolean;
|
|
13
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const Theme:
|
|
1
|
+
import type { ThemeModule } from '../types/themeModule';
|
|
2
|
+
declare const Theme: ThemeModule;
|
|
3
3
|
export default Theme;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NativePlugin } from
|
|
2
|
-
import
|
|
1
|
+
import type { NativePlugin } from '../../types';
|
|
2
|
+
import type { ThemeModule } from "./types";
|
|
3
3
|
export * from './types';
|
|
4
|
-
declare const ThemePlugin: NativePlugin<
|
|
4
|
+
declare const ThemePlugin: NativePlugin<ThemeModule>;
|
|
5
5
|
export default ThemePlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Appearances } from '../constants/theme';
|
|
2
|
-
import { EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
3
|
-
import { Color } from '../types/color';
|
|
2
|
+
import type { EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
3
|
+
import type { Color } from '../types/color';
|
|
4
4
|
export declare interface ListenerEntry {
|
|
5
5
|
fn: (appearance: Appearances) => any;
|
|
6
6
|
capture: boolean;
|
|
@@ -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
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RGBA } from '../types/color';
|
|
1
|
+
import type { RGBA } from '../types/color';
|
|
2
2
|
export default function parseColor(color: string): RGBA;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { EasingFunction, EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
1
|
+
import type { EasingFunction, EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
2
2
|
export default function parseEasingFunction(easingFunction: EasingSyntax | EasingKeyword): EasingFunction;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const App:
|
|
1
|
+
import type { AppModule } from '../types/appModule';
|
|
2
|
+
declare const App: AppModule;
|
|
3
3
|
export default App;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NativePlugin } from
|
|
2
|
-
import
|
|
1
|
+
import type { NativePlugin } from '../../types';
|
|
2
|
+
import type { AppModule } from "./types";
|
|
3
3
|
export * from './types';
|
|
4
|
-
declare const AppPlugin: NativePlugin<
|
|
4
|
+
declare const AppPlugin: NativePlugin<AppModule>;
|
|
5
5
|
export default AppPlugin;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { OS } from '../../../constants/platform';
|
|
2
|
+
import { AppOpenState, Messengers } from '../constants/app';
|
|
3
|
+
export declare interface EventListenerUtil {
|
|
4
|
+
useStd: boolean;
|
|
5
|
+
add: (target: any, eventListenerOptions: EventListenerOptions) => void;
|
|
6
|
+
remove: (target: any, eventListenerOptions: EventListenerOptions) => void;
|
|
7
|
+
withVender: (target: any, type?: string) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare interface EventListenerOptions {
|
|
10
|
+
type?: string;
|
|
11
|
+
callback: EventListenerOrEventListenerObject | null;
|
|
12
|
+
options?: AddEventListenerOptions | boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare interface AppInfo {
|
|
15
|
+
scheme?: URLCandidate;
|
|
16
|
+
fallback?: URLCandidate | (() => any);
|
|
17
|
+
timeout?: number;
|
|
18
|
+
allowWebStore?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare interface AndroidAppInfo extends AppInfo {
|
|
21
|
+
packageName?: string;
|
|
22
|
+
intent?: URLCandidate;
|
|
23
|
+
}
|
|
24
|
+
export declare interface IOSAppInfo extends MacOSAppInfo {
|
|
25
|
+
universal?: URLCandidate;
|
|
26
|
+
}
|
|
27
|
+
export declare interface WindowsAppInfo extends AppInfo {
|
|
28
|
+
productId?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare interface MacOSAppInfo extends AppInfo {
|
|
31
|
+
bundleId?: string;
|
|
32
|
+
trackId?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare interface AppOpenOptions {
|
|
35
|
+
[OS.Android]?: AndroidAppInfo;
|
|
36
|
+
[OS.iOS]?: IOSAppInfo;
|
|
37
|
+
[OS.Windows]?: WindowsAppInfo;
|
|
38
|
+
[OS.MacOS]?: MacOSAppInfo;
|
|
39
|
+
}
|
|
40
|
+
export declare type URLCandidate = URL | string;
|
|
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<Messengers, (options: MessengerOpenOptions, self?: WindowProxy) => Promise<void>>;
|
|
51
|
+
export declare interface AppModule {
|
|
52
|
+
open: (options: AppOpenOptions, target?: WindowProxy) => Promise<AppOpenState>;
|
|
53
|
+
messenger: Messenger;
|
|
54
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './appModule';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const Platform:
|
|
1
|
+
import type { PlatformModule } from '../types/platformModule';
|
|
2
|
+
declare const Platform: PlatformModule;
|
|
3
3
|
export default Platform;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NativePlugin } from
|
|
2
|
-
import
|
|
1
|
+
import type { NativePlugin } from '../../types';
|
|
2
|
+
import type { PlatformModule } from "./types";
|
|
3
3
|
export * from './types';
|
|
4
|
-
declare const PlatformPlugin: NativePlugin<
|
|
4
|
+
declare const PlatformPlugin: NativePlugin<PlatformModule>;
|
|
5
5
|
export default PlatformPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './platformModule';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Devices, Engines, OS } from '../../../constants/platform';
|
|
2
|
+
export declare interface PlatformModule {
|
|
3
|
+
os: OS;
|
|
4
|
+
device: Devices;
|
|
5
|
+
engine: Engines;
|
|
6
|
+
osVersion: string;
|
|
7
|
+
engineVersion: string;
|
|
8
|
+
renderer: string;
|
|
9
|
+
isWebview: boolean;
|
|
10
|
+
isStandalone: boolean;
|
|
11
|
+
isMobile: boolean;
|
|
12
|
+
isDesktop: boolean;
|
|
13
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const Theme:
|
|
1
|
+
import type { ThemeModule } from '../types/themeModule';
|
|
2
|
+
declare const Theme: ThemeModule;
|
|
3
3
|
export default Theme;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NativePlugin } from
|
|
2
|
-
import
|
|
1
|
+
import type { NativePlugin } from '../../types';
|
|
2
|
+
import type { ThemeModule } from "./types";
|
|
3
3
|
export * from './types';
|
|
4
|
-
declare const ThemePlugin: NativePlugin<
|
|
4
|
+
declare const ThemePlugin: NativePlugin<ThemeModule>;
|
|
5
5
|
export default ThemePlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Appearances } from '../constants/theme';
|
|
2
|
-
import { EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
3
|
-
import { Color } from '../types/color';
|
|
2
|
+
import type { EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
3
|
+
import type { Color } from '../types/color';
|
|
4
4
|
export declare interface ListenerEntry {
|
|
5
5
|
fn: (appearance: Appearances) => any;
|
|
6
6
|
capture: boolean;
|
|
@@ -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
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RGBA } from '../types/color';
|
|
1
|
+
import type { RGBA } from '../types/color';
|
|
2
2
|
export default function parseColor(color: string): RGBA;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { EasingFunction, EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
1
|
+
import type { EasingFunction, EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
2
2
|
export default function parseEasingFunction(easingFunction: EasingSyntax | EasingKeyword): EasingFunction;
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "native-fn",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": " ",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "rollup -c"
|
|
6
|
+
"build": "rollup -c",
|
|
7
|
+
"publish": "npm publish"
|
|
7
8
|
},
|
|
8
9
|
"author": "pjy",
|
|
9
10
|
"license": "MIT",
|
|
@@ -39,8 +40,9 @@
|
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@rollup/plugin-json": "^6.1.0",
|
|
41
42
|
"@rollup/plugin-terser": "^0.4.4",
|
|
42
|
-
"@rollup/plugin-typescript": "^
|
|
43
|
-
"rollup": "^4.
|
|
44
|
-
"
|
|
43
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
44
|
+
"rollup": "^4.52.5",
|
|
45
|
+
"rollup-plugin-dts": "^6.2.3",
|
|
46
|
+
"typescript": "^5.9.3"
|
|
45
47
|
}
|
|
46
48
|
}
|