UNPKG

bookish-potato-dto

Version:

## Overview A TypeScript decorators-based API for defining Data Transfer Object (DTO) classes, types, and parsers. Simplifies schema validation and type enforcement using intuitive decorators and TypeScript classes.

16 lines (15 loc) 721 B
import { PropertyDataToParse } from '../../_types'; import { PropertyParsingError } from '../../error'; export interface ParseChainData { readonly propertyDataToParse: PropertyDataToParse<unknown>; readonly dto: Record<string, unknown>; } export interface ParseChain { parse(data: ParseChainData): PropertyParsingError | undefined; } export declare abstract class ParseChainBase implements ParseChain { private nextChain; setNextChain(nextChain: ParseChainBase): ParseChainBase; parse(data: ParseChainData): PropertyParsingError | undefined; protected abstract _parse(data: ParseChainData, next: (data: ParseChainData) => PropertyParsingError | undefined): PropertyParsingError | undefined; }