import * as React from 'react'; export interface ShorthandConfig { mappedProp?: keyof TProps; mappedArrayProp?: keyof TProps; allowsJSX?: boolean; } export type PropsOfElement | ComponentWithAs> = E extends { __PRIVATE_PROPS: any; } ? E['__PRIVATE_PROPS'] : JSX.LibraryManagedAttributes>; export type ComponentWithAs = ((props: Omit, 'as' | keyof TProps> & { as?: TExtendedElementType; } & TProps) => JSX.Element) & { propTypes?: React.WeakValidationMap & { as: React.Requireable any) | (new (props: any, context?: any) => any)>; }; contextTypes?: React.ValidationMap; defaultProps?: Partial; displayName?: string; /** * A hack to simplify the resolution for ComponentWithAs. * @see https://github.com/microsoft/fluentui/pull/13841 */ readonly __PRIVATE_PROPS?: Omit, 'as' | keyof TProps> & { as?: TElementType; } & TProps; }; export type ForwardRefWithAs = ((props: React.RefAttributes & Omit, 'as' | keyof TProps> & { as?: TExtendedElementType; } & TProps) => JSX.Element) & { propTypes?: React.WeakValidationMap & { as: React.Requireable any) | (new (props: any, context?: any) => any)>; }; contextTypes?: React.ValidationMap; defaultProps?: Partial; displayName?: string; /** * A hack to simplify the resolution for ComponentWithAs. * @see https://github.com/microsoft/fluentui/pull/13841 */ readonly __PRIVATE_PROPS?: React.RefAttributes & Omit, 'as' | keyof TProps> & { as?: TElementType; } & TProps; }; export type ComposedComponent = React.FunctionComponent & { fluentComposeConfig: Required; }; export type InputComposeComponent = React.FunctionComponent & { fluentComposeConfig?: Required; }; export type Input = InputComposeComponent | ComposeRenderFunction; export type ComposeRenderFunction = (props: TProps, ref: React.Ref, options: ComposePreparedOptions & { state: any; }) => React.ReactElement | null; export type ComposeOptions = { className?: string; classes?: ClassDictionary | ClassFunction | (ClassDictionary | ClassFunction)[]; displayName?: string; mapPropsToStylesProps?: (props: TParentStylesProps & TInputProps) => TInputStylesProps; defaultProps?: Partial; handledProps?: (keyof TInputProps | 'as')[]; overrideStyles?: boolean; slots?: Record; slotProps?: (props: TParentProps & TInputProps) => Record; shorthandConfig?: ShorthandConfig; state?: (props: TState, ref: React.Ref, options: ComposePreparedOptions) => any; }; export type MergePropsResult = { state: TState; slots: TSlots; slotProps: TSlotProps; }; /** * Generic name to any dictionary. */ export type GenericDictionary = Record; /** * Generic set of module to class name map. */ export type ClassDictionary = Record; /** * Generic class resolver function type. */ export type ClassFunction = (state: GenericDictionary, slots: GenericDictionary) => ClassDictionary; /** * Merged ComposeOptions. */ export type ComposePreparedOptions = { className: string; classes: (undefined | ClassDictionary | ClassFunction)[]; displayName: string; displayNames: string[]; mapPropsToStylesPropsChain: ((props: object) => object)[]; render: ComposeRenderFunction; defaultProps: Partial; handledProps: (keyof TProps | 'as')[]; overrideStyles: boolean; slots: Record & { __self: React.ElementType; }; slotProps: ((props: TProps) => Record)[]; state: (props: TParentState, ref: React.Ref, options: ComposePreparedOptions) => TInputState; resolveSlotProps: (props: TResolvedProps) => Record; shorthandConfig: ShorthandConfig; }; export interface ComponentProps { as?: React.ElementType; className?: string; } export interface BaseSlots { root: React.ElementType; } export type SlotProps> = { [key in keyof Omit]: key extends keyof TProps ? TProps[key] : any; } & { root: TRootProps; }; export type SlotPropRenderFunction = (Component: React.ElementType, props: TProps) => React.ReactNode; export type ObjectSlotProp = TProps & { children?: TProps['children'] | SlotPropRenderFunction; }; export type SlotProp = React.ReactChild | React.ReactNode[] | React.ReactPortal | boolean | null | undefined | ObjectSlotProp; export declare const defaultComposeOptions: Required; /** * A set of mapped props for intrinsic element types. */ export declare const defaultMappedProps: Record; /** * React.ForwardRef with static props */ export type ForwardRefComponent = React.ForwardRefExoticComponent> & { handledProps: (keyof TProps)[]; };