ArgumentsHost
Provides methods for retrieving the arguments being passed to a handler. Allows choosing the appropriate execution context (e.g., Http, RPC, or WebSockets) to retrieve the arguments from.
interface ArgumentsHost {
getArgs<T extends Array<any> = any[]>(): T
getArgByIndex<T = any>(index: number): T
switchToRpc(): RpcArgumentsHost
switchToHttp(): HttpArgumentsHost
switchToWs(): WsArgumentsHost
getType<TContext extends string = ContextType>(): TContext
}
Child interfaces
Methods
getArgs() |
---|
Returns the array of arguments being passed to the handler. |
ParametersThere are no parameters. Returns
|
getArgByIndex() |
---|
Returns a particular argument by index. |
switchToRpc() |
---|
Switch context to RPC. |
ParametersThere are no parameters. Returns
|
switchToHttp() |
---|
Switch context to HTTP. |
ParametersThere are no parameters. Returns
|
switchToWs() |
---|
Switch context to WebSockets. |
ParametersThere are no parameters. Returns
|
getType() |
---|
Returns the current execution context type (string) |
ParametersThere are no parameters. Returns
|