import type { AlertComponentType, ArchComponentType, BadgeComponentType, BaseEnumProps, ButtonGroupType, ButtonProps, CalendarComponentType, CardProps, CloseButtonProps, FieldBaseProps, FieldRenderProps, IAccordionCardProps, IBreadcrumbProps, ICircleProgressProps, IDetailCardProps, IDonutChartProps, IDropdownMenuProps, InputGroupComponentType, InputSize, IntFieldProps, ISegmentedControlProps, ISimplePaginationProps, ISpaceProps, IStepsProps, ITimeProps, ITimeZoneSelectProps, LegacyModalProps, LegacySelectComponentType, LinkComponentType, LoadingComponentType, MessageApi, PaginationProps, PercentFn, RadioButtonProps, RadioProps, SearchInputProps, SelectComponentType, StatusCapsuleComponentType, StringProps, SwitchProps, TableComponent, TableFormHandle, TableFormProps, TagComponentType, TextAreaProps, TokenComponentType, TooltipProps, TruncatePropTypes, UnitFn } from "../core"; import type { CronCalendarProps, CronPlanProps, DateRangePickerProps, DeprecatedIDonutChartProps, DropdownTransitionProps, GoBackButtonType, I18nNameTagType, IBatchOperation, IChartWithUnitProps, ICountingProps, ICWTProps, IUnitWithChartProps, NamesTooltipType, OverflowTooltipProps, SidebarSubtitleComponentType, SortableListComponentType, SummaryTableComponentType, SwitchWithTextProps } from "../coreX"; import { AutoCompleteProps } from "antd/lib/auto-complete"; import { BadgeProps } from "antd/lib/badge"; import { ButtonProps as AntdButtonProps } from "antd/lib/button"; import { CheckboxGroupProps, CheckboxProps } from "antd/lib/checkbox"; import { ColProps } from "antd/lib/col"; import { CollapsePanelProps, CollapseProps } from "antd/lib/collapse"; import { DatePickerProps, RangePickerProps } from "antd/lib/date-picker"; import { DividerProps as AntdDividerProps } from "antd/lib/divider"; import { DrawerProps } from "antd/lib/drawer"; import { DropDownProps } from "antd/lib/dropdown"; import { EmptyProps } from "antd/lib/empty"; import type Form from "antd/lib/form"; import type Input from "antd/lib/input"; import { InputProps } from "antd/lib/input"; import { InputNumberProps } from "antd/lib/input-number"; import { SiderProps } from "antd/lib/layout"; import { BasicProps } from "antd/lib/layout/layout"; import { ListProps } from "antd/lib/list"; import { ListItemProps } from "antd/lib/list/Item"; import { MenuItemGroupProps, MenuProps } from "antd/lib/menu"; import { MenuItemProps } from "antd/lib/menu/MenuItem"; import { SubMenuProps } from "antd/lib/menu/SubMenu"; import { ModalProps as AntdModalProps } from "antd/lib/modal"; import { PopoverProps } from "antd/lib/popover"; import { ProgressProps as AntdProgressProps } from "antd/lib/progress"; import { RadioGroupProps as AntdRadioGroupProps } from "antd/lib/radio"; import { RowProps } from "antd/lib/row"; import { SelectProps } from "antd/lib/select"; import { SkeletonProps as AntdSkeletonProps } from "antd/lib/skeleton"; import { SkeletonButtonProps } from "antd/lib/skeleton/Button"; import Steps from "antd/lib/steps"; import { SwitchProps as AntdSwitchProps } from "antd/lib/switch"; import { TableProps as AntdTableProps } from "antd/lib/table"; import { TabPaneProps, TabsProps } from "antd/lib/tabs"; import { TimePickerProps } from "antd/lib/time-picker"; import { TimeLineItemProps, TimelineProps } from "antd/lib/timeline"; import { TreeProps as AntdTreeProps } from "antd/lib/tree"; import type TreeSelect from "antd/lib/tree-select"; import { TextProps } from "antd/lib/typography/Text"; import { DraggerProps, UploadProps } from "antd/lib/upload"; import React, { ForwardRefExoticComponent, PropsWithChildren, PropsWithoutRef, ReactChild, ReactNode, ReactPortal, RefAttributes } from "react"; import { SerializableObject } from "../utils/tower"; /** * 在 React 18 之前,ReactNode 包含 `{}` 类型,导致任意 object 都可以赋值给它, * 存在类型安全漏洞。SafeReactNode 排除了 `{}`,同时保留了 ReactNode 的其他全部能力。 * * @see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210 */ export interface SafeReactNodeArray extends Array { } export type SafeReactNode = ReactChild | SafeReactNodeArray | ReactPortal | boolean | null | undefined; export type AntdTableComponentType = (props: AntdTableProps) => JSX.Element; export type AntdTreeSelectComponentType = TreeSelect; interface EmptyType extends React.FC { PRESENTED_IMAGE_DEFAULT: React.ReactNode; PRESENTED_IMAGE_SIMPLE: React.ReactNode; } export interface CollapseInterface extends React.FC { Panel: React.FC; } type Primitive = "Int" | "Float" | "DateTime" | "Enum" | "String" | "Boolean"; export type Child = { type: Exclude; } | { type: "Enum"; enumValues: readonly string[]; }; interface OptionProps { value: React.ReactText; disabled?: boolean; key?: string; hidden?: boolean; label?: string; className?: string; object?: SerializableObject; title?: string; } export type TableScroll = string | number | boolean; export interface FloatProps { placeholder?: string; suffix?: string; size?: InputSize; onBlur?: (input: FieldBaseProps["input"], event?: React.FocusEvent) => void; } export type DateTimeRangeProps = DatePickerProps; export type IntegerFieldProps = FieldBaseProps & InputNumberProps & { onChange?: FieldBaseProps["input"]["onChange"]; controls?: boolean; suffix?: string; prefix?: string; size?: InputSize; onBlur?: (input: FieldBaseProps["input"], event?: React.FocusEvent) => void; }; export type FloatFieldProps = FieldBaseProps & FloatProps & { onChange?: FieldBaseProps["input"]["onChange"]; autoComplete?: "on" | "off"; }; export type AntdInputComponentType = Input; export interface IExpandableItemProps { header?: React.ReactNode; order?: number; disableExpand?: boolean; defaultActive?: boolean; } export interface Kit { loading: LoadingComponentType; error: React.FunctionComponent<{ error: unknown; }>; pagination: React.FC; legacySelect: LegacySelectComponentType; select: SelectComponentType; option: OptionComponentType; selectOptGroup: import("rc-select/lib/OptGroup").OptionGroupFC; table: TableComponent; button: React.FC; legacyModal: React.FC; dropdown: React.FC; switch: React.FC; tooltip: React.FC; input: React.FC; textArea: React.FC; checkbox: React.FC; fields: { Int: React.FunctionComponent>; Integer: React.FunctionComponent>; Float: React.FunctionComponent>; DateTime: React.FunctionComponent>; Enum: React.FunctionComponent<{ input: Partial["input"]>; meta: FieldRenderProps["meta"]; disabled?: boolean; className?: string; dropdownClassName?: string; } & BaseEnumProps>; String: React.FunctionComponent & StringProps>; Boolean: React.FunctionComponent>; TextArea: React.FC & TextAreaProps>; DateTimeRange: React.FunctionComponent & DatePickerProps>; TimePicker: React.FunctionComponent & TimePickerProps>; }; units: { Percent: PercentFn; Byte: UnitFn; BytePerSecond: UnitFn; Frequency: UnitFn; Speed: UnitFn; Second: UnitFn; Bps: UnitFn; BitPerSecond: UnitFn; Bit: UnitFn; }; inputGroup: InputGroupComponentType; Empty: React.ReactElement | null; alert: AlertComponentType; searchInput: React.FC; badge: BadgeComponentType; radio: React.FC; radioGroup: React.FC; radioButton: React.FC; tree: React.FC; DeprecatedProgress: React.FC; divider: React.FC; skeleton: React.FC; skeletonButton: { (props: SkeletonButtonProps): JSX.Element; defaultProps: { size: string; }; }; menu: React.ComponentType & { Divider: React.FC; Item: React.ComponentType; SubMenu: React.ComponentType; ItemGroup: React.ComponentType; }; menuItem: React.ComponentType; menuItemGroup: React.ComponentType; list: (props: ListProps) => JSX.Element; listItem: React.FC; layout: React.ComponentType & { Header: React.ComponentType; Footer: React.ComponentType; Content: React.ComponentType; Sider: React.ComponentType; }; autoComplete: React.ForwardRefExoticComponent; message: MessageApi; tag: TagComponentType; popover: React.ForwardRefExoticComponent>; arch: ArchComponentType; buttonGroup: React.ForwardRefExoticComponent>; steps: React.FC; form: Form; antdSteps: typeof Steps; simplePagination: React.FC; statusCapsule: StatusCapsuleComponentType; space: React.FC; timeZoneSelect: React.FC; col: React.FC; row: React.FC; timeline: React.FC; timelineItem: React.FC; checkboxGroup: React.ComponentType; typographyText: React.FC; upload: React.ComponentType; datePickerRangePicker: React.ComponentType; tableForm: React.ForwardRefExoticComponent>; token: TokenComponentType; overflowTooltip: React.FC; I18nNameTag: React.FC; uploadDragger: React.ComponentType; calendar: CalendarComponentType; timePicker: React.FC; datePicker: React.ComponentType; tabs: React.FC; tabsTabPane: React.FC; antdBadge: React.FC; antdMessage: MessageApi; antdButton: React.ComponentType; antdSelect: React.ComponentType>; antdTooltip: React.FC; antdModal: React.FC; antdInput: typeof Input; antdTable: AntdTableComponentType; antdEmpty: EmptyType; antdCheckbox: React.ComponentType; antdSwitch: React.FC; antdCollapse: CollapseInterface; antdTreeSelect: typeof TreeSelect; antdDrawer: React.FC; truncate: React.FC; card: ForwardRefExoticComponent> & RefAttributes>; expandableList: { ExpandableContainer: React.FC>; ExpandableItem: React.FC>; }; time: React.FC; DropdownTransition: React.FC; AccordionCard: React.FC & { CloseButton: React.FC; }; DetailCard: React.FC; Counting: React.FC; Breadcrumb: React.FC; CircleProgress: React.FC; SwitchWithText: React.FC; CronPlan: React.FC; NamesTooltip: React.FC; ChartWithTooltip: React.FC; ChartWithUnit: React.FC; DonutChart: React.FC; DeprecatedDonutChart: React.FC; UnitWithChart: React.FC; GoBackButton: React.FC; CronCalendar: React.FC; SummaryTable: SummaryTableComponentType; SortableList: SortableListComponentType; SidebarSubtitle: SidebarSubtitleComponentType; Link: LinkComponentType; DropdownMenu: React.FC; BatchOperation: React.FC; DateRangePicker: React.FC; SegmentedControl: React.FC; } export type OptionComponentType = React.FC & { isSelectOption: boolean; }; export type TableFormPropsType = React.ForwardRefExoticComponent>; export {};