openscad-playground/src/app-state.ts

40 lines
861 B
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-25 19:30:34 +00:00
import React from 'react';
import { Model } from "./model"
export interface State {
params: {
source: string,
features: string[],
},
lastCheckerRun?: {
logText: string,
markers: monaco.editor.IMarkerData[]
}
rendering?: boolean,
previewing?: boolean,
checkingSyntax?: boolean,
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-25 19:30:34 +00:00
export const ModelContext = React.createContext(new Model(
{
params: {
source: '',
features: ['manifold', 'lazy-union'],
}
},
() => { throw new Error('Not implemented'); }
));