import { TypeOf, StringIndexable } from "../util"; import { EntityType, IEntity, AnyEntityType } from "../metadata"; import { Saveables, Query } from "../elements"; export interface Service { load: (q: Query) => Promise; save?: (saveables: Saveables) => Promise>; delete?: (entities: IEntity[]) => Promise; } /** * A service implements a connection to an api for loading, saving and deleting entities. * They must always return entities in their dto format (if they have one). */ export declare function ServiceFor(entityTypes?: EntityType[]): (type: TypeOf) => void; export declare function getServiceType(entityType: EntityType): TypeOf; export declare function getAllServiceTypes(): Map, TypeOf>;