Skip to content

Commit d2dc28b

Browse files
committed
update docs for global
1 parent cc4f5f4 commit d2dc28b

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

packages/open-next/src/types/global.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,12 @@ declare global {
6666
// Needed in the cache adapter
6767
/**
6868
* The cache adapter for incremental static regeneration.
69-
* Only available in main functions or in the external middleware with `enableCacheInterception` set to `true`.
70-
* Defined in `createMainHandler` or in `adapter/middleware.ts`.
69+
* Defined in `createMainHandler` and in `adapters/middleware.ts`.
7170
*/
7271
var incrementalCache: IncrementalCache;
7372
/**
7473
* The cache adapter for the tag cache.
75-
* Only available in main functions, the initializationFunction or in the external middleware with `enableCacheInterception` set to `true`.
76-
* Defined in `createMainHandler` or in `adapter/middleware.ts`.
74+
* Defined in `createMainHandler` and in `adapters/middleware.ts`.
7775
*/
7876
var tagCache: TagCache;
7977
/**
@@ -107,7 +105,7 @@ declare global {
107105
/**
108106
* A boolean that indicates if the runtime is Edge.
109107
* Only available in `edge` runtime functions (i.e. external middleware or function with edge runtime).
110-
* Defined in the `edge-adapter.ts`.
108+
* Defined in `adapters/edge-adapter.ts`.
111109
*/
112110
var isEdgeRuntime: true;
113111

@@ -121,35 +119,35 @@ declare global {
121119
/**
122120
* The fetch function that should be used to make requests during the execution of the function.
123121
* Used to bypass Next intercepting and caching the fetch calls. Only available in main functions.
124-
* Defined in the `server-adapter.ts` and in `adapters/middleware.ts`.
122+
* Defined in `adapters/server-adapter.ts` and in `adapters/middleware.ts`.
125123
*/
126124
var internalFetch: typeof fetch;
127125

128126
/**
129127
* The Open Next configuration object.
130128
* Available in all functions.
131-
* Defined in the `createMainHandler` or in the `createGenericHandler`.
129+
* Defined in `createMainHandler` and in the `createGenericHandler`.
132130
*/
133131
var openNextConfig: Partial<OpenNextConfig>;
134132

135133
/**
136134
* The name of the function that is currently being executed.
137135
* Only available in main functions.
138-
* Defined in the `createMainHandler`.
136+
* Defined in `createMainHandler`.
139137
*/
140138
var fnName: string | undefined;
141139
/**
142140
* The unique identifier of the server.
143141
* Only available in main functions.
144-
* Defined in the `createMainHandler`.
142+
* Defined in `createMainHandler`.
145143
*/
146144
var serverId: string;
147145

148146
/**
149147
* The AsyncLocalStorage instance that is used to store the request context.
150148
* Only available in main, middleware and edge functions.
151149
* TODO: should be available everywhere in the future.
152-
* Defined in `requestHandler.ts`, `middleware.ts` and `edge-adapter.ts`.
150+
* Defined in `requestHandler.ts`, `adapters/middleware.ts` and `adapters/edge-adapter.ts`.
153151
*/
154152
var __openNextAls: AsyncLocalStorage<OpenNextRequestContext>;
155153

@@ -159,22 +157,26 @@ declare global {
159157
* Defined in the esbuild edge plugin.
160158
*/
161159
var _ENTRIES: Entries;
160+
162161
/**
163162
* The routes object that contains the routes that are available in the function.
164163
* Only available in edge runtime functions.
165164
* Defined in the esbuild edge plugin.
166165
*/
167166
var _ROUTES: EdgeRoute[];
167+
168168
/**
169169
* A map that is used in the edge runtime.
170170
* Only available in edge runtime functions.
171171
*/
172172
var __storage__: Map<unknown, unknown>;
173+
173174
/**
174175
* AsyncContext available globally in the edge runtime.
175176
* Only available in edge runtime functions.
176177
*/
177178
var AsyncContext: any;
179+
178180
/**
179181
* AsyncLocalStorage available globally in the edge runtime.
180182
* Only available in edge runtime functions.
@@ -192,8 +194,7 @@ declare global {
192194

193195
/**
194196
* The queue that is used to handle ISR revalidation requests.
195-
* Only available in main functions and in the external middleware with `enableCacheInterception` set to `true`.
196-
* Defined in `createMainHandler` or in `adapter/middleware.ts`.
197+
* Defined in `createMainHandler` and in `adapters/middleware.ts`.
197198
*/
198199
var queue: Queue;
199200

0 commit comments

Comments
 (0)