• URL query decorator.

    @WebSocketRoute.Query() is a parameter decorator function for the URL query string with type casting and assertion.

    It is almost same with TypedQuery, but @WebSocketRoute.Query() is only for WebSocket protocol router function decorated by WebSocketRoute.

    For reference, as same with TypedQuery, @WebSocketRoute.Query() has same restriction for the target type T. If actual URL query parameter values are different with their promised type T, it would be runtime error.

    1. Type T must be an object type
    2. Do not allow dynamic property
    3. Only boolean, bigint, number, string or their array types are allowed
    4. By the way, union type never be not allowed

    Type Parameters

    • T extends object

    Parameters

    • Optionalvalidator: IRequestQueryValidator<T>

    Returns ParameterDecorator