2023-03-24 04:33:39 +00:00
|
|
|
// Portions of this file are Copyright 2021 Google LLC, and licensed under GPL2+. See COPYING.
|
|
|
|
|
|
2023-03-25 11:59:50 +00:00
|
|
|
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
|
|
|
|
2023-03-25 19:30:34 +00:00
|
|
|
import React from 'react';
|
2023-03-25 11:59:50 +00:00
|
|
|
import { Model } from "./model"
|
|
|
|
|
|
2023-03-24 04:33:39 +00:00
|
|
|
export interface State {
|
2023-03-25 11:59:50 +00:00
|
|
|
params: {
|
|
|
|
|
source: string,
|
2023-03-25 15:23:54 +00:00
|
|
|
features: string[],
|
2023-03-24 04:33:39 +00:00
|
|
|
},
|
2023-03-25 15:23:54 +00:00
|
|
|
lastCheckerRun?: {
|
2023-03-25 11:59:50 +00:00
|
|
|
logText: string,
|
|
|
|
|
markers: monaco.editor.IMarkerData[]
|
|
|
|
|
}
|
2023-03-25 15:23:54 +00:00
|
|
|
rendering?: boolean,
|
|
|
|
|
previewing?: boolean,
|
|
|
|
|
checkingSyntax?: boolean,
|
|
|
|
|
|
2023-03-24 04:33:39 +00:00
|
|
|
output?: {
|
2023-03-25 19:30:34 +00:00
|
|
|
isPreview: boolean,
|
2023-03-25 15:23:54 +00:00
|
|
|
stlFile: File,
|
|
|
|
|
stlFileURL: string,
|
2023-03-25 20:41:16 +00:00
|
|
|
elapsedMillis: number,
|
|
|
|
|
formattedElapsedMillis: string,
|
|
|
|
|
formattedStlFileSize: string,
|
2023-03-24 04:33:39 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
2023-03-25 19:30:34 +00:00
|
|
|
export const ModelContext = React.createContext(new Model(
|
2023-03-25 11:59:50 +00:00
|
|
|
{
|
|
|
|
|
params: {
|
2023-03-25 15:23:54 +00:00
|
|
|
source: '',
|
|
|
|
|
features: ['manifold', 'lazy-union'],
|
2023-03-25 11:59:50 +00:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
() => { throw new Error('Not implemented'); }
|
|
|
|
|
));
|
|
|
|
|
|