UNPKG

@mdcc/at-json

Version:

A declarative mapper to and from JSON.

15 lines (14 loc) 958 B
import { IMappingFunctions, IMappingOptionsExtra, Mapping } from '../interfaces'; import { JsonMapper } from '../mapper'; /** * A custom decorator factory function, in order to allow defining custom reusable decorators. * * @param serializeFn the function used for serializing the value. * @param deserializeFn the function used for deserializing the value. */ export declare function makeCustomDecorator<S = any, D = any>(fn: () => IMappingFunctions<S, D>): (params?: string | IMappingOptionsExtra | undefined) => PropertyDecorator; /** * A decorator transforming function, used internally. */ export declare function transformDecorator<S = any, D = any>(fn: (opt: IMappingFunctions<S, D>) => IMappingFunctions<S, D>): (params?: string | IMappingOptionsExtra | undefined) => PropertyDecorator; export declare function mapArray<D, S = any>(mapper: JsonMapper, propertyValue: S, deserializeItem?: Mapping<S, D>, throwIfNotArray?: boolean): D[] | null;