import { ComponentClass, ReactElement, Ref, RefObject } from "react"; /** * A higher-order component (HOC) that creates a provider class for a given React component. * * @template ComponentProps - The props type for the wrapped component. * @template ComponentInstance - The instance type of the wrapped component. * @template ProviderOpenProps - The type of the props passed to the open method of the provider. * @param Component - The React component class to be wrapped as a provider. * @param defaultRenderProps - Optional default props to be passed to the component. * @param openProviderOptionMutator - Optional function to mutate the open options before passing them to the provider. * * @returns A new provider class that extends the original component. * * @example * const MyProvider = createProvider(MyComponent, { defaultProp: 'value' }); * * // Usage in a component * * MyProvider.getProviderInstance(myRef)?.someMethod(); */ export declare function createProvider(Component: ComponentClass, defaultRenderProps?: ComponentProps, openProviderOptionMutator?: (options: ProviderOpenProps) => ProviderOpenProps): { new (props: ComponentProps, context?: any): { context: unknown; setState(state: any, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; render(): import("react").ReactNode; readonly props: Readonly; state: Readonly; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly): any; componentDidUpdate?(prevProps: Readonly, prevState: Readonly, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; }; _innerClassProviderRef?: RefObject; /** * Opens the provider component with the specified properties and optional callback. * * This static method retrieves the instance of the provider component and calls its open method. * It allows for customization of the provider component through the provided properties. * * @param options - The properties to customize the provider component. * @param innerProviderRef - An optional reference to access the instance of the provider component. * @param callback - An optional callback function that is called after opening the provider component. * * @returns The result of the open method on the provider component, or undefined if the instance is not valid. * * @example * MyProvider.open({ someProp: 'value' }, myRef, () => { * console.log('Provider opened'); * }); */ open(options: ProviderOpenProps, innerProviderRef?: any, callback?: Function): any; /** * Closes the provider component with the specified properties and optional callback. * * This static method retrieves the instance of the provider component and calls its close method. * It allows for any necessary cleanup to be performed on the provider component. * * @param callback - An optional callback function that is called after closing the provider component. * @param innerProviderRef - An optional reference to access the instance of the provider component. * * @returns The result of the close method on the provider component, or undefined if the instance is not valid. * * @example * MyProvider.close(myRef, () => { * console.log('Provider closed'); * }); */ close(callback?: Function, innerProviderRef?: any): any; /** * A forward ref component that allows access to the provider's instance. * * @param props - The props passed to the wrapped component. * @param ref - A ref that can be used to access the component instance. * * @returns A React element with the passed props and ref. * * @example * */ Provider(props?: ComponentProps, ref?: Ref): ReactElement; /** * Retrieves the instance of the provider component. * * @param innerProviderRef - An optional ref or instance of the provider component. * * @returns The instance of the provider component if it exists, otherwise null. * * @example * const instance = this.getProviderInstance(myRef); * if (instance) { * instance.someMethod(); * } */ getProviderInstance(innerProviderRef?: ComponentInstance | RefObject): ComponentInstance | null; propTypes?: any; contextType?: import("react").Context | undefined; defaultProps?: Partial | undefined; displayName?: string | undefined; getDerivedStateFromProps?: import("react").GetDerivedStateFromProps | undefined; getDerivedStateFromError?: import("react").GetDerivedStateFromError | undefined; };