/// import { ConfigEntity, EntityOpts } from '../../../common'; import { Disposable, Emitter } from '@gedit/utils'; import type { PlaygroundConfigEntity } from './playground-config-entity'; /** * 编辑态 */ export interface EditorState { id: string; icon?: string; title?: string | ((config: PlaygroundConfigEntity) => string); showTitle?: boolean; keybinding?: string; disabled?: boolean | ((config: PlaygroundConfigEntity) => boolean); hidden?: boolean | ((config: PlaygroundConfigEntity) => boolean); cursor?: string; shortcut?: string; ctr?: boolean; shortcutAutoEsc?: boolean; order?: number; priority?: number; handle?: (config: PlaygroundConfigEntity, e?: EditorStateChangeEvent) => void; disableSelector?: boolean; state?: EditorState[]; cancelMode: 'esc' | 'once' | 'hold' | 'text'; cancelFactor?: (config: PlaygroundConfigEntity, e?: EditorStateChangeEvent) => boolean; onEsc?: (config: PlaygroundConfigEntity, e?: KeyboardEvent) => void; } export declare namespace EditorState { const STATE_SELECT: EditorState; const STATE_GRAB: EditorState; const SHOW_SCENE_RANGE_RULER: EditorState; const STATE_ZOOM_CENTER: EditorState; const STATE_ZOOM_IN: EditorState; const STATE_ZOOM_OUT: EditorState; const STATE_ZOOM_TEXT: EditorState; const EDIT_PATH_STATE: EditorState; } export declare const EDITOR_STATE_DEFAULTS: EditorState[]; export interface EditorStateChangeEvent { state: EditorState; event?: React.MouseEvent; lastState?: EditorState; } /** * 编辑状态管理 */ export declare class EditorStateConfigEntity extends ConfigEntity { static type: string; playgroundId?: string; protected states: EditorState[]; protected stateGroups: EditorState[][]; protected selected: string; protected onStateChangeEmitter: Emitter; readonly onStateChange: import("@gedit/utils").Event; constructor(opts: EntityOpts); /** * 取消指定状态后触发 * @param stateId * @param fn */ onCancel(stateId: string, fn: () => void): Disposable; getCurrentState(): EditorState | undefined; is(stateId: string): boolean; changeState(stateId: string, event?: React.MouseEvent): void; toDefaultState(): void; registerState(state: EditorState): void; protected sortStates(): void; removeState(stateId: string): void; getStates(): EditorState[]; /** * state 分组显示 */ getStateGroups(): EditorState[][]; getStateFormShortCut(e: KeyboardEvent): EditorState | undefined; } //# sourceMappingURL=editor-state-config-entity.d.ts.map