1 |
|
2 | import { Type } from '@nestjs/common';
|
3 | import { IncomingMessage } from 'http';
|
4 | import { Observable } from 'rxjs';
|
5 | import { ContextId } from '../injector/instance-wrapper';
|
6 | import { HeaderStream } from '../router/sse-stream';
|
7 | import { ParamProperties } from './context-utils';
|
8 | export declare const HANDLER_METADATA_SYMBOL: unique symbol;
|
9 | export declare type HandleResponseFn = HandlerResponseBasicFn | HandleSseResponseFn;
|
10 | export declare type HandlerResponseBasicFn = <TResult, TResponse>(result: TResult, res: TResponse, req?: any) => any;
|
11 | export declare type HandleSseResponseFn = <TResult extends Observable<unknown> = any, TResponse extends HeaderStream = any, TRequest extends IncomingMessage = any>(result: TResult, res: TResponse, req: TRequest) => any;
|
12 | export interface HandlerMetadata {
|
13 | argsLength: number;
|
14 | paramtypes: any[];
|
15 | httpStatusCode: number;
|
16 | responseHeaders: any[];
|
17 | hasCustomHeaders: boolean;
|
18 | getParamsMetadata: (moduleKey: string, contextId?: ContextId, inquirerId?: string) => (ParamProperties & {
|
19 | metatype?: any;
|
20 | })[];
|
21 | fnHandleResponse: HandleResponseFn;
|
22 | }
|
23 | export declare class HandlerMetadataStorage<TValue = HandlerMetadata, TKey extends Type<unknown> = any> {
|
24 | private readonly [HANDLER_METADATA_SYMBOL];
|
25 | set(controller: TKey, methodName: string, metadata: TValue): void;
|
26 | get(controller: TKey, methodName: string): TValue | undefined;
|
27 | private getMetadataKey;
|
28 | }
|