From ac79bf8ef7f26c98dfd9631438af5c41ae9f3a1e Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Tue, 5 May 2020 09:35:17 +0200 Subject: [PATCH] using TPersistent as example --- lib/interfaces/Assignable.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/interfaces/Assignable.ts b/lib/interfaces/Assignable.ts index f9f9ab9..5d22e9f 100644 --- a/lib/interfaces/Assignable.ts +++ b/lib/interfaces/Assignable.ts @@ -1,11 +1,22 @@ -export abstract class Assignable { - protected data: Record = {}; +export interface Assignable { + assign (a: Assignable): void; + assign_to (a: Assignable): void; +} + +export abstract class Persistent { + private data: Record = {}; + private properties: Record; + + public constructor() { + this.properties = this.define_properties(); + } + + public abstract define_properties(): Record; public assign (da: Assignable): void { this.assign_object (da.get_data ()); } - public assign_to (da: Assignable): void { da.assign (this); } @@ -18,4 +29,6 @@ export abstract class Assignable { public get_data (): Record { return this.data; } + + wip }