From c2994a6629df0b27f2f8f7efbd194296fb82a8e4 Mon Sep 17 00:00:00 2001 From: tanjinzhou <415800467@qq.com> Date: Tue, 13 Oct 2020 10:43:39 +0800 Subject: [PATCH] perf: update ts types --- components/alert/index.tsx | 10 +++++----- components/anchor/Anchor.tsx | 2 +- components/anchor/AnchorLink.tsx | 2 +- components/auto-complete/index.tsx | 2 +- components/config-provider/index.tsx | 4 ++-- components/select/index.tsx | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/components/alert/index.tsx b/components/alert/index.tsx index 194366fd0..ff075666d 100644 --- a/components/alert/index.tsx +++ b/components/alert/index.tsx @@ -39,11 +39,11 @@ export const AlertProps = { /** Whether Alert can be closed */ closable: PropTypes.looseBool, /** Close text to show */ - closeText: PropTypes.any, + closeText: PropTypes.VNodeChild, /** Content of Alert */ - message: PropTypes.any, + message: PropTypes.VNodeChild, /** Additional content of Alert */ - description: PropTypes.any, + description: PropTypes.VNodeChild, /** Callback when close Alert */ // onClose?: React.MouseEventHandler; /** Trigger when animation ending of Alert */ @@ -52,8 +52,8 @@ export const AlertProps = { showIcon: PropTypes.looseBool, prefixCls: PropTypes.string, banner: PropTypes.looseBool, - icon: PropTypes.any, - onClose: PropTypes.func, + icon: PropTypes.VNodeChild, + onClose: PropTypes.VNodeChild, }; const Alert = defineComponent({ diff --git a/components/anchor/Anchor.tsx b/components/anchor/Anchor.tsx index d0a3f50e4..fdbb14534 100644 --- a/components/anchor/Anchor.tsx +++ b/components/anchor/Anchor.tsx @@ -52,7 +52,7 @@ const AnchorProps = { showInkInFixed: PropTypes.looseBool.def(false), getContainer: PropTypes.func.def(getDefaultContainer), wrapperClass: PropTypes.string, - wrapperStyle: PropTypes.object, + wrapperStyle: PropTypes.style, getCurrentAnchor: PropTypes.func, targetOffset: PropTypes.number, onChange: PropTypes.func, diff --git a/components/anchor/AnchorLink.tsx b/components/anchor/AnchorLink.tsx index 256cc38dc..0f0a9f816 100644 --- a/components/anchor/AnchorLink.tsx +++ b/components/anchor/AnchorLink.tsx @@ -9,7 +9,7 @@ function noop(..._any: any[]): any {} const AnchorLinkProps = { prefixCls: PropTypes.string, href: PropTypes.string.def('#'), - title: PropTypes.any, + title: PropTypes.VNodeChild, target: PropTypes.string, }; diff --git a/components/auto-complete/index.tsx b/components/auto-complete/index.tsx index 7e7be38a4..f631fab7d 100644 --- a/components/auto-complete/index.tsx +++ b/components/auto-complete/index.tsx @@ -16,7 +16,7 @@ const AutoCompleteProps = { value: SelectValue, defaultValue: SelectValue, dataSource: PropTypes.array, - dropdownMenuStyle: PropTypes.object, + dropdownMenuStyle: PropTypes.style, optionLabelProp: PropTypes.string, dropdownMatchSelectWidth: PropTypes.looseBool, // onChange?: (value: SelectValue) => void; diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx index ced6ec71c..c928732ba 100644 --- a/components/config-provider/index.tsx +++ b/components/config-provider/index.tsx @@ -154,13 +154,13 @@ const ConfigProvider = defineComponent({ }, }); -export const defaultConfigProvider = { +export const defaultConfigProvider: ConfigConsumerProps = { getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => { if (customizePrefixCls) return customizePrefixCls; return `ant-${suffixCls}`; }, renderEmpty: defaultRenderEmpty, -} as any; +}; /* istanbul ignore next */ ConfigProvider.install = function(app: App) { diff --git a/components/select/index.tsx b/components/select/index.tsx index 583f129df..8409cd10c 100644 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -16,18 +16,18 @@ const AbstractSelectProps = () => ({ prefixCls: PropTypes.string, size: PropTypes.oneOf(['small', 'large', 'default']), showAction: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(String)]), - notFoundContent: PropTypes.any, + notFoundContent: PropTypes.VNodeChild, transitionName: PropTypes.string, choiceTransitionName: PropTypes.string, showSearch: PropTypes.looseBool, allowClear: PropTypes.looseBool, disabled: PropTypes.looseBool, tabindex: PropTypes.number, - placeholder: PropTypes.any, + placeholder: PropTypes.VNodeChild, defaultActiveFirstOption: PropTypes.looseBool, dropdownClassName: PropTypes.string, - dropdownStyle: PropTypes.any, - dropdownMenuStyle: PropTypes.any, + dropdownStyle: PropTypes.style, + dropdownMenuStyle: PropTypes.style, dropdownMatchSelectWidth: PropTypes.looseBool, // onSearch: (value: string) => any, filterOption: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func])),