Every response has a numeric status_code. Success responses (200) carry result;
error responses (4xx/5xx) carry error. Use the type guards (isSuccess,
isError, etc.) to narrow to a specific shape.
Per-module response types (e.g., ScanQRCodeResponse) are derived from their valibot
schemas via v.InferOutput and form proper discriminated unions — enabling precise
TypeScript narrowing while this base type serves as the internal contract.
Base response type for all JSBridge calls.
Remarks
Every response has a numeric
status_code. Success responses (200) carryresult; error responses (4xx/5xx) carryerror. Use the type guards (isSuccess, isError, etc.) to narrow to a specific shape.Per-module response types (e.g.,
ScanQRCodeResponse) are derived from their valibot schemas viav.InferOutputand form proper discriminated unions — enabling precise TypeScript narrowing while this base type serves as the internal contract.