@tsed/json-mapper
Version:
Json mapper module for Ts.ED Framework
29 lines (28 loc) • 631 B
TypeScript
import { Type } from "@tsed/core";
export interface JsonMapperCtx<T = any, C = any> {
collectionType: Type<C> | undefined;
type: Type<T> | T;
next: JsonMapperNext;
options: {
format?: string;
};
}
export interface JsonMapperNext {
(obj: any): any;
}
export interface JsonMapperMethods {
/**
*
* @param obj
* @param {JsonMapperNext} ctx
* @returns {any}
*/
deserialize<T = any, C = any>(obj: any, ctx: JsonMapperCtx<T, C>): any;
/**
*
* @param obj
* @param ctx
* @returns {any}
*/
serialize(obj: any, ctx: JsonMapperCtx<any>): any;
}