import 'reflect-metadata'; import { IMFGetListOptions, IMFGetOneOptions, IMFLocation, IMFSaveOptions, IMFUpdateOptions, MFOmit } from '@modelata/fire/lib/node'; import { MFDao } from './mf-dao'; import { MFModel } from './mf-model'; import { Bucket } from '@google-cloud/storage'; import { DocumentReference } from '@google-cloud/firestore'; /** * Abstract Flattable DAO class */ export declare abstract class MFFlattableDao> extends MFDao { /** * List of sub daos used */ private subDAOs; /** * @inheritdoc * * @param db * @param storage */ constructor(db: FirebaseFirestore.Firestore, storage?: Bucket); /** * Create all sub daos used */ private initAllSubDao; /** * Creates one sub dao * * @param subDaoPath path used by the sub dao */ private instantiateSubDao; /** * Fetch all subdocs * * @param parentLocation Location of the parent document * @param options Options to apply to fetch one subdoc */ private get_subDocs; /** * @inheritdoc * * @param reference * @param options */ getByReference(reference: DocumentReference, options?: IMFGetOneOptions): Promise; /** * Rebuild a model with data from subdocuments * * @param mainModel The main model * @param options Options to apply to fetch subdocs */ private getModelWithSubDocsFromMainModel; /** * @inheritdoc * * @param location * @param options */ getList(location?: MFOmit, options?: IMFGetListOptions): Promise; /** * extract from main model data intended to sub model * * @param data main model data */ extractMyData(data: Partial): Partial; /** * Create subdocuments (even empty ones) * * @param data Subdocument data * @param parentLocation Location of parent document * @param options Create options */ private create_subDocs; /** * @inheritdoc * * @param data * @param location * @param options */ create(data: M, location?: string | Partial, options?: IMFSaveOptions): Promise; /** * Update subdocuments the same way normal update does * * @param data Subdocument data * @param parentLocation Location of the parent document * @param options Update options */ private update_subDocs; /** * @inheritdoc * * @param data * @param location * @param options */ update(data: Partial, location?: string | IMFLocation | M, options?: IMFUpdateOptions): Promise>; }