Browse Source

fix: ts type error

pull/4936/head
tangjinzhou 3 years ago
parent
commit
b25c5cc28e
  1. 7
      components/carousel/index.tsx
  2. 2
      components/components.ts
  3. 2
      components/drawer/index.tsx
  4. 11
      components/empty/index.tsx
  5. 2
      components/input/inputProps.ts
  6. 3
      components/radio/index.ts
  7. 2
      components/select/index.tsx
  8. 2
      components/typography/Base.tsx
  9. 2
      components/vc-table/Footer/Cell.tsx

7
components/carousel/index.tsx

@ -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),

2
components/components.ts

@ -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';

2
components/drawer/index.tsx

@ -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',

11
components/empty/index.tsx

@ -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 }) => {

2
components/input/inputProps.ts

@ -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,

3
components/radio/index.ts

@ -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;

2
components/select/index.tsx

@ -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;

2
components/typography/Base.tsx

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

2
components/vc-table/Footer/Cell.tsx

@ -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;

Loading…
Cancel
Save