refactor(commands): centralize command ids
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { commandIds } from "./ids";
|
||||
import type { DocumentAddArtboardPayload } from "./document";
|
||||
import type { SelectionAddLayerPayload, SelectionSetPayload } from "./selection";
|
||||
import type { ToolSetActivePayload } from "./tool";
|
||||
@@ -9,18 +10,18 @@ import type {
|
||||
} from "./viewport";
|
||||
|
||||
export type CommandPayloads = {
|
||||
"document.addArtboard": DocumentAddArtboardPayload;
|
||||
"selection.set": SelectionSetPayload;
|
||||
"selection.clear": void;
|
||||
"selection.addLayer": SelectionAddLayerPayload;
|
||||
"tool.setActive": ToolSetActivePayload;
|
||||
"tool.enterTemporaryPan": void;
|
||||
"tool.exitTemporaryPan": void;
|
||||
"viewport.pan": ViewportPanPayload;
|
||||
"viewport.setZoom": ViewportSetZoomPayload;
|
||||
"viewport.zoomAroundPoint": ViewportZoomAroundPointPayload;
|
||||
"viewport.setSize": ViewportSetSizePayload;
|
||||
"viewport.reset": void;
|
||||
[commandIds.documentAddArtboard]: DocumentAddArtboardPayload;
|
||||
[commandIds.selectionSet]: SelectionSetPayload;
|
||||
[commandIds.selectionClear]: void;
|
||||
[commandIds.selectionAddLayer]: SelectionAddLayerPayload;
|
||||
[commandIds.toolSetActive]: ToolSetActivePayload;
|
||||
[commandIds.toolEnterTemporaryPan]: void;
|
||||
[commandIds.toolExitTemporaryPan]: void;
|
||||
[commandIds.viewportPan]: ViewportPanPayload;
|
||||
[commandIds.viewportSetZoom]: ViewportSetZoomPayload;
|
||||
[commandIds.viewportZoomAroundPoint]: ViewportZoomAroundPointPayload;
|
||||
[commandIds.viewportSetSize]: ViewportSetSizePayload;
|
||||
[commandIds.viewportReset]: void;
|
||||
};
|
||||
|
||||
export type CommandId = keyof CommandPayloads;
|
||||
|
||||
Reference in New Issue
Block a user