import type { BasePluginDependenciesAPI, EditorInjectionAPI, ExtractInjectionAPI, ExtractPluginSharedState, NextEditorPlugin, NextEditorPluginMetadata } from '../types/next-editor-plugin';
export type NamedPluginStatesFromInjectionAPI<API extends ExtractInjectionAPI<NextEditorPlugin<any, any>>, PluginNames extends string | number | symbol> = Readonly<{
    [K in PluginNames as `${K extends string ? K : never}State`]: API[K] extends BasePluginDependenciesAPI<any> | undefined ? Exclude<API[K], undefined> extends BasePluginDependenciesAPI<infer Metadata> ? Metadata extends NextEditorPluginMetadata ? ExtractPluginSharedState<Metadata> | undefined : never : never : never;
}>;
export type ExtractPluginNames<API extends EditorInjectionAPI<any, any>> = keyof API;
/**
 *
 * ⚠️⚠️⚠️ This is a debounced hook ⚠️⚠️⚠️
 * If the plugins you are listening to generate multiple shared states while the user is typing,
 * your React Component will get only the last one.
 *
 * Used to return the current plugin state of input dependencies.
 *
 * @example
 * Example in plugin:
 *
 * ```typescript
 * function selector(states: NamedPluginStatesFromInjectionAPI<API, ['dog']>) {
 *  return {
 *   title: states.dogState?.title,
 *  }
 * }
 *
 * function ExampleContent({ api }: Props) {
 *   const { title } = useSharedPluginStateWithSelector(
 *     api,
 *     ['dog'],
 *     selector
 *   )
 *   return <p>{ title }</p>
 * }
 *
 * ```
 *
 * @param injectionApi Plugin injection API from `NextEditorPlugin`
 * @param plugins Plugin names to get the shared plugin state for
 * @param selector A function that takes the shared states of the plugins and returns a subset of a plugin state.
 * @returns A corresponding object, the keys are names of the plugin with `State` appended,
 * the values are the shared state exposed by that plugin.
 */
export declare function useSharedPluginStateWithSelector<API extends EditorInjectionAPI<any, any>, PluginNames extends ExtractPluginNames<API>, PluginStates extends NamedPluginStatesFromInjectionAPI<API, PluginNames>, SelectorResult>(injectionApi: API | null | undefined, plugins: PluginNames[], selector: (states: PluginStates) => SelectorResult): SelectorResult;
