summaryrefslogtreecommitdiff
path: root/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2025-11-09 11:15:19 +0800
committeraltaf-creator <dev@altafcreator.com>2025-11-09 11:15:19 +0800
commit8eff962cab608341a6f2fedc640a0e32d96f26e2 (patch)
tree05534d1a720ddc3691d346c69b4972555820a061 /frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index
pain
Diffstat (limited to 'frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index')
-rw-r--r--frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/directional_index_byte_encoder.d.ts24
-rw-r--r--frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/firestore_index_value_writer.d.ts34
-rw-r--r--frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/index_byte_encoder.d.ts31
-rw-r--r--frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/index_entry.d.ts49
-rw-r--r--frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/ordered_code_writer.d.ts60
5 files changed, 198 insertions, 0 deletions
diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/directional_index_byte_encoder.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/directional_index_byte_encoder.d.ts
new file mode 100644
index 0000000..0038f37
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/directional_index_byte_encoder.d.ts
@@ -0,0 +1,24 @@
+/**
+ * @license
+ * Copyright 2021 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 { ByteString } from '../util/byte_string';
+/** An index value encoder. */
+export interface DirectionalIndexByteEncoder {
+ writeBytes(value: ByteString): void;
+ writeString(value: string): void;
+ writeNumber(value: number): void;
+ writeInfinity(): void;
+}
diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/firestore_index_value_writer.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/firestore_index_value_writer.d.ts
new file mode 100644
index 0000000..01298c6
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/firestore_index_value_writer.d.ts
@@ -0,0 +1,34 @@
+/**
+ * @license
+ * Copyright 2021 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 { Value } from '../protos/firestore_proto_api';
+import { DirectionalIndexByteEncoder } from './directional_index_byte_encoder';
+/** Firestore index value writer. */
+export declare class FirestoreIndexValueWriter {
+ static INSTANCE: FirestoreIndexValueWriter;
+ private constructor();
+ /** Writes an index value. */
+ writeIndexValue(value: Value, encoder: DirectionalIndexByteEncoder): void;
+ private writeIndexValueAux;
+ private writeIndexString;
+ private writeUnlabeledIndexString;
+ private writeIndexMap;
+ private writeIndexVector;
+ private writeIndexArray;
+ private writeIndexEntityRef;
+ private writeValueTypeLabel;
+ private writeTruncationMarker;
+}
diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/index_byte_encoder.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/index_byte_encoder.d.ts
new file mode 100644
index 0000000..dce4631
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/index_byte_encoder.d.ts
@@ -0,0 +1,31 @@
+/**
+ * @license
+ * Copyright 2021 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 { IndexKind } from '../model/field_index';
+import { DirectionalIndexByteEncoder } from './directional_index_byte_encoder';
+/**
+ * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the
+ * actual encoding.
+ */
+export declare class IndexByteEncoder {
+ private orderedCode;
+ private ascending;
+ private descending;
+ seed(encodedBytes: Uint8Array): void;
+ forKind(kind: IndexKind): DirectionalIndexByteEncoder;
+ encodedBytes(): Uint8Array;
+ reset(): void;
+}
diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/index_entry.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/index_entry.d.ts
new file mode 100644
index 0000000..fe89202
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/index_entry.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 { DbIndexEntry } from '../local/indexeddb_schema';
+import { DbIndexEntryKey, KeySafeBytes } from '../local/indexeddb_sentinels';
+import { DocumentKey } from '../model/document_key';
+/** Represents an index entry saved by the SDK in persisted storage. */
+export declare class IndexEntry {
+ readonly _indexId: number;
+ readonly _documentKey: DocumentKey;
+ readonly _arrayValue: Uint8Array;
+ readonly _directionalValue: Uint8Array;
+ constructor(_indexId: number, _documentKey: DocumentKey, _arrayValue: Uint8Array, _directionalValue: Uint8Array);
+ /**
+ * Returns an IndexEntry entry that sorts immediately after the current
+ * directional value.
+ */
+ successor(): IndexEntry;
+ dbIndexEntry(uid: string, orderedDocumentKey: Uint8Array, documentKey: DocumentKey): DbIndexEntry;
+ dbIndexEntryKey(uid: string, orderedDocumentKey: Uint8Array, documentKey: DocumentKey): DbIndexEntryKey;
+}
+export declare function indexEntryComparator(left: IndexEntry, right: IndexEntry): number;
+export declare function compareByteArrays(left: Uint8Array, right: Uint8Array): number;
+/**
+ * Workaround for WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=292721
+ * Create a key safe representation of Uint8Array values.
+ * If the browser is detected as Safari or WebKit, then
+ * the input array will be converted to "sortable byte string".
+ * Otherwise, the input array will be returned in its original type.
+ */
+export declare function encodeKeySafeBytes(array: Uint8Array): KeySafeBytes;
+/**
+ * Reverts the key safe representation of Uint8Array (created by
+ * encodeKeySafeBytes) to a normal Uint8Array.
+ */
+export declare function decodeKeySafeBytes(input: KeySafeBytes): Uint8Array;
diff --git a/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/ordered_code_writer.d.ts b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/ordered_code_writer.d.ts
new file mode 100644
index 0000000..be345f7
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/firestore/dist/firestore/src/index/ordered_code_writer.d.ts
@@ -0,0 +1,60 @@
+import { ByteString } from '../util/byte_string';
+/**
+ * Counts the number of zeros in a byte.
+ *
+ * Visible for testing.
+ */
+export declare function numberOfLeadingZerosInByte(x: number): number;
+/**
+ * OrderedCodeWriter is a minimal-allocation implementation of the writing
+ * behavior defined by the backend.
+ *
+ * The code is ported from its Java counterpart.
+ */
+export declare class OrderedCodeWriter {
+ buffer: Uint8Array;
+ position: number;
+ writeBytesAscending(value: ByteString): void;
+ writeBytesDescending(value: ByteString): void;
+ /** Writes utf8 bytes into this byte sequence, ascending. */
+ writeUtf8Ascending(sequence: string): void;
+ /** Writes utf8 bytes into this byte sequence, descending */
+ writeUtf8Descending(sequence: string): void;
+ writeNumberAscending(val: number): void;
+ writeNumberDescending(val: number): void;
+ /**
+ * Writes the "infinity" byte sequence that sorts after all other byte
+ * sequences written in ascending order.
+ */
+ writeInfinityAscending(): void;
+ /**
+ * Writes the "infinity" byte sequence that sorts before all other byte
+ * sequences written in descending order.
+ */
+ writeInfinityDescending(): void;
+ /**
+ * Resets the buffer such that it is the same as when it was newly
+ * constructed.
+ */
+ reset(): void;
+ seed(encodedBytes: Uint8Array): void;
+ /** Makes a copy of the encoded bytes in this buffer. */
+ encodedBytes(): Uint8Array;
+ /**
+ * Encodes `val` into an encoding so that the order matches the IEEE 754
+ * floating-point comparison results with the following exceptions:
+ * -0.0 < 0.0
+ * all non-NaN < NaN
+ * NaN = NaN
+ */
+ private toOrderedBits;
+ /** Writes a single byte ascending to the buffer. */
+ private writeByteAscending;
+ /** Writes a single byte descending to the buffer. */
+ private writeByteDescending;
+ private writeSeparatorAscending;
+ private writeSeparatorDescending;
+ private writeEscapedByteAscending;
+ private writeEscapedByteDescending;
+ private ensureAvailable;
+}