@plyaz/types 1.7.16 → 1.7.18
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.
- package/dist/api/cache/index.d.ts +5 -0
- package/dist/api/cache/types.d.ts +22 -0
- package/dist/api/client/index.d.ts +5 -0
- package/dist/api/client/types.d.ts +31 -0
- package/dist/api/config/index.d.ts +5 -0
- package/dist/api/config/types.d.ts +634 -0
- package/dist/api/errors/index.d.ts +5 -0
- package/dist/api/errors/types.d.ts +129 -0
- package/dist/api/events/index.d.ts +5 -0
- package/dist/api/events/types.d.ts +795 -0
- package/dist/api/headers/index.d.ts +5 -0
- package/dist/api/headers/types.d.ts +59 -0
- package/dist/api/index.d.ts +19 -1
- package/dist/api/network/enums.d.ts +14 -0
- package/dist/api/network/index.d.ts +6 -0
- package/dist/api/network/types.d.ts +121 -0
- package/dist/api/performance/index.d.ts +5 -0
- package/dist/api/performance/types.d.ts +137 -0
- package/dist/api/polling/index.d.ts +5 -0
- package/dist/api/polling/types.d.ts +74 -0
- package/dist/api/queue/enums.d.ts +31 -0
- package/dist/api/queue/index.d.ts +6 -0
- package/dist/api/queue/types.d.ts +65 -0
- package/dist/api/regional/index.d.ts +5 -0
- package/dist/api/regional/types.d.ts +50 -0
- package/dist/api/retry/index.d.ts +5 -0
- package/dist/api/retry/types.d.ts +26 -0
- package/dist/api/revalidation/index.d.ts +5 -0
- package/dist/api/revalidation/types.d.ts +33 -0
- package/dist/api/strategies/index.d.ts +5 -0
- package/dist/api/strategies/types.d.ts +27 -0
- package/dist/api/utils/enums.d.ts +23 -0
- package/dist/api/utils/index.d.ts +5 -0
- package/dist/auth/index.cjs +0 -41
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +0 -38
- package/dist/auth/index.js.map +1 -1
- package/dist/common/types.d.ts +1 -4
- package/dist/errors/enums.d.ts +27 -0
- package/dist/errors/index.cjs +0 -43
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +0 -40
- package/dist/errors/index.js.map +1 -1
- package/dist/events/index.cjs +0 -33
- package/dist/events/index.cjs.map +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.js +0 -30
- package/dist/events/index.js.map +1 -1
- package/dist/events/types.d.ts +2 -2
- package/dist/index.cjs +0 -138
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +0 -128
- package/dist/index.js.map +1 -1
- package/dist/testing/common/utils/types.d.ts +2 -1
- package/dist/testing/features/api/types.d.ts +173 -21
- package/dist/web3/index.cjs +0 -27
- package/dist/web3/index.cjs.map +1 -1
- package/dist/web3/index.d.ts +1 -1
- package/dist/web3/index.js +0 -26
- package/dist/web3/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/api/types.d.ts +0 -51
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache Management Strategy Types
|
|
3
|
+
* Type definitions for cache strategies (implementations remain in @plyaz/api)
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Cache strategy configuration
|
|
7
|
+
* Maps to fetchff's cache options
|
|
8
|
+
*/
|
|
9
|
+
export interface CacheStrategyConfig {
|
|
10
|
+
/** Time-to-live in seconds */
|
|
11
|
+
ttl?: number;
|
|
12
|
+
/** Stale-while-revalidate time in seconds */
|
|
13
|
+
stale?: number;
|
|
14
|
+
/** Skip caching entirely */
|
|
15
|
+
skip?: boolean;
|
|
16
|
+
/** Cache error responses */
|
|
17
|
+
cacheErrors?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Cache strategy names for type-safe access
|
|
21
|
+
*/
|
|
22
|
+
export type CacheStrategyName = 'none' | 'shortLived' | 'standard' | 'longLived' | 'aggressive' | 'permanent' | 'swr';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Client Types
|
|
3
|
+
* Defines the client interface and options
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Options for creating an API client
|
|
7
|
+
* Endpoints are automatically included from src/api/endpoints
|
|
8
|
+
*
|
|
9
|
+
* Supports three levels of configuration:
|
|
10
|
+
* 1. Unified strategy (simple) - Preconfigured strategy for common patterns
|
|
11
|
+
* 2. Individual strategies (flexible) - Mix and match specific domain strategies
|
|
12
|
+
* 3. Direct configuration (advanced) - Full control via ApiConfig
|
|
13
|
+
*
|
|
14
|
+
* Configuration precedence: Direct config > Individual strategies > Unified strategy
|
|
15
|
+
*
|
|
16
|
+
* Supports all fetchff interceptors:
|
|
17
|
+
* - onRequest: (config) => config - Modify requests before sending
|
|
18
|
+
* - onResponse: (response) => response - Handle successful responses
|
|
19
|
+
* - onError: (error, config) => error - Handle errors
|
|
20
|
+
* - onRetry: (response, attempt) => response - Handle retry attempts
|
|
21
|
+
*
|
|
22
|
+
* Note: ApiConfig is imported from config/types, not defined here to avoid circular dependencies
|
|
23
|
+
*/
|
|
24
|
+
export type ApiClientOptions = Record<string, unknown>;
|
|
25
|
+
/**
|
|
26
|
+
* API client instance with full TypeScript support
|
|
27
|
+
* The client IS the fetchff instance with all endpoint methods
|
|
28
|
+
*
|
|
29
|
+
* Note: Full type definition requires EndpointTypes and endpoints from api package
|
|
30
|
+
*/
|
|
31
|
+
export type ApiClientInstance = Record<string, unknown>;
|