import type { ComponentType, FC, PropsWithChildren } from 'react';
import type { RicosEditorAPI } from '../../ricos-types/index.js';
type RicosEditorApiContextValue = {
    ricosEditorApi: RicosEditorAPI | null;
    setRicosEditorApi: (api: RicosEditorAPI | null) => void;
};
export declare const RicosEditorApiContext: import("../use-context-selector.js").Context<RicosEditorApiContextValue>;
/**
 * Provides a context slot for sharing the imperative `RicosEditor` API with
 * descendants. The wrapped `RicosEditor` self-registers into this slot on
 * mount, so descendants can read it via `useRicosEditorApi()` without prop
 * drilling or rolling their own context.
 *
 * **The provider must wrap exactly one `<RicosEditor>` underneath. Two or
 * more editors will race on the shared slot — the last to mount wins, and
 * the context will silently point at the wrong instance. Or the sky will
 * fall.**
 */
export declare const RicosEditorApiProvider: FC<PropsWithChildren>;
/**
 * Returns the current `RicosEditorAPI` from the nearest `RicosEditorApiProvider`,
 * or `null` if no provider is mounted or the editor has not finished mounting yet.
 *
 * Selector-based subscription — only re-renders when the API instance itself
 * changes (`null` → instance, instance → `null`).
 */
export declare const useRicosEditorApi: () => RicosEditorAPI | null;
/** @internal — used by `<RicosEditor>` to register itself into the context. */
export declare const useSetRicosEditorApi: () => ((api: RicosEditorAPI | null) => void);
/**
 * HOC that injects the current `RicosEditorAPI` (or `null`) as an `editor`
 * prop. Useful when migrating class components off the legacy
 * `withEditorContext` HOC.
 */
export declare const withRicosEditorApi: <P extends object>(Component: ComponentType<P & {
    editor: RicosEditorAPI | null;
}>) => FC<P>;
export {};
//# sourceMappingURL=ricos-editor-api-context.d.ts.map