import type { any, array, bool, func, number, object, string, node, element, symbol, elementType, instanceOf, oneOf, oneOfType, arrayOf, objectOf, shape, exact, ValidationMap } from 'prop-types'; import type React from 'react'; export interface ReactDescObjT { [key: string]: unknown; required?: boolean; deprecated?: Record; description?: string; defaultValue?: unknown; format?: string; signature?: string; warned?: boolean; isRequiredIf?: (props: any) => boolean; group?: Record; } export type InstanceOfT = typeof instanceOf; export type OneOfT = typeof oneOf; export type ObjectOfT = typeof objectOf; export type ExactT = typeof exact; export type OneOfTypeT = typeof oneOfType; export type ArrayOfT = typeof arrayOf; export type ShapeT = typeof shape; export type AnyT = typeof any; export type ArrayT = typeof array; export type BoolT = typeof bool; export type FuncT = typeof func; export type NumberT = typeof number; export type ObjectT = typeof object; export type StringT = typeof string; export type NodeT = typeof node; export type ElementT = typeof element; export type SymbolT = typeof symbol; export type ElementTypeT = typeof elementType; export type ParametizedPropTypes = InstanceOfT | OneOfT | ObjectOfT | ExactT | OneOfTypeT | ArrayOfT | ShapeT; export type AllPropTypes = AnyT | ArrayT | BoolT | FuncT | NumberT | ObjectT | StringT | NodeT | ElementT | SymbolT | ElementTypeT | ParametizedPropTypes; export type PropTypesTypes = 'any' | 'array' | 'bool' | 'func' | 'number' | 'object' | 'string' | 'node' | 'element' | 'symbol' | 'elementType' | 'instanceOf' | 'oneOf' | 'oneOfType' | 'arrayOf' | 'objectOf' | 'shape' | 'exact' | 'tuple'; export interface ReactDescT { [key: string]: unknown; type: PropTypesTypes; defaultValue: (this: ReactDescT, dfault: unknown) => ReactDescT; deprecated: (this: ReactDescT, info: Record) => ReactDescT; description: (this: ReactDescT, descr: string) => ReactDescT; format: (this: ReactDescT, format: string) => ReactDescT; signature: (this: ReactDescT, format: string) => ReactDescT; hidden: (this: ReactDescT) => ReactDescT; dataTestId: (this: ReactDescT) => ReactDescT; global: (this: ReactDescT) => ReactDescT; xstyled: (this: ReactDescT) => ReactDescT; omitValidation: (this: ReactDescT) => ReactDescT; isRequired: ReactDescT; isRequiredIf: (this: ReactDescT, isRequiredIf: (props: any) => boolean) => ReactDescT; reactDesc: ReactDescObjT; args?: ReactDescT | ReactDescT[] | Record | unknown[] | Parameters[0] | Parameters[0] | Parameters[0] | Parameters[0]; } export interface ComponentDocumentation { propTypes: Record; availableAt?: unknown; description?: string; details?: unknown; deprecated?: unknown; usage?: unknown; intrinsicElement?: unknown; toTypescript?: unknown; } export interface TypescriptDocumentation extends Partial { name: string; description: string; properties: { name: string; required?: boolean | undefined; deprecated?: Record | undefined; description?: string; format?: string; signature?: string; warned?: boolean; defaultValue?: unknown; isRequiredIf?: (props: any) => boolean; omitValidation?: boolean; }[]; } export type DocumentedReactComponent = React.ComponentType & { availableAt: unknown; description: (descr: string) => DocumentedReactComponent; details: unknown; deprecated: unknown; usage: unknown; intrinsicElement: unknown; toTypescript: () => TypescriptDocumentation; propTypesValue: ValidationMap>; }; export type Hook = ((props: T) => S) & { displayName?: string; name?: string; }; export type DocumentedPropType = ReactDescT; export type PropTypesObj = { any: DocumentedPropType; array: DocumentedPropType; bool: DocumentedPropType; func: DocumentedPropType; number: DocumentedPropType; object: DocumentedPropType; string: DocumentedPropType; node: DocumentedPropType; element: DocumentedPropType; symbol: DocumentedPropType; elementType: DocumentedPropType; instanceOf: (cls: unknown) => DocumentedPropType; oneOf: (arr: unknown[]) => DocumentedPropType; oneOfType: (arr: DocumentedPropType[]) => DocumentedPropType; arrayOf: (smth: DocumentedPropType) => DocumentedPropType; objectOf: (smth: DocumentedPropType) => DocumentedPropType; shape: (obj: Record) => DocumentedPropType; exact: (obj: Record) => DocumentedPropType; tuple: (arr: DocumentedPropType[]) => DocumentedPropType; }; export type DSPropTypesSchema = Required<{ [key in keyof T]: ReactDescT; }>;