import { A as ApiRequestDataTypeInterface } from './ApiRequestDataTypeInterface-CYEcRUrh.mjs'; declare enum HttpMethod { GET = "GET", POST = "POST", PUT = "PUT", PATCH = "PATCH", DELETE = "DELETE" } interface NextRef { next?: string; } interface PreviousRef { previous?: string; } interface SelfRef { self?: string; } interface TotalRef { total?: number; } declare function getLastApiTotal(): number | undefined; declare function clearLastApiTotal(): void; declare function getLastApiMeta(): Record | undefined; declare function clearLastApiMeta(): void; /** * Set a global error handler for API errors (client-side only). * This handler will be called instead of throwing errors. */ declare function setGlobalErrorHandler(handler: (status: number, message: string) => void): void; /** * Get the current global error handler. */ declare function getGlobalErrorHandler(): ((status: number, message: string) => void) | null; /** * Abstract base class for services that interact with the JSON:API. * Extend this class to create feature-specific services. */ declare abstract class AbstractService { /** * Extract locale from client-side URL pathname * URL structure: /{locale}/route-path (e.g., /it/accounts) * Fallback chain: URL locale → navigator.language → "en" */ private static getClientLocale; static next(params: { type: ApiRequestDataTypeInterface; endpoint: string; next?: NextRef; previous?: PreviousRef; self?: SelfRef; total?: TotalRef; }): Promise; /** * Fetch the previous page of results. */ static previous(params: { type: ApiRequestDataTypeInterface; endpoint: string; next?: NextRef; previous?: PreviousRef; self?: SelfRef; total?: TotalRef; }): Promise; /** * Make an API call with automatic environment detection and error handling. */ protected static callApi(params: { type: ApiRequestDataTypeInterface; method: HttpMethod; endpoint: string; companyId?: string; input?: any; overridesJsonApiCreation?: boolean; next?: NextRef; previous?: PreviousRef; self?: SelfRef; total?: TotalRef; responseType?: ApiRequestDataTypeInterface; files?: { [key: string]: File | Blob; } | File | Blob; token?: string; suppressGlobalError?: boolean; /** * Per-call override of the API base URL. When omitted, the existing global * `NEXT_PUBLIC_API_URL` (or `configureJsonApi({ apiUrl })`) resolution is used — * fully backward compatible. Ignored when `endpoint` starts with "http" (passthrough). */ baseUrl?: string; }): Promise; /** * Make an API call and return both data and meta from the response. */ protected static callApiWithMeta(params: { type: ApiRequestDataTypeInterface; method: HttpMethod; endpoint: string; companyId?: string; input?: any; overridesJsonApiCreation?: boolean; responseType?: ApiRequestDataTypeInterface; files?: { [key: string]: File | Blob; } | File | Blob; suppressGlobalError?: boolean; }): Promise<{ data: T; meta?: Record; }>; /** * Get raw JSON:API response data without deserialization. */ protected static getRawData(params: { type: ApiRequestDataTypeInterface; method: HttpMethod; endpoint: string; companyId?: string; baseUrl?: string; suppressGlobalError?: boolean; }): Promise; } export { AbstractService as A, HttpMethod as H, type NextRef as N, type PreviousRef as P, type SelfRef as S, type TotalRef as T, getLastApiMeta as a, clearLastApiMeta as b, clearLastApiTotal as c, getGlobalErrorHandler as d, getLastApiTotal as g, setGlobalErrorHandler as s };