@tsed/json-mapper
Version:
Json mapper module for Ts.ED Framework
19 lines (18 loc) • 775 B
TypeScript
import { JsonMapperCtx, JsonMapperMethods } from "../interfaces/JsonMapperMethods.js";
export declare class CastError extends Error {
name: string;
constructor(message: string);
}
/**
* Mapper for the `String`, `Number`, `BigInt` and `Boolean` types.
* @jsonmapper
* @component
*/
export declare class PrimitiveMapper implements JsonMapperMethods {
deserialize<T>(data: any, ctx: JsonMapperCtx): string | number | boolean | void | null | BigInt;
serialize(object: string | number | boolean | BigInt, ctx: JsonMapperCtx): string | number | boolean | BigInt;
protected String(data: any): string | null;
protected Boolean(data: any): boolean | null | undefined;
protected Number(data: any): any;
protected BigInt(data: any): bigint | null;
}