import { IDisposable, IRange, Nullable, Disposable, ErrorService, ICommandService, ILogService, Injector, IUndoRedoService, IUniverInstanceService, LocaleService, ObjectMatrix, ThemeService } from '@univerjs/core';
import { SheetsSelectionsService } from '@univerjs/sheets';
import { IClipboardInterfaceService, INotificationService, IPlatformService } from '@univerjs/ui';
import { IRenderManagerService } from '@univerjs/engine-render';
import { IMarkSelectionService } from '../mark-selection/mark-selection.service';
import { IDiscreteRange } from '../../controllers/utils/range-tools';
import { CopyContentCache } from './copy-content-cache';
import { ICellDataWithSpanInfo, ISheetClipboardHook, COPY_TYPE } from './type';
export declare const PREDEFINED_HOOK_NAME: {
    DEFAULT_COPY: string;
    DEFAULT_PASTE: string;
    SPECIAL_PASTE_VALUE: string;
    SPECIAL_PASTE_FORMAT: string;
    SPECIAL_PASTE_COL_WIDTH: string;
    SPECIAL_PASTE_BESIDES_BORDER: string;
    SPECIAL_PASTE_FORMULA: string;
};
interface ICopyContent {
    copyId: string;
    plain: string;
    html: string;
    matrixFragment: ObjectMatrix<ICellDataWithSpanInfo>;
    discreteRange: IDiscreteRange;
}
export interface ISheetClipboardService {
    copy(): Promise<boolean>;
    cut(): Promise<boolean>;
    paste(item: ClipboardItem, pasteType?: string): Promise<boolean>;
    legacyPaste(html?: string, text?: string): Promise<boolean>;
    generateCopyContent(workbookId: string, worksheetId: string, range: IRange): Nullable<ICopyContent>;
    copyContentCache(): CopyContentCache;
    addClipboardHook(hook: ISheetClipboardHook): IDisposable;
    getClipboardHooks(): ISheetClipboardHook[];
}
export declare const ISheetClipboardService: import('@univerjs/core').IdentifierDecorator<ISheetClipboardService>;
export declare class SheetClipboardService extends Disposable implements ISheetClipboardService {
    private readonly _logService;
    private readonly _univerInstanceService;
    private readonly _selectionManagerService;
    private readonly _clipboardInterfaceService;
    private readonly _undoRedoService;
    private readonly _commandService;
    private readonly _markSelectionService;
    private readonly _notificationService;
    private readonly _platformService;
    private readonly _renderManagerService;
    private readonly _themeService;
    private readonly _localeService;
    private readonly _errorService;
    private readonly _injector;
    private _clipboardHooks;
    private readonly _clipboardHooks$;
    readonly clipboardHooks$: import('rxjs').Observable<ISheetClipboardHook[]>;
    private _htmlToUSM;
    private _usmToHtml;
    private _copyContentCache;
    private _copyMarkId;
    constructor(_logService: ILogService, _univerInstanceService: IUniverInstanceService, _selectionManagerService: SheetsSelectionsService, _clipboardInterfaceService: IClipboardInterfaceService, _undoRedoService: IUndoRedoService, _commandService: ICommandService, _markSelectionService: IMarkSelectionService, _notificationService: INotificationService, _platformService: IPlatformService, _renderManagerService: IRenderManagerService, _themeService: ThemeService, _localeService: LocaleService, _errorService: ErrorService, _injector: Injector);
    copyContentCache(): CopyContentCache;
    generateCopyContent(workbookId: string, worksheetId: string, range: IRange): Nullable<ICopyContent>;
    copy(copyType?: COPY_TYPE): Promise<boolean>;
    cut(): Promise<boolean>;
    paste(item: ClipboardItem, pasteType?: string): Promise<boolean>;
    legacyPaste(html?: string, text?: string): Promise<boolean>;
    addClipboardHook(hook: ISheetClipboardHook): IDisposable;
    getClipboardHooks(): ISheetClipboardHook[];
    private _generateCopyContent;
    private _notifyClipboardHook;
    private _pastePlainText;
    private _pasteHTML;
    private _pasteExternal;
    private _pasteInternal;
    private _pasteUSM;
    private _getSetSelectionOperation;
    private _getPastingTarget;
    /**
     * Handles copying one range to another range, obtained by the following rules
     *
     * [Content to be assigned] => [Target range]
     *
     * I. There are no merged cells in the upper left corner of the pasted area
     *
     * 1. 1 -> 1: 1 => 1
     * 2. N -> 1: N => N
     * 3. 1 -> N: N => N
     * 4. N1 -> N2:
     *     1) N1 <N2: If N2 is a multiple of N1 (X), N1 * X => N2; If not, N1 => N1 (refer to office excel, different from google sheet)
     *     2) N1> N2: N1 => N1
     *
     * The above four cases can be combined and processed as
     *
     * Case 1, 1/2/4-2 merged into N1 => N1
     * Case 2, 3/4-1 merge into N1 * X => N2 or Case 1
     *
     * In the end we only need to judge whether N2 is a multiple of N1
     *
     * II. The pasted area contains merged cells
     *
     * 1. If N2 is a multiple of N1,
     *   1) If N2 === N1, paste this area directly and the range remains unchanged.
     *   2) Otherwise, determine whether other cells are included
     *     1] If included, tile, the range remains unchanged
     *     2] If not included, determine whether the source data is a combined cell
     *       1} If yes, tile, the range remains unchanged
     *       2} If not, only the content will be pasted, the original style will be discarded, and the scope will remain unchanged.
     *
     * 2. If N2 is not a multiple of N1, determine whether the upper left corner cell (merged or non-merged or combined) is consistent with the size of the original data.
     *   1) If consistent, only paste this area;
     *   2) If inconsistent, then determine whether the pasted area contains other cells.
     *     1] If yes, pasting is not allowed and an error will pop up;
     *     2] If not, only the content will be pasted and the original style will be discarded.
     *
     * @param rowCount
     * @param colCount
     * @param cellMatrix
     * @param range
     */
    private _transformPastedData;
    private _getPastedRange;
    private _expandOrShrinkRowsCols;
    /**
     * Determine whether the cells starting from the upper left corner of the range (merged or non-merged or combined) are consistent with the size of the original data
     * @param cellMatrix
     * @param range
     */
    private _topLeftCellsMatch;
}
export declare const escapeSpecialCode: (cellStr: string) => string;
export {};
