feat(editor): add transient app state foundation
This commit is contained in:
25
editor/state.ts
Normal file
25
editor/state.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { ImageDocument } from "@core/document";
|
||||
import type { Angle, Size, Vec2D } from "@core/geometry";
|
||||
import type { ArtboardId, LayerId } from "@core/id";
|
||||
|
||||
export type ViewportState = {
|
||||
center: Vec2D;
|
||||
zoom: number;
|
||||
rotation: Angle;
|
||||
size: Size;
|
||||
};
|
||||
|
||||
export type SelectionState = {
|
||||
artboardId?: ArtboardId;
|
||||
layerIds: LayerId[];
|
||||
};
|
||||
|
||||
export type EditorState = {
|
||||
viewport: ViewportState;
|
||||
selection: SelectionState;
|
||||
};
|
||||
|
||||
export type AppState = {
|
||||
document: ImageDocument;
|
||||
editor: EditorState;
|
||||
};
|
||||
Reference in New Issue
Block a user