/*! * JSON-Entity * * Copyright 2017-2019 Josh Swan * Released under the MIT license * https://github.com/joshswan/json-entity/blob/master/LICENSE */ export = Entity; declare class Entity { static isEntity(obj: any): boolean; constructor(config: Entity.EntityConfig); properties: Entity.EntityProperty[]; expose(property: keyof T, options?: Entity.EntityProperty): void; extend(config: Entity.EntityConfig): Entity; represent(obj: T, options?: Entity.EntityOptions): object; } declare namespace Entity { export interface EntityOptions { [key: string]: any; safe?: boolean; } export interface EntityPropertyConfig { [key: string]: any; as?: string; default?: any; filter?: (item: any, obj: T, options: EntityOptions) => boolean; if?: (obj: T, options: EntityOptions) => boolean; merge?: boolean; require?: boolean; using?: Entity; value?: (obj: T, options: EntityOptions) => any | any; } export interface EntityProperty extends EntityPropertyConfig { key: string; } export interface EntityConfig { [key: string]: boolean | ((obj: T, options: EntityOptions) => any) | EntityPropertyConfig; } }