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.

15 lines (14 loc) 627 B
import { PropertyData } from '../types'; import { ClassType } from '../_types'; /** * Decorator to define a property that is a DTO. * @param _dtoClass The DTO class to use to parse the value. * @param data Additional data for the property. * @constructor */ /** * @deprecated Use `field.dto()` inside `defineDto()` instead. * The decorator API will be removed in the next major version (v2). * @see https://github.com/andrei-trukhin/bookish-potato-dto-issues/blob/main/MIGRATION.md */ export declare function DtoProperty<T>(_dtoClass: ClassType<T>, data?: PropertyData<T>): (target: any, propertyKey: string) => void;