UNPKG

domain-objects

Version:

A simple, convenient way to represent domain objects, leverage domain knowledge, and add runtime validation in your code base.

19 lines (18 loc) 817 B
import { MalfunctionError } from 'helpful-errors'; import type { DomainObject, DomainObjectInstantiationOptions } from '../../instantiation/DomainObject'; import type { WithImmute } from '../../manipulation/immute/withImmute'; export declare class DeserializationMissingDomainObjectClassError extends MalfunctionError { constructor({ className }: { className: string; }); } /** * Revives the domain objects stored in a string produced by the `serialize` method * * Use Cases: * - persistance * - e.g., deserialize domain objects from a string that was saved to a persistant store (i.e., a string produced by the `serialize` method) */ export declare const deserialize: <T>(serialized: string, context?: { with?: DomainObject<any>[]; } & DomainObjectInstantiationOptions) => WithImmute<T>;