import { AxiosInstance, AxiosRequestConfig } from 'axios'; import { MintApiError } from '../apiErrors'; /** * Raised when an authenticated SDK request is rejected because the login is no * longer valid. It is also a `MintApiError` (status 401), so typed-error callers * and `instanceof AuthenticationRequiredError` callers both recognise it. */ export declare class AuthenticationRequiredError extends MintApiError { readonly name: string; readonly code: 'AUTHENTICATION_REQUIRED'; readonly status: 401; constructor(cause?: unknown, envelope?: MintApiError); } /** @internal Convert a rejected authenticated request into the SDK's public auth error. */ export declare function authenticationRequiredError(cause: unknown, rejectedToken?: string, envelope?: MintApiError): AuthenticationRequiredError; export interface ApiClientOptions { baseUrl?: string; timeout?: number; withAuth?: boolean; /** Normalize failed responses into MintApiError. Generated clients enable this by default. */ typedErrors?: boolean; } export interface UseApiReturn { client: AxiosInstance; get: (url: string, config?: AxiosRequestConfig) => Promise; post: (url: string, data?: unknown, config?: AxiosRequestConfig) => Promise; put: (url: string, data?: unknown, config?: AxiosRequestConfig) => Promise; patch: (url: string, data?: unknown, config?: AxiosRequestConfig) => Promise; delete: (url: string, config?: AxiosRequestConfig) => Promise; upload: (url: string, file: File, fieldName?: string, additionalData?: Record) => Promise; download: (url: string, filename?: string) => Promise; buildUrl: (path: string) => string; buildWsUrl: (path: string) => string; } /** Axios-based API client that injects the plugin base URL and JWT auth header on every request. */ export declare function useApi(options?: ApiClientOptions): UseApiReturn;