diff --git a/lib/interfaces/Serializable.ts b/lib/interfaces/Serializable.ts index cf75ae6..256ff20 100644 --- a/lib/interfaces/Serializable.ts +++ b/lib/interfaces/Serializable.ts @@ -1,7 +1,7 @@ -export interface Serializable { - serialize(): string; -} - -export interface Deserializable { - deserialize(str: string): Serializable; +export abstract class Serializable { + public abstract serialize(): string; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + public static deserialize (str: string): Serializable { + throw new Error ('not implemented'); + } } diff --git a/lib/interfaces/index.ts b/lib/interfaces/index.ts index a7cbd62..c1ce87b 100644 --- a/lib/interfaces/index.ts +++ b/lib/interfaces/index.ts @@ -1,2 +1,2 @@ export { Assignable } from './Assignable'; -export { Serializable, Deserializable } from './Serializable'; +export { Serializable } from './Serializable';