import { z } from 'zod'; import { ByteStream } from '../streams/index.js'; //#region src/response.d.ts declare const ApiResponseSchema: z.ZodUnion, z.ZodObject<{ data: z.ZodNull; error: z.ZodObject<{ name: z.ZodString; message: z.ZodString; props: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>]>; type ApiResponse = z.infer; /** * Parses the given `Response`, checks for potential errors and extracts the * response data. * * @param res `Response` object to parse. * * @returns The parsed response body. * * @throws If the response body contains an error, it is deserialized * and re-thrown. */ declare const parseApiResponse: (res: Response) => Promise; /** * Parses the given `Response`, checks for potential errors and extracts the * response data as a `ByteStream`. * * @param res `Response` object to parse. * * @returns The parsed response body as a `ByteStream`. * * @throws If the response body contains an error, it is deserialized * and re-thrown. */ declare const parseApiBinaryResponse: (res: Response) => Promise; export { ApiResponseSchema, parseApiBinaryResponse, parseApiResponse }; export type { ApiResponse };