UNPKG

@thisisagile/easy

Version:

Straightforward library for building domain-driven microservice architectures

22 lines (21 loc) 976 B
import { View } from '../utils/View'; import { FetchOptions, Gateway } from '../types/Gateway'; import { Repository } from '../types/Repository'; import { Json, JsonValue } from '../types/Json'; import { PageList } from '../types/PageList'; import { Id, Key } from '../types/Id'; import { List } from '../types/List'; export declare class Typo<T, Options = FetchOptions> extends Repository<T, Options> { protected view: View<T>; private readonly gateway; constructor(view: View<T>, gateway: Gateway<Options>); create: (j: Json) => T; all(options?: Options): Promise<PageList<T>>; byId(id: Id): Promise<T>; byIds(...ids: Id[]): Promise<List<T>>; byKey(key: Key, options?: Options): Promise<PageList<T>>; by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>>; search(q: JsonValue, options?: Options): Promise<PageList<T>>; filter(options?: Options): Promise<PageList<T>>; exists(id: Id): Promise<boolean>; }