2020-10-13 16:57:56 +00:00
|
|
|
import PageRecord from '../../structures/PageRecord';
|
2020-10-14 03:28:38 +00:00
|
|
|
import HostRecord from '../../structures/HostRecord';
|
2020-10-13 16:57:56 +00:00
|
|
|
|
|
|
|
export abstract class EditorNodeContract {
|
|
|
|
protected pageRec!: PageRecord;
|
2020-10-14 03:28:38 +00:00
|
|
|
protected nodeRec!: HostRecord;
|
2020-10-14 01:19:38 +00:00
|
|
|
protected initialValue: any;
|
2020-10-13 16:57:56 +00:00
|
|
|
|
|
|
|
get page() {
|
|
|
|
return this.pageRec;
|
|
|
|
}
|
|
|
|
|
|
|
|
set page(page: PageRecord) {
|
|
|
|
this.pageRec = page;
|
|
|
|
}
|
|
|
|
|
2020-10-14 03:28:38 +00:00
|
|
|
get node() {
|
|
|
|
return this.nodeRec;
|
|
|
|
}
|
|
|
|
|
|
|
|
set node(node: HostRecord) {
|
|
|
|
this.nodeRec = node;
|
|
|
|
}
|
|
|
|
|
2020-10-13 16:57:56 +00:00
|
|
|
get identifier() {
|
|
|
|
return this.nodeRec.UUID;
|
|
|
|
}
|
|
|
|
|
|
|
|
public abstract isDirty(): boolean | Promise<boolean>;
|
2020-10-14 03:28:38 +00:00
|
|
|
public abstract writeChangesToNode(): void | Promise<void>;
|
2020-10-13 16:57:56 +00:00
|
|
|
|
|
|
|
public needsSave(): boolean | Promise<boolean> {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public needsLoad(): boolean | Promise<boolean> {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public performSave(): void | Promise<void> {}
|
|
|
|
|
|
|
|
public performLoad(): void | Promise<void> {}
|
2020-10-14 03:47:59 +00:00
|
|
|
|
|
|
|
public performDelete(): void | Promise<void> {}
|
2020-10-13 16:57:56 +00:00
|
|
|
}
|