diff options
| author | altaf-creator <dev@altafcreator.com> | 2025-11-09 11:15:19 +0800 |
|---|---|---|
| committer | altaf-creator <dev@altafcreator.com> | 2025-11-09 11:15:19 +0800 |
| commit | 8eff962cab608341a6f2fedc640a0e32d96f26e2 (patch) | |
| tree | 05534d1a720ddc3691d346c69b4972555820a061 /frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util | |
pain
Diffstat (limited to 'frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util')
28 files changed, 1792 insertions, 0 deletions
diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/array.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/array.d.ts new file mode 100644 index 0000000..8be6593 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/array.d.ts @@ -0,0 +1,70 @@ +/** + * @license + * Copyright 2017 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. + */ +/** + * Returns true iff the array contains the value using strong equality. + */ +export declare function includes<T>(array: T[], value: T): boolean; +/** + * Returns true iff the array contains any value matching the predicate + */ +export declare function some<T>(array: T[], predicate: (t: T) => boolean): boolean; +/** + * Calls predicate function for each item in the array until the predicate + * returns true, at which point the index of that item is returned. If the + * predicate does not return true for any item, null is returned. + */ +export declare function findIndex<A>(array: A[], predicate: (value: A) => boolean): number | null; +/** + * Compares two array for equality using comparator. The method computes the + * intersection and invokes `onAdd` for every element that is in `after` but not + * `before`. `onRemove` is invoked for every element in `before` but missing + * from `after`. + * + * The method creates a copy of both `before` and `after` and runs in O(n log + * n), where n is the size of the two lists. + * + * @param before - The elements that exist in the original array. + * @param after - The elements to diff against the original array. + * @param comparator - The comparator for the elements in before and after. + * @param onAdd - A function to invoke for every element that is part of ` + * after` but not `before`. + * @param onRemove - A function to invoke for every element that is part of + * `before` but not `after`. + */ +export declare function diffArrays<T>(before: T[], after: T[], comparator: (l: T, r: T) => number, onAdd: (entry: T) => void, onRemove: (entry: T) => void): void; +/** + * Verifies equality for an array of objects using the `isEqual` interface. + * + * @private + * @internal + * @param left Array of objects supporting `isEqual`. + * @param right Array of objects supporting `isEqual`. + * @return True if arrays are equal. + */ +export declare function isArrayEqual<T extends { + isEqual: (t: T) => boolean; +}>(left: T[], right: T[]): boolean; +/** + * Verifies equality for an array of primitives. + * + * @private + * @internal + * @param left Array of primitives. + * @param right Array of primitives. + * @return True if arrays are equal. + */ +export declare function isPrimitiveArrayEqual<T extends number | string>(left: T[], right: T[]): boolean; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/assert.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/assert.d.ts new file mode 100644 index 0000000..294b08a --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/assert.d.ts @@ -0,0 +1,78 @@ +/** + * @license + * Copyright 2017 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. + */ +/** + * Unconditionally fails, throwing an Error with the given message. + * Messages are stripped in production builds. + * + * Returns `never` and can be used in expressions: + * @example + * let futureVar = fail('not implemented yet'); + * + * @param code generate a new unique value with `yarn assertion-id:generate` + * Search for an existing value using `yarn assertion-id:find X` + */ +export declare function fail(code: number, message: string, context?: Record<string, unknown>): never; +/** + * Unconditionally fails, throwing an Error with the given message. + * Messages are stripped in production builds. + * + * Returns `never` and can be used in expressions: + * @example + * let futureVar = fail('not implemented yet'); + * + * @param id generate a new unique value with `yarn assertion-id:generate` + * Search for an existing value using `yarn assertion-id:find X` + */ +export declare function fail(id: number, context?: Record<string, unknown>): never; +/** + * Fails if the given assertion condition is false, throwing an Error with the + * given message if it did. + * + * Messages are stripped in production builds. + * + * @param id generate a new unique value with `yarn assertion-idgenerate`. + * Search for an existing value using `yarn assertion-id:find X` + */ +export declare function hardAssert(assertion: boolean, id: number, message: string, context?: Record<string, unknown>): asserts assertion; +/** + * Fails if the given assertion condition is false, throwing an Error with the + * given message if it did. + * + * Messages are stripped in production builds. + * + * @param id generate a new unique value with `yarn assertion-id:generate`. + * Search for an existing value using `yarn assertion-id:find X` + */ +export declare function hardAssert(assertion: boolean, id: number, context?: Record<string, unknown>): asserts assertion; +/** + * Fails if the given assertion condition is false, throwing an Error with the + * given message if it did. + * + * The code of callsites invoking this function are stripped out in production + * builds. Any side-effects of code within the debugAssert() invocation will not + * happen in this case. + * + * @internal + */ +export declare function debugAssert(assertion: boolean, message: string): asserts assertion; +/** + * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an + * instance of `T` before casting. + */ +export declare function debugCast<T>(obj: object, constructor: { + new (...args: any[]): T; +}): T | never; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/async_observer.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/async_observer.d.ts new file mode 100644 index 0000000..21a965e --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/async_observer.d.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2017 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 { Observer } from '../core/event_manager'; +import { FirestoreError } from './error'; +export declare class AsyncObserver<T> implements Observer<T> { + private observer; + /** + * When set to true, will not raise future events. Necessary to deal with + * async detachment of listener. + */ + private muted; + constructor(observer: Partial<Observer<T>>); + next(value: T): void; + error(error: FirestoreError): void; + mute(): void; + private scheduleEvent; +} diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/async_queue.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/async_queue.d.ts new file mode 100644 index 0000000..098746b --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/async_queue.d.ts @@ -0,0 +1,180 @@ +/** + * @license + * Copyright 2017 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 { FirestoreError } from './error'; +/** + * Wellknown "timer" IDs used when scheduling delayed operations on the + * AsyncQueue. These IDs can then be used from tests to check for the presence + * of operations or to run them early. + * + * The string values are used when encoding these timer IDs in JSON spec tests. + */ +export declare const enum TimerId { + /** All can be used with runDelayedOperationsEarly() to run all timers. */ + All = "all", + /** + * The following 5 timers are used in persistent_stream.ts for the listen and + * write streams. The "Idle" timer is used to close the stream due to + * inactivity. The "ConnectionBackoff" timer is used to restart a stream once + * the appropriate backoff delay has elapsed. The health check is used to mark + * a stream healthy if it has not received an error during its initial setup. + */ + ListenStreamIdle = "listen_stream_idle", + ListenStreamConnectionBackoff = "listen_stream_connection_backoff", + WriteStreamIdle = "write_stream_idle", + WriteStreamConnectionBackoff = "write_stream_connection_backoff", + HealthCheckTimeout = "health_check_timeout", + /** + * A timer used in online_state_tracker.ts to transition from + * OnlineState.Unknown to Offline after a set timeout, rather than waiting + * indefinitely for success or failure. + */ + OnlineStateTimeout = "online_state_timeout", + /** + * A timer used to update the client metadata in IndexedDb, which is used + * to determine the primary leaseholder. + */ + ClientMetadataRefresh = "client_metadata_refresh", + /** A timer used to periodically attempt LRU Garbage collection */ + LruGarbageCollection = "lru_garbage_collection", + /** + * A timer used to retry transactions. Since there can be multiple concurrent + * transactions, multiple of these may be in the queue at a given time. + */ + TransactionRetry = "transaction_retry", + /** + * A timer used to retry operations scheduled via retryable AsyncQueue + * operations. + */ + AsyncQueueRetry = "async_queue_retry", + /** + * A timer used to periodically attempt index backfill. + */ + IndexBackfill = "index_backfill" +} +/** + * Represents an operation scheduled to be run in the future on an AsyncQueue. + * + * It is created via DelayedOperation.createAndSchedule(). + * + * Supports cancellation (via cancel()) and early execution (via skipDelay()). + * + * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type + * in newer versions of TypeScript defines `finally`, which is not available in + * IE. + */ +export declare class DelayedOperation<T extends unknown> implements PromiseLike<T> { + private readonly asyncQueue; + readonly timerId: TimerId; + readonly targetTimeMs: number; + private readonly op; + private readonly removalCallback; + private timerHandle; + private readonly deferred; + private constructor(); + get promise(): Promise<T>; + /** + * Creates and returns a DelayedOperation that has been scheduled to be + * executed on the provided asyncQueue after the provided delayMs. + * + * @param asyncQueue - The queue to schedule the operation on. + * @param id - A Timer ID identifying the type of operation this is. + * @param delayMs - The delay (ms) before the operation should be scheduled. + * @param op - The operation to run. + * @param removalCallback - A callback to be called synchronously once the + * operation is executed or canceled, notifying the AsyncQueue to remove it + * from its delayedOperations list. + * PORTING NOTE: This exists to prevent making removeDelayedOperation() and + * the DelayedOperation class public. + */ + static createAndSchedule<R extends unknown>(asyncQueue: AsyncQueue, timerId: TimerId, delayMs: number, op: () => Promise<R>, removalCallback: (op: DelayedOperation<R>) => void): DelayedOperation<R>; + /** + * Starts the timer. This is called immediately after construction by + * createAndSchedule(). + */ + private start; + /** + * Queues the operation to run immediately (if it hasn't already been run or + * canceled). + */ + skipDelay(): void; + /** + * Cancels the operation if it hasn't already been executed or canceled. The + * promise will be rejected. + * + * As long as the operation has not yet been run, calling cancel() provides a + * guarantee that the operation will not be run. + */ + cancel(reason?: string): void; + then: <TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined) => Promise<TResult1 | TResult2>; + private handleDelayElapsed; + private clearTimeout; +} +export interface AsyncQueue { + readonly isShuttingDown: boolean; + /** + * Adds a new operation to the queue without waiting for it to complete (i.e. + * we ignore the Promise result). + */ + enqueueAndForget<T extends unknown>(op: () => Promise<T>): void; + /** + * Regardless if the queue has initialized shutdown, adds a new operation to the + * queue without waiting for it to complete (i.e. we ignore the Promise result). + */ + enqueueAndForgetEvenWhileRestricted<T extends unknown>(op: () => Promise<T>): void; + /** + * Initialize the shutdown of this queue. Once this method is called, the + * only possible way to request running an operation is through + * `enqueueEvenWhileRestricted()`. + * + * @param purgeExistingTasks Whether already enqueued tasked should be + * rejected (unless enqueued with `enqueueEvenWhileRestricted()`). Defaults + * to false. + */ + enterRestrictedMode(purgeExistingTasks?: boolean): void; + /** + * Adds a new operation to the queue. Returns a promise that will be resolved + * when the promise returned by the new operation is (with its value). + */ + enqueue<T extends unknown>(op: () => Promise<T>): Promise<T>; + /** + * Enqueue a retryable operation. + * + * A retryable operation is rescheduled with backoff if it fails with a + * IndexedDbTransactionError (the error type used by SimpleDb). All + * retryable operations are executed in order and only run if all prior + * operations were retried successfully. + */ + enqueueRetryable(op: () => Promise<void>): void; + /** + * Schedules an operation to be queued on the AsyncQueue once the specified + * `delayMs` has elapsed. The returned DelayedOperation can be used to cancel + * or fast-forward the operation prior to its running. + */ + enqueueAfterDelay<T extends unknown>(timerId: TimerId, delayMs: number, op: () => Promise<T>): DelayedOperation<T>; + /** + * Verifies there's an operation currently in-progress on the AsyncQueue. + * Unfortunately we can't verify that the running code is in the promise chain + * of that operation, so this isn't a foolproof check, but it should be enough + * to catch some bugs. + */ + verifyOperationInProgress(): void; +} +/** + * Returns a FirestoreError that can be surfaced to the user if the provided + * error is an IndexedDbTransactionError. Re-throws the error otherwise. + */ +export declare function wrapInUserErrorIfRecoverable(e: Error, msg: string): FirestoreError; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/async_queue_impl.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/async_queue_impl.d.ts new file mode 100644 index 0000000..6dedc85 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/async_queue_impl.d.ts @@ -0,0 +1,75 @@ +/** + * @license + * Copyright 2020 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 { AsyncQueue, DelayedOperation, TimerId } from './async_queue'; +import { FirestoreError } from './error'; +export declare class AsyncQueueImpl implements AsyncQueue { + private tail; + private retryableOps; + private _isShuttingDown; + private delayedOperations; + failure: FirestoreError | null; + private operationInProgress; + private skipNonRestrictedTasks; + private timerIdsToSkip; + private backoff; + private visibilityHandler; + constructor(tail?: Promise<unknown>); + get isShuttingDown(): boolean; + /** + * Adds a new operation to the queue without waiting for it to complete (i.e. + * we ignore the Promise result). + */ + enqueueAndForget<T extends unknown>(op: () => Promise<T>): void; + enqueueAndForgetEvenWhileRestricted<T extends unknown>(op: () => Promise<T>): void; + enterRestrictedMode(purgeExistingTasks?: boolean): void; + enqueue<T extends unknown>(op: () => Promise<T>): Promise<T>; + enqueueRetryable(op: () => Promise<void>): void; + /** + * Runs the next operation from the retryable queue. If the operation fails, + * reschedules with backoff. + */ + private retryNextOp; + private enqueueInternal; + enqueueAfterDelay<T extends unknown>(timerId: TimerId, delayMs: number, op: () => Promise<T>): DelayedOperation<T>; + private verifyNotFailed; + verifyOperationInProgress(): void; + /** + * Waits until all currently queued tasks are finished executing. Delayed + * operations are not run. + */ + drain(): Promise<void>; + /** + * For Tests: Determine if a delayed operation with a particular TimerId + * exists. + */ + containsDelayedOperation(timerId: TimerId): boolean; + /** + * For Tests: Runs some or all delayed operations early. + * + * @param lastTimerId - Delayed operations up to and including this TimerId + * will be drained. Pass TimerId.All to run all delayed operations. + * @returns a Promise that resolves once all operations have been run. + */ + runAllDelayedOperationsUntil(lastTimerId: TimerId): Promise<void>; + /** + * For Tests: Skip all subsequent delays for a timer id. + */ + skipDelaysForTimerId(timerId: TimerId): void; + /** Called once a DelayedOperation is run or canceled. */ + private removeDelayedOperation; +} +export declare function newAsyncQueue(): AsyncQueue; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/base64_decode_error.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/base64_decode_error.d.ts new file mode 100644 index 0000000..18800ff --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/base64_decode_error.d.ts @@ -0,0 +1,22 @@ +/** + * @license + * Copyright 2023 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. + */ +/** + * An error encountered while decoding base64 string. + */ +export declare class Base64DecodeError extends Error { + readonly name = "Base64DecodeError"; +} diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/bundle_builder_impl.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/bundle_builder_impl.d.ts new file mode 100644 index 0000000..57e978c --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/bundle_builder_impl.d.ts @@ -0,0 +1,97 @@ +/** + * @license + * Copyright 2025 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 { Firestore } from '../api/database'; +import { Query } from '../core/query'; +import { DocumentData } from '../lite-api/reference'; +import { Timestamp } from '../lite-api/timestamp'; +import { DocumentKey } from '../model/document_key'; +/** + * Builds a Firestore data bundle with results from the given document and query snapshots. + */ +export declare class BundleBuilder { + private firestore; + readonly bundleId: string; + private documents; + private namedQueries; + private latestReadTime; + private databaseId; + private readonly serializer; + private readonly userDataReader; + constructor(firestore: Firestore, bundleId: string); + /** + * Adds data from a DocumentSnapshot to the bundle. + * @internal + * @param docBundleData A DocumentSnapshotBundleData containing information from the + * DocumentSnapshot. Note we cannot accept a DocumentSnapshot directly due to a circular + * dependency error. + * @param queryName The name of the QuerySnapshot if this document is part of a Query. + */ + addBundleDocument(docBundleData: DocumentSnapshotBundleData, queryName?: string): void; + /** + * Adds data from a QuerySnapshot to the bundle. + * @internal + * @param docBundleData A QuerySnapshotBundleData containing information from the + * QuerySnapshot. Note we cannot accept a QuerySnapshot directly due to a circular + * dependency error. + */ + addBundleQuery(queryBundleData: QuerySnapshotBundleData): void; + /** + * Convert data from a DocumentSnapshot into the serialized form within a bundle. + * @private + * @internal + * @param docBundleData a DocumentSnapshotBundleData containing the data required to + * serialize a document. + */ + private toBundleDocument; + /** + * Converts a IBundleElement to a Buffer whose content is the length prefixed JSON representation + * of the element. + * @private + * @internal + * @param bundleElement A ProtoBundleElement that is expected to be Proto3 JSON compatible. + */ + private lengthPrefixedString; + /** + * Construct a serialized string containing document and query information that has previously + * been added to the BundleBuilder through the addBundleDocument and addBundleQuery methods. + * @internal + */ + build(): string; +} +/** + * Interface for an object that contains data required to bundle a DocumentSnapshot. + * @internal + */ +export interface DocumentSnapshotBundleData { + documentData: DocumentData; + documentKey: DocumentKey; + documentPath: string; + documentExists: boolean; + createdTime: Timestamp; + readTime?: Timestamp; + versionTime: Timestamp; +} +/** + * Interface for an object that contains data required to bundle a QuerySnapshot. + * @internal + */ +export interface QuerySnapshotBundleData { + name: string; + query: Query; + parent: string; + docBundleDataArray: DocumentSnapshotBundleData[]; +} diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/bundle_reader.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/bundle_reader.d.ts new file mode 100644 index 0000000..cfe6dbd --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/bundle_reader.d.ts @@ -0,0 +1,67 @@ +/** + * @license + * Copyright 2020 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 { BundleElement, BundleMetadata } from '../protos/firestore_bundle_proto'; +import { JsonProtoSerializer } from '../remote/serializer'; +/** + * A complete element in the bundle stream, together with the byte length it + * occupies in the stream. + */ +export declare class SizedBundleElement { + readonly payload: BundleElement; + readonly byteLength: number; + constructor(payload: BundleElement, byteLength: number); + isBundleMetadata(): boolean; +} +export type BundleSource = ReadableStream<Uint8Array> | ArrayBuffer | Uint8Array; +/** + * A class representing a bundle. + * + * Takes a bundle stream or buffer, and presents abstractions to read bundled + * elements out of the underlying content. + */ +export interface BundleReader { + serializer: JsonProtoSerializer; + close(): Promise<void>; + /** + * Returns the metadata of the bundle. + */ + getMetadata(): Promise<BundleMetadata>; + /** + * Returns the next BundleElement (together with its byte size in the bundle) + * that has not been read from underlying ReadableStream. Returns null if we + * have reached the end of the stream. + */ + nextElement(): Promise<SizedBundleElement | null>; +} +/** + * A class representing a synchronized bundle reader. + * + * Takes a bundle string buffer, parses the data, and provides accessors to the data contained + * within it. + */ +export interface BundleReaderSync { + serializer: JsonProtoSerializer; + /** + * Returns the metadata of the bundle. + */ + getMetadata(): BundleMetadata; + /** + * Returns BundleElements parsed from the bundle. Returns an empty array if no bundle elements + * exist. + */ + getElements(): SizedBundleElement[]; +} diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/bundle_reader_impl.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/bundle_reader_impl.d.ts new file mode 100644 index 0000000..0858a93 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/bundle_reader_impl.d.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright 2020 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 { JsonProtoSerializer } from '../remote/serializer'; +import { BundleReader } from './bundle_reader'; +export declare function newBundleReader(reader: ReadableStreamDefaultReader<Uint8Array>, serializer: JsonProtoSerializer): BundleReader; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/bundle_reader_sync_impl.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/bundle_reader_sync_impl.d.ts new file mode 100644 index 0000000..638497f --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/bundle_reader_sync_impl.d.ts @@ -0,0 +1,59 @@ +/** + * @license + * Copyright 2025 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 { BundleMetadata } from '../protos/firestore_bundle_proto'; +import { JsonProtoSerializer } from '../remote/serializer'; +import { BundleReaderSync, SizedBundleElement } from './bundle_reader'; +/** + * A class that can parse a bundle form the string serialization of a bundle. + */ +export declare class BundleReaderSyncImpl implements BundleReaderSync { + private bundleData; + readonly serializer: JsonProtoSerializer; + private metadata; + private elements; + private cursor; + constructor(bundleData: string, serializer: JsonProtoSerializer); + getMetadata(): BundleMetadata; + getElements(): SizedBundleElement[]; + /** + * Parses the next element of the bundle. + * + * @returns a SizedBundleElement representation of the next element in the bundle, or null if + * no more elements exist. + */ + private nextElement; + /** + * Reads from a specified position from the bundleData string, for a specified + * number of bytes. + * + * @param length how many characters to read. + * @returns a string parsed from the bundle. + */ + private readJsonString; + /** + * Reads from the current cursor until the first '{'. + * + * @returns A string to integer represention of the parsed value. + * @throws An {@link Error} if the cursor has reached the end of the stream, since lengths + * prefix bundle objects. + */ + private readLength; +} +/** + * Creates an instance of BundleReader without exposing the BundleReaderSyncImpl class type. + */ +export declare function newBundleReaderSync(bundleData: string, serializer: JsonProtoSerializer): BundleReaderSync; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/byte_stream.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/byte_stream.d.ts new file mode 100644 index 0000000..72d8ed7 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/byte_stream.d.ts @@ -0,0 +1,29 @@ +/** + * @license + * Copyright 2020 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. + */ +/** + * How many bytes to read each time when `ReadableStreamReader.read()` is + * called. Only applicable for byte streams that we control (e.g. those backed + * by an UInt8Array). + */ +export declare const DEFAULT_BYTES_PER_READ = 10240; +/** + * Builds a `ByteStreamReader` from a UInt8Array. + * @param source - The data source to use. + * @param bytesPerRead - How many bytes each `read()` from the returned reader + * will read. + */ +export declare function toByteStreamReaderHelper(source: Uint8Array, bytesPerRead?: number): ReadableStreamDefaultReader<Uint8Array>; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/byte_string.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/byte_string.d.ts new file mode 100644 index 0000000..9aec389 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/byte_string.d.ts @@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2020 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. + */ +/** + * Immutable class that represents a "proto" byte string. + * + * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when + * sent on the wire. This class abstracts away this differentiation by holding + * the proto byte string in a common class that must be converted into a string + * before being sent as a proto. + * @internal + */ +export declare class ByteString { + private readonly binaryString; + static readonly EMPTY_BYTE_STRING: ByteString; + private constructor(); + static fromBase64String(base64: string): ByteString; + static fromUint8Array(array: Uint8Array): ByteString; + [Symbol.iterator](): Iterator<number>; + toBase64(): string; + toUint8Array(): Uint8Array; + approximateByteSize(): number; + compareTo(other: ByteString): number; + isEqual(other: ByteString): boolean; +} +/** + * Helper function to convert an Uint8array to a binary string. + */ +export declare function binaryStringFromUint8Array(array: Uint8Array): string; +/** + * Helper function to convert a binary string to an Uint8Array. + */ +export declare function uint8ArrayFromBinaryString(binaryString: string): Uint8Array; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/debug_uid.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/debug_uid.d.ts new file mode 100644 index 0000000..b590233 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/debug_uid.d.ts @@ -0,0 +1,28 @@ +/** + * @license + * Copyright 2023 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. + */ +/** + * Generates and returns a unique ID as a hexadecimal string. + * + * The returned ID is intended to be used in debug logging messages to help + * correlate log messages that may be spatially separated in the logs, but + * logically related. For example, a network connection could include the same + * "debug ID" string in all of its log messages to help trace a specific + * connection over time. + * + * @return the 10-character generated ID (e.g. "0xa1b2c3d4"). + */ +export declare function generateUniqueDebugId(): string; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/error.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/error.d.ts new file mode 100644 index 0000000..e49c172 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/error.d.ts @@ -0,0 +1,195 @@ +/** + * @license + * Copyright 2017 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 { FirebaseError } from '@firebase/util'; +/** + * The set of Firestore status codes. The codes are the same at the ones + * exposed by gRPC here: + * https://github.com/grpc/grpc/blob/master/doc/statuscodes.md + * + * Possible values: + * - 'cancelled': The operation was cancelled (typically by the caller). + * - 'unknown': Unknown error or an error from a different error domain. + * - 'invalid-argument': Client specified an invalid argument. Note that this + * differs from 'failed-precondition'. 'invalid-argument' indicates + * arguments that are problematic regardless of the state of the system + * (e.g. an invalid field name). + * - 'deadline-exceeded': Deadline expired before operation could complete. + * For operations that change the state of the system, this error may be + * returned even if the operation has completed successfully. For example, + * a successful response from a server could have been delayed long enough + * for the deadline to expire. + * - 'not-found': Some requested document was not found. + * - 'already-exists': Some document that we attempted to create already + * exists. + * - 'permission-denied': The caller does not have permission to execute the + * specified operation. + * - 'resource-exhausted': Some resource has been exhausted, perhaps a + * per-user quota, or perhaps the entire file system is out of space. + * - 'failed-precondition': Operation was rejected because the system is not + * in a state required for the operation's execution. + * - 'aborted': The operation was aborted, typically due to a concurrency + * issue like transaction aborts, etc. + * - 'out-of-range': Operation was attempted past the valid range. + * - 'unimplemented': Operation is not implemented or not supported/enabled. + * - 'internal': Internal errors. Means some invariants expected by + * underlying system has been broken. If you see one of these errors, + * something is very broken. + * - 'unavailable': The service is currently unavailable. This is most likely + * a transient condition and may be corrected by retrying with a backoff. + * - 'data-loss': Unrecoverable data loss or corruption. + * - 'unauthenticated': The request does not have valid authentication + * credentials for the operation. + */ +export type FirestoreErrorCode = 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated'; +/** + * Error Codes describing the different ways Firestore can fail. These come + * directly from GRPC. + */ +export type Code = FirestoreErrorCode; +export declare const Code: { + /** Not an error; returned on success. */ + OK: FirestoreErrorCode; + /** The operation was cancelled (typically by the caller). */ + CANCELLED: FirestoreErrorCode; + /** Unknown error or an error from a different error domain. */ + UNKNOWN: FirestoreErrorCode; + /** + * Client specified an invalid argument. Note that this differs from + * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are + * problematic regardless of the state of the system (e.g., a malformed file + * name). + */ + INVALID_ARGUMENT: FirestoreErrorCode; + /** + * Deadline expired before operation could complete. For operations that + * change the state of the system, this error may be returned even if the + * operation has completed successfully. For example, a successful response + * from a server could have been delayed long enough for the deadline to + * expire. + */ + DEADLINE_EXCEEDED: FirestoreErrorCode; + /** Some requested entity (e.g., file or directory) was not found. */ + NOT_FOUND: FirestoreErrorCode; + /** + * Some entity that we attempted to create (e.g., file or directory) already + * exists. + */ + ALREADY_EXISTS: FirestoreErrorCode; + /** + * The caller does not have permission to execute the specified operation. + * PERMISSION_DENIED must not be used for rejections caused by exhausting + * some resource (use RESOURCE_EXHAUSTED instead for those errors). + * PERMISSION_DENIED must not be used if the caller cannot be identified + * (use UNAUTHENTICATED instead for those errors). + */ + PERMISSION_DENIED: FirestoreErrorCode; + /** + * The request does not have valid authentication credentials for the + * operation. + */ + UNAUTHENTICATED: FirestoreErrorCode; + /** + * Some resource has been exhausted, perhaps a per-user quota, or perhaps the + * entire file system is out of space. + */ + RESOURCE_EXHAUSTED: FirestoreErrorCode; + /** + * Operation was rejected because the system is not in a state required for + * the operation's execution. For example, directory to be deleted may be + * non-empty, an rmdir operation is applied to a non-directory, etc. + * + * A litmus test that may help a service implementor in deciding + * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE: + * (a) Use UNAVAILABLE if the client can retry just the failing call. + * (b) Use ABORTED if the client should retry at a higher-level + * (e.g., restarting a read-modify-write sequence). + * (c) Use FAILED_PRECONDITION if the client should not retry until + * the system state has been explicitly fixed. E.g., if an "rmdir" + * fails because the directory is non-empty, FAILED_PRECONDITION + * should be returned since the client should not retry unless + * they have first fixed up the directory by deleting files from it. + * (d) Use FAILED_PRECONDITION if the client performs conditional + * REST Get/Update/Delete on a resource and the resource on the + * server does not match the condition. E.g., conflicting + * read-modify-write on the same resource. + */ + FAILED_PRECONDITION: FirestoreErrorCode; + /** + * The operation was aborted, typically due to a concurrency issue like + * sequencer check failures, transaction aborts, etc. + * + * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED, + * and UNAVAILABLE. + */ + ABORTED: FirestoreErrorCode; + /** + * Operation was attempted past the valid range. E.g., seeking or reading + * past end of file. + * + * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed + * if the system state changes. For example, a 32-bit file system will + * generate INVALID_ARGUMENT if asked to read at an offset that is not in the + * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from + * an offset past the current file size. + * + * There is a fair bit of overlap between FAILED_PRECONDITION and + * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error) + * when it applies so that callers who are iterating through a space can + * easily look for an OUT_OF_RANGE error to detect when they are done. + */ + OUT_OF_RANGE: FirestoreErrorCode; + /** Operation is not implemented or not supported/enabled in this service. */ + UNIMPLEMENTED: FirestoreErrorCode; + /** + * Internal errors. Means some invariants expected by underlying System has + * been broken. If you see one of these errors, Something is very broken. + */ + INTERNAL: FirestoreErrorCode; + /** + * The service is currently unavailable. This is a most likely a transient + * condition and may be corrected by retrying with a backoff. + * + * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED, + * and UNAVAILABLE. + */ + UNAVAILABLE: FirestoreErrorCode; + /** Unrecoverable data loss or corruption. */ + DATA_LOSS: FirestoreErrorCode; +}; +/** An error returned by a Firestore operation. */ +export declare class FirestoreError extends FirebaseError { + /** + * The backend error code associated with this error. + */ + readonly code: FirestoreErrorCode; + /** + * A custom error description. + */ + readonly message: string; + /** The stack of the error. */ + readonly stack?: string; + /** @hideconstructor */ + constructor( + /** + * The backend error code associated with this error. + */ + code: FirestoreErrorCode, + /** + * A custom error description. + */ + message: string); +} diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/input_validation.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/input_validation.d.ts new file mode 100644 index 0000000..c62ae20 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/input_validation.d.ts @@ -0,0 +1,56 @@ +/** + * @license + * Copyright 2017 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 { ResourcePath } from '../model/path'; +/** Types accepted by validateType() and related methods for validation. */ +export type ValidationType = 'undefined' | 'object' | 'function' | 'boolean' | 'number' | 'string' | 'non-empty string'; +export declare function validateNonEmptyArgument(functionName: string, argumentName: string, argument?: string): asserts argument is string; +/** + * Validates that two boolean options are not set at the same time. + * @internal + */ +export declare function validateIsNotUsedTogether(optionName1: string, argument1: boolean | undefined, optionName2: string, argument2: boolean | undefined): void; +/** + * Validates that `path` refers to a document (indicated by the fact it contains + * an even numbers of segments). + */ +export declare function validateDocumentPath(path: ResourcePath): void; +/** + * Validates that `path` refers to a collection (indicated by the fact it + * contains an odd numbers of segments). + */ +export declare function validateCollectionPath(path: ResourcePath): void; +/** + * Returns true if it's a non-null object without a custom prototype + * (i.e. excludes Array, Date, etc.). + */ +export declare function isPlainObject(input: unknown): boolean; +/** Returns a string describing the type / value of the provided input. */ +export declare function valueDescription(input: unknown): string; +/** try to get the constructor name for an object. */ +export declare function tryGetCustomObjectType(input: object): string | null; +/** + * Casts `obj` to `T`, optionally unwrapping Compat types to expose the + * underlying instance. Throws if `obj` is not an instance of `T`. + * + * This cast is used in the Lite and Full SDK to verify instance types for + * arguments passed to the public API. + * @internal + */ +export declare function cast<T>(obj: object, constructor: { + new (...args: any[]): T; +}): T | never; +export declare function validatePositiveNumber(functionName: string, n: number): void; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/json_validation.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/json_validation.d.ts new file mode 100644 index 0000000..df52006 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/json_validation.d.ts @@ -0,0 +1,70 @@ +/** + * @license + * Copyright 2025 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. + */ +/** + * A list of data types Firestore objects may serialize in their toJSON implemenetations. + * @private + * @internal + */ +export type JsonTypeDesc = 'object' | 'string' | 'number' | 'boolean' | 'null' | 'undefined'; +/** + * An association of JsonTypeDesc values to their native types. + * @private + * @internal + */ +export type TSType<T extends JsonTypeDesc> = T extends 'object' ? object : T extends 'string' ? string : T extends 'number' ? number : T extends 'boolean' ? boolean : T extends 'null' ? null : T extends 'undefined' ? undefined : never; +/** + * The representation of a JSON object property name and its type value. + * @private + * @internal + */ +export interface Property<T extends JsonTypeDesc> { + value?: TSType<T>; + typeString: JsonTypeDesc; +} +/** + * A type Firestore data types may use to define the fields used in their JSON serialization. + * @private + * @internal + */ +export interface JsonSchema { + [key: string]: Property<JsonTypeDesc>; +} +/** + * Associates the JSON property type to the native type and sets them to be Required. + * @private + * @internal + */ +export type Json<T extends JsonSchema> = { + [K in keyof T]: Required<T[K]>['value']; +}; +/** + * Helper function to define a JSON schema {@link Property}. + * @private + * @internal + */ +export declare function property<T extends JsonTypeDesc>(typeString: T, optionalValue?: TSType<T>): Property<T>; +/** + * Validates the JSON object based on the provided schema, and narrows the type to the provided + * JSON schema. + * @private + * @internal + * + * @param json A JSON object to validate. + * @param scheme a {@link JsonSchema} that defines the properties to validate. + * @returns true if the JSON schema exists within the object. Throws a FirestoreError otherwise. + */ +export declare function validateJSON<S extends JsonSchema>(json: object, schema: S): json is Json<S>; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/log.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/log.d.ts new file mode 100644 index 0000000..f638baa --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/log.d.ts @@ -0,0 +1,39 @@ +/** + * @license + * Copyright 2017 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 { LogLevel, LogLevelString } from '@firebase/logger'; +export { LogLevel, LogLevelString }; +export declare function getLogLevel(): LogLevel; +/** + * Sets the verbosity of Cloud Firestore logs (debug, error, or silent). + * + * @param logLevel - The verbosity you set for activity and error logging. Can + * be any of the following values: + * + * <ul> + * <li>`debug` for the most verbose logging level, primarily for + * debugging.</li> + * <li>`error` to log errors only.</li> + * <li><code>`silent` to turn off logging.</li> + * </ul> + */ +export declare function setLogLevel(logLevel: LogLevelString): void; +export declare function logDebug(msg: string, ...obj: unknown[]): void; +export declare function logError(msg: string, ...obj: unknown[]): void; +/** + * @internal + */ +export declare function logWarn(msg: string, ...obj: unknown[]): void; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/logic_utils.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/logic_utils.d.ts new file mode 100644 index 0000000..2333586 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/logic_utils.d.ts @@ -0,0 +1,52 @@ +/** + * @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 { CompositeFilter, Filter } from '../core/filter'; +/** + * Provides utility functions that help with boolean logic transformations needed for handling + * complex filters used in queries. + */ +/** + * The `in` filter is only a syntactic sugar over a disjunction of equalities. For instance: `a in + * [1,2,3]` is in fact `a==1 || a==2 || a==3`. This method expands any `in` filter in the given + * input into a disjunction of equality filters and returns the expanded filter. + */ +export declare function computeInExpansion(filter: Filter): Filter; +/** + * Given a composite filter, returns the list of terms in its disjunctive normal form. + * + * <p>Each element in the return value is one term of the resulting DNF. For instance: For the + * input: (A || B) && C, the DNF form is: (A && C) || (B && C), and the return value is a list + * with two elements: a composite filter that performs (A && C), and a composite filter that + * performs (B && C). + * + * @param filter the composite filter to calculate DNF transform for. + * @return the terms in the DNF transform. + */ +export declare function getDnfTerms(filter: CompositeFilter): Filter[]; +export declare function computeDistributedNormalForm(filter: Filter): Filter; +export declare function applyDistribution(lhs: Filter, rhs: Filter): Filter; +/** + * Applies the associativity property to the given filter and returns the resulting filter. + * + * <ul> + * <li>A | (B | C) == (A | B) | C == (A | B | C) + * <li>A & (B & C) == (A & B) & C == (A & B & C) + * </ul> + * + * <p>For more info, visit: https://en.wikipedia.org/wiki/Associative_property#Propositional_logic + */ +export declare function applyAssociation(filter: Filter): Filter; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/misc.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/misc.d.ts new file mode 100644 index 0000000..95d4d43 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/misc.d.ts @@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2017 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 type EventHandler<E> = (value: E) => void; +export interface Indexable { + [k: string]: unknown; +} +/** + * A utility class for generating unique alphanumeric IDs of a specified length. + * + * @internal + * Exported internally for testing purposes. + */ +export declare class AutoId { + static newId(): string; +} +export declare function primitiveComparator<T>(left: T, right: T): number; +export interface Equatable<T> { + isEqual(other: T): boolean; +} +/** Compare strings in UTF-8 encoded byte order */ +export declare function compareUtf8Strings(left: string, right: string): number; +export declare function isSurrogate(s: string): boolean; +export interface Iterable<V> { + forEach: (cb: (v: V) => void) => void; +} +/** Helper to compare arrays using isEqual(). */ +export declare function arrayEquals<T>(left: T[], right: T[], comparator: (l: T, r: T) => boolean): boolean; +/** + * Returns the immediate lexicographically-following string. This is useful to + * construct an inclusive range for indexeddb iterators. + */ +export declare function immediateSuccessor(s: string): string; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/node_api.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/node_api.d.ts new file mode 100644 index 0000000..2285e8e --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/node_api.d.ts @@ -0,0 +1,58 @@ +/** + * @license + * Copyright 2017 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. + */ +/** + * Creates a node-style callback that resolves or rejects a new Promise. The + * callback is passed to the given action which can then use the callback as + * a parameter to a node-style function. + * + * The intent is to directly bridge a node-style function (which takes a + * callback) into a Promise without manually converting between the node-style + * callback and the promise at each call. + * + * In effect it allows you to convert: + * + * @example + * new Promise((resolve: (value?: fs.Stats) => void, + * reject: (error?: any) => void) => { + * fs.stat(path, (error?: any, stat?: fs.Stats) => { + * if (error) { + * reject(error); + * } else { + * resolve(stat); + * } + * }); + * }); + * + * Into + * @example + * nodePromise((callback: NodeCallback<fs.Stats>) => { + * fs.stat(path, callback); + * }); + * + * @param action - a function that takes a node-style callback as an argument + * and then uses that callback to invoke some node-style API. + * @returns a new Promise which will be rejected if the callback is given the + * first Error parameter or will resolve to the value given otherwise. + */ +export declare function nodePromise<R>(action: (callback: NodeCallback<R>) => void): Promise<R>; +/** + * A node-style callback which passes an Error as the first argument if there + * was an error, or passes null and a proper value + */ +export interface NodeCallback<R> { + (error?: unknown, value?: R): void; +} diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/obj.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/obj.d.ts new file mode 100644 index 0000000..90bf468 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/obj.d.ts @@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2017 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 Dict<V> { + [stringKey: string]: V; +} +export declare function objectSize(obj: object): number; +export declare function forEach<V>(obj: Dict<V> | undefined, fn: (key: string, val: V) => void): void; +export declare function mapToArray<V, R>(obj: Dict<V>, fn: (element: V, key: string, obj: Dict<V>) => R): R[]; +export declare function isEmpty<V>(obj: Dict<V>): boolean; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/obj_map.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/obj_map.d.ts new file mode 100644 index 0000000..f858bcf --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/obj_map.d.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright 2017 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. + */ +/** + * A map implementation that uses objects as keys. Objects must have an + * associated equals function and must be immutable. Entries in the map are + * stored together with the key being produced from the mapKeyFn. This map + * automatically handles collisions of keys. + */ +export declare class ObjectMap<KeyType, ValueType> { + private mapKeyFn; + private equalsFn; + /** + * The inner map for a key/value pair. Due to the possibility of collisions we + * keep a list of entries that we do a linear search through to find an actual + * match. Note that collisions should be rare, so we still expect near + * constant time lookups in practice. + */ + private inner; + /** The number of entries stored in the map */ + private innerSize; + constructor(mapKeyFn: (key: KeyType) => string, equalsFn: (l: KeyType, r: KeyType) => boolean); + /** Get a value for this key, or undefined if it does not exist. */ + get(key: KeyType): ValueType | undefined; + has(key: KeyType): boolean; + /** Put this key and value in the map. */ + set(key: KeyType, value: ValueType): void; + /** + * Remove this key from the map. Returns a boolean if anything was deleted. + */ + delete(key: KeyType): boolean; + forEach(fn: (key: KeyType, val: ValueType) => void): void; + isEmpty(): boolean; + size(): number; +} diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/promise.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/promise.d.ts new file mode 100644 index 0000000..f966068 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/promise.d.ts @@ -0,0 +1,34 @@ +/** + * @license + * Copyright 2017 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 = void> { + promise: Promise<R>; + resolve: Resolver<R>; + reject: Rejecter; + constructor(); +} +/** + * Takes an array of values and a function from a value to a Promise. The function is run on each + * value sequentially, waiting for the previous promise to resolve before starting the next one. + * The returned promise resolves once the function has been run on all values. + */ +export declare function sequence<T>(values: T[], fn: (value: T) => Promise<void>): Promise<void>; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/sorted_map.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/sorted_map.d.ts new file mode 100644 index 0000000..5060fa5 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/sorted_map.d.ts @@ -0,0 +1,100 @@ +/** + * @license + * Copyright 2017 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 type Comparator<K> = (key1: K, key2: K) => number; +export interface Entry<K, V> { + key: K; + value: V; +} +export declare class SortedMap<K, V> { + comparator: Comparator<K>; + root: LLRBNode<K, V> | LLRBEmptyNode<K, V>; + constructor(comparator: Comparator<K>, root?: LLRBNode<K, V> | LLRBEmptyNode<K, V>); + insert(key: K, value: V): SortedMap<K, V>; + remove(key: K): SortedMap<K, V>; + get(key: K): V | null; + indexOf(key: K): number; + isEmpty(): boolean; + get size(): number; + minKey(): K | null; + maxKey(): K | null; + inorderTraversal<T>(action: (k: K, v: V) => T): T; + forEach(fn: (k: K, v: V) => void): void; + toString(): string; + reverseTraversal<T>(action: (k: K, v: V) => T): T; + getIterator(): SortedMapIterator<K, V>; + getIteratorFrom(key: K): SortedMapIterator<K, V>; + getReverseIterator(): SortedMapIterator<K, V>; + getReverseIteratorFrom(key: K): SortedMapIterator<K, V>; +} +export declare class SortedMapIterator<K, V> { + private isReverse; + private nodeStack; + constructor(node: LLRBNode<K, V> | LLRBEmptyNode<K, V>, startKey: K | null, comparator: Comparator<K>, isReverse: boolean); + getNext(): Entry<K, V>; + hasNext(): boolean; + peek(): Entry<K, V> | null; +} +export declare class LLRBNode<K, V> { + key: K; + value: V; + readonly color: boolean; + readonly left: LLRBNode<K, V> | LLRBEmptyNode<K, V>; + readonly right: LLRBNode<K, V> | LLRBEmptyNode<K, V>; + readonly size: number; + static EMPTY: LLRBEmptyNode<any, any>; + static RED: boolean; + static BLACK: boolean; + constructor(key: K, value: V, color?: boolean, left?: LLRBNode<K, V> | LLRBEmptyNode<K, V>, right?: LLRBNode<K, V> | LLRBEmptyNode<K, V>); + copy(key: K | null, value: V | null, color: boolean | null, left: LLRBNode<K, V> | LLRBEmptyNode<K, V> | null, right: LLRBNode<K, V> | LLRBEmptyNode<K, V> | null): LLRBNode<K, V>; + isEmpty(): boolean; + inorderTraversal<T>(action: (k: K, v: V) => T): T; + reverseTraversal<T>(action: (k: K, v: V) => T): T; + private min; + minKey(): K | null; + maxKey(): K | null; + insert(key: K, value: V, comparator: Comparator<K>): LLRBNode<K, V>; + private removeMin; + remove(key: K, comparator: Comparator<K>): LLRBNode<K, V> | LLRBEmptyNode<K, V>; + isRed(): boolean; + private fixUp; + private moveRedLeft; + private moveRedRight; + private rotateLeft; + private rotateRight; + private colorFlip; + checkMaxDepth(): boolean; + protected check(): number; +} +export declare class LLRBEmptyNode<K, V> { + get key(): never; + get value(): never; + get color(): never; + get left(): never; + get right(): never; + size: number; + copy(key: K | null, value: V | null, color: boolean | null, left: LLRBNode<K, V> | LLRBEmptyNode<K, V> | null, right: LLRBNode<K, V> | LLRBEmptyNode<K, V> | null): LLRBEmptyNode<K, V>; + insert(key: K, value: V, comparator: Comparator<K>): LLRBNode<K, V>; + remove(key: K, comparator: Comparator<K>): LLRBEmptyNode<K, V>; + isEmpty(): boolean; + inorderTraversal(action: (k: K, v: V) => boolean): boolean; + reverseTraversal(action: (k: K, v: V) => boolean): boolean; + minKey(): K | null; + maxKey(): K | null; + isRed(): boolean; + checkMaxDepth(): boolean; + protected check(): 0; +} diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/sorted_set.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/sorted_set.d.ts new file mode 100644 index 0000000..ff6aedc --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/sorted_set.d.ts @@ -0,0 +1,80 @@ +/** + * @license + * Copyright 2017 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 { SortedMapIterator } from './sorted_map'; +/** + * SortedSet is an immutable (copy-on-write) collection that holds elements + * in order specified by the provided comparator. + * + * NOTE: if provided comparator returns 0 for two elements, we consider them to + * be equal! + */ +export declare class SortedSet<T> { + private comparator; + private data; + constructor(comparator: (left: T, right: T) => number); + has(elem: T): boolean; + first(): T | null; + last(): T | null; + get size(): number; + indexOf(elem: T): number; + /** Iterates elements in order defined by "comparator" */ + forEach(cb: (elem: T) => void): void; + /** Iterates over `elem`s such that: range[0] <= elem < range[1]. */ + forEachInRange(range: [T, T], cb: (elem: T) => void): void; + /** + * Iterates over `elem`s such that: start <= elem until false is returned. + */ + forEachWhile(cb: (elem: T) => boolean, start?: T): void; + /** Finds the least element greater than or equal to `elem`. */ + firstAfterOrEqual(elem: T): T | null; + getIterator(): SortedSetIterator<T>; + getIteratorFrom(key: T): SortedSetIterator<T>; + /** Inserts or updates an element */ + add(elem: T): SortedSet<T>; + /** Deletes an element */ + delete(elem: T): SortedSet<T>; + isEmpty(): boolean; + unionWith(other: SortedSet<T>): SortedSet<T>; + isEqual(other: SortedSet<T>): boolean; + toArray(): T[]; + toString(): string; + private copy; +} +export declare class SortedSetIterator<T> { + private iter; + constructor(iter: SortedMapIterator<T, boolean>); + getNext(): T; + hasNext(): boolean; +} +/** + * Compares two sorted sets for equality using their natural ordering. The + * method computes the intersection and invokes `onAdd` for every element that + * is in `after` but not `before`. `onRemove` is invoked for every element in + * `before` but missing from `after`. + * + * The method creates a copy of both `before` and `after` and runs in O(n log + * n), where n is the size of the two lists. + * + * @param before - The elements that exist in the original set. + * @param after - The elements to diff against the original set. + * @param comparator - The comparator for the elements in before and after. + * @param onAdd - A function to invoke for every element that is part of ` + * after` but not `before`. + * @param onRemove - A function to invoke for every element that is part of + * `before` but not `after`. + */ +export declare function diffSortedSets<T>(before: SortedSet<T>, after: SortedSet<T>, comparator: (l: T, r: T) => number, onAdd: (entry: T) => void, onRemove: (entry: T) => void): void; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/testing_hooks.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/testing_hooks.d.ts new file mode 100644 index 0000000..90c6a65 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/testing_hooks.d.ts @@ -0,0 +1,52 @@ +/** + * @license + * Copyright 2023 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 { Unsubscribe } from '../api/reference_impl'; +import { ExistenceFilterMismatchInfo } from './testing_hooks_spi'; +/** + * Testing hooks for use by Firestore's integration test suite to reach into the + * SDK internals to validate logic and behavior that is not visible from the + * public API surface. + * + * @internal + */ +export declare class TestingHooks { + private constructor(); + /** + * Registers a callback to be notified when an existence filter mismatch + * occurs in the Watch listen stream. + * + * The relative order in which callbacks are notified is unspecified; do not + * rely on any particular ordering. If a given callback is registered multiple + * times then it will be notified multiple times, once per registration. + * + * @param callback the callback to invoke upon existence filter mismatch. + * + * @return a function that, when called, unregisters the given callback; only + * the first invocation of the returned function does anything; all subsequent + * invocations do nothing. + */ + static onExistenceFilterMismatch(callback: ExistenceFilterMismatchCallback): Unsubscribe; +} +/** + * The signature of callbacks registered with + * `TestingUtils.onExistenceFilterMismatch()`. + * + * The return value, if any, is ignored. + * + * @internal + */ +export type ExistenceFilterMismatchCallback = (info: ExistenceFilterMismatchInfo) => unknown; diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/testing_hooks_spi.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/testing_hooks_spi.d.ts new file mode 100644 index 0000000..3d456e9 --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/testing_hooks_spi.d.ts @@ -0,0 +1,93 @@ +/** + * @license + * Copyright 2023 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. + */ +/** + * The global, singleton instance of TestingHooksSpi. + * + * This variable will be `null` in all cases _except_ when running from + * integration tests that have registered callbacks to be notified of events + * that happen during the test execution. + */ +export declare let testingHooksSpi: TestingHooksSpi | null; +/** + * Sets the value of the `testingHooksSpi` object. + * @param instance the instance to set. + */ +export declare function setTestingHooksSpi(instance: TestingHooksSpi): void; +/** + * The "service provider interface" for the testing hooks. + * + * The implementation of this object will handle the callbacks made by the SDK + * to be handled by the integration tests. + * + * This "SPI" is separated from the implementation to avoid import cycles and + * to enable production builds to fully tree-shake away the testing hooks logic. + */ +export interface TestingHooksSpi { + /** + * Invokes all callbacks registered with + * `TestingHooks.onExistenceFilterMismatch()` with the given info. + */ + notifyOnExistenceFilterMismatch(info: ExistenceFilterMismatchInfo): void; +} +/** + * Information about an existence filter mismatch. + * @internal + */ +export interface ExistenceFilterMismatchInfo { + /** The number of documents that matched the query in the local cache. */ + localCacheCount: number; + /** + * The number of documents that matched the query on the server, as specified + * in the ExistenceFilter message's `count` field. + */ + existenceFilterCount: number; + /** + * The projectId used when checking documents for membership in the bloom + * filter. + */ + projectId: string; + /** + * The databaseId used when checking documents for membership in the bloom + * filter. + */ + databaseId: string; + /** + * Information about the bloom filter provided by Watch in the ExistenceFilter + * message's `unchangedNames` field. If this property is omitted or undefined + * then that means that Watch did _not_ provide a bloom filter. + */ + bloomFilter?: { + /** + * Whether a full requery was averted by using the bloom filter. If false, + * then something happened, such as a false positive, to prevent using the + * bloom filter to avoid a full requery. + */ + applied: boolean; + /** The number of hash functions used in the bloom filter. */ + hashCount: number; + /** The number of bytes in the bloom filter's bitmask. */ + bitmapLength: number; + /** The number of bits of padding in the last byte of the bloom filter. */ + padding: number; + /** + * Tests the given string for membership in the bloom filter created from + * the existence filter; will be undefined if creating the bloom filter + * failed. + */ + mightContain?: (value: string) => boolean; + }; +} diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/types.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/types.d.ts new file mode 100644 index 0000000..a6842fe --- /dev/null +++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/util/types.d.ts @@ -0,0 +1,45 @@ +/** + * @license + * Copyright 2017 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. + */ +/** Sentinel value that sorts before any Mutation Batch ID. */ +export declare const BATCHID_UNKNOWN = -1; +export interface StringMap { + [key: string]: string; +} +/** + * Returns whether a variable is either undefined or null. + */ +export declare function isNullOrUndefined(value: unknown): value is null | undefined; +/** Returns whether the value represents -0. */ +export declare function isNegativeZero(value: number): boolean; +/** + * Returns whether a value is an integer and in the safe integer range + * @param value - The value to test for being an integer and in the safe range + */ +export declare function isSafeInteger(value: unknown): boolean; +/** The subset of the browser's Window interface used by the SDK. */ +export interface WindowLike { + readonly localStorage: Storage; + readonly indexedDB: IDBFactory | null; + addEventListener(type: string, listener: EventListener): void; + removeEventListener(type: string, listener: EventListener): void; +} +/** The subset of the browser's Document interface used by the SDK. */ +export interface DocumentLike { + readonly visibilityState: DocumentVisibilityState; + addEventListener(type: string, listener: EventListener): void; + removeEventListener(type: string, listener: EventListener): void; +} |
