koatty_router 2.1.9 → 2.2.0

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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2026-03-07 23:34:52
3
+ * @Date: 2026-04-24 16:20:40
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -138,6 +138,7 @@ export declare interface IRouterMiddlewareManager {
138
138
  getMiddlewareByRoute(middlewareName: string, route: string, method?: string): MiddlewareConfig | null;
139
139
  listMiddlewares(): string[];
140
140
  compose(instanceIds: string[], context?: MiddlewareExecutionContext): MiddlewareFunction;
141
+ createGroup(groupName: string, middlewareNames: string[]): Promise<void>;
141
142
  }
142
143
 
143
144
  export declare const MAPPING_KEY = "MAPPING_KEY";
@@ -290,6 +291,8 @@ export declare type ProtocolExtConfig = WebSocketExtConfig | GrpcExtConfig | Gra
290
291
  export declare interface ProtocolExtConfigMap {
291
292
  http: HttpExtConfig;
292
293
  https: HttpExtConfig;
294
+ http2: HttpExtConfig;
295
+ http3: HttpExtConfig;
293
296
  ws: WebSocketExtConfig;
294
297
  wss: WebSocketExtConfig;
295
298
  grpc: GrpcExtConfig;
@@ -312,10 +315,11 @@ export declare function RegisterMiddleware(app: Application, config: Omit<Middle
312
315
  export declare function RegisterRouter(protocol: string): <T extends RouterConstructor>(target: T) => T;
313
316
 
314
317
  /**
315
- * Get parsed body(form variable and file object).
318
+ * Get parsed request body as a flat object.
319
+ * For multipart requests, use FILE_KEY symbol from payload/interface to access uploaded files.
316
320
  *
317
321
  * @export
318
- * @returns ex: {body: {...}, file: {...}}
322
+ * @returns Flat body object. Files (if any) accessible via body[FILE_KEY].
319
323
  */
320
324
  export declare function RequestBody(): ParameterDecorator;
321
325
 
@@ -498,12 +502,6 @@ export declare class RouterMiddlewareManager implements IRouterMiddlewareManager
498
502
  * Reset singleton instance (for testing)
499
503
  */
500
504
  static resetInstance(): void;
501
- /**
502
- * Start cache cleanup timer
503
- */
504
- /**
505
- * Perform periodic cache cleanup
506
- */
507
505
  /**
508
506
  * Get total cache size
509
507
  */
@@ -592,7 +590,7 @@ export declare class RouterMiddlewareManager implements IRouterMiddlewareManager
592
590
  /**
593
591
  * Create middleware group
594
592
  */
595
- createGroup(groupName: string, middlewareNames: string[]): void;
593
+ createGroup(groupName: string, middlewareNames: string[]): Promise<void>;
596
594
  }
597
595
 
598
596
  /**
@@ -687,8 +685,6 @@ export declare interface StreamConfig {
687
685
  streamTimeout?: number;
688
686
  /** 背压阈值(字节),默认2048 */
689
687
  backpressureThreshold?: number;
690
- /** 流缓冲区大小,默认1024 */
691
- streamBufferSize?: number;
692
688
  /** 是否启用流压缩,默认false */
693
689
  enableCompression?: boolean;
694
690
  }