/** * HTTP client for the MyArchitectAI REST API. * * Responsibilities: * - attach the `x-api-key` header and JSON content negotiation * - enforce a per-request timeout via AbortController * - retry transient failures (429/5xx/network/timeout) with exponential * backoff + jitter, honoring `Retry-After` * - map HTTP responses onto the typed error hierarchy in {@link ./errors.js} * * All endpoints share the same response contract, so a single * {@link MyArchitectAIClient.generate} method covers every tool. */ import type { Config } from './config.js'; /** Normalized success payload returned by every generation endpoint. */ export interface GenerationResult { /** URLs of the generated image(s). */ output: string[]; /** Remaining account credit balance after the request. */ balance: number; /** Credits charged for the request. */ cost: number; } /** Minimal `fetch` signature so tests can inject a stub. */ export type FetchLike = (input: string | URL, init?: RequestInit) => Promise; export declare class MyArchitectAIClient { #private; constructor(config: Config, fetchImpl?: FetchLike); /** * POST `body` to `path` (e.g. `/render/exterior`) and return the normalized * result, retrying transient failures up to `config.maxRetries` times. * * @throws {MyArchitectAIError} on a non-retryable failure or exhausted retries. */ generate(path: string, body: Record): Promise; } //# sourceMappingURL=client.d.ts.map