create-request 0.0.1-beta.22 → 0.0.1-beta.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,49 +0,0 @@
1
- import type { CacheOptions } from "../types/cache.js";
2
- import type { StorageProvider } from "./StorageProvider.js";
3
- /**
4
- * Create a memory storage provider using Map
5
- * This provider stores data in memory and is cleared when the application restarts.
6
- *
7
- * @returns A storage provider using an in-memory Map
8
- *
9
- * @example
10
- * const storage = createMemoryStorage();
11
- * storage.set("key", "value");
12
- */
13
- export declare function createMemoryStorage(): StorageProvider;
14
- /**
15
- * Create a localStorage-based storage provider
16
- * This provider persists data between browser sessions.
17
- *
18
- * @returns A storage provider using localStorage
19
- * @throws Console warnings if localStorage is not available or storage quota is exceeded
20
- *
21
- * @example
22
- * const storage = createLocalStorageStorage();
23
- * storage.set("key", "value");
24
- */
25
- export declare function createLocalStorageStorage(): StorageProvider;
26
- /**
27
- * Create a sessionStorage-based storage provider
28
- * This provider persists data only for the current browser session.
29
- *
30
- * @returns A storage provider using sessionStorage
31
- * @throws Console warnings if sessionStorage is not available or storage quota is exceeded
32
- *
33
- * @example
34
- * const storage = createSessionStorageStorage();
35
- * storage.set("key", "value");
36
- */
37
- export declare function createSessionStorageStorage(): StorageProvider;
38
- /**
39
- * Create a storage provider from cache options
40
- * Selects the appropriate storage implementation based on the provided options.
41
- * Falls back to memory storage if no suitable storage is found.
42
- *
43
- * @param options - Cache configuration options
44
- * @returns A storage provider based on the options
45
- *
46
- * @example
47
- * const storage = createStorageProvider({ storage: localStorage });
48
- */
49
- export declare function createStorageProvider(options?: CacheOptions): StorageProvider;
@@ -1,33 +0,0 @@
1
- /**
2
- * Interface for storage providers used by the cache system
3
- */
4
- export interface StorageProvider {
5
- /**
6
- * Get a value from storage
7
- * @param key The key to retrieve
8
- * @returns The stored value or null if not found
9
- */
10
- get(key: string): Promise<string | null> | string | null;
11
- /**
12
- * Set a value in storage
13
- * @param key The key to store
14
- * @param value The value to store
15
- * @param ttl Optional TTL in milliseconds
16
- * @returns Promise or void
17
- */
18
- set(key: string, value: string, ttl?: number): Promise<void> | void;
19
- /**
20
- * Check if a key exists in storage
21
- * @param key The key to check
22
- */
23
- has(key: string): Promise<boolean> | boolean;
24
- /**
25
- * Delete a value from storage
26
- * @param key The key to delete
27
- */
28
- delete(key: string): Promise<void> | void;
29
- /**
30
- * Clear all values from storage
31
- */
32
- clear(): Promise<void> | void;
33
- }