import Query from "./Query"; import Collection from "./Collection"; import { ISubscription } from "rxjs/Subscription"; import { Class } from './Classes'; export declare type FetchOption = { [K in keyof T]?: boolean | FetchOption; }; export declare type FetchOptions = { collection?: Collection; load?: FetchOption; }; export interface OrmDriver { /** * Upserts the model in the ORM */ save(model: T, collection?: Collection): Promise; /** * Removes the model in the ORM */ delete(model: T, collection?: Collection): Promise; /** * gets the cid of the model with the passed id if the relative model is already fetched, null otherwise */ getModelById(model: Class, id: string | number, options?: FetchOptions): Promise; executeQuery(model: Class, query: Query): Promise; observeQuery(model: Class, query: Query, handler: (array: T[]) => void): ISubscription; find(model: Class): Query; }