import { RejectionCode } from "./rejection"; import type { LinkedIdentityType } from "../auth"; /** Raw backend rejection details before bounded codes and methods are decoded. */ export interface ApiRejectedDetailsWire { reason: string; rejection_code?: string; error_code?: string; /** Primary method of a deterministic identity owner; unknown values are ignored. */ existing_method?: string; error_log_id?: string; } export type ApiResponse = { status: "success"; body: T; } | { status: "error"; error_details: ApiRejectedDetailsWire; }; /** Structured rejection details with correlation and transport context. */ export declare class ApiRejectedDetails { readonly reason: string; readonly rejectionCode?: RejectionCode; readonly errorCode?: string; readonly existingMethod?: LinkedIdentityType; readonly errorLogId?: string; readonly requestId?: string; /** * HTTP status of the response that carried this rejection. Set by the HTTP * client when the rejection rode a non-2xx response; not present in the * backend JSON. Lets callers classify rejections at the transport level * (e.g. `isUnauthorized`) without matching on backend error strings. */ readonly httpStatus?: number; constructor(params: { reason: string; rejectionCode?: RejectionCode; errorCode?: string; existingMethod?: LinkedIdentityType; errorLogId?: string; requestId?: string; httpStatus?: number; }); static fromWire(wire: ApiRejectedDetailsWire, requestId?: string, httpStatus?: number): ApiRejectedDetails; toString(): string; } export declare function isApiResponse(value: unknown): value is ApiResponse; //# sourceMappingURL=api_response.d.ts.map