import { TrackExtras, TrackResponse, ClientRequest } from './types'; /** * The Pintail client. */ export declare class Client { /** * The base URL for the Pintail API. */ private baseUrl; /** * The constructor. * * @param baseUrl The base URL for the Pintail API. Defaults to 'https://event.pintail.io/v2'. */ constructor(baseUrl?: string); /** * Track an event. * * This method never throws. Any transport, serialization, timeout, or * server-side failure is surfaced via `console.warn` and reported back as * `{ success: false }`. * * In the browser, the request is preferentially dispatched via * `navigator.sendBeacon`, which survives page unload and is rarely blocked * by corporate proxies or extensions. When sendBeacon is unavailable or * refuses the payload, the call falls back to `fetch` with a 5-second * timeout and a CORS-safelisted `text/plain` content type so the request * does not trigger an `OPTIONS` preflight. * * @param codename The codename of the event to track. * @param extras The extras to track. Defaults to an empty object. * @param req The client request. Defaults to null. * @returns The response from the Pintail API. When `sendBeacon` is used, * `{ success: true }` reflects a successful enqueue rather than a server * acknowledgement. */ track: (codename: string, extras?: TrackExtras, req?: ClientRequest | null) => Promise; } //# sourceMappingURL=Client.d.ts.map