declare type SimpleSourceResult = string | number | boolean; declare type SourceResult = SimpleSourceResult | SimpleSourceResult[]; declare type SourceResultDict = Record; declare type Source = { state: State.Success; value: SourceResult; } | { state: State.Failure; value: string; }; interface Options { token: string; async?: boolean; endpoint?: string; } declare const enum State { Success = 1, Failure = -1 } declare class BotDetector { endpoint: string; token: string; async: boolean; timestamp?: number; tag?: string; performance?: number; sources?: SourceResultDict; constructor(options: Options); setTag(tag: unknown): void; collect(): Promise; get(tag: unknown): Promise>; poll(): Promise>; } declare function load(options: Options): Promise; export { load };