export type CompressType = 'lz4'; export interface WebTrackerOptions { host: string; // 不带协议 projectId: string; topicId: string; source?: string; protocol?: string; // https | http time?: number; count?: number; headers?: Record; } export interface SingleLogReq { [index:string]: any; } export type MultiLogsReq = Record[] export interface OnCallback { (logs: Record[], err?: any): void; } interface AsyncBatchLogsConfigOptions{ onSuccess?: OnCallback; onFail?: OnCallback; } export interface WebTrackBrowserOptions extends WebTrackerOptions { } export class WebTrackerBrowser { constructor(options: WebTrackBrowserOptions); send: (data: SingleLogReq, options?: AsyncBatchLogsConfigOptions) => void; sendImmediate: (data: SingleLogReq) => Promise; sendBatchLogs: (data: MultiLogsReq, options?: AsyncBatchLogsConfigOptions) => void; sendBatchLogsImmediate: (data: MultiLogsReq) => Promise; }