import GC from '@grapecity/spread-sheets';
import { CellMasks, ConnectedMessage, CustomMessageData, DocVersion, DocVersionWithData, LoadTableOptions, Message, OnProgress, OnesTable, OnesTableCustom, OnesTableEvents, SheetRange, TableSidebarOptions, OnesTableHook, ToastInfo } from '../../../../@ones-table/common';
import ReconnectingWebSocket, { ErrorEvent, CloseEvent } from 'reconnecting-websocket';
import { TypedEmitter } from 'tiny-typed-emitter';
import { CommandSenderStatus } from './command-sender/commands-sender';
export declare class TableDocument extends TypedEmitter<OnesTableEvents> implements OnesTable {
    private ws;
    private connectMessage;
    private spread;
    private loadOptions;
    private version;
    private executingRemoteCommand;
    private remoteCursor;
    private reauthCounter;
    private debounceTimer;
    private masks;
    private formulaMask;
    private customs;
    private commandsSender;
    private currentCommand;
    private hooks;
    constructor(ws: ReconnectingWebSocket, connectMessage: ConnectedMessage, spread: GC.Spread.Sheets.Workbook, loadOptions: LoadTableOptions);
    get options(): LoadTableOptions;
    getSettings(): import("@ones-table/common").OnesTableSettings;
    token(): string;
    docId(): string;
    server(): string;
    addHook(hook: OnesTableHook): void;
    getHooks(): OnesTableHook[];
    addCustom<T extends OnesTableCustom>(name: string, creator: () => T): T;
    getCustom<T>(name: string): T | undefined;
    setReadonly(readonly: boolean): void;
    readonly(): boolean;
    setCurrentCommand(command: string): void;
    getCurrentCommand(): string;
    cellMasks(): CellMasks;
    getUserColor(userId: string): string;
    clientId(): string;
    workbook(): GC.Spread.Sheets.Workbook;
    user(): import("@ones-table/common").UserData;
    sendMessageToServer(message: Message): void;
    debounce(inner: () => void, ms?: number): void;
    broadcastCustomMessage(data: CustomMessageData): void;
    handleSelectionChanged(sheetName: string, newSelections: SheetRange[]): void;
    handleWebsocketError: (event: ErrorEvent) => void;
    handleClose: (event: CloseEvent) => void;
    handleStatusChanged: (status: CommandSenderStatus) => void;
    handleActiveSheetChanged: () => void;
    destroy(): void;
    private nextVersion;
    private handleRemoteMessage;
    private handleLocalEvent;
    private handleLocalCommand;
    private handleError;
    private handleRemoteCommand;
    private handleReload;
    reauth(): Promise<string | null>;
    queryCellActions(sheetName: string, row: number, col: number): Promise<any>;
    createVersion(options?: {
        name?: string;
        tag?: string;
        type?: string;
    }): Promise<DocVersion>;
    queryVersions(): Promise<DocVersion[]>;
    queryVersion(version: number, options?: {
        withData: boolean;
    }): Promise<DocVersion | DocVersionWithData | null>;
    restoreVersion(version: number): Promise<DocVersion>;
    uploadResource(file: File, onProgress?: OnProgress): Promise<string>;
    getResourceUrl(resourceId: string, options?: {
        withToken?: boolean;
    }): string;
    getResourceId(url: string): string;
    showSidebar(content: HTMLElement, options: TableSidebarOptions): void;
    showToast(options: ToastInfo): void;
    closeSidebar(): void;
    static sendConnectMessage(ws: ReconnectingWebSocket, token: string, docId: string): void;
    private setData;
    toExcel(): Promise<File>;
}
