UNPKG

@herlinus/coloquent

Version:

Library for retrieving model objects from a JSON-API, with a fluent syntax inspired by Laravel Eloquent.

21 lines (20 loc) 758 B
import { Model } from "./Model"; export declare class PolymorphicEntry { klass: any; value: string; constructor(klass: any, value: string); isTheGood(type: string): boolean; } export declare class PolymorphicMapping { polymorphicEntries: PolymorphicEntry[]; constructor(polymorphicEntries: PolymorphicEntry[]); getClass(type: string): typeof Model | typeof PolymorphicEntry | null; } export interface PolymorphicModel { constructor: typeof PolymorphicModel; } export declare abstract class PolymorphicModel extends Model { static polymorphicOn: PolymorphicMapping; static appendPolymorph(value: string): (klass: any) => any; static getClass(doc: any): typeof Model | typeof PolymorphicEntry; }