@grabjs/superapp-sdk
    Preparing search index...

    Type Alias BridgeResponse<Codes, T>

    BridgeResponse: StatusCodeMap<T>[Codes]

    Universal response type for JSBridge method callbacks.

    Type Parameters

    Represents the response shape from a JSBridge method call. Use with specific status codes to constrain which responses are possible, or use BridgeStatusCode for the full union.

    This type works for both single (non-streaming) responses and as the item type emitted by BridgeStream.

    Status codes come first in the type parameters for better readability at module call sites.

    // Constrained to specific status codes (common case)
    type SuccessOrError = BridgeResponse<200 | 500, string>;

    // Only success
    type OnlySuccess = BridgeResponse<200, string>;

    // Unconstrained - all status codes possible (internal use)
    type AnyResponse = BridgeResponse<BridgeStatusCode, string>;