UNPKG

ravendb

Version:
37 lines 1.88 kB
import { ObjectTypeDescriptor, EntityConstructor } from "../Types/index.js"; import { DocumentConventions } from "../Documents/Conventions/DocumentConventions.js"; export interface TypeInfo { typeName?: string; nestedTypes?: NestedTypes; } export interface NestedTypes { [propertyPath: string]: string; } export interface ITypesAwareObjectMapper { fromObjectLiteral<TResult extends object>(rawResult: object, typeInfo?: TypeInfo, knownTypes?: Map<string, ObjectTypeDescriptor>): TResult; toObjectLiteral<TFrom extends object>(obj: TFrom, typeInfoCallback?: (typeInfo: TypeInfo) => void, knownTypes?: Map<string, ObjectTypeDescriptor>): object; } export declare class TypesAwareObjectMapper implements ITypesAwareObjectMapper { private _throwMappingErrors; private _conventions; constructor(opts?: TypesAwareJsonObjectMapperOptions); get throwMappingErrors(): boolean; set throwMappingErrors(value: boolean); fromObjectLiteral<TResult extends object>(rawResult: object, typeInfo?: TypeInfo, knownTypes?: Map<string, ObjectTypeDescriptor>): TResult; private _applyNestedTypes; toObjectLiteral<TFrom extends object>(obj: TFrom, typeInfoCallback?: (typeInfo: TypeInfo) => void, knownTypes?: Map<string, ObjectTypeDescriptor>): object; private _getFieldContext; private _getFieldContextsForMapEntries; private _getFieldContextsForSetElements; private _getFieldContextsForArrayElements; private _flattenFieldContexts; private _applyTypeToNestedProperty; private _instantiateObject; private _getKnownType; protected createEmptyObject<TResult extends object>(ctor: EntityConstructor<TResult>, rawValue: object): TResult; private _makeObjectLiteral; } export interface TypesAwareJsonObjectMapperOptions { documentConventions?: DocumentConventions; } //# sourceMappingURL=ObjectMapper.d.ts.map