Files
image-studio/app/app.ts
2026-07-03 09:52:00 +02:00

19 lines
726 B
TypeScript

import { documentCommands } from "@commands/document";
import { createCommandRegistry } from "@commands/registry";
import { selectionCommands } from "@commands/selection";
import { viewportCommands } from "@commands/viewport";
import { createInitialAppState } from "@editor/initial-state";
import { createAppStore } from "@editor/store";
export type ImageStudioApp = ReturnType<typeof createImageStudioApp>;
export function createImageStudioApp(options?: { documentName?: string }) {
const registry = createCommandRegistry([...viewportCommands, ...selectionCommands, ...documentCommands]);
const store = createAppStore(createInitialAppState(options?.documentName), registry);
return {
registry,
store,
};
}