native-fn 1.0.27 → 1.0.29

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.
Files changed (85) hide show
  1. package/dist/index.d.ts +19 -4
  2. package/dist/native.cjs +2 -2
  3. package/dist/native.mjs +2 -2
  4. package/dist/native.umd.js +2 -2
  5. package/dist/plugin/app/index.cjs +1 -1
  6. package/dist/plugin/app/index.d.ts +86 -4
  7. package/dist/plugin/app/index.mjs +1 -1
  8. package/dist/plugin/app/index.umd.js +1 -1
  9. package/dist/plugin/app/src/plugin/app/cores/app.d.ts +2 -2
  10. package/dist/plugin/app/src/plugin/app/index.d.ts +3 -3
  11. package/dist/plugin/app/src/plugin/app/types/appModule.d.ts +54 -0
  12. package/dist/plugin/app/src/plugin/app/types/index.d.ts +1 -1
  13. package/dist/plugin/app/src/plugin/app/utils/event-listener-utils.d.ts +1 -1
  14. package/dist/plugin/app/src/plugin/platform/cores/platform.d.ts +2 -2
  15. package/dist/plugin/app/src/plugin/platform/index.d.ts +3 -3
  16. package/dist/plugin/app/src/plugin/platform/types/index.d.ts +1 -1
  17. package/dist/plugin/app/src/plugin/platform/types/platformModule.d.ts +13 -0
  18. package/dist/plugin/app/src/plugin/theme/constants/theme.d.ts +1 -1
  19. package/dist/plugin/app/src/plugin/theme/cores/theme.d.ts +2 -2
  20. package/dist/plugin/app/src/plugin/theme/index.d.ts +3 -3
  21. package/dist/plugin/app/src/plugin/theme/types/index.d.ts +1 -1
  22. package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +2 -2
  23. package/dist/plugin/app/src/plugin/theme/types/themeModule.d.ts +24 -0
  24. package/dist/plugin/app/src/plugin/theme/utils/parse-color.d.ts +1 -1
  25. package/dist/plugin/app/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
  26. package/dist/plugin/platform/index.cjs +1 -1
  27. package/dist/plugin/platform/index.d.ts +51 -4
  28. package/dist/plugin/platform/index.mjs +1 -1
  29. package/dist/plugin/platform/index.umd.js +1 -1
  30. package/dist/plugin/platform/src/plugin/app/cores/app.d.ts +2 -2
  31. package/dist/plugin/platform/src/plugin/app/index.d.ts +3 -3
  32. package/dist/plugin/platform/src/plugin/app/types/appModule.d.ts +54 -0
  33. package/dist/plugin/platform/src/plugin/app/types/index.d.ts +1 -1
  34. package/dist/plugin/platform/src/plugin/app/utils/event-listener-utils.d.ts +1 -1
  35. package/dist/plugin/platform/src/plugin/platform/cores/platform.d.ts +2 -2
  36. package/dist/plugin/platform/src/plugin/platform/index.d.ts +3 -3
  37. package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +1 -1
  38. package/dist/plugin/platform/src/plugin/platform/types/platformModule.d.ts +13 -0
  39. package/dist/plugin/platform/src/plugin/theme/constants/theme.d.ts +1 -1
  40. package/dist/plugin/platform/src/plugin/theme/cores/theme.d.ts +2 -2
  41. package/dist/plugin/platform/src/plugin/theme/index.d.ts +3 -3
  42. package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +1 -1
  43. package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +2 -2
  44. package/dist/plugin/platform/src/plugin/theme/types/themeModule.d.ts +24 -0
  45. package/dist/plugin/platform/src/plugin/theme/utils/parse-color.d.ts +1 -1
  46. package/dist/plugin/platform/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
  47. package/dist/plugin/theme/index.cjs +1 -1
  48. package/dist/plugin/theme/index.d.ts +75 -4
  49. package/dist/plugin/theme/index.mjs +1 -1
  50. package/dist/plugin/theme/index.umd.js +1 -1
  51. package/dist/plugin/theme/src/plugin/app/cores/app.d.ts +2 -2
  52. package/dist/plugin/theme/src/plugin/app/index.d.ts +3 -3
  53. package/dist/plugin/theme/src/plugin/app/types/appModule.d.ts +54 -0
  54. package/dist/plugin/theme/src/plugin/app/types/index.d.ts +1 -1
  55. package/dist/plugin/theme/src/plugin/app/utils/event-listener-utils.d.ts +1 -1
  56. package/dist/plugin/theme/src/plugin/platform/cores/platform.d.ts +2 -2
  57. package/dist/plugin/theme/src/plugin/platform/index.d.ts +3 -3
  58. package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +1 -1
  59. package/dist/plugin/theme/src/plugin/platform/types/platformModule.d.ts +13 -0
  60. package/dist/plugin/theme/src/plugin/theme/constants/theme.d.ts +1 -1
  61. package/dist/plugin/theme/src/plugin/theme/cores/theme.d.ts +2 -2
  62. package/dist/plugin/theme/src/plugin/theme/index.d.ts +3 -3
  63. package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +1 -1
  64. package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +2 -2
  65. package/dist/plugin/theme/src/plugin/theme/types/themeModule.d.ts +24 -0
  66. package/dist/plugin/theme/src/plugin/theme/utils/parse-color.d.ts +1 -1
  67. package/dist/plugin/theme/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
  68. package/dist/src/plugin/app/cores/app.d.ts +2 -2
  69. package/dist/src/plugin/app/index.d.ts +3 -3
  70. package/dist/src/plugin/app/types/appModule.d.ts +54 -0
  71. package/dist/src/plugin/app/types/index.d.ts +1 -1
  72. package/dist/src/plugin/app/utils/event-listener-utils.d.ts +1 -1
  73. package/dist/src/plugin/platform/cores/platform.d.ts +2 -2
  74. package/dist/src/plugin/platform/index.d.ts +3 -3
  75. package/dist/src/plugin/platform/types/index.d.ts +1 -1
  76. package/dist/src/plugin/platform/types/platformModule.d.ts +13 -0
  77. package/dist/src/plugin/theme/constants/theme.d.ts +1 -1
  78. package/dist/src/plugin/theme/cores/theme.d.ts +2 -2
  79. package/dist/src/plugin/theme/index.d.ts +3 -3
  80. package/dist/src/plugin/theme/types/index.d.ts +1 -1
  81. package/dist/src/plugin/theme/types/theme.d.ts +2 -2
  82. package/dist/src/plugin/theme/types/themeModule.d.ts +24 -0
  83. package/dist/src/plugin/theme/utils/parse-color.d.ts +1 -1
  84. package/dist/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
  85. package/package.json +56 -12
@@ -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;
@@ -804,7 +804,7 @@ var ThemePlugin = {
804
804
  LinearSyntaxError: LinearSyntaxError,
805
805
  CubicBezierSyntaxError: CubicBezierSyntaxError,
806
806
  UnsupportedColorError: UnsupportedColorError
807
- },
807
+ }
808
808
  };
809
809
 
810
810
  module.exports = ThemePlugin;
@@ -1,4 +1,75 @@
1
- import { Native } from "./src/types";
2
- export * from './src/types';
3
- declare const Native: Native;
4
- export default Native;
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 };
@@ -802,7 +802,7 @@ var ThemePlugin = {
802
802
  LinearSyntaxError: LinearSyntaxError,
803
803
  CubicBezierSyntaxError: CubicBezierSyntaxError,
804
804
  UnsupportedColorError: UnsupportedColorError
805
- },
805
+ }
806
806
  };
807
807
 
808
808
  export { ThemePlugin as default };
@@ -808,7 +808,7 @@
808
808
  LinearSyntaxError: LinearSyntaxError,
809
809
  CubicBezierSyntaxError: CubicBezierSyntaxError,
810
810
  UnsupportedColorError: UnsupportedColorError
811
- },
811
+ }
812
812
  };
813
813
 
814
814
  return ThemePlugin;
@@ -1,3 +1,3 @@
1
- import { App } from '../types/app';
2
- declare const App: 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 "../../types";
2
- import App from "./cores/app";
1
+ import type { NativePlugin } from '../../types';
2
+ import type { AppModule } from "./types";
3
3
  export * from './types';
4
- declare const AppPlugin: NativePlugin<App>;
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 './app';
1
+ export * from './appModule';
@@ -1,3 +1,3 @@
1
- import { EventListenerUtil } from '../types/app';
1
+ import type { EventListenerUtil } from '../types/appModule';
2
2
  declare const EventListenerUtils: EventListenerUtil;
3
3
  export default EventListenerUtils;
@@ -1,3 +1,3 @@
1
- import { Platform } from '../types/platform';
2
- declare const Platform: 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 "../../types";
2
- import Platform from "./cores/platform";
1
+ import type { NativePlugin } from '../../types';
2
+ import type { PlatformModule } from "./types";
3
3
  export * from './types';
4
- declare const PlatformPlugin: NativePlugin<Platform>;
4
+ declare const PlatformPlugin: NativePlugin<PlatformModule>;
5
5
  export default PlatformPlugin;
@@ -1 +1 @@
1
- export * from './platform';
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,4 +1,4 @@
1
- import { ListenerEntry } from '../types/theme';
1
+ import type { ListenerEntry } from '../types/themeModule';
2
2
  export declare enum Appearances {
3
3
  Unknown = "unknown",
4
4
  Light = "light",
@@ -1,3 +1,3 @@
1
- import { Theme } from '../types/theme';
2
- declare const Theme: 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 "../../types";
2
- import Theme from "./cores/theme";
1
+ import type { NativePlugin } from '../../types';
2
+ import type { ThemeModule } from "./types";
3
3
  export * from './types';
4
- declare const ThemePlugin: NativePlugin<Theme>;
4
+ declare const ThemePlugin: NativePlugin<ThemeModule>;
5
5
  export default ThemePlugin;
@@ -1,3 +1,3 @@
1
1
  export * from './color';
2
2
  export * from './easing-syntax';
3
- export * from './theme';
3
+ export * from './themeModule';
@@ -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 { App } from '../types/app';
2
- declare const App: 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 "../../types";
2
- import App from "./cores/app";
1
+ import type { NativePlugin } from '../../types';
2
+ import type { AppModule } from "./types";
3
3
  export * from './types';
4
- declare const AppPlugin: NativePlugin<App>;
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 './app';
1
+ export * from './appModule';
@@ -1,3 +1,3 @@
1
- import { EventListenerUtil } from '../types/app';
1
+ import type { EventListenerUtil } from '../types/appModule';
2
2
  declare const EventListenerUtils: EventListenerUtil;
3
3
  export default EventListenerUtils;
@@ -1,3 +1,3 @@
1
- import { Platform } from '../types/platform';
2
- declare const Platform: 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 "../../types";
2
- import Platform from "./cores/platform";
1
+ import type { NativePlugin } from '../../types';
2
+ import type { PlatformModule } from "./types";
3
3
  export * from './types';
4
- declare const PlatformPlugin: NativePlugin<Platform>;
4
+ declare const PlatformPlugin: NativePlugin<PlatformModule>;
5
5
  export default PlatformPlugin;
@@ -1 +1 @@
1
- export * from './platform';
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,4 +1,4 @@
1
- import { ListenerEntry } from '../types/theme';
1
+ import type { ListenerEntry } from '../types/themeModule';
2
2
  export declare enum Appearances {
3
3
  Unknown = "unknown",
4
4
  Light = "light",
@@ -1,3 +1,3 @@
1
- import { Theme } from '../types/theme';
2
- declare const Theme: 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 "../../types";
2
- import Theme from "./cores/theme";
1
+ import type { NativePlugin } from '../../types';
2
+ import type { ThemeModule } from "./types";
3
3
  export * from './types';
4
- declare const ThemePlugin: NativePlugin<Theme>;
4
+ declare const ThemePlugin: NativePlugin<ThemeModule>;
5
5
  export default ThemePlugin;
@@ -1,3 +1,3 @@
1
1
  export * from './color';
2
2
  export * from './easing-syntax';
3
- export * from './theme';
3
+ export * from './themeModule';
@@ -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,22 +1,65 @@
1
1
  {
2
2
  "name": "native-fn",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "description": " ",
5
- "scripts": {
6
- "build": "rollup -c"
7
- },
8
- "author": "pjy",
9
- "license": "MIT",
10
5
  "type": "module",
6
+
11
7
  "main": "dist/native.cjs",
12
8
  "module": "dist/native.mjs",
13
9
  "browser": "dist/native.umd.js",
14
10
  "types": "dist/index.d.ts",
11
+
15
12
  "exports": {
16
- "require": "./dist/native.cjs",
17
- "import": "./dist/native.mjs",
18
- "default": "./dist/native.umd.js"
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/native.mjs",
16
+ "require": "./dist/native.cjs",
17
+ "default": "./dist/native.mjs"
18
+ },
19
+ "./plugin/app": {
20
+ "types": "./dist/plugin/app/index.d.ts",
21
+ "import": "./dist/plugin/app/index.mjs",
22
+ "require": "./dist/plugin/app/index.cjs",
23
+ "default": "./dist/plugin/app/index.mjs"
24
+ },
25
+ "./plugin/theme": {
26
+ "types": "./dist/plugin/theme/index.d.ts",
27
+ "import": "./dist/plugin/theme/index.mjs",
28
+ "require": "./dist/plugin/theme/index.cjs",
29
+ "default": "./dist/plugin/theme/index.mjs"
30
+ },
31
+ "./plugin/platform": {
32
+ "types": "./dist/plugin/platform/index.d.ts",
33
+ "import": "./dist/plugin/platform/index.mjs",
34
+ "require": "./dist/plugin/platform/index.cjs",
35
+ "default": "./dist/plugin/platform/index.mjs"
36
+ }
37
+ },
38
+
39
+ "typesVersions": {
40
+ "*": {
41
+ "plugin/app": ["dist/plugin/app/index.d.ts"],
42
+ "plugin/theme": ["dist/plugin/theme/index.d.ts"],
43
+ "plugin/platform": ["dist/plugin/platform/index.d.ts"],
44
+ "dist/*": ["dist/*"]
45
+ }
19
46
  },
47
+
48
+ "files": [
49
+ "dist/**",
50
+ "package.json",
51
+ "README.md",
52
+ "LICENSE"
53
+ ],
54
+
55
+ "scripts": {
56
+ "build": "rollup -c",
57
+ "publish": "npm publish"
58
+ },
59
+
60
+ "author": "pjy",
61
+ "license": "MIT",
62
+
20
63
  "repository": {
21
64
  "type": "git",
22
65
  "url": "https://github.com/pjy0509/native-fn"
@@ -39,8 +82,9 @@
39
82
  "devDependencies": {
40
83
  "@rollup/plugin-json": "^6.1.0",
41
84
  "@rollup/plugin-terser": "^0.4.4",
42
- "@rollup/plugin-typescript": "^12.1.4",
43
- "rollup": "^4.45.1",
44
- "typescript": "^5.4.5"
85
+ "@rollup/plugin-typescript": "^11.1.6",
86
+ "rollup": "^4.52.5",
87
+ "rollup-plugin-dts": "^6.2.3",
88
+ "typescript": "^5.9.3"
45
89
  }
46
90
  }