import React from "react"; /** * Configuration for API connectivity. Passed once at the top level * and available to any hook that needs `apiUrl` or `getAuthToken`. * * Individual hooks can still accept explicit overrides — this context * serves as a fallback to eliminate repetitive threading. */ export interface ApiConfig { apiUrl: string; /** * The path the backend mounts its API under, appended to {@link apiUrl}. * * `"/api"` by default, which is the server's default `basePath`. It is * carried here because a good deal of UI builds request URLs by hand * instead of going through the client's typed methods, and every one of * those sites used to write `/api` as a literal — so a backend configured * with any other `basePath` served an admin panel whose auth-provider * discovery, storage browser, history panel, user picker and Studio tools * all requested paths that did not exist. */ apiPath: string; getAuthToken?: () => Promise; } /** What the server uses when `basePath` is not configured. */ export declare const DEFAULT_API_PATH = "/api"; /** * Read the API config from context. Returns `undefined` if no provider is present, * allowing hooks to fall back to their own props. */ export declare function useApiConfig(): ApiConfig | undefined; /** * `apiUrl` and `apiPath` joined, with no trailing slash — the prefix to build a * request URL from. * * Returns `undefined` when there is no provider, so a caller can keep its own * fallback rather than silently requesting a relative path. */ export declare function useApiBase(): string | undefined; /** * The same prefix, derived from a client rather than from context. * * For the code that holds a `RebaseClient` but sits outside (or above) an * `ApiConfigProvider`. Returns `undefined` when the client has no base URL, * which is the signal every caller already treats as "cannot build a request". */ export declare function apiBaseOf(client?: { baseUrl?: string; apiPath?: string; }): string | undefined; /** * Provide API configuration (apiUrl, apiPath, getAuthToken) to the entire subtree. * Typically rendered inside `` or at the app root. */ export declare function ApiConfigProvider({ apiUrl, apiPath, getAuthToken, children }: Omit & { apiPath?: string; children: React.ReactNode; }): React.JSX.Element;