firewalk
Version:
A collection traversal library for Firestore
19 lines (18 loc) • 2 kB
TypeScript
import type { firestore } from 'firebase-admin';
import type { BatchMigrator, MigrationPredicate, MigrationResult, SetDataGetter, SetOptions, SetPartialDataGetter, Traverser, UpdateDataGetter, UpdateFieldValueGetter } from '../../api';
import { AbstractMigrator, RegisteredCallbacks } from './abstract';
export declare class BasicBatchMigratorImpl<AppModelType = firestore.DocumentData, DbModelType extends firestore.DocumentData = firestore.DocumentData> extends AbstractMigrator<AppModelType, DbModelType> implements BatchMigrator<AppModelType, DbModelType> {
#private;
readonly traverser: Traverser<AppModelType, DbModelType>;
constructor(traverser: Traverser<AppModelType, DbModelType>, registeredCallbacks?: RegisteredCallbacks<AppModelType, DbModelType>, migrationPredicates?: MigrationPredicate<AppModelType, DbModelType>[]);
withPredicate(predicate: MigrationPredicate<AppModelType, DbModelType>): BatchMigrator<AppModelType, DbModelType>;
withTraverser(traverser: Traverser<AppModelType, DbModelType>): BatchMigrator<AppModelType, DbModelType>;
set(data: firestore.PartialWithFieldValue<AppModelType>, options: SetOptions): Promise<MigrationResult>;
set(data: firestore.WithFieldValue<AppModelType>): Promise<MigrationResult>;
setWithDerivedData(getData: SetPartialDataGetter<AppModelType, DbModelType>, options: SetOptions): Promise<MigrationResult>;
setWithDerivedData(getData: SetDataGetter<AppModelType, DbModelType>): Promise<MigrationResult>;
update(data: firestore.UpdateData<DbModelType>, precondition?: firestore.Precondition): Promise<MigrationResult>;
update(field: string | firestore.FieldPath, value: any, ...moreFieldsOrPrecondition: any[]): Promise<MigrationResult>;
updateWithDerivedData(getData: UpdateDataGetter<AppModelType, DbModelType>, precondition?: firestore.Precondition): Promise<MigrationResult>;
updateWithDerivedData(getData: UpdateFieldValueGetter<AppModelType, DbModelType>): Promise<MigrationResult>;
}