interface ApiClientOptions {
    context?: string;
    org?: string;
    apiUrl?: string;
    fetchImpl?: typeof fetch;
}
interface ResolvedApiClient {
    client: ApiClient;
    contextName: string;
    apiBaseUrl: string;
    orgSlug: string;
    token: string;
}
interface OrganizationInfo {
    slug: string;
    name?: string;
}
/** HTTP verbs the CLI's REST clients issue. */
export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
export interface RequestWithStatusOptions {
    okStatuses?: number[];
    /** Send `Accept: application/json` (default). Off matches the apply client. */
    sendAccept?: boolean;
    /**
     * Always send `Content-Type: application/json` even with no body. Default
     * sends it only when a body is present.
     */
    alwaysJsonContentType?: boolean;
}
export declare class ApiClient {
    private readonly apiBaseUrl;
    private readonly token;
    private readonly fetchImpl;
    constructor(apiBaseUrl: string, token: string, fetchImpl?: typeof fetch);
    /**
     * Single HTTP chokepoint: fetch (with retry) → parse JSON → throw `ApiError`
     * on a non-ok / non-allowed status. Returns the response status alongside the
     * parsed body so callers that branch on status (e.g. `lobu apply`'s 404/409
     * handling) don't reimplement the fetch/parse/error pipeline.
     */
    requestWithStatus<T>(method: HttpMethod, path: string, body?: unknown, options?: RequestWithStatusOptions): Promise<{
        status: number;
        body: T;
    }>;
    request<T>(method: HttpMethod, path: string, body?: unknown, options?: {
        okStatuses?: number[];
    }): Promise<T>;
    get<T>(path: string): Promise<T>;
    post<T>(path: string, body?: unknown): Promise<T>;
    patch<T>(path: string, body?: unknown): Promise<T>;
    delete<T>(path: string): Promise<T>;
}
export declare function resolveApiClient(options?: ApiClientOptions): Promise<ResolvedApiClient>;
export declare function listOrganizations(options?: Pick<ApiClientOptions, "context" | "apiUrl" | "fetchImpl">): Promise<OrganizationInfo[]>;
export declare function apiBaseFromContextUrl(apiUrl: string): string;
export {};
//# sourceMappingURL=api-client.d.ts.map