Skip to content

Commit b25c5cc

Browse files
committed
fix: ts type error
1 parent 9693e4b commit b25c5cc

File tree

9 files changed

+19
-14
lines changed

9 files changed

+19
-14
lines changed

components/carousel/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { ExtractPropTypes } from 'vue';
12
import { defineComponent, inject } from 'vue';
23
import PropTypes from '../_util/vue-types';
34
import debounce from 'lodash-es/debounce';
@@ -9,7 +10,7 @@ import SlickCarousel from '../vc-slick/src';
910
import { tuple, withInstall } from '../_util/type';
1011

1112
// Carousel
12-
export const CarouselProps = {
13+
export const carouselProps = {
1314
effect: PropTypes.oneOf(tuple('scrollx', 'fade')),
1415
dots: PropTypes.looseBool.def(true),
1516
vertical: PropTypes.looseBool,
@@ -53,11 +54,11 @@ export const CarouselProps = {
5354
dotPosition: PropTypes.oneOf(tuple('top', 'bottom', 'left', 'right')),
5455
verticalSwiping: PropTypes.looseBool.def(false),
5556
};
56-
57+
export type CarouselProps = Partial<ExtractPropTypes<typeof carouselProps>>;
5758
const Carousel = defineComponent({
5859
name: 'ACarousel',
5960
inheritAttrs: false,
60-
props: CarouselProps,
61+
props: carouselProps,
6162
setup() {
6263
return {
6364
configProvider: inject('configProvider', defaultConfigProvider),

components/components.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export { default as Divider } from './divider';
6969
export type { DropdownProps } from './dropdown';
7070
export { default as Dropdown, DropdownButton } from './dropdown';
7171

72+
export type { DrawerProps } from './drawer';
7273
export { default as Drawer } from './drawer';
7374

7475
export type { EmptyProps } from './empty';
@@ -130,6 +131,7 @@ export { default as Popover } from './popover';
130131
export type { ProgressProps } from './progress';
131132
export { default as Progress } from './progress';
132133

134+
export type { RadioProps, RadioChangeEvent, RadioGroupProps } from './radio';
133135
export { default as Radio, RadioButton, RadioGroup } from './radio';
134136

135137
export type { RateProps } from './rate';

components/drawer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const drawerProps = () => ({
7474
afterVisibleChange: PropTypes.func,
7575
});
7676

77-
export type DrawerProps = Partial<ExtractPropTypes<typeof drawerProps>>;
77+
export type DrawerProps = Partial<ExtractPropTypes<ReturnType<typeof drawerProps>>>;
7878

7979
const Drawer = defineComponent({
8080
name: 'ADrawer',

components/empty/index.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CSSProperties, VNodeTypes, FunctionalComponent } from 'vue';
1+
import type { CSSProperties, FunctionalComponent } from 'vue';
22
import { inject } from 'vue';
33
import classNames from '../_util/classNames';
44
import { defaultConfigProvider } from '../config-provider';
@@ -7,6 +7,7 @@ import DefaultEmptyImg from './empty';
77
import SimpleEmptyImg from './simple';
88
import { filterEmpty } from '../_util/props-util';
99
import PropTypes from '../_util/vue-types';
10+
import type { VueNode } from '../_util/type';
1011
import { withInstall } from '../_util/type';
1112

1213
const defaultEmptyImg = <DefaultEmptyImg />;
@@ -21,14 +22,14 @@ export interface EmptyProps {
2122
class?: any;
2223
style?: string | CSSProperties;
2324
imageStyle?: CSSProperties;
24-
image?: VNodeTypes | null;
25-
description?: VNodeTypes;
25+
image?: VueNode | null;
26+
description?: VueNode;
2627
}
2728

2829
interface EmptyType extends FunctionalComponent<EmptyProps> {
2930
displayName: string;
30-
PRESENTED_IMAGE_DEFAULT: VNodeTypes;
31-
PRESENTED_IMAGE_SIMPLE: VNodeTypes;
31+
PRESENTED_IMAGE_DEFAULT: VueNode;
32+
PRESENTED_IMAGE_SIMPLE: VueNode;
3233
}
3334

3435
const Empty: EmptyType = (props, { slots = {}, attrs }) => {

components/input/inputProps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const textAreaProps = {
8686
...omit(inputProps, ['prefix', 'addonBefore', 'addonAfter', 'suffix']),
8787
autosize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
8888
autoSize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
89-
showCount: { type: [Boolean, Object] as PropType<ShowCountProps> },
89+
showCount: { type: [Boolean, Object] as PropType<boolean | ShowCountProps> },
9090
onResize: { type: Function as PropType<(size: { width: number; height: number }) => void> },
9191
onCompositionstart: PropTypes.func,
9292
onCompositionend: PropTypes.func,

components/radio/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import type { App, Plugin } from 'vue';
22
import Radio from './Radio';
33
import Group from './Group';
44
import Button from './RadioButton';
5-
5+
export type { RadioProps } from './Radio';
6+
export type { RadioGroupProps } from './Group';
67
export type { RadioChangeEventTarget, RadioChangeEvent } from './interface';
78

89
Radio.Group = Group;

components/select/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export type OptionType = typeof Option;
2020
export interface LabeledValue {
2121
key?: string;
2222
value: RawValue;
23-
label: any;
23+
label?: any;
2424
}
2525
export type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[] | undefined;
2626

components/typography/Base.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export interface EllipsisConfig {
6161
symbol?: string;
6262
onExpand?: EventHandler;
6363
onEllipsis?: (ellipsis: boolean) => void;
64-
tooltip?: boolean;
64+
tooltip?: any;
6565
}
6666

6767
export interface BlockProps extends TypographyProps {

components/vc-table/Footer/Cell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { AlignType } from '../interface';
66
import { getCellFixedInfo } from '../utils/fixUtil';
77

88
export interface SummaryCellProps {
9-
index: number;
9+
index?: number;
1010
colSpan?: number;
1111
rowSpan?: number;
1212
align?: AlignType;

0 commit comments

Comments
 (0)