UNPKG

@vladbasin/strong-api-mapping

Version:

Strongly typed API models. Mapping & validation

10 lines (9 loc) 441 B
import { ObjectSchema } from 'joi'; import { CustomApiRequestDataType, Newable, RawApiRequestType } from './types'; export declare type MapApiRequestToPayloadOptionsType<T> = { rawApiRequest: RawApiRequestType; customApiRequestData?: CustomApiRequestDataType; PayloadConstructor: Newable<T>; schema: ObjectSchema<T>; }; export declare const mapRawApiRequestToPayload: <T>(options: MapApiRequestToPayloadOptionsType<T>) => T;