@orpc/server 2.0.0-beta.4 → 2.0.0-beta.40

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.
Files changed (60) hide show
  1. package/README.md +97 -94
  2. package/dist/adapters/aws-lambda/index.d.mts +50 -0
  3. package/dist/adapters/aws-lambda/index.d.ts +50 -0
  4. package/dist/adapters/aws-lambda/index.mjs +39 -0
  5. package/dist/adapters/crossws/index.d.mts +21 -12
  6. package/dist/adapters/crossws/index.d.ts +21 -12
  7. package/dist/adapters/crossws/index.mjs +14 -10
  8. package/dist/adapters/fastify/index.d.mts +42 -0
  9. package/dist/adapters/fastify/index.d.ts +42 -0
  10. package/dist/adapters/fastify/index.mjs +39 -0
  11. package/dist/adapters/fetch/index.d.mts +21 -114
  12. package/dist/adapters/fetch/index.d.ts +21 -114
  13. package/dist/adapters/fetch/index.mjs +20 -182
  14. package/dist/adapters/message-port/index.d.mts +23 -20
  15. package/dist/adapters/message-port/index.d.ts +23 -20
  16. package/dist/adapters/message-port/index.mjs +31 -34
  17. package/dist/adapters/node/index.d.mts +19 -96
  18. package/dist/adapters/node/index.d.ts +19 -96
  19. package/dist/adapters/node/index.mjs +19 -157
  20. package/dist/adapters/standard/index.d.mts +91 -17
  21. package/dist/adapters/standard/index.d.ts +91 -17
  22. package/dist/adapters/standard/index.mjs +4 -4
  23. package/dist/adapters/standard-peer/index.d.mts +6 -11
  24. package/dist/adapters/standard-peer/index.d.ts +6 -11
  25. package/dist/adapters/standard-peer/index.mjs +10 -2
  26. package/dist/adapters/websocket/index.d.mts +45 -29
  27. package/dist/adapters/websocket/index.d.ts +45 -29
  28. package/dist/adapters/websocket/index.mjs +37 -28
  29. package/dist/extensions/callable.d.mts +5 -5
  30. package/dist/extensions/callable.d.ts +5 -5
  31. package/dist/extensions/callable.mjs +2 -2
  32. package/dist/helpers/index.d.mts +23 -6
  33. package/dist/helpers/index.d.ts +23 -6
  34. package/dist/helpers/index.mjs +13 -5
  35. package/dist/index.d.mts +332 -37
  36. package/dist/index.d.ts +332 -37
  37. package/dist/index.mjs +131 -49
  38. package/dist/plugins/index.d.mts +243 -31
  39. package/dist/plugins/index.d.ts +243 -31
  40. package/dist/plugins/index.mjs +527 -30
  41. package/dist/shared/server.1ExWFMze.mjs +69 -0
  42. package/dist/shared/{server.CjOb6ItT.mjs → server.24nXyhbl.mjs} +1 -1
  43. package/dist/shared/{server.DBANIheG.d.ts → server.B5K1CViq.d.mts} +24 -13
  44. package/dist/shared/{server.BsNNjG5J.d.mts → server.BpmUhems.d.mts} +32 -20
  45. package/dist/shared/{server.BL22TloH.d.mts → server.BsujoJoF.d.mts} +38 -59
  46. package/dist/shared/{server.BL22TloH.d.ts → server.BsujoJoF.d.ts} +38 -59
  47. package/dist/shared/{server.BwHnWUuN.mjs → server.BynNaBBA.mjs} +24 -19
  48. package/dist/shared/{server.GDpX6Df8.mjs → server.C0lFtoHU.mjs} +162 -68
  49. package/dist/shared/server.C7xllBNN.d.mts +34 -0
  50. package/dist/shared/server.CFqSIFnT.d.mts +14 -0
  51. package/dist/shared/{server.Pa0F03f_.d.ts → server.CRwPbhLO.d.ts} +32 -20
  52. package/dist/shared/{server.DJIkub_t.d.mts → server.Cxranw-8.d.ts} +24 -13
  53. package/dist/shared/server.D0dr-F8u.d.ts +34 -0
  54. package/dist/shared/{server.CrlKQucM.mjs → server.Djb_ebJT.mjs} +25 -53
  55. package/dist/shared/server.RRVK1xTV.d.ts +14 -0
  56. package/package.json +47 -14
  57. package/dist/shared/server.CX4vUnDk.mjs +0 -11
  58. package/dist/shared/server.Cj5lgPuG.d.mts +0 -66
  59. package/dist/shared/server.D_QauotT.mjs +0 -30
  60. package/dist/shared/server.d_2NS3g5.d.ts +0 -66
@@ -1,10 +1,19 @@
1
1
  import { Value, Promisable, ThrowableError } from '@orpc/shared';
2
- import { StandardLazyRequest, StandardHeaders } from '@standardserver/core';
3
- import { C as Context } from '../shared/server.BL22TloH.js';
4
- import { e as StandardHandlerPlugin, f as StandardHandlerRoutingInterceptorOptions, a as StandardHandlerOptions, g as StandardHandlerInterceptorOptions } from '../shared/server.DBANIheG.js';
2
+ import { StandardLazyRequest, StandardHeaders, StandardMethod } from '@standard-server/core';
3
+ import { Context } from '../index.js';
4
+ import { StandardHandlerPlugin, StandardHandlerRoutingInterceptorOptions, StandardHandlerOptions, StandardHandlerInterceptorOptions } from '../adapters/standard/index.js';
5
+ export { R as RequestLimitHandlerPlugin, a as RequestLimitHandlerPluginOptions } from '../shared/server.D0dr-F8u.js';
5
6
  import '@orpc/client';
6
7
  import '@orpc/contract';
7
8
 
9
+ /**
10
+ * Content type for batch responses that use the length-prefixed binary framing
11
+ * (streaming mode, and buffered mode when any sub-response contains binary).
12
+ *
13
+ * Decoding is driven by the `standard-server` body hint, not this header,
14
+ * so it only serves to describe the payload to logs, proxies, and dev tools.
15
+ */
16
+ declare const BATCH_CONTENT_TYPE = "application/vnd.orpc.batch";
8
17
  interface BatchHandlerPluginOptions<T extends Context> {
9
18
  /**
10
19
  * The max size of the batch allowed.
@@ -15,7 +24,8 @@ interface BatchHandlerPluginOptions<T extends Context> {
15
24
  /**
16
25
  * Map each subrequest in the batch before it is processed.
17
26
  *
18
- * @default merges the batch request headers into the subrequest and remove `orpc-batch` header to prevent nested batching
27
+ * @default merges the batch request headers into the subrequest, giving them priority over
28
+ * the subrequest headers, and removes the `orpc-batch` header to prevent nested batching
19
29
  */
20
30
  mapSubrequest?: (subrequest: StandardLazyRequest, batchOptions: StandardHandlerRoutingInterceptorOptions<T>) => StandardLazyRequest;
21
31
  /**
@@ -30,11 +40,43 @@ interface BatchHandlerPluginOptions<T extends Context> {
30
40
  * @default {}
31
41
  */
32
42
  headers?: Value<Promisable<StandardHeaders>, [batchOptions: StandardHandlerRoutingInterceptorOptions<T>]>;
43
+ /**
44
+ * Keep-alive settings for streaming batch responses.
45
+ *
46
+ * When enabled, a zero-length length-prefixed frame is sent periodically while the
47
+ * stream is idle (no message sent for `interval` ms). Clients ignore these frames.
48
+ * Only applies to streaming mode.
49
+ *
50
+ * @default { enabled: true, interval: 15000 }
51
+ */
52
+ keepAlive?: undefined | {
53
+ /**
54
+ * If true, a keep-alive frame is sent periodically while the stream is idle.
55
+ *
56
+ * @default true
57
+ */
58
+ enabled: boolean;
59
+ /**
60
+ * Interval (in milliseconds) between keep-alive frames after the last message.
61
+ *
62
+ * @default 15000
63
+ */
64
+ interval?: number;
65
+ };
33
66
  }
67
+ /**
68
+ * Handles batch requests sent by the client Batch Link Plugin, splitting each
69
+ * batch into sub-requests and streaming their responses back together.
70
+ *
71
+ * @remarks
72
+ * **Note**: HTTP/2 and later already multiplex requests over a single connection, which often makes this plugin unnecessary.
73
+ *
74
+ * @see {@link https://orpc.dev/docs/plugins/batch | Batch Plugin}
75
+ */
34
76
  declare class BatchHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
35
77
  name: string;
36
78
  /**
37
- * Run batch interceptors before OpenTelemetry interceptors
79
+ * Run batch interceptors inside the tracing interceptors
38
80
  * so each subrequest gets its own span instead of sharing one batch-level span.
39
81
  */
40
82
  after: string[];
@@ -42,6 +84,8 @@ declare class BatchHandlerPlugin<T extends Context> implements StandardHandlerPl
42
84
  private readonly mapSubrequest;
43
85
  private readonly successStatus;
44
86
  private readonly headers;
87
+ private readonly keepAliveEnabled;
88
+ private readonly keepAliveInterval;
45
89
  constructor(options?: BatchHandlerPluginOptions<T>);
46
90
  init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
47
91
  }
@@ -49,54 +93,45 @@ declare class BatchHandlerPlugin<T extends Context> implements StandardHandlerPl
49
93
  interface CORSHandlerPluginOptions<T extends Context> {
50
94
  /**
51
95
  * Configures the `Access-Control-Allow-Origin` header.
52
- * Can be a string, an array of allowed origins, or a function that returns the allowed origin(s).
96
+ * Can be a string, an array of allowed origins, or a function (optionally async) that returns the allowed origin(s).
53
97
  *
54
- * @default (origin) => origin
98
+ * @default '*'
55
99
  */
56
100
  origin?: Value<Promisable<string | readonly string[] | null | undefined>, [origin: string, options: StandardHandlerRoutingInterceptorOptions<T>]>;
57
101
  /**
58
102
  * Configures the `Timing-Allow-Origin` header.
59
- * Can be a string, an array of allowed origins, or a function that returns the allowed origin(s).
60
- *
61
- * @default undefined
103
+ * Can be a string, an array of allowed origins, or a function (optionally async) that returns the allowed origin(s).
62
104
  */
63
105
  timingOrigin?: Value<Promisable<string | readonly string[] | null | undefined>, [origin: string, options: StandardHandlerRoutingInterceptorOptions<T>]>;
64
106
  /**
65
107
  * Configures the `Access-Control-Allow-Methods` header for preflight requests.
66
108
  *
67
- * @default ['GET', 'HEAD', 'PUT', 'POST', 'DELETE', 'PATCH']
109
+ * @default ['GET', 'HEAD', 'PUT', 'POST', 'DELETE', 'PATCH', 'QUERY']
68
110
  */
69
111
  allowMethods?: readonly string[];
70
112
  /**
71
113
  * Configures the `Access-Control-Allow-Headers` header for preflight requests.
72
114
  * Falls back to the request's `Access-Control-Request-Headers` if not set.
73
- *
74
- * @default undefined
75
115
  */
76
116
  allowHeaders?: readonly string[];
77
117
  /**
78
118
  * Configures the `Access-Control-Max-Age` header (in seconds) for preflight requests.
79
- *
80
- * @default undefined
81
119
  */
82
120
  maxAge?: number;
83
121
  /**
84
122
  * Configures the `Access-Control-Allow-Credentials` header.
85
- *
86
- * @default undefined
87
123
  */
88
124
  credentials?: boolean;
89
125
  /**
90
126
  * Configures the `Access-Control-Expose-Headers` header.
91
- *
92
- * @default undefined
93
127
  */
94
128
  exposeHeaders?: readonly string[];
95
129
  }
96
130
  /**
97
- * CORSHandlerPlugin is a plugin for oRPC that allows you to configure CORS for your API.
131
+ * Configures the [CORS Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
132
+ * for your API, including preflight requests.
98
133
  *
99
- * @see {@link https://orpc.dev/docs/plugins/cors CORS Plugin Docs}
134
+ * @see {@link https://orpc.dev/docs/plugins/cors | CORS Handler Plugin}
100
135
  */
101
136
  declare class CORSHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
102
137
  private readonly options;
@@ -109,20 +144,111 @@ declare class CORSHandlerPlugin<T extends Context> implements StandardHandlerPlu
109
144
  after: string[];
110
145
  constructor(options?: CORSHandlerPluginOptions<T>);
111
146
  init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
147
+ private resolveOrigin;
112
148
  }
113
149
 
114
150
  /**
115
- * Adds basic Cross-Site Request Forgery (CSRF) protection to your oRPC application.
116
- * When a request includes cookies, it helps ensure the request originates from JavaScript
117
- * (for example, fetch/XHR) rather than from standard HTML forms or direct browser navigation.
151
+ * Adds Cross-Site Request Forgery (CSRF) protection that makes the safe `GET` method as
152
+ * secure as unsafe ones such as `POST`. It rejects `GET` requests arriving as top-level
153
+ * navigations initiated cross-site or from outside the browser, the only context where
154
+ * another site can make a browser attach `SameSite=Lax` cookies to a safe-method request.
155
+ * Requests matching no procedure stay unmatched, so they can fall through to whatever
156
+ * serves the rest of the site.
157
+ *
158
+ * @remarks
159
+ * **Note**: Requests browsers send without `SameSite=Lax` cookies, such as cross-site `fetch`
160
+ * and `<img>`, pass through, so procedures stay reachable from other sites. This safeguard
161
+ * requires authentication cookies explicitly marked `SameSite=Lax` or `SameSite=Strict`,
162
+ * since browsers may attach other cookies to the requests that pass.
118
163
  *
119
- * @info This plugin is enabled by default for `RPCHandler` over HTTP.
164
+ * @see {@link https://orpc.dev/docs/plugins/get-method-csrf-protection | GET Method CSRF Protection Plugin}
120
165
  */
121
- declare class CSRFGuardHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
166
+ declare class GetMethodCsrfProtectionHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
122
167
  name: string;
123
168
  init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
169
+ private isAllowed;
124
170
  }
125
171
 
172
+ interface MethodOverrideHandlerPluginOptions {
173
+ /**
174
+ * The query parameter carrying the override method.
175
+ *
176
+ * @default 'method'
177
+ */
178
+ param?: string;
179
+ /**
180
+ * The methods a POST request may be overridden to.
181
+ *
182
+ * GET and HEAD are excluded by default because they switch input decoding
183
+ * from the request body to the query string and widen the CSRF surface.
184
+ *
185
+ * @default ['PUT', 'PATCH', 'DELETE']
186
+ */
187
+ methods?: readonly StandardMethod[];
188
+ }
189
+ /**
190
+ * Overrides the HTTP method of a POST request based on a query parameter,
191
+ * so HTML forms (which only support GET and POST) can invoke procedures
192
+ * routed as PUT, PATCH, or DELETE.
193
+ *
194
+ * @see {@link https://orpc.dev/docs/plugins/method-override | Method Override Plugin}
195
+ */
196
+ declare class MethodOverrideHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
197
+ name: string;
198
+ /**
199
+ * Should override batch sub-request methods, not the original batch request.
200
+ */
201
+ before: string[];
202
+ private readonly param;
203
+ private readonly methods;
204
+ constructor(options?: MethodOverrideHandlerPluginOptions);
205
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
206
+ }
207
+
208
+ /**
209
+ * Rejects requests whose decoded input contains prototype-polluting keys: an own
210
+ * `__proto__` key, or an own `constructor` key holding a `prototype` key. oRPC's own
211
+ * decoding never assigns through the prototype chain, so this plugin exists to stop such
212
+ * keys from reaching application code that merges, clones, or path-sets input with a
213
+ * library vulnerable to prototype pollution. An `AsyncIteratorObject` input is checked
214
+ * value by value as it arrives, and a polluting value fails that iteration instead.
215
+ *
216
+ * @see {@link https://orpc.dev/docs/plugins/prototype-pollution-protection | Prototype Pollution Protection Plugin}
217
+ */
218
+ declare class PrototypePollutionProtectionHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
219
+ name: string;
220
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
221
+ private rejectPollutingInput;
222
+ /**
223
+ * Walks the containers the built-in codecs can produce: arrays, maps, sets, and plain
224
+ * objects, including null-prototype ones. Other objects, such as files and dates, carry
225
+ * no attacker-authored keys and are left alone. The walk is iterative, so input nested
226
+ * deeper than the call stack allows still gets the intended verdict instead of a
227
+ * `RangeError`.
228
+ */
229
+ private containsPollutingKey;
230
+ }
231
+
232
+ /**
233
+ * Decompresses incoming request bodies based on the Content-Encoding header,
234
+ * supporting gzip, deflate, and deflate-raw.
235
+ *
236
+ * @see {@link https://orpc.dev/docs/plugins/request-compression | Request Compression Plugin}
237
+ */
238
+ declare class RequestCompressionHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
239
+ name: string;
240
+ /**
241
+ * Should decompress the original batch request body instead of sub-requests.
242
+ */
243
+ after: string[];
244
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
245
+ }
246
+
247
+ /**
248
+ * The context shape into which the Request Headers Plugin injects `reqHeaders`.
249
+ *
250
+ * @see {@link https://orpc.dev/docs/plugins/request-headers | Request Headers Plugin}
251
+ */
126
252
  interface RequestHeadersHandlerPluginContext {
127
253
  /**
128
254
  * Request headers as a Headers instance. This is injected by the Request Headers Plugin.
@@ -133,13 +259,64 @@ interface RequestHeadersHandlerPluginContext {
133
259
  * The Request Headers Plugin injects a `reqHeaders` instance into the context,
134
260
  * allowing access to request headers in oRPC.
135
261
  *
136
- * @see {@link https://orpc.dev/docs/plugins/request-headers Request Headers Plugin Docs}
262
+ * @see {@link https://orpc.dev/docs/plugins/request-headers | Request Headers Plugin}
137
263
  */
138
264
  declare class RequestHeadersHandlerPlugin<T extends RequestHeadersHandlerPluginContext> implements StandardHandlerPlugin<T> {
139
265
  name: string;
140
266
  init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
141
267
  }
142
268
 
269
+ interface ResponseCompressionHandlerPluginOptions<T extends Context> {
270
+ /**
271
+ * The compression schemes to use for response compression.
272
+ * Schemes are prioritized by their order in this array and
273
+ * only applied if the client supports them (via Accept-Encoding).
274
+ *
275
+ * @default ['gzip', 'deflate']
276
+ */
277
+ encodings?: readonly ('gzip' | 'deflate' | 'deflate-raw')[];
278
+ /**
279
+ * The minimum response size in bytes required to trigger compression.
280
+ * Responses smaller than this threshold will not be compressed to avoid overhead.
281
+ * If the response size cannot be determined, compression will still be applied.
282
+ *
283
+ * @default 1024 (1KB)
284
+ */
285
+ threshold?: number;
286
+ /**
287
+ * Determines whether a response with the given Content-Type should be compressed.
288
+ * Only consulted for binary transfers (streams, files, and file form-data parts).
289
+ * Also receives the routing interceptor options for per-request decisions.
290
+ *
291
+ * @default isCompressibleContentType (covers common text-based formats)
292
+ */
293
+ isCompressibleContentType?: (contentType: string | null | undefined, options: StandardHandlerRoutingInterceptorOptions<T>) => boolean;
294
+ }
295
+ /**
296
+ * Compresses response bodies based on the client's Accept-Encoding header.
297
+ * Works at the standard handler level, so it supports all adapters.
298
+ *
299
+ * @see {@link https://orpc.dev/docs/plugins/response-compression | Response Compression Plugin}
300
+ */
301
+ declare class ResponseCompressionHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
302
+ name: string;
303
+ /**
304
+ * Compression should be done after batching, to compress the final response.
305
+ * Compression should also be done after response headers are set, to access final headers like Content-Type and Cache-Control.
306
+ */
307
+ after: string[];
308
+ private readonly encodings;
309
+ private readonly threshold;
310
+ private readonly isCompressibleContentType;
311
+ constructor(options?: ResponseCompressionHandlerPluginOptions<T>);
312
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
313
+ }
314
+
315
+ /**
316
+ * The context shape into which the Response Headers Plugin injects `resHeaders`.
317
+ *
318
+ * @see {@link https://orpc.dev/docs/plugins/response-headers | Response Headers Plugin}
319
+ */
143
320
  interface ResponseHeadersHandlerPluginContext {
144
321
  /**
145
322
  * Response headers as a Headers instance. This is injected by the Response Headers Plugin.
@@ -151,7 +328,7 @@ interface ResponseHeadersHandlerPluginContext {
151
328
  * The Response Headers Plugin allows you to set response headers in oRPC.
152
329
  * It injects a resHeaders instance into the context, enabling you to modify response headers easily.
153
330
  *
154
- * @see {@link https://orpc.dev/docs/plugins/response-headers Response Headers Plugin Docs}
331
+ * @see {@link https://orpc.dev/docs/plugins/response-headers | Response Headers Plugin}
155
332
  */
156
333
  declare class ResponseHeadersHandlerPlugin<T extends ResponseHeadersHandlerPluginContext> implements StandardHandlerPlugin<T> {
157
334
  name: string;
@@ -183,7 +360,7 @@ interface RethrowHandlerPluginOptions<T extends Context> {
183
360
  * and rethrow matching errors directly to your framework's error handling mechanism
184
361
  * (e.g., NestJS exception filters, Express error middleware).
185
362
  *
186
- * @see {@link https://orpc.dev/docs/plugins/rethrow Rethrow Plugin Documentation}
363
+ * @see {@link https://orpc.dev/docs/plugins/rethrow | Rethrow Handler Plugin}
187
364
  */
188
365
  declare class RethrowHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
189
366
  name: string;
@@ -193,5 +370,40 @@ declare class RethrowHandlerPlugin<T extends Context> implements StandardHandler
193
370
  init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
194
371
  }
195
372
 
196
- export { BatchHandlerPlugin, CORSHandlerPlugin, CSRFGuardHandlerPlugin, RequestHeadersHandlerPlugin, ResponseHeadersHandlerPlugin, RethrowHandlerPlugin };
197
- export type { BatchHandlerPluginOptions, CORSHandlerPluginOptions, RequestHeadersHandlerPluginContext, ResponseHeadersHandlerPluginContext, RethrowHandlerPluginOptions };
373
+ interface TimeoutHandlerPluginOptions<T extends Context> {
374
+ /**
375
+ * Timeout in milliseconds before the request signal is aborted.
376
+ * This only covers producing the response, use `streamingTimeout`
377
+ * to limit streaming response bodies.
378
+ * Use `null` or `undefined` to disable the timeout.
379
+ */
380
+ timeout: Value<number | null | undefined, [options: StandardHandlerInterceptorOptions<T>]>;
381
+ /**
382
+ * Timeout in milliseconds for the full duration of a streaming response body
383
+ * (async iterator object or readable stream), measured from when the response is produced.
384
+ * When exceeded, the request signal is aborted and the body ends
385
+ * once its producer honors the signal.
386
+ * Usually higher than `timeout`.
387
+ * Use `null` or `undefined` to disable the timeout.
388
+ *
389
+ * @default undefined (streaming responses run without limit)
390
+ */
391
+ streamingTimeout?: Value<number | null | undefined, [options: StandardHandlerInterceptorOptions<T>]>;
392
+ }
393
+ /**
394
+ * The Timeout Handler Plugin aborts the request signal with an `AbortError`
395
+ * when handling exceeds a configured timeout. It only aborts the signal,
396
+ * the procedure must honor it to stop early and produce the response.
397
+ *
398
+ * @see {@link https://orpc.dev/docs/plugins/timeout | Timeout Plugin}
399
+ */
400
+ declare class TimeoutHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
401
+ private readonly timeout;
402
+ private readonly streamingTimeout;
403
+ name: string;
404
+ constructor(options: NoInfer<TimeoutHandlerPluginOptions<T>>);
405
+ init(options: StandardHandlerOptions<T>): StandardHandlerOptions<T>;
406
+ }
407
+
408
+ export { BATCH_CONTENT_TYPE, BatchHandlerPlugin, CORSHandlerPlugin, CORSHandlerPlugin as CORSPlugin, GetMethodCsrfProtectionHandlerPlugin, MethodOverrideHandlerPlugin, PrototypePollutionProtectionHandlerPlugin, RequestCompressionHandlerPlugin, RequestHeadersHandlerPlugin, RequestHeadersHandlerPlugin as RequestHeadersPlugin, ResponseCompressionHandlerPlugin, ResponseHeadersHandlerPlugin, ResponseHeadersHandlerPlugin as ResponseHeadersPlugin, RethrowHandlerPlugin, TimeoutHandlerPlugin };
409
+ export type { BatchHandlerPluginOptions, CORSHandlerPluginOptions, MethodOverrideHandlerPluginOptions, RequestHeadersHandlerPluginContext, RequestHeadersHandlerPluginContext as RequestHeadersPluginContext, ResponseCompressionHandlerPluginOptions, ResponseHeadersHandlerPluginContext, ResponseHeadersHandlerPluginContext as ResponseHeadersPluginContext, RethrowHandlerPluginOptions, TimeoutHandlerPluginOptions };