domain-objects
Version:
A simple, convenient way to represent domain objects, leverage domain knowledge, and add runtime validation in your code base.
18 lines (17 loc) • 690 B
TypeScript
import { DomainObject } from '../..';
import { DomainObjectInstantiationOptions } from '../../instantiation/DomainObject';
export declare class DeserializationMissingDomainObjectClassError extends Error {
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) => T;