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.
Files changed (161) hide show
  1. package/README.md +22 -192
  2. package/dist/index.d.ts +18 -27
  3. package/dist/native.cjs +27 -1400
  4. package/dist/native.min.cjs +1 -0
  5. package/dist/native.min.mjs +1 -0
  6. package/dist/native.mjs +27 -1400
  7. package/dist/native.umd.js +27 -1400
  8. package/dist/native.umd.min.js +1 -0
  9. package/dist/plugin/app/index.cjs +1025 -0
  10. package/dist/plugin/app/index.d.ts +86 -0
  11. package/dist/plugin/app/index.min.cjs +1 -0
  12. package/dist/plugin/app/index.min.mjs +1 -0
  13. package/dist/plugin/app/index.mjs +1023 -0
  14. package/dist/plugin/app/index.umd.js +1031 -0
  15. package/dist/plugin/app/index.umd.min.js +1 -0
  16. package/dist/plugin/app/src/constants/platform.d.ts +35 -0
  17. package/dist/plugin/app/src/constants/user-agent.d.ts +1 -0
  18. package/dist/plugin/app/src/plugin/app/cores/app.d.ts +3 -0
  19. package/dist/plugin/app/src/plugin/app/index.d.ts +5 -0
  20. package/dist/plugin/app/src/plugin/app/types/app.d.ts +54 -0
  21. package/dist/plugin/app/src/plugin/app/types/appModule.d.ts +54 -0
  22. package/dist/plugin/app/src/plugin/app/types/index.d.ts +1 -0
  23. package/dist/plugin/app/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
  24. package/dist/plugin/app/src/plugin/platform/cores/platform.d.ts +3 -0
  25. package/dist/plugin/app/src/plugin/platform/index.d.ts +5 -0
  26. package/dist/plugin/app/src/plugin/platform/types/index.d.ts +1 -0
  27. package/dist/{src → plugin/app/src/plugin/platform}/types/platform.d.ts +1 -1
  28. package/dist/plugin/app/src/plugin/platform/types/platformModule.d.ts +13 -0
  29. package/dist/{src → plugin/app/src/plugin/theme}/constants/theme.d.ts +1 -1
  30. package/dist/plugin/app/src/plugin/theme/cores/theme.d.ts +3 -0
  31. package/dist/plugin/app/src/plugin/theme/index.d.ts +5 -0
  32. package/dist/plugin/app/src/plugin/theme/types/color.d.ts +17 -0
  33. package/dist/{src → plugin/app/src/plugin/theme}/types/easing-syntax.d.ts +1 -1
  34. package/dist/plugin/app/src/plugin/theme/types/index.d.ts +3 -0
  35. package/dist/{src → plugin/app/src/plugin/theme}/types/theme.d.ts +4 -4
  36. package/dist/plugin/app/src/plugin/theme/types/themeModule.d.ts +24 -0
  37. package/dist/{src → plugin/app/src/plugin/theme}/utils/parse-color.d.ts +1 -1
  38. package/dist/{src → plugin/app/src/plugin/theme}/utils/parse-easing-function.d.ts +1 -1
  39. package/dist/plugin/app/src/types/index.d.ts +1 -0
  40. package/dist/plugin/app/src/types/native.d.ts +14 -0
  41. package/dist/plugin/app/src/utils/assign.d.ts +1 -0
  42. package/dist/plugin/app/src/utils/create-custom-error.d.ts +1 -0
  43. package/dist/plugin/platform/index.cjs +171 -0
  44. package/dist/plugin/platform/index.d.ts +51 -0
  45. package/dist/plugin/platform/index.min.cjs +1 -0
  46. package/dist/plugin/platform/index.min.mjs +1 -0
  47. package/dist/plugin/platform/index.mjs +169 -0
  48. package/dist/plugin/platform/index.umd.js +177 -0
  49. package/dist/plugin/platform/index.umd.min.js +1 -0
  50. package/dist/plugin/platform/src/constants/platform.d.ts +35 -0
  51. package/dist/plugin/platform/src/constants/user-agent.d.ts +1 -0
  52. package/dist/plugin/platform/src/plugin/app/constants/app.d.ts +13 -0
  53. package/dist/plugin/platform/src/plugin/app/cores/app.d.ts +3 -0
  54. package/dist/plugin/platform/src/plugin/app/errors/url-open-error.d.ts +2 -0
  55. package/dist/plugin/platform/src/plugin/app/index.d.ts +5 -0
  56. package/dist/plugin/platform/src/plugin/app/types/app.d.ts +54 -0
  57. package/dist/plugin/platform/src/plugin/app/types/appModule.d.ts +54 -0
  58. package/dist/plugin/platform/src/plugin/app/types/index.d.ts +1 -0
  59. package/dist/plugin/platform/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
  60. package/dist/plugin/platform/src/plugin/app/utils/try-open-url.d.ts +1 -0
  61. package/dist/plugin/platform/src/plugin/platform/cores/platform.d.ts +3 -0
  62. package/dist/plugin/platform/src/plugin/platform/index.d.ts +5 -0
  63. package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +1 -0
  64. package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +13 -0
  65. package/dist/plugin/platform/src/plugin/platform/types/platformModule.d.ts +13 -0
  66. package/dist/plugin/platform/src/plugin/theme/constants/theme.d.ts +16 -0
  67. package/dist/plugin/platform/src/plugin/theme/cores/theme.d.ts +3 -0
  68. package/dist/plugin/platform/src/plugin/theme/errors/easing-error.d.ts +6 -0
  69. package/dist/plugin/platform/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
  70. package/dist/plugin/platform/src/plugin/theme/index.d.ts +5 -0
  71. package/dist/plugin/platform/src/plugin/theme/types/color.d.ts +17 -0
  72. package/dist/plugin/platform/src/plugin/theme/types/easing-syntax.d.ts +16 -0
  73. package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +3 -0
  74. package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +24 -0
  75. package/dist/plugin/platform/src/plugin/theme/types/themeModule.d.ts +24 -0
  76. package/dist/plugin/platform/src/plugin/theme/utils/parse-color.d.ts +2 -0
  77. package/dist/plugin/platform/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
  78. package/dist/plugin/platform/src/types/index.d.ts +1 -0
  79. package/dist/plugin/platform/src/types/native.d.ts +14 -0
  80. package/dist/plugin/platform/src/utils/assign.d.ts +1 -0
  81. package/dist/plugin/platform/src/utils/create-custom-error.d.ts +1 -0
  82. package/dist/plugin/theme/index.cjs +810 -0
  83. package/dist/plugin/theme/index.d.ts +75 -0
  84. package/dist/plugin/theme/index.min.cjs +1 -0
  85. package/dist/plugin/theme/index.min.mjs +1 -0
  86. package/dist/plugin/theme/index.mjs +808 -0
  87. package/dist/plugin/theme/index.umd.js +816 -0
  88. package/dist/plugin/theme/index.umd.min.js +1 -0
  89. package/dist/plugin/theme/src/constants/platform.d.ts +35 -0
  90. package/dist/plugin/theme/src/constants/user-agent.d.ts +1 -0
  91. package/dist/plugin/theme/src/plugin/app/constants/app.d.ts +13 -0
  92. package/dist/plugin/theme/src/plugin/app/cores/app.d.ts +3 -0
  93. package/dist/plugin/theme/src/plugin/app/errors/url-open-error.d.ts +2 -0
  94. package/dist/plugin/theme/src/plugin/app/index.d.ts +5 -0
  95. package/dist/plugin/theme/src/plugin/app/types/app.d.ts +54 -0
  96. package/dist/plugin/theme/src/plugin/app/types/appModule.d.ts +54 -0
  97. package/dist/plugin/theme/src/plugin/app/types/index.d.ts +1 -0
  98. package/dist/plugin/theme/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
  99. package/dist/plugin/theme/src/plugin/app/utils/try-open-url.d.ts +1 -0
  100. package/dist/plugin/theme/src/plugin/platform/cores/platform.d.ts +3 -0
  101. package/dist/plugin/theme/src/plugin/platform/index.d.ts +5 -0
  102. package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +1 -0
  103. package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +13 -0
  104. package/dist/plugin/theme/src/plugin/platform/types/platformModule.d.ts +13 -0
  105. package/dist/plugin/theme/src/plugin/theme/constants/theme.d.ts +16 -0
  106. package/dist/plugin/theme/src/plugin/theme/cores/theme.d.ts +3 -0
  107. package/dist/plugin/theme/src/plugin/theme/errors/easing-error.d.ts +6 -0
  108. package/dist/plugin/theme/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
  109. package/dist/plugin/theme/src/plugin/theme/index.d.ts +5 -0
  110. package/dist/plugin/theme/src/plugin/theme/types/color.d.ts +17 -0
  111. package/dist/plugin/theme/src/plugin/theme/types/easing-syntax.d.ts +16 -0
  112. package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +3 -0
  113. package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +24 -0
  114. package/dist/plugin/theme/src/plugin/theme/types/themeModule.d.ts +24 -0
  115. package/dist/plugin/theme/src/plugin/theme/utils/parse-color.d.ts +2 -0
  116. package/dist/plugin/theme/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
  117. package/dist/plugin/theme/src/types/index.d.ts +1 -0
  118. package/dist/plugin/theme/src/types/native.d.ts +14 -0
  119. package/dist/plugin/theme/src/utils/assign.d.ts +1 -0
  120. package/dist/plugin/theme/src/utils/create-custom-error.d.ts +1 -0
  121. package/dist/src/plugin/app/constants/app.d.ts +13 -0
  122. package/dist/src/plugin/app/cores/app.d.ts +3 -0
  123. package/dist/src/plugin/app/errors/url-open-error.d.ts +2 -0
  124. package/dist/src/plugin/app/index.d.ts +5 -0
  125. package/dist/src/plugin/app/types/app.d.ts +54 -0
  126. package/dist/src/plugin/app/types/appModule.d.ts +54 -0
  127. package/dist/src/plugin/app/types/index.d.ts +1 -0
  128. package/dist/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
  129. package/dist/src/plugin/app/utils/try-open-url.d.ts +1 -0
  130. package/dist/src/plugin/platform/cores/platform.d.ts +3 -0
  131. package/dist/src/plugin/platform/index.d.ts +5 -0
  132. package/dist/src/plugin/platform/types/index.d.ts +1 -0
  133. package/dist/src/plugin/platform/types/platform.d.ts +13 -0
  134. package/dist/src/plugin/platform/types/platformModule.d.ts +13 -0
  135. package/dist/src/plugin/theme/constants/theme.d.ts +16 -0
  136. package/dist/src/plugin/theme/cores/theme.d.ts +3 -0
  137. package/dist/src/plugin/theme/errors/easing-error.d.ts +6 -0
  138. package/dist/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
  139. package/dist/src/plugin/theme/index.d.ts +5 -0
  140. package/dist/src/plugin/theme/types/color.d.ts +17 -0
  141. package/dist/src/plugin/theme/types/easing-syntax.d.ts +16 -0
  142. package/dist/src/plugin/theme/types/index.d.ts +3 -0
  143. package/dist/src/plugin/theme/types/theme.d.ts +24 -0
  144. package/dist/src/plugin/theme/types/themeModule.d.ts +24 -0
  145. package/dist/src/plugin/theme/utils/parse-color.d.ts +2 -0
  146. package/dist/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
  147. package/dist/src/types/index.d.ts +1 -5
  148. package/dist/src/types/native.d.ts +14 -0
  149. package/dist/src/utils/assign.d.ts +1 -0
  150. package/package.json +8 -5
  151. package/dist/src/cores/app.d.ts +0 -3
  152. package/dist/src/cores/platform.d.ts +0 -3
  153. package/dist/src/cores/theme.d.ts +0 -3
  154. package/dist/src/types/app.d.ts +0 -44
  155. package/dist/src/types/color.d.ts +0 -17
  156. package/dist/src/utils/freeze-deep.d.ts +0 -1
  157. /package/dist/{src → plugin/app/src/plugin/app}/constants/app.d.ts +0 -0
  158. /package/dist/{src → plugin/app/src/plugin/app}/errors/url-open-error.d.ts +0 -0
  159. /package/dist/{src → plugin/app/src/plugin/app}/utils/try-open-url.d.ts +0 -0
  160. /package/dist/{src → plugin/app/src/plugin/theme}/errors/easing-error.d.ts +0 -0
  161. /package/dist/{src → plugin/app/src/plugin/theme}/errors/unsupported-color-error.d.ts +0 -0
@@ -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
+ }
@@ -0,0 +1,16 @@
1
+ import type { ListenerEntry } from '../types/themeModule';
2
+ export declare enum Appearances {
3
+ Unknown = "unknown",
4
+ Light = "light",
5
+ Dark = "dark"
6
+ }
7
+ export declare const CHROME_VERSION: number;
8
+ export declare const MEDIA_QUERY_LIST: MediaQueryList;
9
+ export declare const SUPPORT_PREFERS_COLOR_SCHEME: boolean;
10
+ export declare const IS_FULL_SUPPORT_THEME_COLOR: boolean;
11
+ export declare const CONTEXT: CanvasRenderingContext2D | null;
12
+ export declare const SVG_PIXEL_DATA_URL: string;
13
+ export declare const IS_SAMSUNG: boolean;
14
+ export declare const IS_IE_MOBILE: boolean;
15
+ export declare const IS_WINDOWS_PHONE: boolean;
16
+ export declare const ENTRIES: ListenerEntry[];
@@ -0,0 +1,3 @@
1
+ import type { ThemeModule } from '../types/themeModule';
2
+ declare const Theme: ThemeModule;
3
+ export default Theme;
@@ -0,0 +1,6 @@
1
+ declare const EasingError: ErrorConstructor;
2
+ declare const CubicBezierSyntaxError: ErrorConstructor;
3
+ declare const LinearSyntaxError: ErrorConstructor;
4
+ declare const StepSyntaxError: ErrorConstructor;
5
+ declare const UnsupportedEasingFunctionError: ErrorConstructor;
6
+ export { EasingError, CubicBezierSyntaxError, LinearSyntaxError, StepSyntaxError, UnsupportedEasingFunctionError, };
@@ -0,0 +1,2 @@
1
+ declare const UnsupportedColorError: ErrorConstructor;
2
+ export { UnsupportedColorError, };
@@ -0,0 +1,5 @@
1
+ import type { NativePlugin } from '../../types';
2
+ import type { ThemeModule } from "./types";
3
+ export * from './types';
4
+ declare const ThemePlugin: NativePlugin<ThemeModule>;
5
+ export default ThemePlugin;
@@ -0,0 +1,17 @@
1
+ export 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';
2
+ export type DeprecatedSystemColor = 'ActiveText' | 'ButtonBorder' | 'ButtonFace' | 'ButtonText' | 'Canvas' | 'CanvasText' | 'Field' | 'FieldText' | 'GrayText' | 'Highlight' | 'HighlightText' | 'LinkText' | 'Mark' | 'MarkText' | 'SelectedItem' | 'SelectedItemText' | 'VisitedText';
3
+ export 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';
4
+ export type RGBColor = `rgb(${string})`;
5
+ export type RGBAColor = `rgba(${string})`;
6
+ export type HSLColor = `hsl(${string})`;
7
+ export type HSLAColor = `hsla(${string})`;
8
+ export type HEXColor = `#${string}`;
9
+ export type Color = 'currentColor' | 'transparent' | SystemColor | DeprecatedSystemColor | NamedColor | RGBColor | RGBAColor | HSLColor | HSLAColor | HEXColor | string;
10
+ export declare interface RGB {
11
+ red: number;
12
+ green: number;
13
+ blue: number;
14
+ }
15
+ export declare interface RGBA extends RGB {
16
+ alpha: number;
17
+ }
@@ -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,3 @@
1
+ export * from './color';
2
+ export * from './easing-syntax';
3
+ export * from './themeModule';
@@ -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,2 @@
1
+ import type { RGBA } from '../types/color';
2
+ export default function parseColor(color: string): RGBA;
@@ -0,0 +1,2 @@
1
+ import type { EasingFunction, EasingKeyword, EasingSyntax } from '../types/easing-syntax';
2
+ export default function parseEasingFunction(easingFunction: EasingSyntax | EasingKeyword): EasingFunction;
@@ -1,5 +1 @@
1
- export * from "./app";
2
- export * from "./theme";
3
- export * from "./platform";
4
- export * from "./easing-syntax";
5
- export * from "./color";
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;
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "native-fn",
3
- "version": "1.0.26",
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",
@@ -37,9 +38,11 @@
37
38
  "theme-color"
38
39
  ],
39
40
  "devDependencies": {
40
- "rollup": "^4.45.1",
41
41
  "@rollup/plugin-json": "^6.1.0",
42
- "@rollup/plugin-typescript": "^12.1.4",
43
- "typescript": "^5.4.5"
42
+ "@rollup/plugin-terser": "^0.4.4",
43
+ "@rollup/plugin-typescript": "^11.1.6",
44
+ "rollup": "^4.52.5",
45
+ "rollup-plugin-dts": "^6.2.3",
46
+ "typescript": "^5.9.3"
44
47
  }
45
48
  }
@@ -1,3 +0,0 @@
1
- import { App } from "../types/app";
2
- declare const App: App;
3
- export default App;
@@ -1,3 +0,0 @@
1
- import { Platform } from "../types/platform";
2
- declare const Platform: Platform;
3
- export default Platform;
@@ -1,3 +0,0 @@
1
- import { Theme } from "../types/theme";
2
- declare const Theme: Theme;
3
- export default Theme;
@@ -1,44 +0,0 @@
1
- import { OS } from "../constants/platform";
2
- import { AppOpenState, Messengers } from "../constants/app";
3
- export declare interface AppInfo {
4
- scheme?: string;
5
- fallback?: string;
6
- timeout?: number;
7
- allowWebStore?: boolean;
8
- }
9
- export declare interface AndroidAppInfo extends AppInfo {
10
- packageName?: string;
11
- intent?: string;
12
- }
13
- export declare interface IOSAppInfo extends AppInfo {
14
- packageName?: string;
15
- trackId?: string;
16
- universal?: string;
17
- }
18
- export declare interface WindowsAppInfo extends AppInfo {
19
- productId?: string;
20
- }
21
- export declare interface MacOSAppInfo extends AppInfo {
22
- packageName?: string;
23
- trackId?: string;
24
- }
25
- export declare interface AppOpenOptions {
26
- [OS.Android]?: AndroidAppInfo;
27
- [OS.iOS]?: IOSAppInfo;
28
- [OS.Windows]?: WindowsAppInfo;
29
- [OS.MacOS]?: MacOSAppInfo;
30
- }
31
- export declare type Stringifiable = string | number | boolean | HTMLElement | null | undefined;
32
- export declare type StringifiableList = Stringifiable[] | NodeList | NodeListOf<Node> | HTMLCollectionBase;
33
- export declare type MessengerOpenOptions = {
34
- to?: Stringifiable | StringifiableList;
35
- cc?: Stringifiable | StringifiableList;
36
- bcc?: Stringifiable | StringifiableList;
37
- subject?: Stringifiable;
38
- body?: Stringifiable;
39
- } | HTMLFormElement | FormData;
40
- export declare type Messenger = Record<Messengers, (options: MessengerOpenOptions, self?: WindowProxy) => Promise<void>>;
41
- export declare interface App {
42
- open: (options: AppOpenOptions, target?: WindowProxy) => Promise<AppOpenState>;
43
- messenger: Messenger;
44
- }
@@ -1,17 +0,0 @@
1
- export 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";
2
- export type DeprecatedSystemColor = "ActiveText" | "ButtonBorder" | "ButtonFace" | "ButtonText" | "Canvas" | "CanvasText" | "Field" | "FieldText" | "GrayText" | "Highlight" | "HighlightText" | "LinkText" | "Mark" | "MarkText" | "SelectedItem" | "SelectedItemText" | "VisitedText";
3
- export 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";
4
- export type RGBColor = `rgb(${string})`;
5
- export type RGBAColor = `rgba(${string})`;
6
- export type HSLColor = `hsl(${string})`;
7
- export type HSLAColor = `hsla(${string})`;
8
- export type HEXColor = `#${string}`;
9
- export type Color = "currentColor" | "transparent" | SystemColor | DeprecatedSystemColor | NamedColor | RGBColor | RGBAColor | HSLColor | HSLAColor | HEXColor | string;
10
- export declare interface RGB {
11
- red: number;
12
- green: number;
13
- blue: number;
14
- }
15
- export declare interface RGBA extends RGB {
16
- alpha: number;
17
- }
@@ -1 +0,0 @@
1
- export default function freezeDeep<T>(o: T): T;