import { OpenAPI } from "openapi-types";
import { User } from "./contexts/UserContext";
import { PageContribComponent } from "./types";
export declare const BODY_APPLICATION_TYPES: readonly ["application/json", "multipart/form-data"];
export type BodyApplicationType = (typeof BODY_APPLICATION_TYPES)[number];
export declare class ApiLoadFailedError extends Error {
    readonly response: Response;
    constructor(response: Response, message?: string);
}
export interface Request extends OpenAPI.Request {
    headers?: Record<string, string>;
    params?: Record<string, string | number>;
    query?: URLSearchParams;
}
export declare class ApiOperation {
    readonly id: string;
    readonly tags: string[];
    readonly server: string;
    readonly endpoint: string;
    readonly method: string;
    readonly request: OpenAPI.Request;
    readonly app: string;
    readonly summary?: string;
    readonly description?: string;
    readonly contribs?: string[];
    readonly bodyType?: BodyApplicationType;
    component?: PageContribComponent;
    order?: number;
    constructor(id: string, tags: string[], server: string, endpoint: string, method: string, request: OpenAPI.Request, app: string, summary?: string, description?: string, bodyType?: BodyApplicationType, contribs?: string[], component?: PageContribComponent, order?: number);
    /**
     * Return the `URL` for `endpoint`, possibly enriched with `request` params.
     * Useful for operations that generate a static url, like a file download.
     */
    url(request?: OpenAPI.Request): URL;
    call(request?: OpenAPI.Request, init?: RequestInit): Promise<Response>;
}
export declare class ApiClient {
    readonly document: OpenAPI.Document;
    readonly operations: Record<string, ApiOperation>;
    readonly contrib: Record<string, Record<string, ApiOperation>>;
    static load(source: string | URL, server?: string | URL): Promise<ApiClient>;
    constructor(document: OpenAPI.Document, server?: string | URL);
    getAuthenticatedUser(): Promise<User | null>;
    findContrib(prefix: string): ApiOperation[];
}
