interface StorageAdapter {
    open(name: string): Promise<void>;
    get<T = unknown>(key: string): Promise<T | undefined>;
    set(key: string, value: unknown): Promise<void>;
    delete(key: string): Promise<void>;
    iterate(prefix: string): AsyncIterable<[string, unknown]>;
    close(): Promise<void>;
}
type StorageKind = 'memory' | 'indexeddb' | 'localstorage' | StorageAdapter;

type IdentityProvider = () => Record<string, unknown> | undefined;

type AnalyticsEvent = {
    ts: number;
    event: string;
    payload?: Record<string, unknown>;
} & Record<string, unknown>;
type AnalyticsOpts = {
    endpoint?: string;
    identity?: IdentityProvider;
    batchSize?: number;
    flushIntervalMs?: number;
    offlineBuffer?: StorageKind;
    transport?: (events: AnalyticsEvent[]) => Promise<void>;
};
declare class Analytics {
    private endpoint?;
    private identity?;
    private batchSize;
    private flushIntervalMs;
    private buffer;
    private storage?;
    private staticIdentity;
    private flushTimer?;
    private transport?;
    constructor(opts: AnalyticsOpts);
    init(): Promise<void>;
    identify(values: Record<string, unknown>): void;
    reset(): void;
    track(event: string, payload?: Record<string, unknown>, overrides?: {
        identity?: Record<string, unknown>;
    }): void;
    flush(): Promise<void>;
    dispose(): Promise<void>;
}
declare function createAnalytics(opts: AnalyticsOpts): Analytics;

export { Analytics, type AnalyticsEvent, type AnalyticsOpts, createAnalytics };
