import { IMFLocation } from '@modelata/fire/lib/node'; import { MFDao } from './mf-dao'; import { Bucket } from '@google-cloud/storage'; /** * Abstract Dao class use for subdocuments of flattable model */ export declare class SubMFDao extends MFDao { private referentGetNewModel; beforeSave: (model: Partial, location?: string | Partial) => Promise>; /** * @inheritdoc */ mustachePath: string; /** * Must be called with super * * @param mustachePath subCollection mustache path * @param db Firestore database to use * @param referentGetNewModel Parent getNewModelMethod * @param beforeSave Parent before save method to apply * @param storage Bucket if model contains files to save */ constructor(mustachePath: string, db: FirebaseFirestore.Firestore, referentGetNewModel: (data?: Partial, location?: Partial) => any, beforeSave: (model: Partial, location?: string | Partial) => Promise>, storage?: Bucket); /** * Returns true or false denpending on if the data contains values applicable to this subDao's submodel * * @param data The data to check * @return boolean */ containsSomeValuesForMe(data: Object): boolean; /** * Splits the data passed as parameter into data applicable to different documents using the same DAO * * @param data the data to split * @returns An object containing the data splitted by docIds */ splitDataByDocId(data: Partial): { [docId: string]: object; }; /** * @inheritdoc * * @param data * @param location */ getNewModel(data?: Partial, location?: Partial): any; }