import * as React from 'react'; export interface ShorthandConfig { mappedProp?: keyof TProps; mappedArrayProp?: keyof TProps; allowsJSX?: boolean; } export declare type PropsOfElement | ComponentWithAs> = E extends { __PRIVATE_PROPS: any; } ? E['__PRIVATE_PROPS'] : JSX.LibraryManagedAttributes>; export declare 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 declare type ComposedComponent = React.FunctionComponent & { fluentComposeConfig: Required; }; export declare type InputComposeComponent = React.FunctionComponent & { fluentComposeConfig?: Required; }; export declare type Input = InputComposeComponent | ComposeRenderFunction; export declare type ComposeRenderFunction = (props: TProps, ref: React.Ref, options: ComposePreparedOptions & { state: any; }) => React.ReactElement | null; export declare type ComposeOptions = { className?: string; classes?: ClassDictionary | ClassFunction | (ClassDictionary | ClassFunction)[]; displayName?: string; mapPropsToStylesProps?: (props: TParentStylesProps & TInputProps) => TInputStylesProps; 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 declare type MergePropsResult = { state: TState; slots: TSlots; slotProps: TSlotProps; }; /** * Generic name to any dictionary. */ export declare type GenericDictionary = Record; /** * Generic set of module to class name map. */ export declare type ClassDictionary = Record; /** * Generic class resolver function type. */ export declare type ClassFunction = (state: GenericDictionary, slots: GenericDictionary) => ClassDictionary; /** * Merged ComposeOptions. */ export declare type ComposePreparedOptions = { className: string; classes: (undefined | ClassDictionary | ClassFunction)[]; displayName: string; displayNames: string[]; mapPropsToStylesPropsChain: ((props: object) => object)[]; render: ComposeRenderFunction; 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 declare type SlotProps> = { [key in keyof Omit]: key extends keyof TProps ? TProps[key] : any; } & { root: TRootProps; }; export declare type SlotPropRenderFunction = (Component: React.ElementType, props: TProps) => React.ReactNode; export declare type ObjectSlotProp = TProps & { children?: TProps['children'] | SlotPropRenderFunction; }; export declare type SlotProp = React.ReactChild | React.ReactNodeArray | React.ReactPortal | boolean | null | undefined | ObjectSlotProp;