diff options
Diffstat (limited to 'frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util')
6 files changed, 201 insertions, 0 deletions
diff --git a/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/equality_matcher.d.ts b/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/equality_matcher.d.ts new file mode 100644 index 0000000..57994ad --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/equality_matcher.d.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Duck-typed interface for objects that have an isEqual() method. + * + * Note: This is copied from src/util/misc.ts to avoid importing private types. + */ +export interface Equatable<T> { + isEqual(other: T): boolean; +} +/** + * Custom equals override for types that have a free-standing equals functions + * (such as `queryEquals()`). + */ +export interface CustomMatcher<T> { + equalsFn: (left: T, right: T) => boolean; + forType: Function; +} +export declare function addEqualityMatcher(...customMatchers: Array<CustomMatcher<any>>): void; diff --git a/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/events_accumulator.d.ts b/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/events_accumulator.d.ts new file mode 100644 index 0000000..7205365 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/events_accumulator.d.ts @@ -0,0 +1,39 @@ +/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import * as firestore from '@firebase/firestore-types'; +/** + * A helper object that can accumulate an arbitrary amount of events and resolve + * a promise when expected number has been emitted. + */ +export declare class EventsAccumulator<T extends firestore.DocumentSnapshot | firestore.QuerySnapshot> { + private events; + private waitingFor; + private deferred; + private rejectAdditionalEvents; + storeEvent: (evt: T) => void; + awaitEvents(length: number): Promise<T[]>; + awaitEvent(): Promise<T>; + /** Waits for a latency compensated local snapshot. */ + awaitLocalEvent(): Promise<T>; + /** Waits for multiple latency compensated local snapshot. */ + awaitLocalEvents(count: number): Promise<T[]>; + /** Waits for a snapshot that has no pending writes */ + awaitRemoteEvent(): Promise<T>; + assertNoAdditionalEvents(): Promise<void>; + allowAdditionalEvents(): void; + private checkFulfilled; +} diff --git a/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/firebase_export.d.ts b/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/firebase_export.d.ts new file mode 100644 index 0000000..8db0ed3 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/firebase_export.d.ts @@ -0,0 +1,29 @@ +/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { FirebaseApp } from '@firebase/app-types'; +import { GeoPoint, Timestamp } from '@firebase/firestore'; +import * as firestore from '@firebase/firestore-types'; +import { Blob } from '../../src/api/blob'; +import { Firestore, DocumentReference, QueryDocumentSnapshot } from '../../src/api/database'; +import { FieldPath } from '../../src/api/field_path'; +import { FieldValue } from '../../src/api/field_value'; +/** + * Creates a new test instance of Firestore using either firebase.firestore() + * or `initializeFirestore` from the modular API. + */ +export declare function newTestFirestore(projectId: string, nameOrApp?: string | FirebaseApp, settings?: firestore.Settings): firestore.FirebaseFirestore; +export { Firestore, FieldValue, FieldPath, Timestamp, Blob, GeoPoint, DocumentReference, QueryDocumentSnapshot }; diff --git a/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/helpers.d.ts b/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/helpers.d.ts new file mode 100644 index 0000000..38cf3fc --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/helpers.d.ts @@ -0,0 +1,49 @@ +/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import * as firestore from '@firebase/firestore-types'; +export declare function isPersistenceAvailable(): boolean; +type ApiSuiteFunction = (message: string, testSuite: (persistence: boolean) => void) => void; +interface ApiDescribe { + (message: string, testSuite: (persistence: boolean) => void): void; + skip: ApiSuiteFunction; + only: ApiSuiteFunction; +} +export declare const apiDescribe: ApiDescribe; +/** Converts the documents in a QuerySnapshot to an array with the data of each document. */ +export declare function toDataArray(docSet: firestore.QuerySnapshot): firestore.DocumentData[]; +/** Converts the changes in a QuerySnapshot to an array with the data of each document. */ +export declare function toChangesArray(docSet: firestore.QuerySnapshot, options?: firestore.SnapshotListenOptions): firestore.DocumentData[]; +export declare function toDataMap(docSet: firestore.QuerySnapshot): { + [field: string]: firestore.DocumentData; +}; +/** Converts a DocumentSet to an array with the id of each document */ +export declare function toIds(docSet: firestore.QuerySnapshot): string[]; +export declare function withTestDb(persistence: boolean, fn: (db: firestore.FirebaseFirestore) => Promise<void>): Promise<void>; +/** Runs provided fn with a db for an alternate project id. */ +export declare function withAlternateTestDb(persistence: boolean, fn: (db: firestore.FirebaseFirestore) => Promise<void>): Promise<void>; +export declare function withTestDbs(persistence: boolean, numDbs: number, fn: (db: firestore.FirebaseFirestore[]) => Promise<void>): Promise<void>; +export declare function withTestDbsSettings(persistence: boolean, projectId: string, settings: firestore.Settings, numDbs: number, fn: (db: firestore.FirebaseFirestore[]) => Promise<void>): Promise<void>; +export declare function withTestDoc(persistence: boolean, fn: (doc: firestore.DocumentReference) => Promise<void>): Promise<void>; +export declare function withTestDocAndSettings(persistence: boolean, settings: firestore.Settings, fn: (doc: firestore.DocumentReference) => Promise<void>): Promise<void>; +export declare function withTestDocAndInitialData(persistence: boolean, initialData: firestore.DocumentData | null, fn: (doc: firestore.DocumentReference) => Promise<void>): Promise<void>; +export declare function withTestCollection(persistence: boolean, docs: { + [key: string]: firestore.DocumentData; +}, fn: (collection: firestore.CollectionReference) => Promise<void>): Promise<void>; +export declare function withTestCollectionSettings(persistence: boolean, settings: firestore.Settings, docs: { + [key: string]: firestore.DocumentData; +}, fn: (collection: firestore.CollectionReference) => Promise<void>): Promise<void>; +export {}; diff --git a/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/promise.d.ts b/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/promise.d.ts new file mode 100644 index 0000000..0826bce --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/promise.d.ts @@ -0,0 +1,28 @@ +/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export interface Resolver<R> { + (value: R | Promise<R>): void; +} +export interface Rejecter { + (reason?: Error): void; +} +export declare class Deferred<R> { + promise: Promise<R>; + resolve: Resolver<R>; + reject: Rejecter; + constructor(); +} diff --git a/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/settings.d.ts b/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/settings.d.ts new file mode 100644 index 0000000..0b8cfb6 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore-compat/dist/node-esm/test/util/settings.d.ts @@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export declare const USE_EMULATOR: boolean; +export declare const DEFAULT_SETTINGS: { + host: string; + ssl: boolean; +}; +export declare const DEFAULT_PROJECT_ID: any; +export declare const ALT_PROJECT_ID = "test-db2"; |
