UNPKG

bookish-potato-dto

Version:

A TypeScript DTO (Data Transfer Object) parsing and validation library. Define a schema once — get runtime validation and a fully inferred TypeScript type for free.

13 lines (12 loc) 559 B
import { SchemaMap } from './field-descriptor.type'; /** * The output of defineDto(). Carries a stable _uuid for parser caching * and the raw fields map which can be spread to compose/extend DTOs. */ export interface DtoDefinition<TSchema extends SchemaMap = SchemaMap> { /** Stable identifier used by the parser cache for nested DTOs. */ readonly _uuid: string; /** The schema map — spread this to compose or extend DTOs. */ readonly fields: TSchema; } export { type AnyFieldDescriptor, type SchemaMap, } from './field-descriptor.type';