From 30508b01246ae0754d24c55e469f780e0e24f2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Sun, 28 Apr 2019 11:47:22 +0800 Subject: [PATCH] fix error types (#16043) --- components/cascader/index.tsx | 2 +- components/config-provider/index.tsx | 4 ++-- components/dropdown/dropdown.tsx | 2 +- components/menu/index.tsx | 2 +- components/select/index.tsx | 2 +- components/table/interface.tsx | 2 +- components/time-picker/index.tsx | 2 +- components/tooltip/index.tsx | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index 3df6635a9a..676e7e95f3 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -89,7 +89,7 @@ export interface CascaderProps { onPopupVisibleChange?: (popupVisible: boolean) => void; prefixCls?: string; inputPrefixCls?: string; - getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; + getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; popupVisible?: boolean; /** use this after antd@3.7.0 */ fieldNames?: FieldNamesType; diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx index 9ca54423f9..03c3362054 100644 --- a/components/config-provider/index.tsx +++ b/components/config-provider/index.tsx @@ -10,7 +10,7 @@ export interface CSPConfig { } export interface ConfigConsumerProps { - getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; + getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; rootPrefixCls?: string; getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => string; renderEmpty: RenderEmptyHandler; @@ -28,7 +28,7 @@ export const configConsumerProps = [ ]; export interface ConfigProviderProps { - getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; + getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; prefixCls?: string; children?: React.ReactNode; renderEmpty?: RenderEmptyHandler; diff --git a/components/dropdown/dropdown.tsx b/components/dropdown/dropdown.tsx index 63f31f35c6..e0a53af933 100644 --- a/components/dropdown/dropdown.tsx +++ b/components/dropdown/dropdown.tsx @@ -39,7 +39,7 @@ export interface DropDownProps { visible?: boolean; disabled?: boolean; align?: Align; - getPopupContainer?: (triggerNode: Element) => HTMLElement; + getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; prefixCls?: string; className?: string; transitionName?: string; diff --git a/components/menu/index.tsx b/components/menu/index.tsx index 5cd00864c7..c3d33b8fba 100644 --- a/components/menu/index.tsx +++ b/components/menu/index.tsx @@ -56,7 +56,7 @@ export interface MenuProps { subMenuOpenDelay?: number; focusable?: boolean; onMouseEnter?: (e: MouseEvent) => void; - getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; + getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; overflowedIndicator?: React.ReactNode; } diff --git a/components/select/index.tsx b/components/select/index.tsx index 55dc50c757..3f41b44ec0 100755 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -31,7 +31,7 @@ export interface AbstractSelectProps { dropdownMenuStyle?: React.CSSProperties; dropdownMatchSelectWidth?: boolean; onSearch?: (value: string) => any; - getPopupContainer?: (triggerNode?: Element) => HTMLElement; + getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; filterOption?: boolean | ((inputValue: string, option: React.ReactElement) => any); id?: string; defaultOpen?: boolean; diff --git a/components/table/interface.tsx b/components/table/interface.tsx index 6e474f2812..3da8a7472e 100644 --- a/components/table/interface.tsx +++ b/components/table/interface.tsx @@ -184,7 +184,7 @@ export interface TableState { } export type SelectionItemSelectFn = (key: string[]) => any; -type GetPopupContainer = (triggerNode?: Element) => HTMLElement; +type GetPopupContainer = (triggerNode?: HTMLElement) => HTMLElement; export interface SelectionItem { key: string; diff --git a/components/time-picker/index.tsx b/components/time-picker/index.tsx index d01f479753..4cea9460fd 100644 --- a/components/time-picker/index.tsx +++ b/components/time-picker/index.tsx @@ -38,7 +38,7 @@ export interface TimePickerProps { disabledMinutes?: (selectedHour: number) => number[]; disabledSeconds?: (selectedHour: number, selectedMinute: number) => number[]; style?: React.CSSProperties; - getPopupContainer?: (triggerNode: Element) => HTMLElement; + getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; addon?: Function; use12Hours?: boolean; focusOnOpen?: boolean; diff --git a/components/tooltip/index.tsx b/components/tooltip/index.tsx index cc459968a0..c9bcd6fe39 100644 --- a/components/tooltip/index.tsx +++ b/components/tooltip/index.tsx @@ -56,8 +56,8 @@ export interface AbstractTooltipProps { arrowPointAtCenter?: boolean; autoAdjustOverflow?: boolean | AdjustOverflow; // getTooltipContainer had been rename to getPopupContainer - getTooltipContainer?: (triggerNode: Element) => HTMLElement; - getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; + getTooltipContainer?: (triggerNode: HTMLElement) => HTMLElement; + getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; children?: React.ReactNode; // align is a more higher api align?: TooltipAlignConfig;