@mpxjs/webpack-plugin 2.10.24 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/lib/index.js +4 -1
  2. package/lib/platform/style/wx/index.js +417 -120
  3. package/lib/platform/template/wx/component-config/picker.js +0 -6
  4. package/lib/react/style-helper.js +6 -6
  5. package/lib/resolver/AddEnvPlugin.js +1 -1
  6. package/lib/resolver/AddModePlugin.js +1 -1
  7. package/lib/resolver/ExtendComponentsPlugin.js +68 -0
  8. package/lib/runtime/components/extends/section-list.mpx +14 -0
  9. package/lib/runtime/components/react/animationHooks/index.ts +7 -3
  10. package/lib/runtime/components/react/dist/animationHooks/index.d.ts +0 -2
  11. package/lib/runtime/components/react/dist/animationHooks/index.js +6 -1
  12. package/lib/runtime/components/react/dist/event.config.d.ts +2 -6
  13. package/lib/runtime/components/react/dist/event.config.js +28 -24
  14. package/lib/runtime/components/react/dist/getInnerListeners.d.ts +1 -1
  15. package/lib/runtime/components/react/dist/getInnerListeners.js +74 -56
  16. package/lib/runtime/components/react/dist/mpx-button.d.ts +1 -2
  17. package/lib/runtime/components/react/dist/mpx-button.jsx +16 -9
  18. package/lib/runtime/components/react/dist/mpx-camera.d.ts +0 -2
  19. package/lib/runtime/components/react/dist/mpx-camera.jsx +36 -5
  20. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +0 -2
  21. package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +1 -3
  22. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +1 -1
  23. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +0 -2
  24. package/lib/runtime/components/react/dist/mpx-checkbox-group.jsx +3 -4
  25. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +1 -2
  26. package/lib/runtime/components/react/dist/mpx-checkbox.jsx +8 -9
  27. package/lib/runtime/components/react/dist/mpx-form.d.ts +1 -2
  28. package/lib/runtime/components/react/dist/mpx-form.jsx +5 -5
  29. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +0 -2
  30. package/lib/runtime/components/react/dist/mpx-icon/index.jsx +2 -2
  31. package/lib/runtime/components/react/dist/mpx-image.d.ts +0 -2
  32. package/lib/runtime/components/react/dist/mpx-image.jsx +59 -43
  33. package/lib/runtime/components/react/dist/mpx-inline-text.jsx +13 -4
  34. package/lib/runtime/components/react/dist/mpx-input.d.ts +0 -2
  35. package/lib/runtime/components/react/dist/mpx-input.jsx +16 -8
  36. package/lib/runtime/components/react/dist/mpx-label.d.ts +1 -2
  37. package/lib/runtime/components/react/dist/mpx-label.jsx +5 -6
  38. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +0 -2
  39. package/lib/runtime/components/react/dist/mpx-movable-area.jsx +3 -3
  40. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +1 -2
  41. package/lib/runtime/components/react/dist/mpx-movable-view.jsx +6 -6
  42. package/lib/runtime/components/react/dist/mpx-nav.jsx +1 -1
  43. package/lib/runtime/components/react/dist/mpx-picker/index.jsx +72 -23
  44. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.jsx +2 -2
  45. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +4 -0
  46. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +1 -1
  47. package/lib/runtime/components/react/dist/mpx-picker-view/index.jsx +10 -14
  48. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +0 -2
  49. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.js +0 -5
  50. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +1 -1
  51. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.jsx +34 -14
  52. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +0 -2
  53. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.jsx +4 -5
  54. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts +0 -2
  55. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.jsx +3 -5
  56. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +5 -4
  57. package/lib/runtime/components/react/dist/mpx-popup/index.jsx +2 -2
  58. package/lib/runtime/components/react/dist/mpx-popup/popupBase.jsx +3 -2
  59. package/lib/runtime/components/react/dist/mpx-progress.d.ts +0 -2
  60. package/lib/runtime/components/react/dist/mpx-progress.jsx +1 -3
  61. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +0 -2
  62. package/lib/runtime/components/react/dist/mpx-radio-group.jsx +3 -4
  63. package/lib/runtime/components/react/dist/mpx-radio.d.ts +1 -2
  64. package/lib/runtime/components/react/dist/mpx-radio.jsx +8 -9
  65. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +0 -2
  66. package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +1 -3
  67. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +1 -2
  68. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +6 -6
  69. package/lib/runtime/components/react/dist/mpx-section-list.d.ts +51 -0
  70. package/lib/runtime/components/react/dist/mpx-section-list.jsx +376 -0
  71. package/lib/runtime/components/react/dist/mpx-simple-text.jsx +37 -19
  72. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +4 -1
  73. package/lib/runtime/components/react/dist/mpx-simple-view.jsx +11 -4
  74. package/lib/runtime/components/react/dist/mpx-slider.d.ts +0 -2
  75. package/lib/runtime/components/react/dist/mpx-slider.jsx +6 -7
  76. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +1 -2
  77. package/lib/runtime/components/react/dist/mpx-sticky-header.jsx +5 -5
  78. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +1 -2
  79. package/lib/runtime/components/react/dist/mpx-sticky-section.jsx +6 -6
  80. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +1 -2
  81. package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +5 -5
  82. package/lib/runtime/components/react/dist/mpx-swiper.d.ts +1 -2
  83. package/lib/runtime/components/react/dist/mpx-swiper.jsx +4 -8
  84. package/lib/runtime/components/react/dist/mpx-switch.d.ts +0 -2
  85. package/lib/runtime/components/react/dist/mpx-switch.jsx +1 -3
  86. package/lib/runtime/components/react/dist/mpx-text.d.ts +0 -2
  87. package/lib/runtime/components/react/dist/mpx-text.jsx +43 -25
  88. package/lib/runtime/components/react/dist/mpx-video.d.ts +0 -2
  89. package/lib/runtime/components/react/dist/mpx-video.jsx +4 -5
  90. package/lib/runtime/components/react/dist/mpx-view.d.ts +2 -2
  91. package/lib/runtime/components/react/dist/mpx-view.jsx +214 -114
  92. package/lib/runtime/components/react/dist/mpx-web-view.d.ts +2 -1
  93. package/lib/runtime/components/react/dist/mpx-web-view.jsx +5 -1
  94. package/lib/runtime/components/react/dist/namedColorSet.d.ts +2 -0
  95. package/lib/runtime/components/react/dist/namedColorSet.js +149 -0
  96. package/lib/runtime/components/react/dist/utils.d.ts +71 -70
  97. package/lib/runtime/components/react/dist/utils.jsx +1295 -456
  98. package/lib/runtime/components/react/event.config.ts +32 -25
  99. package/lib/runtime/components/react/getInnerListeners.ts +84 -60
  100. package/lib/runtime/components/react/mpx-button.tsx +18 -18
  101. package/lib/runtime/components/react/mpx-camera.tsx +40 -8
  102. package/lib/runtime/components/react/mpx-canvas/index.tsx +5 -7
  103. package/lib/runtime/components/react/mpx-canvas/utils.tsx +3 -1
  104. package/lib/runtime/components/react/mpx-checkbox-group.tsx +2 -8
  105. package/lib/runtime/components/react/mpx-checkbox.tsx +9 -13
  106. package/lib/runtime/components/react/mpx-form.tsx +6 -8
  107. package/lib/runtime/components/react/mpx-icon/index.tsx +1 -5
  108. package/lib/runtime/components/react/mpx-image.tsx +66 -58
  109. package/lib/runtime/components/react/mpx-inline-text.tsx +13 -4
  110. package/lib/runtime/components/react/mpx-input.tsx +19 -12
  111. package/lib/runtime/components/react/mpx-label.tsx +6 -10
  112. package/lib/runtime/components/react/mpx-movable-area.tsx +3 -5
  113. package/lib/runtime/components/react/mpx-movable-view.tsx +7 -9
  114. package/lib/runtime/components/react/mpx-nav.tsx +1 -1
  115. package/lib/runtime/components/react/mpx-picker/index.tsx +100 -29
  116. package/lib/runtime/components/react/mpx-picker/multiSelector.tsx +3 -3
  117. package/lib/runtime/components/react/mpx-picker/selector.tsx +1 -1
  118. package/lib/runtime/components/react/mpx-picker/type.ts +4 -0
  119. package/lib/runtime/components/react/mpx-picker-view/index.tsx +17 -24
  120. package/lib/runtime/components/react/mpx-picker-view/pickerVIewContext.ts +0 -9
  121. package/lib/runtime/components/react/mpx-picker-view-column/index.tsx +44 -23
  122. package/lib/runtime/components/react/mpx-picker-view-column/pickerViewColumnItem.tsx +1 -9
  123. package/lib/runtime/components/react/mpx-picker-view-column/pickerViewColumnItemLite.tsx +0 -9
  124. package/lib/runtime/components/react/mpx-popup/index.tsx +7 -3
  125. package/lib/runtime/components/react/mpx-popup/popupBase.tsx +3 -2
  126. package/lib/runtime/components/react/mpx-progress.tsx +0 -6
  127. package/lib/runtime/components/react/mpx-radio-group.tsx +2 -8
  128. package/lib/runtime/components/react/mpx-radio.tsx +9 -13
  129. package/lib/runtime/components/react/mpx-rich-text/index.tsx +0 -6
  130. package/lib/runtime/components/react/mpx-scroll-view.tsx +7 -9
  131. package/lib/runtime/components/react/mpx-section-list.tsx +557 -0
  132. package/lib/runtime/components/react/mpx-simple-text.tsx +36 -25
  133. package/lib/runtime/components/react/mpx-simple-view.tsx +17 -5
  134. package/lib/runtime/components/react/mpx-slider.tsx +15 -13
  135. package/lib/runtime/components/react/mpx-sticky-header.tsx +6 -8
  136. package/lib/runtime/components/react/mpx-sticky-section.tsx +7 -9
  137. package/lib/runtime/components/react/mpx-swiper-item.tsx +6 -7
  138. package/lib/runtime/components/react/mpx-swiper.tsx +5 -11
  139. package/lib/runtime/components/react/mpx-switch.tsx +0 -6
  140. package/lib/runtime/components/react/mpx-text.tsx +45 -36
  141. package/lib/runtime/components/react/mpx-video.tsx +3 -8
  142. package/lib/runtime/components/react/mpx-view.tsx +235 -129
  143. package/lib/runtime/components/react/mpx-web-view.tsx +12 -6
  144. package/lib/runtime/components/react/namedColorSet.ts +150 -0
  145. package/lib/runtime/components/react/types/getInnerListeners.d.ts +21 -1
  146. package/lib/runtime/components/react/types/global.d.ts +1 -0
  147. package/lib/runtime/components/react/utils.tsx +1352 -550
  148. package/lib/runtime/i18n.wxs +15 -9
  149. package/lib/style-compiler/strip-conditional.js +19 -4
  150. package/lib/template-compiler/compiler.js +6 -0
  151. package/package.json +6 -6
@@ -0,0 +1,149 @@
1
+ const namedColorSet = {
2
+ transparent: true,
3
+ aliceblue: true,
4
+ antiquewhite: true,
5
+ aqua: true,
6
+ aquamarine: true,
7
+ azure: true,
8
+ beige: true,
9
+ bisque: true,
10
+ black: true,
11
+ blanchedalmond: true,
12
+ blue: true,
13
+ blueviolet: true,
14
+ brown: true,
15
+ burlywood: true,
16
+ cadetblue: true,
17
+ chartreuse: true,
18
+ chocolate: true,
19
+ coral: true,
20
+ cornflowerblue: true,
21
+ cornsilk: true,
22
+ crimson: true,
23
+ cyan: true,
24
+ darkblue: true,
25
+ darkcyan: true,
26
+ darkgoldenrod: true,
27
+ darkgray: true,
28
+ darkgreen: true,
29
+ darkgrey: true,
30
+ darkkhaki: true,
31
+ darkmagenta: true,
32
+ darkolivegreen: true,
33
+ darkorange: true,
34
+ darkorchid: true,
35
+ darkred: true,
36
+ darksalmon: true,
37
+ darkseagreen: true,
38
+ darkslateblue: true,
39
+ darkslategrey: true,
40
+ darkturquoise: true,
41
+ darkviolet: true,
42
+ deeppink: true,
43
+ deepskyblue: true,
44
+ dimgray: true,
45
+ dimgrey: true,
46
+ dodgerblue: true,
47
+ firebrick: true,
48
+ floralwhite: true,
49
+ forestgreen: true,
50
+ fuchsia: true,
51
+ gainsboro: true,
52
+ ghostwhite: true,
53
+ gold: true,
54
+ goldenrod: true,
55
+ gray: true,
56
+ green: true,
57
+ greenyellow: true,
58
+ grey: true,
59
+ honeydew: true,
60
+ hotpink: true,
61
+ indianred: true,
62
+ indigo: true,
63
+ ivory: true,
64
+ khaki: true,
65
+ lavender: true,
66
+ lavenderblush: true,
67
+ lawngreen: true,
68
+ lemonchiffon: true,
69
+ lightblue: true,
70
+ lightcoral: true,
71
+ lightcyan: true,
72
+ lightgoldenrodyellow: true,
73
+ lightgray: true,
74
+ lightgreen: true,
75
+ lightgrey: true,
76
+ lightpink: true,
77
+ lightsalmon: true,
78
+ lightseagreen: true,
79
+ lightskyblue: true,
80
+ lightslategrey: true,
81
+ lightsteelblue: true,
82
+ lightyellow: true,
83
+ lime: true,
84
+ limegreen: true,
85
+ linen: true,
86
+ magenta: true,
87
+ maroon: true,
88
+ mediumaquamarine: true,
89
+ mediumblue: true,
90
+ mediumorchid: true,
91
+ mediumpurple: true,
92
+ mediumseagreen: true,
93
+ mediumslateblue: true,
94
+ mediumspringgreen: true,
95
+ mediumturquoise: true,
96
+ mediumvioletred: true,
97
+ midnightblue: true,
98
+ mintcream: true,
99
+ mistyrose: true,
100
+ moccasin: true,
101
+ navajowhite: true,
102
+ navy: true,
103
+ oldlace: true,
104
+ olive: true,
105
+ olivedrab: true,
106
+ orange: true,
107
+ orangered: true,
108
+ orchid: true,
109
+ palegoldenrod: true,
110
+ palegreen: true,
111
+ paleturquoise: true,
112
+ palevioletred: true,
113
+ papayawhip: true,
114
+ peachpuff: true,
115
+ peru: true,
116
+ pink: true,
117
+ plum: true,
118
+ powderblue: true,
119
+ purple: true,
120
+ rebeccapurple: true,
121
+ red: true,
122
+ rosybrown: true,
123
+ royalblue: true,
124
+ saddlebrown: true,
125
+ salmon: true,
126
+ sandybrown: true,
127
+ seagreen: true,
128
+ seashell: true,
129
+ sienna: true,
130
+ silver: true,
131
+ skyblue: true,
132
+ slateblue: true,
133
+ slategray: true,
134
+ snow: true,
135
+ springgreen: true,
136
+ steelblue: true,
137
+ tan: true,
138
+ teal: true,
139
+ thistle: true,
140
+ tomato: true,
141
+ turquoise: true,
142
+ violet: true,
143
+ wheat: true,
144
+ white: true,
145
+ whitesmoke: true,
146
+ yellow: true,
147
+ yellowgreen: true
148
+ };
149
+ export default namedColorSet;
@@ -2,19 +2,11 @@ import { ReactNode, ReactElement, Dispatch, SetStateAction, MutableRefObject } f
2
2
  import { LayoutChangeEvent, TextStyle, ImageProps, Image } from 'react-native';
3
3
  import { TextPassThroughContextValue } from './context';
4
4
  import type { AnyFunc } from './types/common';
5
- export declare const TEXT_STYLE_MAP: Record<string, boolean>;
6
- export declare const PERCENT_REGEX: RegExp;
7
- export declare const URL_REGEX: RegExp;
8
- export declare const SVG_REGEXP: RegExp;
9
- export declare const BACKGROUND_STYLE_MAP: Record<string, boolean>;
10
- export declare const TEXT_PROPS_MAP: Record<string, boolean>;
11
- export declare const DEFAULT_FONT_SIZE = 16;
12
- export declare const HIDDEN_STYLE: {
5
+ export declare const percentRegExp: RegExp;
6
+ export declare const svgRegExp: RegExp;
7
+ export declare const hiddenStyle: {
13
8
  opacity: number;
14
9
  };
15
- export declare const DEFAULT_BOX_SIZING_STYLE: {
16
- boxSizing: string;
17
- };
18
10
  export declare const isIOS: boolean;
19
11
  export declare const isAndroid: boolean;
20
12
  export declare const isHarmony: boolean;
@@ -24,88 +16,42 @@ export declare const extendObject: {
24
16
  <T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
25
17
  (target: object, ...sources: any[]): any;
26
18
  };
27
- export declare function getDefaultAllowFontScaling(): boolean;
28
- export declare function transformBoxSizing(style?: Record<string, any>, hasBoxSizingAffectingStyle?: boolean): Record<string, any>;
29
- export declare function isBoxSizingAffectingStyle(key: string): boolean;
30
- export declare function useNavigation(): Record<string, any> | undefined;
31
- export declare function omit<T, K extends string>(obj: T, fields: K[]): Omit<T, K>;
32
- /**
33
- * 用法等同于 useEffect,但是会忽略首次执行,只在依赖更新时执行
34
- */
35
- export declare const useUpdateEffect: (effect: any, deps: any) => void;
36
- export declare const parseUrl: (cssUrl?: string) => string | undefined;
37
- export declare const getRestProps: (transferProps?: any, originProps?: any, deletePropsKey?: any) => any;
38
- export declare function isText(ele: ReactNode): ele is ReactElement;
39
- export declare function isStringChildren(children: ReactNode): boolean;
40
- type GroupData<T> = Record<string, Partial<T>>;
41
- export declare function groupBy<T extends Record<string, any>>(obj: T, callback: (key: string, val: T[keyof T]) => string, group?: GroupData<T>): GroupData<T>;
42
- export declare function splitStyle<T extends Record<string, any>>(styleObj: T, sideEffect?: (key: string, val: T[keyof T]) => void): {
43
- textStyle?: Partial<T>;
44
- backgroundStyle?: Partial<T>;
45
- innerStyle?: Partial<T>;
46
- };
47
- export declare function parseValues(str: string, char?: string): string[];
19
+ interface PercentConfig {
20
+ fontSize?: number | string;
21
+ width?: number;
22
+ height?: number;
23
+ parentWidth?: number;
24
+ parentHeight?: number;
25
+ }
48
26
  interface TransformStyleConfig {
49
27
  enableVar?: boolean;
50
- externalVarContext?: Record<string, any>;
51
- parentFontSize?: number;
52
28
  parentWidth?: number;
53
29
  parentHeight?: number;
54
30
  transformRadiusPercent?: boolean;
31
+ defaultStyle?: Record<string, any>;
55
32
  }
56
- export declare function useTransformStyle(styleObj: Record<string, any> | undefined, { enableVar, transformRadiusPercent, externalVarContext, parentFontSize, parentWidth, parentHeight }: TransformStyleConfig): {
57
- hasVarDec: boolean;
58
- varContextRef: MutableRefObject<{}>;
59
- setWidth: Dispatch<SetStateAction<number>>;
60
- setHeight: Dispatch<SetStateAction<number>>;
61
- normalStyle: Record<string, any>;
62
- hasSelfPercent: boolean;
63
- hasPositionFixed: boolean;
64
- };
65
33
  export interface VisitorArg {
66
34
  target: Record<string, any>;
67
35
  key: string;
68
36
  value: any;
69
37
  keyPath: Array<string>;
70
38
  }
71
- export declare function traverseStyle(styleObj: Record<string, any>, visitors: Array<(arg: VisitorArg) => void>): void;
72
- export declare function setStyle(styleObj: Record<string, any>, keyPath: Array<string>, setter: (arg: VisitorArg) => void): void;
73
- export declare function splitProps<T extends Record<string, any>>(props: T): {
74
- textProps?: Partial<T>;
75
- innerProps?: Partial<T>;
76
- };
77
39
  interface LayoutConfig {
78
40
  props: Record<string, any>;
79
41
  hasSelfPercent: boolean;
80
42
  setWidth?: Dispatch<SetStateAction<number>>;
81
43
  setHeight?: Dispatch<SetStateAction<number>>;
82
- onLayout?: (event?: LayoutChangeEvent) => void;
44
+ onLayout?: (event: LayoutChangeEvent) => void;
83
45
  nodeRef: React.RefObject<any>;
84
46
  }
85
- export declare const useLayout: ({ props, hasSelfPercent, setWidth, setHeight, onLayout, nodeRef }: LayoutConfig) => {
86
- layoutRef: MutableRefObject<{}>;
87
- layoutStyle: {};
88
- layoutProps: Record<string, any>;
89
- };
90
47
  export interface WrapChildrenConfig {
91
48
  hasVarDec: boolean;
92
49
  varContext?: Record<string, any>;
93
50
  textPassThrough?: TextPassThroughContextValue | null;
94
51
  }
95
52
  export interface TextPassThroughValueOptions {
96
- inheritTextProps?: boolean;
97
- disabled?: boolean;
53
+ enableTextPassThrough?: boolean;
98
54
  }
99
- export declare function useTextPassThroughValue(textStyle?: TextStyle, textProps?: Record<string, any>, { inheritTextProps, disabled }?: TextPassThroughValueOptions): TextPassThroughContextValue | null;
100
- export declare function wrapChildren(props: Record<string, any> | undefined, { hasVarDec, varContext, textPassThrough }: WrapChildrenConfig): any;
101
- export declare const debounce: <T extends AnyFunc>(func: T, delay: number) => ((...args: Parameters<T>) => void) & {
102
- clear: () => void;
103
- };
104
- export declare const useDebounceCallback: <T extends AnyFunc>(func: T, delay: number) => ((...args: Parameters<T>) => void) & {
105
- clear: () => void;
106
- };
107
- export declare const useStableCallback: <T extends AnyFunc | null | undefined>(callback: T) => T extends AnyFunc ? T : () => void;
108
- export declare function usePrevious<T>(value: T): T | undefined;
109
55
  export interface GestureHandler {
110
56
  nodeRefs?: Array<{
111
57
  getNodeInstance: () => {
@@ -113,11 +59,57 @@ export interface GestureHandler {
113
59
  };
114
60
  }>;
115
61
  current?: unknown;
62
+ handlerTag?: number;
116
63
  }
117
- export declare function flatGesture(gestures?: Array<GestureHandler>): any[];
118
- export declare function getCurrentPage(pageId: number | null | undefined): any;
119
- export declare function renderImage(imageProps: ImageProps, enableFastImage?: boolean): import("react").CElement<ImageProps, Image>;
64
+ export declare function omit<T, K extends string>(obj: T, fields: K[]): Omit<T, K>;
65
+ export declare const parseUrl: (cssUrl?: string) => string | undefined;
66
+ export declare const getRestProps: (transferProps?: any, originProps?: any, deletePropsKey?: any) => any;
67
+ export declare function getDefaultAllowFontScaling(): boolean;
68
+ export declare function isText(ele: ReactNode): ele is ReactElement;
69
+ export declare function isStringChildren(children: ReactNode): boolean;
70
+ export declare function parseValues(str: string, char?: string): string[];
71
+ export declare const debounce: <T extends AnyFunc>(func: T, delay: number) => ((...args: Parameters<T>) => void) & {
72
+ clear: () => void;
73
+ };
74
+ export declare function isBoxSizingAffectingStyle(key: string): boolean;
75
+ export declare function transformBoxSizing(style?: Record<string, any>): void;
76
+ export declare function splitStyle<T extends Record<string, any>>(styleObj?: T, sideEffect?: (key: string, val: T[keyof T]) => void): {
77
+ textStyle?: Partial<T>;
78
+ backgroundStyle?: Partial<T>;
79
+ innerStyle?: Partial<T>;
80
+ };
81
+ export declare function splitProps<T extends Record<string, any>>(props?: T): {
82
+ textProps?: Partial<T>;
83
+ innerProps?: Partial<T>;
84
+ };
120
85
  export declare function pickStyle(styleObj: Record<string, any> | undefined, pickedKeys: Array<string>, callback?: (key: string, val: number | string) => number | string): Record<string, any>;
86
+ export declare function transformShorthand(styleObj: Record<string, any>, shorthandKeys: string[], percentConfig: PercentConfig): void;
87
+ export declare function traverseStyle(styleObj: Record<string, any>, visitor: (arg: VisitorArg) => void): void;
88
+ export declare function setStyle(styleObj: Record<string, any>, keyPath: Array<string>, setter: (arg: VisitorArg) => void): void;
89
+ export declare function useTransformStyle(styleObj: Record<string, any> | undefined, { enableVar, transformRadiusPercent, parentWidth, parentHeight, defaultStyle }: TransformStyleConfig): {
90
+ hasVarDec: boolean;
91
+ varContextRef: MutableRefObject<Record<string, any>>;
92
+ setWidth: Dispatch<SetStateAction<number>>;
93
+ setHeight: Dispatch<SetStateAction<number>>;
94
+ normalStyle: Record<string, any>;
95
+ hasSelfPercent: boolean;
96
+ hasPositionFixed: boolean;
97
+ };
98
+ export declare function useNavigation(): Record<string, any> | undefined;
99
+ export declare function resolveTextFontSizePercentStyle<T extends TextStyle | undefined>(textStyle: T, parentTextStyle?: TextStyle): T;
100
+ export declare function resolveTextLineHeightPercentStyle<T extends TextStyle | undefined>(textStyle: T, parentTextStyle?: TextStyle): T;
101
+ /**
102
+ * 用法等同于 useEffect,但是会忽略首次执行,只在依赖更新时执行
103
+ */
104
+ export declare const useUpdateEffect: (effect: any, deps: any) => void;
105
+ export declare const useLayout: ({ props, hasSelfPercent, setWidth, setHeight, onLayout, nodeRef }: LayoutConfig) => {
106
+ layoutRef: MutableRefObject<{}>;
107
+ layoutStyle: {
108
+ opacity: number;
109
+ } | undefined;
110
+ layoutProps: Record<string, any>;
111
+ };
112
+ export declare function useTextPassThrough(textStyle?: TextStyle, textProps?: Record<string, any>, { enableTextPassThrough }?: TextPassThroughValueOptions): TextPassThroughContextValue | null;
121
113
  export declare function useHover({ enableHover, hoverStartTime, hoverStayTime, disabled }: {
122
114
  enableHover: boolean;
123
115
  hoverStartTime: number;
@@ -131,4 +123,13 @@ export declare function useHover({ enableHover, hoverStartTime, hoverStayTime, d
131
123
  gesture: import("react-native-gesture-handler/lib/typescript/handlers/gestures/panGesture").PanGesture;
132
124
  };
133
125
  export declare function useRunOnJSCallback(callbackMapRef: MutableRefObject<Record<string, AnyFunc>>): (key: string, ...args: any) => any;
126
+ export declare const useDebounceCallback: <T extends AnyFunc>(func: T, delay: number) => ((...args: Parameters<T>) => void) & {
127
+ clear: () => void;
128
+ };
129
+ export declare const useStableCallback: <T extends AnyFunc | null | undefined>(callback: T) => T extends AnyFunc ? T : () => void;
130
+ export declare function usePrevious<T>(value: T): T | undefined;
131
+ export declare function wrapChildren(children: ReactNode, { hasVarDec, varContext, textPassThrough }: WrapChildrenConfig): ReactNode;
132
+ export declare function renderImage(imageProps: ImageProps, enableFastImage?: boolean): import("react").CElement<ImageProps, Image>;
133
+ export declare function flatGesture(gestures?: Array<GestureHandler>): any[];
134
+ export declare function getCurrentPage(pageId: number | null | undefined): any;
134
135
  export {};