@thaumaturgy/zod
Version:
Thaumaturgy is a fixtures and seeding library for TypeScript.
18 lines (17 loc) • 393 B
TypeScript
import { z } from 'zod';
import { EntityC } from './types';
/**
* A reference to another entity.
*
* ### Examples
*
* ```
* Ref.to(User).through(user => user.id);
* ```
*/
export declare class Ref<C extends EntityC> {
private readonly Entity;
static to<C extends EntityC>(Entity: C): Ref<C>;
private constructor();
through<U>(mapping: (entity: z.TypeOf<C>) => U): U;
}