import type { ResolvedConfig } from "./context.js"; import type { WaitBudget } from "./wait.js"; /** Options accepted by {@link createNeonClient}. */ export interface NeonConfig { /** * Your Neon API key, or a function returning it (sync or async — handy for refreshing * short-lived tokens). Used as a Bearer credential on every request. A missing or * empty string throws a `"client"`-kind error at construction; a function that later * returns empty is not checked here. */ apiKey: string | (() => string | Promise); /** * When `true`, methods return the resource directly and throw a `NeonError` on failure. * When `false` (default), they return `{ data, error }`. Overridable per call. */ throwOnError?: Throw; /** * Omit to use per-method defaults: `projects.create`, `projects.createAndConnect`, * `branches.create`, and `branches.createAndConnect` poll until provisioning * operations finish, and `realtime.enable` polls until the Realtime state is no * longer pending; other mutations do not. Set `false` to disable polling on those * five. Set `true` to poll on every mutation that returns operations and on the * `realtime` mutations. Overridable per call. */ waitForReadiness?: boolean; /** Tuning for the readiness poller (interval / timeout). Not a per-call abort. */ wait?: WaitBudget; /** * Number of automatic retries on always-safe statuses (423/429/503). Default 2. * `0` disables retries. Non-integer, negative, `NaN`, or `Infinity` throws a * `"client"`-kind error at construction. */ retries?: number; /** * Deadline in milliseconds for a single request **and** its retries, after which the * call resolves with a `NeonTimeoutError` and the request is aborted. Overridable per * call. * * Unset by default: calls are unbounded, as they have always been. Set it to bound * them, and pass `Infinity` on a call that needs to opt back out of a client-wide * value — a large `storage.objects.get` download or a `functions.deploy` upload, say. * * Separate from `wait.timeoutMs`, which budgets readiness polling rather than a * request. */ requestTimeoutMs?: number; /** Override the API base URL. Defaults to `https://console.neon.tech/api/v2`. */ baseUrl?: string; /** Custom `fetch` implementation (e.g. for proxies, tests, or non-global runtimes). */ fetch?: typeof fetch; /** * Default organization id. Applied to project creation/listing and as the source org * for transfers when not given explicitly. Not a `CallOptions` key — pass `org_id` * on list/create, or `fromOrgId` on transfer. */ orgId?: string; } export declare function resolveConfig(config: NeonConfig): ResolvedConfig; //# sourceMappingURL=config.d.ts.map