import type { IconType } from '../../components/eui-icon';
import type Component from '@glimmer/component';
import type { ComponentLike } from '@glint/template';
import type { Parser } from 'remark-parse';
import type { Node as UnistNode, Position as UnistPosition } from 'unist';
import type { VFile } from 'vfile';
import type { VFileMessage } from 'vfile-message';
export interface RemarkParser {
    Parser: typeof Parser;
    tokenizeInline: Function;
    file: VFile;
}
export interface RemarkTokenizer {
    (this: RemarkParser, eat: Function & {
        now: Function;
    }, value: string, silent: boolean): boolean | void;
    locator?: (value: string, fromIndex: number) => number;
    notInLink?: boolean;
}
export interface RehypeNode extends EuiMarkdownAstNode {
    [index: string]: unknown;
    tagName: string;
    children?: RehypeNode[];
    value: string;
    type: string;
}
type RemarkRehypeHandlerCallback = (node: UnistPosition, tagName: string, props: Record<string, unknown>, children: RehypeNode[]) => RehypeNode;
export type RemarkRehypeHandler = (h: RemarkRehypeHandlerCallback, node: UnistNode) => RehypeNode;
export interface EuiMarkdownEditorUiPluginEditorProps<NodeShape> {
    node: NodeShape | null;
    onCancel: () => void;
    onSave: (markdown: string, config: EuiMarkdownStringTagConfig) => void;
}
export declare const isPluginWithImmediateFormatting: (x: PluginWithImmediateFormatting | PluginWithDelayedFormatting<any>) => x is PluginWithImmediateFormatting;
export interface PluginWithImmediateFormatting {
    formatting: EuiMarkdownFormatting;
    editor?: never;
}
export interface PluginWithDelayedFormatting<T> {
    formatting?: never;
    editor: T;
}
export type EuiMarkdownEditorUiPlugin<NodeShape = any> = {
    name: string;
    button: {
        label: string;
        iconType: IconType;
    };
    helpText?: Component | string;
} & (PluginWithImmediateFormatting | PluginWithDelayedFormatting<NodeShape>);
export interface EuiMarkdownFormatting {
    prefix?: string;
    suffix?: string;
    blockPrefix?: string;
    blockSuffix?: string;
    multiline?: boolean;
    replaceNext?: string;
    prefixSpace?: boolean;
    scanFor?: string;
    surroundWithNewlines?: boolean;
    orderedList?: boolean;
    trimFirst?: boolean;
}
export interface EuiMarkdownAstNode {
    type: string;
    children?: EuiMarkdownAstNode[];
    position: EuiMarkdownAstNodePosition;
    properties: {
        [index: string]: unknown;
        componentName?: ComponentLike;
        className?: string[];
    };
}
export interface EuiMarkdownAstNodePosition {
    start: {
        line: number;
        column: number;
        offset: number;
    };
    end: {
        line: number;
        column: number;
        offset: number;
    };
}
export type EuiMarkdownParseError = string | VFileMessage | Error;
export interface EuiMarkdownDropHandler {
    supportedFiles: string[];
    accepts: (itemType: string) => boolean;
    getFormattingForItem: (file: File) => EuiMarkdownDragAndDropResult | Promise<EuiMarkdownDragAndDropResult>;
}
export interface EuiMarkdownStringTagConfig {
    block: boolean;
}
export interface EuiMarkdownDragAndDropResult {
    text: string;
    config: EuiMarkdownStringTagConfig;
}
export {};
//# sourceMappingURL=markdown-types.d.ts.map