-
-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathworker-configuration.d.ts
More file actions
59 lines (47 loc) · 1.24 KB
/
worker-configuration.d.ts
File metadata and controls
59 lines (47 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* Cloudflare Workers Environment Bindings
* Defines all required and optional environment bindings for DeepLX
*/
interface Env {
/** KV namespace for translation caching */
CACHE_KV: KVNamespace;
/** KV namespace for rate limiting data */
RATE_LIMIT_KV: KVNamespace;
/** Analytics Engine dataset for metrics collection */
ANALYTICS: AnalyticsEngineDataset;
/** Comma-separated list of proxy URLs (optional) */
PROXY_URLS?: string;
/** Comma-separated list of proxy weights (optional) */
PROXY_WEIGHTS?: string;
}
/**
* Cache entry structure for translation storage
*/
interface CacheEntry {
/** Translated text content */
data: string;
/** Timestamp when translation was cached */
timestamp: number;
/** Source language code (uppercase) */
source_lang: string;
/** Target language code (uppercase) */
target_lang: string;
/** Optional unique request identifier */
id?: number;
}
/**
* Rate limiting entry structure for token bucket algorithm
*/
interface RateLimitEntry {
/** Current number of available tokens */
tokens: number;
/** Timestamp of last token refill */
lastRefill: number;
}
/**
* Proxy endpoint configuration
*/
interface ProxyEndpoint {
/** Proxy URL endpoint */
url: string;
}