import * as admin from 'firebase-admin'; import { Model } from '../model'; import { Data } from './data'; import { FirestoreWhereFilterOp } from './firestore-where-filter-op'; import { ModelOptions } from './model-options'; export interface IModel extends ModelOptions { fieldNames: string[]; collectionReference: admin.firestore.CollectionReference; documentReference: admin.firestore.DocumentReference; exists: boolean; createTime: admin.firestore.Timestamp; updateTime: admin.firestore.Timestamp; readTime: admin.firestore.Timestamp; init: (options: ModelOptions) => void; set: (target: Model, key: string, value: any) => boolean; setValue: (fieldName: string, value: any) => boolean; setValues: (values: Data) => boolean; deleteField: (fieldName: string) => boolean; deleteFields: (fieldNames: string[]) => boolean; get: (target: Model, key: string) => any; getValue: (fieldName: string) => any; getValues: (fieldNames?: string[]) => Data; getValuesForUpdate: () => Data; setId: (id: string) => boolean; getId: () => string; update: (values?: Data) => Promise; setFromSnapshot: (snapshot: admin.firestore.DocumentSnapshot) => boolean; collectionReferenceError: (reject: (reason?: any) => void) => void; create: (modelName_or_id?: string, id?: string) => Promise; add: (id: string, values: Data) => Promise; find: (id_or_fieldName?: string, opStr?: FirestoreWhereFilterOp, value?: any) => Promise; findById: (id: string) => Promise; findWhere: (fieldName: string, opStr: FirestoreWhereFilterOp, value: any) => Promise; findAll: () => Promise; [key: string]: any; }