/** * The generated SDK's non-throwing result shape. * * Defined locally so the hand-written helpers never import generated code. */ export type SdkResult = { data: TData; error: undefined; request: Request; response: Response; } | { data: undefined; error: TError; request: Request; response: Response | undefined; }; type ErrorStatus = Extract; /** An API error whose status and body were declared by the operation. */ export type DocumentedSentryApiError = { [TStatus in ErrorStatus]: SentryApiError; }[ErrorStatus]; /** An API error returned under a status absent from the operation's schema. */ export type UndocumentedSentryApiError = SentryApiError; /** A request failure that happened before an HTTP response arrived. */ export type SentryApiTransportError = SentryApiError; export type SentryApiResultError = DocumentedSentryApiError | UndocumentedSentryApiError | SentryApiTransportError; export type NarrowedResult = { ok: true; data: TData; response: Response; } | { ok: false; error: SentryApiResultError; }; /** An API failure with its parsed body and raw response. */ export declare class SentryApiError extends Error { readonly status: TStatus; readonly body: TBody; readonly response: Response | undefined; readonly documented: TDocumented; constructor(status: TStatus, body: TBody, response: Response | undefined, documented: TDocumented, message?: string); } /** * Convert an SDK result to a status-discriminated result. * * Prefer the generated `narrowError_` wrappers. They supply the * operation's complete error map and documented statuses automatically. */ export declare const narrowError: (result: SdkResult]>, documentedStatuses: ReadonlyArray>) => NarrowedResult; /** * Call an SDK operation and convert HTTP and transport failures to one result. * Generated operation wrappers use this helper. */ export declare const callWithTypedErrors: (call: () => Promise]>>, documentedStatuses: ReadonlyArray>) => Promise>; export {};