openscad-playground/src/state/app-state.ts

48 lines
1.1 KiB
TypeScript
Raw Normal View History

// Portions of this file are Copyright 2021 Google LLC, and licensed under GPL2+. See COPYING.
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
2023-03-26 07:48:04 +01:00
export type MultiLayoutComponentId = 'editor' | 'viewer' | 'customizer';
export type SingleLayoutComponentId = MultiLayoutComponentId;
export interface State {
params: {
2023-03-26 07:48:04 +01:00
sourcePath: string,
source: string,
features: string[],
},
2023-03-26 07:48:04 +01:00
view: {
logs?: boolean,
layout: {
mode: 'single',
focus: SingleLayoutComponentId,
} | ({
mode: 'multi',
} & { [K in MultiLayoutComponentId]: boolean })
}
lastCheckerRun?: {
logText: string,
markers: monaco.editor.IMarkerData[]
}
rendering?: boolean,
previewing?: boolean,
checkingSyntax?: boolean,
2023-03-26 07:48:04 +01:00
error?: string,
output?: {
2023-03-25 19:30:34 +00:00
isPreview: boolean,
stlFile: File,
stlFileURL: string,
2023-03-25 20:41:16 +00:00
elapsedMillis: number,
formattedElapsedMillis: string,
formattedStlFileSize: string,
2023-03-26 15:28:05 +01:00
// path: string,
// timestamp: number,
// sizeBytes: number,
// formattedSize: string,
},
};
2023-03-26 15:28:05 +01:00
export {}