import { UnionCommands, Editor as TiptapEditor } from "@tiptap/core";
export type PermissionRequestEvent = CustomEvent<{
    id: keyof UnionCommands;
}>;
export declare class Editor extends TiptapEditor {
    private mutex;
    /**
     * Request permission before executing a command to make sure user
     * is allowed to perform the action.
     * @param id the command id to get permission for
     * @returns latest editor instance
     */
    requestPermission(id: keyof UnionCommands): TiptapEditor | undefined;
    /**
     * Performs editor state changes in a thread-safe manner using a mutex
     * ensuring that all changes are applied sequentially. Use this when
     * you are getting `RangeError: Applying a mismatched transaction` errors.
     */
    threadsafe(callback: (editor: TiptapEditor) => void): Promise<void>;
}
export declare function hasPermission(id: keyof UnionCommands): boolean;
