UNPKG

@rest-api/react-models

Version:

[![npm version](https://img.shields.io/npm/v/@rest-api/react-models)](https://www.npmjs.com/package/@rest-api/react-models) [![codecov](https://codecov.io/gh/hector7/rest-api-react-models/branch/master/graph/badge.svg)](https://codecov.io/gh/hector7/rest-

20 lines (19 loc) 942 B
import { Schema, StringOrNumberKeys } from "./Schema"; import BasicRestModel from "./restmodels/basic/BasicRestModel"; declare type DummyType = { someId: number; date: Date; }; declare type DummySchema = Schema<DummyType>; export default class ModelConstructor<R, MetaData = null> { private itemStructure?; private items?; private metaData?; constructor(getItemsStructure?: (el: DummySchema) => Schema<R>, getItems?: (schema: R) => DummyType[], getMetaData?: (schema: R) => MetaData); protected getItemsStructure<R>(schema: Schema<R>): Schema<any>; protected getItems(): (schema: R) => any[]; protected getMetaData(): (schema: R) => MetaData; protected get routeOpts(): {}; getModel<S extends Schema<any>, IdKey extends StringOrNumberKeys<S['RealType']> & StringOrNumberKeys<S['PopulatedType']> & string>(schema: S, idKey: IdKey, url: string): BasicRestModel<S, IdKey, any, MetaData>; } export {};