import type { ComponentType, ReactElement } from 'react';
import type { PmConverters } from '../pm-converters/collect.js';
import type { IEditorQuery } from '../ricos-content-query/index.js';
import type { ModalService } from '../ricos-modals/index.js';
import type { RicosStyles } from '../ricos-styles/styles.js';
import type { Editor } from '../tiptap/core/index';
import type { Node as TiptapNode } from '../tiptap/pm/model';
import type { TFunction } from './common-types.js';
import type { PublicCommands } from './editor-commands-type.js';
import type { TiptapEditor } from './editor.js';
import type { AmbientStyles } from './styles.js';
export type IToolbarItem = {
    id: string;
    type: 'toggle' | 'modal' | 'separator' | 'dropdown' | 'custom' | 'color';
    presentation: Record<string, any>;
    attributes: Record<string, any>;
    commands: Record<string, (...args: any) => any>;
};
export type Resolver<T = unknown> = (content: TiptapNode[], services: {
    converters: PmConverters;
    styles: RicosStyles;
    getEditorQuery: () => IEditorQuery;
    editor: null | Editor;
    modals?: ModalService;
}, editor?: Editor) => T;
type Modify<T, R> = Omit<T, keyof R> & R;
export type TiptapCommand = (args: {
    attributes: any;
    publicCommands: PublicCommands;
    tiptapEditor: Editor;
    editorQuery: IEditorQuery;
}) => (args: $TSFixMe) => void;
export type ToolbarItemAttributes = Record<string, Resolver>;
export type IToolbarItemConfigTiptap = Modify<IToolbarItem, {
    attributes: ToolbarItemAttributes;
    commands: Record<string, TiptapCommand>;
}>;
export type PluginToolbarButtonConfig = Modify<IToolbarItem, {
    attributes: ToolbarItemAttributes;
    commands: Record<string, (args: {
        [key: string]: any;
        publicCommands: PublicCommands;
        tiptapEditor: Editor;
        attributes: $TSFixMe;
        value?: $TSFixMe;
    }) => void>;
}>;
export type TextButton<P = unknown> = {
    id: string;
    type: 'separator';
    presentation: {
        icon: ComponentType;
    };
    attributes: Record<string, string | Resolver>;
} | {
    id: string;
    type: 'toggle';
    presentation: Presentation & {
        tooltipShortcut?: {
            MacOS: string;
            Windows: string;
        };
    };
    attributes: Record<string, string | Resolver>;
    command: TextButtonCommand<P>;
} | {
    id: string;
    type: 'modal';
    presentation: Presentation;
    attributes: Record<string, string | Resolver>;
    command: TextButtonCommand<P>;
} | {
    id: string;
    type: 'dropdown';
    presentation: Presentation & {
        id: string;
        Component: React.ComponentType<P>;
        getComponentProps: (args: {
            publicCommands: PublicCommands;
            t: TFunction;
            modals: ModalService;
            styles: AmbientStyles;
            editor: TiptapEditor;
        }) => P;
    };
    command: TextButtonCommand<P>;
    attributes: Record<string, string | Resolver>;
};
type PresentationBase = {
    dataHook: string;
    tooltip: string;
    renderer?: (toolbarItem: IToolbarItem) => ReactElement;
};
type Presentation = (PresentationBase & {
    icon: ComponentType;
}) | (PresentationBase & {
    getIcon: (params: {
        publicCommands: PublicCommands;
        t: TFunction;
    }) => ComponentType;
});
export type TextButtonCommand<P> = (params: {
    publicCommands: PublicCommands;
    editor: TiptapEditor;
    modalService: ModalService;
    editorQuery: IEditorQuery;
    referenceElement?: HTMLElement | null;
    isMobile: boolean;
    componentProps: P | undefined;
}) => (args: Record<string, any>) => boolean;
export {};
//# sourceMappingURL=toolbar-types.d.ts.map