import type React from 'react'; /** https://github.com/Microsoft/TypeScript/issues/29729 */ export type LiteralUnion = T | (string & {}); export type AnyObject = Record; export type CustomComponent

= React.ComponentType

| string; /** * Get component props * @example * ```ts * import { Checkbox } from 'antd' * import type { GetProps } from 'antd'; * * type CheckboxGroupProps = GetProps * ``` * @since 5.13.0 */ export type GetProps | object> = T extends React.ComponentType ? P : T extends object ? T : never; /** * Get component props by component name * @example * ```ts * import { Select } from 'antd'; * import type { GetProp, SelectProps } from 'antd'; * * type SelectOption1 = GetProp[number]; * // or * type SelectOption2 = GetProp[number]; * * const onChange: GetProp = (value, option) => { * // Do something * }; * ``` * @since 5.13.0 */ export type GetProp | object, PropName extends keyof GetProps> = NonNullable[PropName]>; type ReactRefComponent | string; }> = (props: Props) => React.ReactNode; type ExtractRefAttributesRef = T extends React.RefAttributes ? P : never; /** * Get component ref * @example * ```ts * import { Input } from 'antd'; * import type { GetRef } from 'antd'; * * type InputRef = GetRef; * ``` * @since 5.13.0 */ export type GetRef | React.Component> = T extends React.Component ? T : T extends React.ComponentType ? ExtractRefAttributesRef

: never; export type GetContextProps = T extends React.Context ? P : never; export type GetContextProp, PropName extends keyof GetContextProps> = NonNullable[PropName]>; export {};