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/database/dist/node-esm/src/core/storage | |
pain
Diffstat (limited to 'frontend-old/node_modules/@firebase/database/dist/node-esm/src/core/storage')
3 files changed, 95 insertions, 0 deletions
diff --git a/frontend-old/node_modules/@firebase/database/dist/node-esm/src/core/storage/DOMStorageWrapper.d.ts b/frontend-old/node_modules/@firebase/database/dist/node-esm/src/core/storage/DOMStorageWrapper.d.ts new file mode 100644 index 0000000..662d8f5 --- /dev/null +++ b/frontend-old/node_modules/@firebase/database/dist/node-esm/src/core/storage/DOMStorageWrapper.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. + */ +/** + * Wraps a DOM Storage object and: + * - automatically encode objects as JSON strings before storing them to allow us to store arbitrary types. + * - prefixes names with "firebase:" to avoid collisions with app data. + * + * We automatically (see storage.js) create two such wrappers, one for sessionStorage, + * and one for localStorage. + * + */ +export declare class DOMStorageWrapper { + private domStorage_; + private prefix_; + /** + * @param domStorage_ - The underlying storage object (e.g. localStorage or sessionStorage) + */ + constructor(domStorage_: Storage); + /** + * @param key - The key to save the value under + * @param value - The value being stored, or null to remove the key. + */ + set(key: string, value: unknown | null): void; + /** + * @returns The value that was stored under this key, or null + */ + get(key: string): unknown; + remove(key: string): void; + isInMemoryStorage: boolean; + prefixedName_(name: string): string; + toString(): string; +} diff --git a/frontend-old/node_modules/@firebase/database/dist/node-esm/src/core/storage/MemoryStorage.d.ts b/frontend-old/node_modules/@firebase/database/dist/node-esm/src/core/storage/MemoryStorage.d.ts new file mode 100644 index 0000000..08dd04e --- /dev/null +++ b/frontend-old/node_modules/@firebase/database/dist/node-esm/src/core/storage/MemoryStorage.d.ts @@ -0,0 +1,27 @@ +/** + * @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. + */ +/** + * An in-memory storage implementation that matches the API of DOMStorageWrapper + * (TODO: create interface for both to implement). + */ +export declare class MemoryStorage { + private cache_; + set(key: string, value: unknown | null): void; + get(key: string): unknown; + remove(key: string): void; + isInMemoryStorage: boolean; +} diff --git a/frontend-old/node_modules/@firebase/database/dist/node-esm/src/core/storage/storage.d.ts b/frontend-old/node_modules/@firebase/database/dist/node-esm/src/core/storage/storage.d.ts new file mode 100644 index 0000000..52b3579 --- /dev/null +++ b/frontend-old/node_modules/@firebase/database/dist/node-esm/src/core/storage/storage.d.ts @@ -0,0 +1,22 @@ +/** + * @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 { DOMStorageWrapper } from './DOMStorageWrapper'; +import { MemoryStorage } from './MemoryStorage'; +/** A storage object that lasts across sessions */ +export declare const PersistentStorage: DOMStorageWrapper | MemoryStorage; +/** A storage object that only lasts one session */ +export declare const SessionStorage: DOMStorageWrapper | MemoryStorage; |
