1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | import * as CSS from 'csstype'
|
14 | import { DefineComponent, VNodeRef } from 'vue'
|
15 |
|
16 | import { AdProps } from './Ad'
|
17 | import { AdCustomProps } from './AdCustom'
|
18 | import { AudioProps } from './Audio'
|
19 | import { ButtonProps } from './Button'
|
20 | import { CameraProps } from './Camera'
|
21 | import { CanvasProps } from './Canvas'
|
22 | import { ChannelLiveProps } from './ChannelLive'
|
23 | import { ChannelVideoProps } from './ChannelVideo'
|
24 | import { CheckboxProps } from './Checkbox'
|
25 | import { CheckboxGroupProps } from './CheckboxGroup'
|
26 | import { StandardProps } from './common'
|
27 | import { CoverImageProps } from './CoverImage'
|
28 | import { CoverViewProps } from './CoverView'
|
29 | import { CustomWrapperProps } from './CustomWrapper'
|
30 | import { EditorProps } from './Editor'
|
31 | import { FormProps } from './Form'
|
32 | import { FunctionalPageNavigatorProps } from './FunctionalPageNavigator'
|
33 | import { GridViewProps } from './GridView'
|
34 | import { IconProps } from './Icon'
|
35 | import { ImageProps } from './Image'
|
36 | import { InputProps } from './Input'
|
37 | import { KeyboardAccessoryProps } from './KeyboardAccessory'
|
38 | import { LabelProps } from './Label'
|
39 | import { ListViewProps } from './ListView'
|
40 | import { LivePlayerProps } from './LivePlayer'
|
41 | import { LivePusherProps } from './LivePusher'
|
42 | import { MapProps } from './Map'
|
43 | import { MatchMediaProps } from './MatchMedia'
|
44 | import { MovableAreaProps } from './MovableArea'
|
45 | import { MovableViewProps } from './MovableView'
|
46 | import { NativeSlotProps } from './NativeSlot'
|
47 | import { NavigationBarProps } from './NavigationBar'
|
48 | import { NavigatorProps } from './Navigator'
|
49 | import { OfficialAccountProps } from './OfficialAccount'
|
50 | import { OpenDataProps } from './OpenData'
|
51 | import { PageContainerProps } from './PageContainer'
|
52 | import { PageMetaProps } from './PageMeta'
|
53 | import {
|
54 | PickerDateProps, PickerMultiSelectorProps,
|
55 | PickerRegionProps, PickerSelectorProps, PickerTimeProps
|
56 | } from './Picker'
|
57 | import { PickerViewProps } from './PickerView'
|
58 | import { PickerViewColumnProps } from './PickerViewColumn'
|
59 | import { ProgressProps } from './Progress'
|
60 | import { RadioProps } from './Radio'
|
61 | import { RadioGroupProps } from './RadioGroup'
|
62 | import { RichTextProps } from './RichText'
|
63 | import { RootPortalProps } from './RootPortal'
|
64 | import { ScrollViewProps } from './ScrollView'
|
65 | import { ShareElementProps } from './ShareElement'
|
66 | import { SliderProps } from './Slider'
|
67 | import { SlotProps } from './Slot'
|
68 | import { SnapshotProps } from './SnapShot'
|
69 | import { SpanProps } from './Span'
|
70 | import { StickyHeaderProps } from './StickyHeader'
|
71 | import { StickySectionProps } from './StickySection'
|
72 | import { SwiperProps } from './Swiper'
|
73 | import { SwiperItemProps } from './SwiperItem'
|
74 | import { SwitchProps } from './Switch'
|
75 | import { TextProps } from './Text'
|
76 | import { TextareaProps } from './Textarea'
|
77 | import { VideoProps } from './Video'
|
78 | import { ViewProps } from './View'
|
79 | import { VoipRoomProps } from './VoipRoom'
|
80 | import { WebViewProps } from './WebView'
|
81 |
|
82 |
|
83 | type OnCamelCaseToOnCamelcase<T extends string> = T extends `on${infer Rest}`
|
84 | ? `on${Capitalize<Lowercase<Rest>>}`
|
85 | : T;
|
86 |
|
87 | type TransformCamelCase<T extends Record<string, any>> = {
|
88 | [key in keyof T as OnCamelCaseToOnCamelcase<key>]: T[key]
|
89 | }
|
90 |
|
91 |
|
92 | type DistributiveOmit<T, K extends keyof T> = T extends unknown ? TransformCamelCase<Omit<T, K>> : never
|
93 |
|
94 | interface SlimProps {
|
95 | class?: any
|
96 | style?: CSS.Properties<string | number>
|
97 | innerHTML?: string
|
98 | }
|
99 |
|
100 |
|
101 | export type RemoveReactAttribute = 'className' | 'style' | 'key' | 'ref' | 'dangerouslySetInnerHTML'
|
102 | export type TransformReact2VueType<P extends StandardProps = Record<string, never>> = DistributiveOmit<P, RemoveReactAttribute> & SlimProps
|
103 | export type VueComponentType<P = Record<string, never>> = DefineComponent<TransformReact2VueType<P>>
|
104 |
|
105 | export * from './common'
|
106 | export * from './event'
|
107 | export * from './props'
|
108 |
|
109 |
|
110 | export declare const Block: VueComponentType<StandardProps>
|
111 | export declare const CoverImage: VueComponentType<CoverImageProps>
|
112 | export declare const CoverView: VueComponentType<CoverViewProps>
|
113 | export declare const MatchMedia: VueComponentType<MatchMediaProps>
|
114 | export declare const MovableArea: VueComponentType<MovableAreaProps>
|
115 | export declare const MovableView: VueComponentType<MovableViewProps>
|
116 | export declare const PageContainer: VueComponentType<PageContainerProps>
|
117 | export declare const RootPortal: VueComponentType<RootPortalProps>
|
118 | export declare const ScrollView: VueComponentType<ScrollViewProps>
|
119 | export declare const Swiper: VueComponentType<SwiperProps>
|
120 | export declare const SwiperItem: VueComponentType<SwiperItemProps>
|
121 | export declare const View: VueComponentType<ViewProps>
|
122 |
|
123 | export declare const Icon: VueComponentType<IconProps>
|
124 | export declare const Progress: VueComponentType<ProgressProps>
|
125 | export declare const RichText: VueComponentType<RichTextProps>
|
126 | export declare const Text: VueComponentType<TextProps>
|
127 |
|
128 | export declare const Button: VueComponentType<ButtonProps>
|
129 | export declare const Checkbox: VueComponentType<CheckboxProps>
|
130 | export declare const CheckboxGroup: VueComponentType<CheckboxGroupProps>
|
131 | export declare const Editor: VueComponentType<EditorProps>
|
132 | export declare const Form: VueComponentType<FormProps>
|
133 | export declare const Input: VueComponentType<InputProps>
|
134 | export declare const KeyboardAccessory: VueComponentType<KeyboardAccessoryProps>
|
135 | export declare const Label: VueComponentType<LabelProps>
|
136 | export declare const Picker: VueComponentType<PickerMultiSelectorProps | PickerTimeProps | PickerDateProps | PickerRegionProps | PickerSelectorProps>
|
137 | export declare const PickerView: VueComponentType<PickerViewProps>
|
138 | export declare const PickerViewColumn: VueComponentType<PickerViewColumnProps>
|
139 | export declare const Radio: VueComponentType<RadioProps>
|
140 | export declare const RadioGroup: VueComponentType<RadioGroupProps>
|
141 | export declare const Slider: VueComponentType<SliderProps>
|
142 | export declare const Switch: VueComponentType<SwitchProps>
|
143 | export declare const Textarea: VueComponentType<TextareaProps>
|
144 |
|
145 | export declare const GridView: VueComponentType<GridViewProps>
|
146 | export declare const ListView: VueComponentType<ListViewProps>
|
147 | export declare const Snapshot: VueComponentType<SnapshotProps>
|
148 | export declare const Span: VueComponentType<SpanProps>
|
149 | export declare const ShareElement: VueComponentType<ShareElementProps>
|
150 | export declare const StickyHeader: VueComponentType<StickyHeaderProps>
|
151 | export declare const StickySection: VueComponentType<StickySectionProps>
|
152 |
|
153 | export declare const FunctionalPageNavigator: VueComponentType<FunctionalPageNavigatorProps>
|
154 | export declare const Navigator: VueComponentType<NavigatorProps>
|
155 | export declare const NavigationBar: VueComponentType<NavigationBarProps>
|
156 |
|
157 | export declare const Audio: VueComponentType<AudioProps>
|
158 | export declare const Camera: VueComponentType<CameraProps>
|
159 | export declare const ChannelLive: VueComponentType<ChannelLiveProps>
|
160 | export declare const ChannelVideo: VueComponentType<ChannelVideoProps>
|
161 | export declare const Image: VueComponentType<ImageProps>
|
162 | export declare const LivePlayer: VueComponentType<LivePlayerProps>
|
163 | export declare const LivePusher: VueComponentType<LivePusherProps>
|
164 | export declare const Video: VueComponentType<VideoProps>
|
165 | export declare const VoipRoom: VueComponentType<VoipRoomProps>
|
166 |
|
167 | export declare const Map: VueComponentType<MapProps>
|
168 |
|
169 | export declare const Canvas: VueComponentType<CanvasProps>
|
170 |
|
171 | export declare const Ad: VueComponentType<AdProps>
|
172 | export declare const AdCustom: VueComponentType<AdCustomProps>
|
173 | export declare const OfficialAccount: VueComponentType<OfficialAccountProps>
|
174 | export declare const OpenData: VueComponentType<OpenDataProps>
|
175 | export declare const WebView: VueComponentType<WebViewProps>
|
176 |
|
177 | export declare const PageMeta: VueComponentType<PageMetaProps>
|
178 |
|
179 | export declare const CustomWrapper: VueComponentType<CustomWrapperProps>
|
180 | export declare const Slot: VueComponentType<SlotProps>
|
181 | export declare const NativeSlot: VueComponentType<NativeSlotProps>
|
182 |
|
183 | export type ReservedProps = {
|
184 | key?: string | number | symbol
|
185 | ref?: VNodeRef
|
186 | ref_for?: boolean
|
187 | ref_key?: string
|
188 | }
|
189 |
|
190 | export type ElementAttrs<T> = T & ReservedProps
|
191 |
|
192 | declare global {
|
193 | namespace JSX {
|
194 | interface IntrinsicElements {
|
195 |
|
196 | block: ElementAttrs<TransformReact2VueType<StandardProps>>
|
197 | 'taro-block-core': ElementAttrs<TransformReact2VueType<StandardProps>>
|
198 | 'cover-image': ElementAttrs<TransformReact2VueType<CoverImageProps>>
|
199 | 'taro-cover-image-core': ElementAttrs<TransformReact2VueType<CoverImageProps>>
|
200 | 'cover-view': ElementAttrs<TransformReact2VueType<CoverViewProps>>
|
201 | 'taro-cover-view-core': ElementAttrs<TransformReact2VueType<CoverViewProps>>
|
202 | 'match-media': ElementAttrs<TransformReact2VueType<MatchMediaProps>>
|
203 | 'taro-match-media-core': ElementAttrs<TransformReact2VueType<MatchMediaProps>>
|
204 | 'movable-area': ElementAttrs<TransformReact2VueType<MovableAreaProps>>
|
205 | 'taro-movable-area-core': ElementAttrs<TransformReact2VueType<MovableAreaProps>>
|
206 | 'movable-view': ElementAttrs<TransformReact2VueType<MovableViewProps>>
|
207 | 'taro-movable-view-core': ElementAttrs<TransformReact2VueType<MovableViewProps>>
|
208 | 'page-container': ElementAttrs<TransformReact2VueType<PageContainerProps>>
|
209 | 'taro-page-container-core': ElementAttrs<TransformReact2VueType<PageContainerProps>>
|
210 | 'root-portal': ElementAttrs<TransformReact2VueType<RootPortalProps>>
|
211 | 'taro-root-portal-core': ElementAttrs<TransformReact2VueType<RootPortalProps>>
|
212 | 'scroll-view': ElementAttrs<TransformReact2VueType<ScrollViewProps>>
|
213 | 'taro-scroll-view-core': ElementAttrs<TransformReact2VueType<ScrollViewProps>>
|
214 | swiper: ElementAttrs<TransformReact2VueType<SwiperProps>>
|
215 | 'taro-swiper-core': ElementAttrs<TransformReact2VueType<SwiperProps>>
|
216 | 'swiper-item': ElementAttrs<TransformReact2VueType<SwiperItemProps>>
|
217 | 'taro-swiper-item-core': ElementAttrs<TransformReact2VueType<SwiperItemProps>>
|
218 | view: ElementAttrs<TransformReact2VueType<ViewProps>>
|
219 | 'taro-view-core': ElementAttrs<TransformReact2VueType<ViewProps>>
|
220 |
|
221 | icon: ElementAttrs<TransformReact2VueType<IconProps>>
|
222 | 'taro-icon-core': ElementAttrs<TransformReact2VueType<IconProps>>
|
223 | progress: ElementAttrs<TransformReact2VueType<ProgressProps>>
|
224 | 'taro-progress-core': ElementAttrs<TransformReact2VueType<ProgressProps>>
|
225 | 'rich-text': ElementAttrs<TransformReact2VueType<RichTextProps>>
|
226 | 'taro-rich-text-core': ElementAttrs<TransformReact2VueType<RichTextProps>>
|
227 | text: ElementAttrs<TransformReact2VueType<TextProps>>
|
228 | 'taro-text-core': ElementAttrs<TransformReact2VueType<TextProps>>
|
229 |
|
230 | button: ElementAttrs<TransformReact2VueType<ButtonProps>>
|
231 | 'taro-button-core': ElementAttrs<TransformReact2VueType<ButtonProps>>
|
232 | checkbox: ElementAttrs<TransformReact2VueType<CheckboxProps>>
|
233 | 'taro-checkbox-core': ElementAttrs<TransformReact2VueType<CheckboxProps>>
|
234 | 'checkbox-group': ElementAttrs<TransformReact2VueType<CheckboxGroupProps>>
|
235 | 'taro-checkbox-group-core': ElementAttrs<TransformReact2VueType<CheckboxGroupProps>>
|
236 | editor: ElementAttrs<TransformReact2VueType<EditorProps>>
|
237 | 'taro-editor-core': ElementAttrs<TransformReact2VueType<EditorProps>>
|
238 | form: ElementAttrs<TransformReact2VueType<FormProps>>
|
239 | 'taro-form-core': ElementAttrs<TransformReact2VueType<FormProps>>
|
240 | input: ElementAttrs<TransformReact2VueType<InputProps>>
|
241 | 'taro-input-core': ElementAttrs<TransformReact2VueType<InputProps>>
|
242 | 'keyboard-accessory': ElementAttrs<TransformReact2VueType<KeyboardAccessoryProps>>
|
243 | 'taro-keyboard-accessory-core': ElementAttrs<TransformReact2VueType<KeyboardAccessoryProps>>
|
244 | label: ElementAttrs<TransformReact2VueType<LabelProps>>
|
245 | 'taro-label-core': ElementAttrs<TransformReact2VueType<LabelProps>>
|
246 | picker: ElementAttrs<TransformReact2VueType<PickerMultiSelectorProps | PickerTimeProps | PickerDateProps | PickerRegionProps | PickerSelectorProps>>
|
247 | 'taro-picker-core': ElementAttrs<TransformReact2VueType<PickerMultiSelectorProps | PickerTimeProps | PickerDateProps | PickerRegionProps | PickerSelectorProps>>
|
248 | 'picker-view': ElementAttrs<TransformReact2VueType<PickerViewProps>>
|
249 | 'taro-picker-view-core': ElementAttrs<TransformReact2VueType<PickerViewProps>>
|
250 | 'picker-view-column': ElementAttrs<TransformReact2VueType<PickerViewColumnProps>>
|
251 | 'taro-picker-view-column-core': ElementAttrs<TransformReact2VueType<PickerViewColumnProps>>
|
252 | radio: ElementAttrs<TransformReact2VueType<RadioProps>>
|
253 | 'taro-radio-core': ElementAttrs<TransformReact2VueType<RadioProps>>
|
254 | 'radio-group': ElementAttrs<TransformReact2VueType<RadioGroupProps>>
|
255 | 'taro-radio-group-core': ElementAttrs<TransformReact2VueType<RadioGroupProps>>
|
256 | slider: ElementAttrs<TransformReact2VueType<SliderProps>>
|
257 | 'taro-slider-core': ElementAttrs<TransformReact2VueType<SliderProps>>
|
258 | switch: ElementAttrs<TransformReact2VueType<SwitchProps>>
|
259 | 'taro-switch-core': ElementAttrs<TransformReact2VueType<SwitchProps>>
|
260 | textarea: ElementAttrs<TransformReact2VueType<TextareaProps>>
|
261 | 'taro-textarea-core': ElementAttrs<TransformReact2VueType<TextareaProps>>
|
262 |
|
263 | 'grid-view': ElementAttrs<TransformReact2VueType<GridViewProps>>
|
264 | 'taro-grid-view-core': ElementAttrs<TransformReact2VueType<GridViewProps>>
|
265 | 'list-view': ElementAttrs<TransformReact2VueType<ListViewProps>>
|
266 | 'taro-list-view-core': ElementAttrs<TransformReact2VueType<ListViewProps>>
|
267 | 'share-element': ElementAttrs<TransformReact2VueType<ShareElementProps>>
|
268 | 'taro-share-element-core': ElementAttrs<TransformReact2VueType<ShareElementProps>>
|
269 | 'snapshot': ElementAttrs<TransformReact2VueType<SnapshotProps>>
|
270 | 'taro-snapshot-core': ElementAttrs<TransformReact2VueType<SnapshotProps>>
|
271 | 'span': ElementAttrs<TransformReact2VueType<SpanProps>>
|
272 | 'taro-span-core': ElementAttrs<TransformReact2VueType<SpanProps>>
|
273 | 'sticky-header': ElementAttrs<TransformReact2VueType<StickyHeaderProps>>
|
274 | 'taro-sticky-header-core': ElementAttrs<TransformReact2VueType<StickyHeaderProps>>
|
275 | 'sticky-section': ElementAttrs<TransformReact2VueType<StickySectionProps>>
|
276 | 'taro-sticky-section-core': ElementAttrs<TransformReact2VueType<StickySectionProps>>
|
277 |
|
278 | 'functional-page-navigator': ElementAttrs<TransformReact2VueType<FunctionalPageNavigatorProps>>
|
279 | 'taro-functional-page-navigator-core': ElementAttrs<TransformReact2VueType<FunctionalPageNavigatorProps>>
|
280 | navigator: ElementAttrs<TransformReact2VueType<NavigatorProps>>
|
281 | 'taro-navigator-core': ElementAttrs<TransformReact2VueType<NavigatorProps>>
|
282 | 'navigation-bar': ElementAttrs<TransformReact2VueType<NavigationBarProps>>
|
283 | 'taro-navigation-bar-core': ElementAttrs<TransformReact2VueType<NavigationBarProps>>
|
284 |
|
285 | audio: ElementAttrs<TransformReact2VueType<AudioProps>>
|
286 | 'taro-audio-core': ElementAttrs<TransformReact2VueType<AudioProps>>
|
287 | camera: ElementAttrs<TransformReact2VueType<CameraProps>>
|
288 | 'taro-camera-core': ElementAttrs<TransformReact2VueType<CameraProps>>
|
289 | 'channel-live': ElementAttrs<TransformReact2VueType<ChannelLiveProps>>
|
290 | 'taro-channel-live-core': ElementAttrs<TransformReact2VueType<ChannelLiveProps>>
|
291 | 'channel-video': ElementAttrs<TransformReact2VueType<ChannelVideoProps>>
|
292 | 'taro-channel-video-core': ElementAttrs<TransformReact2VueType<ChannelVideoProps>>
|
293 | image: ElementAttrs<TransformReact2VueType<ImageProps>>
|
294 | 'taro-image-core': ElementAttrs<TransformReact2VueType<ImageProps>>
|
295 | 'live-player': ElementAttrs<TransformReact2VueType<LivePlayerProps>>
|
296 | 'taro-live-player-core': ElementAttrs<TransformReact2VueType<LivePlayerProps>>
|
297 | 'live-pusher': ElementAttrs<TransformReact2VueType<LivePusherProps>>
|
298 | 'taro-live-pusher-core': ElementAttrs<TransformReact2VueType<LivePusherProps>>
|
299 | video: ElementAttrs<TransformReact2VueType<VideoProps>>
|
300 | 'taro-video-core': ElementAttrs<TransformReact2VueType<VideoProps>>
|
301 | 'voip-room': ElementAttrs<TransformReact2VueType<VoipRoomProps>>
|
302 | 'taro-voip-room-core': ElementAttrs<TransformReact2VueType<VoipRoomProps>>
|
303 |
|
304 | map: ElementAttrs<TransformReact2VueType<MapProps>>
|
305 | 'taro-map-core': ElementAttrs<TransformReact2VueType<MapProps>>
|
306 |
|
307 | canvas: ElementAttrs<TransformReact2VueType<CanvasProps>>
|
308 | 'taro-canvas-core': ElementAttrs<TransformReact2VueType<CanvasProps>>
|
309 |
|
310 | ad: ElementAttrs<TransformReact2VueType<AdProps>>
|
311 | 'taro-ad-core': ElementAttrs<TransformReact2VueType<AdProps>>
|
312 | 'ad-custom': ElementAttrs<TransformReact2VueType<AdCustomProps>>
|
313 | 'taro-ad-custom-core': ElementAttrs<TransformReact2VueType<AdCustomProps>>
|
314 | 'official-account': ElementAttrs<TransformReact2VueType<OfficialAccountProps>>
|
315 | 'taro-official-account-core': ElementAttrs<TransformReact2VueType<OfficialAccountProps>>
|
316 | 'open-data': ElementAttrs<TransformReact2VueType<OpenDataProps>>
|
317 | 'taro-open-data-core': ElementAttrs<TransformReact2VueType<OpenDataProps>>
|
318 | 'web-view': ElementAttrs<TransformReact2VueType<WebViewProps>>
|
319 | 'taro-web-view-core': ElementAttrs<TransformReact2VueType<WebViewProps>>
|
320 |
|
321 | 'page-meta': ElementAttrs<TransformReact2VueType<PageMetaProps>>
|
322 | 'taro-page-meta-core': ElementAttrs<TransformReact2VueType<PageMetaProps>>
|
323 |
|
324 | 'custom-wrapper': ElementAttrs<TransformReact2VueType<CustomWrapperProps>>
|
325 | 'taro-custom-wrapper-core': ElementAttrs<TransformReact2VueType<CustomWrapperProps>>
|
326 |
|
327 | 'slot': ElementAttrs<TransformReact2VueType<SlotProps>> & Record<string, any>
|
328 | 'taro-slot-core': ElementAttrs<TransformReact2VueType<SlotProps>>
|
329 | 'native-slot': ElementAttrs<TransformReact2VueType<NativeSlotProps>>
|
330 | 'taro-native-slot-core': ElementAttrs<TransformReact2VueType<NativeSlotProps>>
|
331 | }
|
332 | }
|
333 | }
|