import { AnalyticsUser } from './analytics-user'; import { Context, IDs, Message, PlatformAdatper } from './models'; import { TrackingPlan } from './tracking-plan'; /** * We use `TrackingPlan` instead of Validator here for best compile * time error checking in TypeScript. All the type information goes away * in JavaScript so has no impact on JS code */ export interface Config { adapter: PlatformAdatper; validator?: T; debug?: boolean; context?: Context; /** * Simplified middleware api that takes a message and returns another * Return `null` or `undefined` to swallow the message */ middleware?: (message: Message) => Message | null | undefined; } export declare class Analytics { private config; private adapter; private validator?; constructor(config: Config); user(userId: string | IDs, context?: Context): AnalyticsUser; enqueueMessage(message: Message): void; flush(): Promise; private error; } export declare class AnalyticsError extends Error { }