decorated-factory
Version:
A factory decorators for creating objects with faker data
13 lines (12 loc) • 572 B
TypeScript
import type { Paths } from "src/interfaces/paths";
import type { Type } from "../interfaces";
export interface RelationKeyBinding<Parent, Child> {
key: Paths<Parent>;
inverseKey: Paths<Child>;
}
export interface FactoryRelationMetadata {
property: string;
returnTypeFn: () => Type | [Type];
keyBinding?: RelationKeyBinding<any, any>;
}
export declare function FactoryRelationField<Parent, Child>(returnValueFN: () => Type<Child> | [Type<Child>], keyBinding?: RelationKeyBinding<Parent, Child>): (target: NonNullable<any>, propertyKey: string) => void;