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) • 628 B
TypeScript
import { PropertyData, PropertyParser } from '../types';
interface PropertyDecoratorCustomData<T> extends PropertyData<T> {
/**
* Property parser to use. Used to parse the value to the correct type.
*/
readonly parser: PropertyParser<T>;
}
/**
* @deprecated Use `field.custom()` 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 CustomProperty<T>(data: PropertyDecoratorCustomData<T>): (target: any, propertyKey: string) => void;
export {};