/** * API Client Instances * Default client references that can be set by the consuming application * * This module exports a default API client reference that service functions use. * The consuming application (Next.js app, backend service, etc.) must set this * client by calling `setDefaultApiClient()` after creating their client instance. * * The client should include all endpoints combined in EndpointsList. */ import type { ApiClientWithEvents } from '@plyaz/types/api'; import type { ClientEventManager } from '../client/clientEventManager'; import type { EndpointsList } from '../endpoints'; /** * Default API client used by all service functions * This is set by the consuming application via `setDefaultApiClient()` * * The client has access to all endpoints defined in EndpointsList. * * @internal */ export declare let apiClient: ApiClientWithEvents | null; /** * Set the default API client for all service functions * Must be called by the consuming application before using any service functions * * The client should be created with all endpoints from the package. * * @param client - The API client instance with all endpoints from EndpointsList * * @example * ```typescript * // In your app initialization (e.g., Next.js _app.tsx or main.ts) * import { createApiClient, setDefaultApiClient } from '@plyaz/api'; * * const client = await createApiClient({ * baseURL: process.env.NEXT_PUBLIC_API_URL, * // Endpoints are managed internally by the package * }); * * setDefaultApiClient(client); * * // Now all service functions have access to all endpoints * const campaign = await fetchCampaign('123'); * ``` */ export declare function setDefaultApiClient(client: ApiClientWithEvents): void; /** * Get the default API client * Returns the client with all endpoints from EndpointsList * * Throws an error if the client hasn't been set * * @internal * @throws {Error} When the client hasn't been initialized */ export declare function getDefaultApiClient(): ApiClientWithEvents; //# sourceMappingURL=clients.d.ts.map