domain-objects
Version:
A simple, convenient way to represent domain objects, leverage domain knowledge, and add runtime validation in your code base.
10 lines (9 loc) • 547 B
TypeScript
import type { DomainEntity } from '../instantiation/DomainEntity';
import type { DomainEvent } from '../instantiation/DomainEvent';
import type { DomainObjectShape } from '../instantiation/DomainObjectShape';
export type { DomainObjectShape } from '../instantiation/DomainObjectShape';
export interface Refable<TShape extends DomainObjectShape, TPrimary extends readonly string[], TUnique extends readonly string[]> extends DomainEntity<TShape>, DomainEvent<TShape> {
new (props: TShape): TShape;
primary: TPrimary;
unique: TUnique;
}