UNPKG

@geogirafe/lib-geoportal

Version:

GeoGirafe is a flexible application to build online geoportals.

13 lines (12 loc) 555 B
export type Constructor<T> = new (...args: any[]) => T; export interface IBrainSerializer<T> { brainSerialize(obj: T): string; brainDeserialize(str: string, stateLocation?: string): void; } export default class BrainSerializer<T extends Record<string | symbol, any>> { private readonly registry; addSerializer(type: Constructor<object>, serializerData: IBrainSerializer<object>): void; private getSerializer; serialize(state: T): string; deserialize(stringSerializedState: string, state: Record<string | symbol, any>): void; }