/** * vue tsx @tarojs/components 类型提示文件 * * ## 如何使用? * 请在醒目全局的类型文件中写入以下代码,覆盖默认的组件类型提示 * ```typescript * export declare module '@tarojs/components' { * export * from '@tarojs/components/types/index.vue3' * } * ``` */ import * as CSS from 'csstype' import { DefineComponent, VNodeRef } from 'vue' import { AdProps } from './Ad' import { AdCustomProps } from './AdCustom' import { AudioProps } from './Audio' import { ButtonProps } from './Button' import { CameraProps } from './Camera' import { CanvasProps } from './Canvas' import { ChannelLiveProps } from './ChannelLive' import { ChannelVideoProps } from './ChannelVideo' import { CheckboxProps } from './Checkbox' import { CheckboxGroupProps } from './CheckboxGroup' import { StandardProps } from './common' import { CoverImageProps } from './CoverImage' import { CoverViewProps } from './CoverView' import { CustomWrapperProps } from './CustomWrapper' import { EditorProps } from './Editor' import { FormProps } from './Form' import { FunctionalPageNavigatorProps } from './FunctionalPageNavigator' import { GridViewProps } from './GridView' import { IconProps } from './Icon' import { ImageProps } from './Image' import { InputProps } from './Input' import { KeyboardAccessoryProps } from './KeyboardAccessory' import { LabelProps } from './Label' import { ListViewProps } from './ListView' import { LivePlayerProps } from './LivePlayer' import { LivePusherProps } from './LivePusher' import { MapProps } from './Map' import { MatchMediaProps } from './MatchMedia' import { MovableAreaProps } from './MovableArea' import { MovableViewProps } from './MovableView' import { NativeSlotProps } from './NativeSlot' import { NavigationBarProps } from './NavigationBar' import { NavigatorProps } from './Navigator' import { OfficialAccountProps } from './OfficialAccount' import { OpenDataProps } from './OpenData' import { PageContainerProps } from './PageContainer' import { PageMetaProps } from './PageMeta' import { PickerDateProps, PickerMultiSelectorProps, PickerRegionProps, PickerSelectorProps, PickerTimeProps } from './Picker' import { PickerViewProps } from './PickerView' import { PickerViewColumnProps } from './PickerViewColumn' import { ProgressProps } from './Progress' import { RadioProps } from './Radio' import { RadioGroupProps } from './RadioGroup' import { RichTextProps } from './RichText' import { RootPortalProps } from './RootPortal' import { ScrollViewProps } from './ScrollView' import { ShareElementProps } from './ShareElement' import { SliderProps } from './Slider' import { SlotProps } from './Slot' import { SnapshotProps } from './SnapShot' import { SpanProps } from './Span' import { StickyHeaderProps } from './StickyHeader' import { StickySectionProps } from './StickySection' import { SwiperProps } from './Swiper' import { SwiperItemProps } from './SwiperItem' import { SwitchProps } from './Switch' import { TextProps } from './Text' import { TextareaProps } from './Textarea' import { VideoProps } from './Video' import { ViewProps } from './View' import { VoipRoomProps } from './VoipRoom' import { WebViewProps } from './WebView' /** 因为react的事件是CamelCase而vue得是Camelcase, 所以需要转换 */ type OnCamelCaseToOnCamelcase = T extends `on${infer Rest}` ? `on${Capitalize>}` : T; type TransformCamelCase> = { [key in keyof T as OnCamelCaseToOnCamelcase]: T[key] } /** 联合类型不能用omit(比如picker) */ type DistributiveOmit = T extends unknown ? TransformCamelCase> : never interface SlimProps { class?: any style?: CSS.Properties innerHTML?: string } /** 转换 react 的类型到 vue */ export type RemoveReactAttribute = 'className' | 'style' | 'key' | 'ref' | 'dangerouslySetInnerHTML' export type TransformReact2VueType

> = DistributiveOmit & SlimProps export type VueComponentType

> = DefineComponent> export * from './common' export * from './event' export * from './props' /** 视图容器 */ export declare const Block: VueComponentType export declare const CoverImage: VueComponentType export declare const CoverView: VueComponentType export declare const MatchMedia: VueComponentType export declare const MovableArea: VueComponentType export declare const MovableView: VueComponentType export declare const PageContainer: VueComponentType export declare const RootPortal: VueComponentType export declare const ScrollView: VueComponentType export declare const Swiper: VueComponentType export declare const SwiperItem: VueComponentType export declare const View: VueComponentType /** 基础内容 */ export declare const Icon: VueComponentType export declare const Progress: VueComponentType export declare const RichText: VueComponentType export declare const Text: VueComponentType /** 表单组件 */ export declare const Button: VueComponentType export declare const Checkbox: VueComponentType export declare const CheckboxGroup: VueComponentType export declare const Editor: VueComponentType export declare const Form: VueComponentType export declare const Input: VueComponentType export declare const KeyboardAccessory: VueComponentType export declare const Label: VueComponentType export declare const Picker: VueComponentType export declare const PickerView: VueComponentType export declare const PickerViewColumn: VueComponentType export declare const Radio: VueComponentType export declare const RadioGroup: VueComponentType export declare const Slider: VueComponentType export declare const Switch: VueComponentType export declare const Textarea: VueComponentType /** Skyline */ export declare const GridView: VueComponentType export declare const ListView: VueComponentType export declare const Snapshot: VueComponentType export declare const Span: VueComponentType export declare const ShareElement: VueComponentType export declare const StickyHeader: VueComponentType export declare const StickySection: VueComponentType /** 导航 */ export declare const FunctionalPageNavigator: VueComponentType export declare const Navigator: VueComponentType export declare const NavigationBar: VueComponentType /** 媒体组件 */ export declare const Audio: VueComponentType export declare const Camera: VueComponentType export declare const ChannelLive: VueComponentType export declare const ChannelVideo: VueComponentType export declare const Image: VueComponentType export declare const LivePlayer: VueComponentType export declare const LivePusher: VueComponentType export declare const Video: VueComponentType export declare const VoipRoom: VueComponentType /** 地图 */ export declare const Map: VueComponentType /** 画布 */ export declare const Canvas: VueComponentType /** 开放能力 */ export declare const Ad: VueComponentType export declare const AdCustom: VueComponentType export declare const OfficialAccount: VueComponentType export declare const OpenData: VueComponentType export declare const WebView: VueComponentType /** 配置节点 */ export declare const PageMeta: VueComponentType export declare const CustomWrapper: VueComponentType export declare const Slot: VueComponentType export declare const NativeSlot: VueComponentType export type ReservedProps = { key?: string | number | symbol ref?: VNodeRef ref_for?: boolean ref_key?: string } export type ElementAttrs = T & ReservedProps declare global { namespace JSX { interface IntrinsicElements { /** 视图容器 */ block: ElementAttrs> 'taro-block-core': ElementAttrs> 'cover-image': ElementAttrs> 'taro-cover-image-core': ElementAttrs> 'cover-view': ElementAttrs> 'taro-cover-view-core': ElementAttrs> 'match-media': ElementAttrs> 'taro-match-media-core': ElementAttrs> 'movable-area': ElementAttrs> 'taro-movable-area-core': ElementAttrs> 'movable-view': ElementAttrs> 'taro-movable-view-core': ElementAttrs> 'page-container': ElementAttrs> 'taro-page-container-core': ElementAttrs> 'root-portal': ElementAttrs> 'taro-root-portal-core': ElementAttrs> 'scroll-view': ElementAttrs> 'taro-scroll-view-core': ElementAttrs> swiper: ElementAttrs> 'taro-swiper-core': ElementAttrs> 'swiper-item': ElementAttrs> 'taro-swiper-item-core': ElementAttrs> view: ElementAttrs> 'taro-view-core': ElementAttrs> /** 基础内容 */ icon: ElementAttrs> 'taro-icon-core': ElementAttrs> progress: ElementAttrs> 'taro-progress-core': ElementAttrs> 'rich-text': ElementAttrs> 'taro-rich-text-core': ElementAttrs> text: ElementAttrs> 'taro-text-core': ElementAttrs> /** 表单组件 */ button: ElementAttrs> 'taro-button-core': ElementAttrs> checkbox: ElementAttrs> 'taro-checkbox-core': ElementAttrs> 'checkbox-group': ElementAttrs> 'taro-checkbox-group-core': ElementAttrs> editor: ElementAttrs> 'taro-editor-core': ElementAttrs> form: ElementAttrs> 'taro-form-core': ElementAttrs> input: ElementAttrs> 'taro-input-core': ElementAttrs> 'keyboard-accessory': ElementAttrs> 'taro-keyboard-accessory-core': ElementAttrs> label: ElementAttrs> 'taro-label-core': ElementAttrs> picker: ElementAttrs> 'taro-picker-core': ElementAttrs> 'picker-view': ElementAttrs> 'taro-picker-view-core': ElementAttrs> 'picker-view-column': ElementAttrs> 'taro-picker-view-column-core': ElementAttrs> radio: ElementAttrs> 'taro-radio-core': ElementAttrs> 'radio-group': ElementAttrs> 'taro-radio-group-core': ElementAttrs> slider: ElementAttrs> 'taro-slider-core': ElementAttrs> switch: ElementAttrs> 'taro-switch-core': ElementAttrs> textarea: ElementAttrs> 'taro-textarea-core': ElementAttrs> /** Skyline */ 'grid-view': ElementAttrs> 'taro-grid-view-core': ElementAttrs> 'list-view': ElementAttrs> 'taro-list-view-core': ElementAttrs> 'share-element': ElementAttrs> 'taro-share-element-core': ElementAttrs> 'snapshot': ElementAttrs> 'taro-snapshot-core': ElementAttrs> 'span': ElementAttrs> 'taro-span-core': ElementAttrs> 'sticky-header': ElementAttrs> 'taro-sticky-header-core': ElementAttrs> 'sticky-section': ElementAttrs> 'taro-sticky-section-core': ElementAttrs> /** 导航 */ 'functional-page-navigator': ElementAttrs> 'taro-functional-page-navigator-core': ElementAttrs> navigator: ElementAttrs> 'taro-navigator-core': ElementAttrs> 'navigation-bar': ElementAttrs> 'taro-navigation-bar-core': ElementAttrs> /** 媒体组件 */ audio: ElementAttrs> 'taro-audio-core': ElementAttrs> camera: ElementAttrs> 'taro-camera-core': ElementAttrs> 'channel-live': ElementAttrs> 'taro-channel-live-core': ElementAttrs> 'channel-video': ElementAttrs> 'taro-channel-video-core': ElementAttrs> image: ElementAttrs> 'taro-image-core': ElementAttrs> 'live-player': ElementAttrs> 'taro-live-player-core': ElementAttrs> 'live-pusher': ElementAttrs> 'taro-live-pusher-core': ElementAttrs> video: ElementAttrs> 'taro-video-core': ElementAttrs> 'voip-room': ElementAttrs> 'taro-voip-room-core': ElementAttrs> /** 地图 */ map: ElementAttrs> 'taro-map-core': ElementAttrs> /** 画布 */ canvas: ElementAttrs> 'taro-canvas-core': ElementAttrs> /** 开放能力 */ ad: ElementAttrs> 'taro-ad-core': ElementAttrs> 'ad-custom': ElementAttrs> 'taro-ad-custom-core': ElementAttrs> 'official-account': ElementAttrs> 'taro-official-account-core': ElementAttrs> 'open-data': ElementAttrs> 'taro-open-data-core': ElementAttrs> 'web-view': ElementAttrs> 'taro-web-view-core': ElementAttrs> /** 配置节点 */ 'page-meta': ElementAttrs> 'taro-page-meta-core': ElementAttrs> 'custom-wrapper': ElementAttrs> 'taro-custom-wrapper-core': ElementAttrs> /** 为了不与vue3模板默认的slot冲突,增加 Record */ 'slot': ElementAttrs> & Record 'taro-slot-core': ElementAttrs> 'native-slot': ElementAttrs> 'taro-native-slot-core': ElementAttrs> } } }