feat: update data type

This commit is contained in:
chenshenhai 2021-05-26 22:06:47 +08:00
parent de81eccf29
commit 83b037a869
2 changed files with 5 additions and 9 deletions

View file

@ -46,10 +46,6 @@ class Core {
console.log('index');
}
getData() {
return this._data;
}
scale(ratio: number) {
this._board.scale(ratio);
}
@ -62,6 +58,10 @@ class Core {
this._board.scrollY(y);
}
getData(): TypeData {
return JSON.parse(JSON.stringify(this._data));
}
setData(data: TypeData) {
return this._data = data;
}

View file

@ -1,15 +1,11 @@
import { TypeElemDesc, TypeElement } from './element';
type TypeDataBase = {
type TypeData = {
elements: TypeElement<keyof TypeElemDesc>[];
bgColor?: string;
}
type TypeData = TypeDataBase & {}
export {
TypeDataBase,
TypeData
}