fix: ts type error

This commit is contained in:
tangjinzhou 2022-01-11 23:23:07 +08:00
parent 9693e4b10b
commit b25c5cc28e
9 changed files with 19 additions and 14 deletions

View File

@ -1,3 +1,4 @@
import type { ExtractPropTypes } from 'vue';
import { defineComponent, inject } from 'vue';
import PropTypes from '../_util/vue-types';
import debounce from 'lodash-es/debounce';
@ -9,7 +10,7 @@ import SlickCarousel from '../vc-slick/src';
import { tuple, withInstall } from '../_util/type';
// Carousel
export const CarouselProps = {
export const carouselProps = {
effect: PropTypes.oneOf(tuple('scrollx', 'fade')),
dots: PropTypes.looseBool.def(true),
vertical: PropTypes.looseBool,
@ -53,11 +54,11 @@ export const CarouselProps = {
dotPosition: PropTypes.oneOf(tuple('top', 'bottom', 'left', 'right')),
verticalSwiping: PropTypes.looseBool.def(false),
};
export type CarouselProps = Partial<ExtractPropTypes<typeof carouselProps>>;
const Carousel = defineComponent({
name: 'ACarousel',
inheritAttrs: false,
props: CarouselProps,
props: carouselProps,
setup() {
return {
configProvider: inject('configProvider', defaultConfigProvider),

View File

@ -69,6 +69,7 @@ export { default as Divider } from './divider';
export type { DropdownProps } from './dropdown';
export { default as Dropdown, DropdownButton } from './dropdown';
export type { DrawerProps } from './drawer';
export { default as Drawer } from './drawer';
export type { EmptyProps } from './empty';
@ -130,6 +131,7 @@ export { default as Popover } from './popover';
export type { ProgressProps } from './progress';
export { default as Progress } from './progress';
export type { RadioProps, RadioChangeEvent, RadioGroupProps } from './radio';
export { default as Radio, RadioButton, RadioGroup } from './radio';
export type { RateProps } from './rate';

View File

@ -74,7 +74,7 @@ const drawerProps = () => ({
afterVisibleChange: PropTypes.func,
});
export type DrawerProps = Partial<ExtractPropTypes<typeof drawerProps>>;
export type DrawerProps = Partial<ExtractPropTypes<ReturnType<typeof drawerProps>>>;
const Drawer = defineComponent({
name: 'ADrawer',

View File

@ -1,4 +1,4 @@
import type { CSSProperties, VNodeTypes, FunctionalComponent } from 'vue';
import type { CSSProperties, FunctionalComponent } from 'vue';
import { inject } from 'vue';
import classNames from '../_util/classNames';
import { defaultConfigProvider } from '../config-provider';
@ -7,6 +7,7 @@ import DefaultEmptyImg from './empty';
import SimpleEmptyImg from './simple';
import { filterEmpty } from '../_util/props-util';
import PropTypes from '../_util/vue-types';
import type { VueNode } from '../_util/type';
import { withInstall } from '../_util/type';
const defaultEmptyImg = <DefaultEmptyImg />;
@ -21,14 +22,14 @@ export interface EmptyProps {
class?: any;
style?: string | CSSProperties;
imageStyle?: CSSProperties;
image?: VNodeTypes | null;
description?: VNodeTypes;
image?: VueNode | null;
description?: VueNode;
}
interface EmptyType extends FunctionalComponent<EmptyProps> {
displayName: string;
PRESENTED_IMAGE_DEFAULT: VNodeTypes;
PRESENTED_IMAGE_SIMPLE: VNodeTypes;
PRESENTED_IMAGE_DEFAULT: VueNode;
PRESENTED_IMAGE_SIMPLE: VueNode;
}
const Empty: EmptyType = (props, { slots = {}, attrs }) => {

View File

@ -86,7 +86,7 @@ const textAreaProps = {
...omit(inputProps, ['prefix', 'addonBefore', 'addonAfter', 'suffix']),
autosize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
autoSize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
showCount: { type: [Boolean, Object] as PropType<ShowCountProps> },
showCount: { type: [Boolean, Object] as PropType<boolean | ShowCountProps> },
onResize: { type: Function as PropType<(size: { width: number; height: number }) => void> },
onCompositionstart: PropTypes.func,
onCompositionend: PropTypes.func,

View File

@ -2,7 +2,8 @@ import type { App, Plugin } from 'vue';
import Radio from './Radio';
import Group from './Group';
import Button from './RadioButton';
export type { RadioProps } from './Radio';
export type { RadioGroupProps } from './Group';
export type { RadioChangeEventTarget, RadioChangeEvent } from './interface';
Radio.Group = Group;

View File

@ -20,7 +20,7 @@ export type OptionType = typeof Option;
export interface LabeledValue {
key?: string;
value: RawValue;
label: any;
label?: any;
}
export type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[] | undefined;

View File

@ -61,7 +61,7 @@ export interface EllipsisConfig {
symbol?: string;
onExpand?: EventHandler;
onEllipsis?: (ellipsis: boolean) => void;
tooltip?: boolean;
tooltip?: any;
}
export interface BlockProps extends TypographyProps {

View File

@ -6,7 +6,7 @@ import type { AlignType } from '../interface';
import { getCellFixedInfo } from '../utils/fixUtil';
export interface SummaryCellProps {
index: number;
index?: number;
colSpan?: number;
rowSpan?: number;
align?: AlignType;