@tsed/json-mapper
Version:
Json mapper module for Ts.ED Framework
40 lines (39 loc) • 1.67 kB
TypeScript
import { Type } from "@tsed/core";
import { JsonDeserializerOptions } from "./JsonDeserializerOptions.js";
import { CachedGroupsJsonMapper, CachedJsonMapper, JsonMapperCompiler } from "./JsonMapperCompiler.js";
/**
* Deserializes raw JSON data into class instances based on schema metadata,
* handling collections, discriminators, hooks, and registered type mappers.
*/
export declare class JsonDeserializer extends JsonMapperCompiler<JsonDeserializerOptions> {
/**
* Cached classes by his id
* @protected
*/
protected constructors: Record<string, Type<any>>;
constructor();
map<Model = any>(input: any, options?: JsonDeserializerOptions): Model;
compile(model: Type<any>, groups: false | string[]): CachedJsonMapper<JsonDeserializerOptions>;
compileMapper(mapper: string, { id, groupsId, model, storeGroups }: {
id: string;
model: Type<any> | string;
groupsId: string;
storeGroups: CachedGroupsJsonMapper<JsonDeserializerOptions>;
}): CachedJsonMapper<JsonDeserializerOptions>;
protected newInstanceOf(id: string, obj: any, options: any): any;
protected createMapper(model: Type<any>, id: string, groups: false | string[]): string;
protected alterValue(schemaId: string, value: any, options: JsonDeserializerOptions): any;
private mapDiscriminator;
private mapProperty;
private getPropertyFiller;
private mapOptions;
private mapAdditionalProperties;
private mapObject;
private mapSet;
private mapArray;
private mapMap;
private mapItem;
private alterBeforeDeserialize;
private alterAfterDeserialize;
private mapGenericsOptions;
}