import * as functions from 'firebase-functions'; /** * Update foreign key join data * @param change - change event * @param queryRef - query for fk docs * @param fields - fields to update, default * * @param field - field to store updated fields * @param isMap - see if field dot notation equals map, default true */ export declare function updateJoinData(change: functions.Change, queryRef: FirebaseFirestore.Query, fields: string[] | null, field: string, del?: boolean, isMap?: boolean): Promise; /** * Create data to join on document * @param change - change event * @param targetRef - the target document * @param fields - the fields to get from the target document * @param field - the field to store the target document fields * @param data - data object to update * @param alwaysCreate - create even if not necessary */ export declare function createJoinData(change: functions.Change, targetRef: FirebaseFirestore.DocumentReference, fields: string[], field?: string, data?: any, alwaysCreate?: boolean): Promise; /** * Get data to join on document * @param change - change event * @param targetRef - the target document * @param fields - the fields to get from the target document * @param field - the field to store the target document fields * @param data - data object to update * @param alwaysCreate - create even if not necessary */ export declare function getJoinData(change: functions.Change, targetRef: FirebaseFirestore.DocumentReference, fields: string[], field?: string, data?: any, alwaysCreate?: boolean): Promise; /** * Aggregate data * @param change - change functions snapshot * @param context - event context * @param targetRef - document reference to edit * @param queryRef - query reference to aggregate on doc * @param fieldExceptions - the fields not to include * @param aggregateField - the name of the aggregated field * @param n - the number of documents to aggregate, default 3 * @param data - if adding any other data to the document * @param alwaysAggregate - skip redundant aggregation, useful if not date sort */ export declare function aggregateData(change: functions.Change, context: functions.EventContext, targetRef: FirebaseFirestore.DocumentReference, queryRef: FirebaseFirestore.Query, fieldExceptions?: string[], aggregateField?: string, n?: number, data?: any, alwaysAggregate?: boolean): Promise; /** * @param change - change functions snapshot * @param context - event context * @param _opts : { * fieldToIndex - field to save in array or map, default id * max - maximum number of items in array / map, default 10,000 * type - array or map, default array * indexFieldName - name of field to store array, defaults to collection name * indexColName - name of new index collection, default collection_name__index * indexPath - path to store new collection, defaults to parent doc * docToIndex - doc to index with array, defaults to to parent doc * docFieldsToIndex - fields from parent doc to index, default * * docFieldName - name of field to store parent doc in, defaults to col name * docSortField - name of field to sort documents by, default createdAt * docSortType - sort by id or value (add id sort, or map value sort), default null * } */ export declare function arrayIndex(change: functions.Change, context: functions.EventContext, _opts?: { fieldToIndex?: string; max?: number; type?: "array" | "map"; indexFieldName?: string; indexColName?: string; indexPath?: string; docToIndex?: string; docFieldsToIndex?: string | string[]; docFieldName?: string; docSortField?: string; docSortType?: "id" | "value" | null; }): Promise;