Libraries
    Preparing search index...

    Type Alias EndpointCallArgs<E>

    EndpointCallArgs: E extends EndpointBuilder<
        infer TParams,
        infer TBody,
        infer TQuery,
        infer THeaders,
        any,
        any,
        any,
        any,
        any,
    >
        ? HasKeys<Simplify<CallArgsParts<TParams, TBody, TQuery, THeaders>>> extends true
            ? Simplify<CallArgsParts<TParams, TBody, TQuery, THeaders>>
            : undefined
        : never

    Extracts the typed request argument shape from an EndpointBuilder.

    The resulting type includes only the keys that carry data:

    • params — path parameters (when the endpoint uses route())
    • body — request body (when .body() was called)
    • query — query string parameters (when .query() was called)
    • headers — request headers (when .headers() was called)

    When no keys are required the type collapses to void so the call can be made without arguments: client.users.me().

    Type Parameters

    • E

      An EndpointBuilder instance type.

    // Endpoint with body:
    type Args = EndpointCallArgs<typeof CreateTodoEndpoint>;
    // ^? { body: { title: string; description?: string } }

    // Endpoint with path params:
    type Args = EndpointCallArgs<typeof GetTodoEndpoint>;
    // ^? { params: { id: number } }

    // Endpoint with no required args:
    type Args = EndpointCallArgs<typeof GetProfileEndpoint>;
    // ^? void