import type { IBoardImportDiagnostic, IBoardImportDraft } from '@univerjs-pro/boards';
import type { Observable } from 'rxjs';
import { IBoardElementService } from '@univerjs-pro/boards';
import { IBoardElementStateService, IBoardUIStateService } from '@univerjs-pro/boards-ui';
import { IExchangeService } from '@univerjs-pro/exchange-client';
import { ICommandService, LocaleService } from '@univerjs/core';
export declare const BOARD_MERMAID_IMPORT_SOURCE_TYPE = "mermaid";
export declare const BoardMermaidImportErrorKey: {
    readonly EmptyCode: "boards-exchange-client.mermaidImport.errors.emptyCode";
    readonly InvalidDraft: "boards-exchange-client.mermaidImport.errors.invalidDraft";
    readonly InsertFailed: "boards-exchange-client.mermaidImport.errors.insertFailed";
};
export type BoardMermaidImportErrorKey = typeof BoardMermaidImportErrorKey[keyof typeof BoardMermaidImportErrorKey];
export declare const MERMAID_CODE_SAMPLES: Record<string, string>;
export declare const DEFAULT_MERMAID_CODE: string;
export interface IBoardMermaidImportContext {
    unitId: string;
    subUnitId: string;
}
export interface IBoardMermaidImportState extends IBoardMermaidImportContext {
    open: boolean;
    code: string;
    containerName: string;
    diagramType: string;
    converting: boolean;
    inserting: boolean;
    draft: IBoardImportDraft | null;
    diagnostics: IBoardImportDiagnostic[];
    error: IBoardMermaidImportError | null;
}
export interface IBoardMermaidConvertOptions {
    diagramType?: string;
    fileName?: string;
}
export interface IBoardMermaidInsertOptions {
    containerName?: string;
    selectAfterInsert?: boolean;
    left?: number;
    top?: number;
}
export interface IBoardMermaidOptions extends IBoardMermaidConvertOptions, IBoardMermaidInsertOptions {
}
export interface IBoardMermaidImportError {
    key: BoardMermaidImportErrorKey;
    detail?: string;
}
export interface IBoardMermaidImportService {
    readonly state$: Observable<IBoardMermaidImportState>;
    getState(): IBoardMermaidImportState;
    openImport(context: IBoardMermaidImportContext): void;
    close(): void;
    updateCode(code: string): void;
    updateContainerName(containerName: string): void;
    updateDiagramType(diagramType: string): void;
    convertMermaidToBoardDraft(code: string, options?: IBoardMermaidConvertOptions): Promise<IBoardImportDraft>;
    insertMermaid(code: string, context: IBoardMermaidImportContext, options?: IBoardMermaidOptions): Promise<boolean>;
    convertCurrentCode(): Promise<IBoardImportDraft | null>;
    insertCurrentDraft(options?: IBoardMermaidInsertOptions): Promise<boolean>;
}
export declare const IBoardMermaidImportService: import("@wendellhu/redi").IdentifierDecorator<IBoardMermaidImportService>;
export declare class BoardMermaidImportService implements IBoardMermaidImportService {
    private readonly _boardElementService;
    private readonly _uiStateService;
    private readonly _elementStateService;
    private readonly _localeService;
    private readonly _commandService;
    private readonly _exchangeService;
    private readonly _state$;
    private _convertRequestId;
    readonly state$: Observable<IBoardMermaidImportState>;
    constructor(_boardElementService: IBoardElementService, _uiStateService: IBoardUIStateService, _elementStateService: IBoardElementStateService, _localeService: LocaleService, _commandService: ICommandService, _exchangeService: IExchangeService);
    dispose(): void;
    getState(): IBoardMermaidImportState;
    openImport(context: IBoardMermaidImportContext): void;
    close(): void;
    updateCode(code: string): void;
    updateContainerName(containerName: string): void;
    updateDiagramType(diagramType: string): void;
    convertMermaidToBoardDraft(code: string, options?: IBoardMermaidConvertOptions): Promise<IBoardImportDraft>;
    insertMermaid(code: string, context: IBoardMermaidImportContext, options?: IBoardMermaidOptions): Promise<boolean>;
    convertCurrentCode(): Promise<IBoardImportDraft | null>;
    insertCurrentDraft(options?: IBoardMermaidInsertOptions): Promise<boolean>;
    private _insertDraft;
}
