UNPKG

@typeheim/orm-on-fire

Version:
31 lines (30 loc) 1.6 kB
import { EntityManager } from './EntityManager'; import { ChangedEntities } from '../Data/ChangedEntities'; import { CollectionReference } from './CollectionReference'; import { FilterFunction, IndexFunction, PropertyMetadata } from '../../index'; import { QueryState, SortOrder } from '../Contracts/Query'; import { EntityStream } from '../Data/EntityStream'; import { EntityPromise } from '../Data/EntityPromise'; export declare class CollectionQuery<Entity, FetchType = Entity[]> { protected collectionReference: CollectionReference; protected entityManager: EntityManager<Entity>; protected filterFields: PropertyMetadata[]; protected queryState: QueryState; constructor(collectionReference: CollectionReference, entityManager: EntityManager<Entity>, filterFields: PropertyMetadata[]); exclude(id: string): any; exclude(ids: string[]): any; map<T = Entity, R = any>(operator: ((value: Entity[]) => R)): CollectionQuery<T, R>; debounceUpdates(dueTime: number): this; useIndex(indexFunction: IndexFunction<Entity>): this; asIds(): CollectionQuery<Entity, string[]>; filter(filterFunction: FilterFunction<Entity>): this; limit(limit: number): this; orderBy(field: string, sortOrder?: SortOrder): this; startAt(position: Entity | any): this; startAfter(position: Entity | any): this; endAt(position: Entity | any): this; endBefore(position: Entity | any): this; get(): EntityPromise<FetchType>; changes(): EntityStream<ChangedEntities<Entity>>; stream(): EntityStream<FetchType>; }