interface ClientConfig { baseUrl: string; apiKey: string; timeout?: number; headers?: Record; onRequest?: (config: RequestConfig) => void | Promise; onResponse?: (response: Response) => void | Promise; onError?: (error: Error) => void | Promise; } interface RequestConfig { url: URL; method: string; headers: Record; body?: string | FormData; } interface PaginatedResponse { page: number; pageSize: number; totalRecords: number; records: T[]; sortKey?: string | null; sortDirection?: 'ascending' | 'descending' | 'default'; } interface PaginationOptions { page?: number; pageSize?: number; sortKey?: string; sortDirection?: 'ascending' | 'descending' | 'default'; [key: string]: unknown; } type SortDirection = 'ascending' | 'descending' | 'default'; interface ClientMethods { get(path: string, params?: Record): Promise; post(path: string, body?: unknown, params?: Record): Promise; postForm(path: string, formData: FormData, params?: Record): Promise; put(path: string, body?: unknown, params?: Record): Promise; delete(path: string, body?: unknown, params?: Record): Promise; paginate(path: string, options?: PaginationOptions & Record): AsyncGenerator; paginateAll(path: string, options?: PaginationOptions & Record): Promise; getBuffer(path: string, params?: Record): Promise; getText(path: string, params?: Record): Promise; } declare abstract class BaseClient implements ClientMethods { protected readonly config: Required> & Omit; constructor(config: ClientConfig); protected request(method: string, path: string, options?: { params?: Record; body?: unknown; }): Promise; private parseError; private extractErrorMessage; private extractValidationErrors; get(path: string, params?: Record): Promise; post(path: string, body?: unknown, params?: Record): Promise; postForm(path: string, formData: FormData, params?: Record): Promise; put(path: string, body?: unknown, params?: Record): Promise; delete(path: string, body?: unknown, params?: Record): Promise; private fetchRaw; getBuffer(path: string, params?: Record): Promise; getText(path: string, params?: Record): Promise; paginate(path: string, options?: PaginationOptions & Record): AsyncGenerator; paginateAll(path: string, options?: PaginationOptions & Record): Promise; } export { BaseClient as B, type ClientConfig as C, type PaginatedResponse as P, type RequestConfig as R, type SortDirection as S, type PaginationOptions as a, type ClientMethods as b };