Interface TgArgumentsHost

interface TgArgumentsHost {
    getArgByIndex<T>(index: number): T;
    getArgs<T>(): T;
    getContext<T>(): T;
    getNext<T>(): T;
    getType<TContext>(): TContext;
    switchToHttp(): HttpArgumentsHost;
    switchToRpc(): RpcArgumentsHost;
    switchToWs(): WsArgumentsHost;
}

Hierarchy

  • ArgumentsHost
    • TgArgumentsHost

Implemented by

Methods

  • Returns a particular argument by index.

    Type Parameters

    • T = any

    Parameters

    • index: number

      index of argument to retrieve

    Returns T

  • Returns the array of arguments being passed to the handler.

    Type Parameters

    • T extends any[] = any[]

    Returns T

  • Returns the current execution context type (string)

    Type Parameters

    • TContext extends string = ContextType

    Returns TContext

  • Switch context to HTTP.

    Returns HttpArgumentsHost

    interface with methods to retrieve HTTP arguments

  • Switch context to RPC.

    Returns RpcArgumentsHost

    interface with methods to retrieve RPC arguments

  • Switch context to WebSockets.

    Returns WsArgumentsHost

    interface with methods to retrieve WebSockets arguments