Skip to content
File

Blob: types/src/cloudflare.ts

typescript99 lines
1// Copyright (c) 2026 Cloudflare, Inc.
2// Licensed under the Apache 2.0 license found in the LICENSE file or at:
3// https://opensource.org/licenses/Apache-2.0
4 
5// This file extends `standards.ts` with specific comments overrides for Cloudflare Workers APIs
6// that aren't adequately described by a standard .d.ts file
7 
8import { CommentsData } from "./transforms";
9export default {
10 caches: {
11 $: `*
12* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
13*
14* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
15`,
16 },
17 CacheStorage: {
18 $: `*
19* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
20*
21* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
22`,
23 },
24 Cache: {
25 $: `*
26* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
27*
28* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
29`,
30 delete: ` [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#delete) `,
31 match: ` [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#match) `,
32 put: ` [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/#put) `,
33 },
34 crypto: {
35 $: `*
36* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
37* The Workers runtime implements the full surface of this API, but with some differences in
38* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
39* compared to those implemented in most browsers.
40*
41* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
42`,
43 },
44 Crypto: {
45 $: `*
46* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
47* The Workers runtime implements the full surface of this API, but with some differences in
48* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
49* compared to those implemented in most browsers.
50*
51* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
52`,
53 },
54 DurableObjectStorage: {
55 primary: `* @deprecated Use \`ctx.primaryStub\` instead. `,
56 ensureReplicas: `* @deprecated Use \`ctx.configureReadReplication()\` instead. `,
57 disableReplicas: `* @deprecated Use \`ctx.configureReadReplication()\` instead. `,
58 },
59 performance: {
60 $: `*
61* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
62* as well as timing of subrequests and other operations.
63*
64* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
65`,
66 },
67 Performance: {
68 $: `*
69* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
70* as well as timing of subrequests and other operations.
71*
72* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
73`,
74 timeOrigin: ` [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) `,
75 now: ` [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) `,
76 },
77 self: {
78 $: undefined,
79 },
80 navigator: {
81 $: undefined,
82 },
83 origin: {
84 $: undefined,
85 },
86 WorkerGlobalScope: {
87 $: undefined,
88 },
89 WebSocketAcceptOptions: {
90 allowHalfOpen: `*
91 * When set to \`true\`, receiving a server-initiated WebSocket Close frame will not
92 * automatically send a reciprocal Close frame, leaving the connection in a half-open
93 * state. This is useful for proxying scenarios where you need to coordinate closing
94 * both sides independently. Defaults to \`false\` when the
95 * \`no_web_socket_half_open_by_default\` compatibility flag is enabled.
96 `,
97 },
98} satisfies CommentsData;