import type { ComponentType } from 'react';
import type { ResizerOptions } from '../ricos-common-plugins/resizable/react-resizer.js';
import type { ComponentData } from '../ricos-content/index.js';
import type { Decoration_Type } from '@wix/ricos/schema';
import type { ExtensionConfig, MarkConfig, NodeConfig, NodeViewRendererProps, isMarkActive as isMarkActiveFn, mergeAttributes as mergeAttributesFn } from '../tiptap/index';
import type { markInputRule as markInputRuleFn, markPasteRule as markPasteRuleFn, textblockTypeInputRule as textblockTypeInputRuleFn } from '../tiptap/core/index';
import type { Node as ProsemirrorNode } from '../tiptap/pm/model';
import type { Plugin as IPlugin, PluginKey as IPluginKey, Selection } from '../tiptap/pm/state';
import type { Editor, NodeViewContent } from '../tiptap/react';
import type { TiptapAdapterServices } from '../tiptap-editor/initialize-tiptap-adapter.js';
import type { TFunction } from './common-types.js';
import type { LinkSettings, ReactNodeViewRendererOptions, RicosTheme, TextAlignment } from './index.js';
import type { LegacyEditorPluginConfig, Node_Type } from './plugin-types.js';
export type PluginProps = NodeViewRendererProps & {
    settings: LegacyEditorPluginConfig;
    componentData: ComponentData;
    updateAttributes: (data: unknown) => null;
    selected: boolean;
    NodeViewContent: typeof NodeViewContent;
};
export type RicosNodeProps = NodeViewRendererProps & RicosTiptapContextValue & {
    componentData: NodeViewRendererProps['node']['attrs'];
};
export type TiptapExtensionConfig = NodeConfig | MarkConfig | RicosExtensionConfig;
export type NodeHoc<T = any> = (Component: ComponentType<T>) => ComponentType<T>;
export type RicosTiptapContextValue = {
    context: {
        t?: TFunction;
    };
};
export interface RicosExtensionConfig<Options = any, Storage = any> extends ExtensionConfig<Options, Storage> {
    addNodeHoc?: () => NodeHocDescriptor;
}
export type NodeHocDescriptor = {
    nodeTypes: string[];
    getNodeHoc: (extension: RicosExtension) => NodeHoc;
    priority: number;
};
export type Group = 'text' | 'spoilerable' | 'shortcuts-enabled' | 'overlay' | 'custom-styles' | 'resizable' | {
    group: 'resizable';
    options: ResizerOptions;
} | 'draggable' | 'no-trailing-node' | 'node-container' | 'footer-disabled' | 'hide-selection' | 'not-overtypable';
type GroupKeysExtractor<T> = T extends string ? T : T extends {
    group: infer U;
} ? U : never;
type GroupKeys = GroupKeysExtractor<Group>;
export declare const includesGroup: (groups: Group[], groupName: GroupKeys) => boolean;
export type RicosNodeExtension<Options = any, Storage = any> = ReactRicosNodeExtension<Options, Storage> | HtmlRicosNodeExtension<Options, Storage>;
export type RicosNodeExtensionBase<NodeType, Options = any, Storage = any> = {
    name: Node_Type | string;
    groups: Group[];
    settings?: Record<string, unknown>;
    reconfigure?: (this: Exclude<RicosNodeExtensionBase<NodeType, Options, Storage>, 'reconfigure' | 'createExtensionConfig'>, config: NodeConfig<Options, Storage>, extensions: RicosExtension[], ricosProps: ExtensionProps, settings: Record<string, unknown>, services: TiptapAdapterServices) => NodeConfig<Options, Storage>;
    createExtensionConfig: (this: Exclude<RicosNodeExtensionBase<NodeType, Options, Storage>, 'reconfigure' | 'createExtensionConfig'>, { textblockTypeInputRule, mergeAttributes, markPasteRule, markInputRule, Plugin, PluginKey }: {
        textblockTypeInputRule: typeof textblockTypeInputRuleFn;
        mergeAttributes: typeof mergeAttributesFn;
        markPasteRule: typeof markPasteRuleFn;
        markInputRule: typeof markInputRuleFn;
        Plugin: typeof IPlugin;
        PluginKey: typeof IPluginKey;
    }) => NodeConfig<Options, Storage>;
    placeholder?: ExtensionPlaceholder;
} & NodeType;
type ReactRicosNode = {
    type: 'react-node';
    Component: ComponentType<PluginProps>;
    renderingOptions?: Partial<ReactNodeViewRendererOptions>;
};
export type ReactRicosNodeExtension<Options = any, Storage = any> = RicosNodeExtensionBase<ReactRicosNode, Options, Storage>;
type HTMLRicosNode = {
    type: 'html-node';
};
export type HtmlRicosNodeExtension<Options = any, Storage = any> = RicosNodeExtensionBase<HTMLRicosNode, Options, Storage>;
export type Mark_Type = Exclude<`${Decoration_Type}`, 'COLOR'> | 'COLOR_BACKGROUND' | 'COLOR_FOREGROUND' | 'HASHTAG';
export declare const Mark_Type: {
    [key in Mark_Type]: Mark_Type;
};
export type RicosMarkExtension<Options = any, Storage = any> = {
    name: Mark_Type;
    type: 'mark';
    groups: Group[];
    settings?: Record<string, unknown>;
    reconfigure?: (this: Exclude<RicosMarkExtension<Options, Storage>, 'reconfigure' | 'createExtensionConfig'>, config: MarkConfig<Options, Storage>, extensions: RicosExtension[], ricosProps: ExtensionProps, settings: Record<string, unknown>, services: TiptapAdapterServices) => MarkConfig<Options, Storage>;
    createExtensionConfig: (this: Exclude<RicosMarkExtension<Options, Storage>, 'reconfigure' | 'createExtensionConfig'>, { isMarkActive, textblockTypeInputRule, mergeAttributes, markPasteRule, markInputRule, Plugin, PluginKey }: {
        isMarkActive: typeof isMarkActiveFn;
        textblockTypeInputRule: typeof textblockTypeInputRuleFn;
        mergeAttributes: typeof mergeAttributesFn;
        markPasteRule: typeof markPasteRuleFn;
        markInputRule: typeof markInputRuleFn;
        Plugin: typeof IPlugin;
        PluginKey: typeof IPluginKey;
    }) => MarkConfig<Options, Storage>;
};
export type ExtensionPlaceholder = {
    predicate: (PlaceholderProps: {
        doc: ProsemirrorNode;
        node: ProsemirrorNode;
        selection: Selection;
        pos: number;
        editor: Editor;
        isMobile?: boolean;
    }) => boolean;
    priority?: number;
    content: string;
    alwaysVisible?: boolean;
    alignCenter?: boolean;
};
export type RicosFunctionalExtension<Options = any, Storage = any> = {
    name: string;
    type: 'extension';
    groups: Group[];
    placeholder?: ExtensionPlaceholder;
    settings?: Record<string, unknown>;
    reconfigure?: (this: Exclude<RicosFunctionalExtension<Options, Storage>, 'reconfigure' | 'createExtensionConfig'>, config: RicosExtensionConfig<Options, Storage>, extensions: RicosExtension[], ricosProps: ExtensionProps, settings: Record<string, unknown>, services: TiptapAdapterServices) => RicosExtensionConfig<Options, Storage>;
    createExtensionConfig: (this: Exclude<RicosFunctionalExtension<Options, Storage>, 'reconfigure' | 'createExtensionConfig'>, { mergeAttributes, services }: {
        mergeAttributes: typeof mergeAttributesFn;
        services: TiptapAdapterServices;
    }) => RicosExtensionConfig<Options, Storage>;
};
export declare const isRicosNodeExtension: (ext: RicosExtension) => ext is RicosNodeExtension;
export declare const isRicosMarkExtension: (ext: RicosExtension) => ext is RicosMarkExtension;
export declare const isRicosFunctionalExtension: (ext: RicosExtension) => ext is RicosFunctionalExtension;
export type RicosExtension<Options = any, Storage = any> = RicosNodeExtension<Options, Storage> | RicosMarkExtension<Options, Storage> | RicosFunctionalExtension<Options, Storage>;
export type { DOMOutputSpec } from '../tiptap/pm/model';
export type { MarkConfig, NodeConfig };
export type ExtensionProps = {
    placeholder?: string;
    textAlignment?: TextAlignment;
    iframeSandboxDomain?: string;
    isTextWrap?: boolean;
    maxTextLength?: number;
    anchorTarget?: LinkSettings['anchorTarget'];
    rel?: LinkSettings['rel'];
    relValue?: LinkSettings['relValue'];
    breakoutRule?: NonNullable<RicosTheme['breakout']>['rule'];
};
export type HtmlAttributes = {
    autoCapitalize: string;
    /**
     * true/false enumeration as required by the HTML spec
     * @default: true
     */
    spellCheck: 'true' | 'false';
    autoComplete: string;
    autoCorrect: string;
    tabIndex: number;
};
export type TiptapEditor = Editor;
//# sourceMappingURL=tiptap.d.ts.map