mirror of
https://github.com/idrawjs/idraw
synced 2026-05-24 10:08:34 +00:00
feat: update data type
This commit is contained in:
parent
de81eccf29
commit
83b037a869
2 changed files with 5 additions and 9 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
Loading…
Reference in a new issue