import type { ComponentType } from "react"; import React from "react"; import { CompositionStore } from "./domain/CompositionStore.js"; import type { ComposeWith, Decoratable, DecoratableComponent, DecoratableHook, Decorator, Enumerable, GenericComponent, GenericHook } from "./types.js"; export declare function compose(...fns: Decorator[]): (decoratee: T) => T; /** * @deprecated Use `Decorator` instead. */ export interface HigherOrderComponent { (Component: GenericComponent): GenericComponent; } export type DecoratableTypes = DecoratableComponent | DecoratableHook; export type DecoratorsTuple = [Decoratable, Decorator[]]; export type DecoratorsCollection = Array; interface CompositionProviderProps { decorators?: DecoratorsCollection; children: React.ReactNode; } export declare const CompositionProvider: ({ decorators, children }: CompositionProviderProps) => React.JSX.Element; export declare function useCompositionStore(): CompositionStore; export declare function useOptionalCompositionStore(): CompositionStore | undefined; export declare function useComponent(baseFunction: T): T; interface CompositionContextValue { composeComponent(component: ComponentType, hocs: Enumerable, scope?: string, inherit?: boolean): () => void; getComponent(component: ComponentType, scope: string[]): GenericComponent | GenericHook | undefined; } /** * This hook will throw an error if composition context doesn't exist. */ export declare function useComposition(): CompositionContextValue; /** * This hook will not throw an error if composition context doesn't exist. */ export declare function useOptionalComposition(): CompositionContextValue | undefined; export {};