UNPKG

@graphity/mapper

Version:

Decorator-based transformer of plain object to class constructors for Javascript(& Typescript).

14 lines (13 loc) 574 B
import { MapperOptions } from '../interfaces/mapper'; export declare class Mapper<TEntity, TSource = any> { readonly options: MapperOptions<TEntity>; constructor(options: MapperOptions<TEntity>); toEntity(rows: TSource[]): TEntity[]; toEntity(rows: TSource): TEntity; assign(entity: Partial<TEntity>[]): TEntity[]; assign(entity: Partial<TEntity>): TEntity; toPlain(entities: TEntity[]): TSource[]; toPlain(entities: TEntity): TSource; toPlain(entities: Partial<TEntity>[]): TSource[]; toPlain(entities: Partial<TEntity>): TSource; }