Refactor usage of EditorState + Add version to editorState + increment editorState to "v2.0.0"

This commit is contained in:
Eric NGUYEN 2023-03-01 11:46:22 +01:00
parent 460669987d
commit afd303f8cb
13 changed files with 136 additions and 179 deletions

View file

@ -1,24 +1,15 @@
import { type IHistoryState } from '../../../Interfaces/IHistoryState';
import { type IConfiguration } from '../../../Interfaces/IConfiguration';
import { GetCircularReplacer } from '../../../utils/saveload';
import { ID } from '../../SVG/SVG';
import { type IEditorState } from '../../../Interfaces/IEditorState';
import { SHOW_SELECTOR_TEXT } from '../../../utils/default';
export function SaveEditorAsJSON(
history: IHistoryState[],
historyCurrentStep: number,
configuration: IConfiguration
editorState: IEditorState
): void {
const exportName = 'state.json';
const spaces = import.meta.env.DEV
? 4
: 0;
const editorState: IEditorState = {
history,
historyCurrentStep,
configuration
};
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (window.Worker) {