import { NonReducibleUnknown, SetupReturn, PromiseActorLogic, EventObject, MetaObject } from 'xstate'; import { Types } from '../likec4diagram/types'; import { HotKeyEvent, HotkeyActorLogic } from './hotkeyActor'; import type * as t from '@likec4/core/types'; export declare namespace EditorCalls { type ApplyLatestToManual = (params: { input: ApplyLatestToManual.Input; }) => Promise; namespace ApplyLatestToManual { type Input = { viewId: t.ViewId; current: t.LayoutedView | undefined; }; type Output = { updated: t.LayoutedView; }; } type ExecuteChange = (params: { input: ExecuteChange.Input; }) => Promise; namespace ExecuteChange { type Input = { viewId: t.ViewId; changes: t.ViewChange[]; }; type Output = NonReducibleUnknown; } } export type EditorActorEvent = { type: 'sync'; } | { type: 'change'; change: t.ViewChange; } | { type: 'edit.start'; subject: 'node' | 'edge'; } | { type: 'edit.finish'; wasChanged?: boolean; } | { type: 'applyLatestToManual'; } | { type: 'synced'; } | { type: 'cancel'; } | { type: 'reset'; } | HotKeyEvent; export type HistorySnapshot = { view: t.LayoutedView; change: t.ViewChange.SaveViewSnapshot; xynodes: Types.Node[]; xyedges: Types.Edge[]; synched: boolean; }; export interface EditorActorInput { viewId: t.ViewId; } export interface EditorActorContext { viewId: t.ViewId; pendingChanges: t.ViewChange[]; history: ReadonlyArray; /** * The state before editing started */ beforeEditing: HistorySnapshot | null; /** * The subject of the edit */ editing: 'node' | 'edge' | null; } export type EditorActorEmitedEvent = { type: 'idle'; }; export declare const machine: SetupReturn; executeChange: PromiseActorLogic; hotkey: HotkeyActorLogic; }, { hotkey: "hotkey"; }, {}, { 'has pending': unknown; 'can undo': unknown; }, "500ms" | "waitBeforeSync", "pending", EditorActorInput, NonReducibleUnknown, EditorActorEmitedEvent, MetaObject>;