UNPKG

@putdotio/pas-js

Version:

Client-side JS client for Putio Analytics System

65 lines (64 loc) 2.1 kB
declare const defaultConfig: { apiURL: string; cache: { domain: string; expires: number; }; }; export declare type Config = typeof defaultConfig; export declare const createClientFactoryWithDependencies: (cacheFactory: <T extends object>(options: import("./cache").IPutioAnalyticsCacheOptions) => { set: (key: string, value: T) => T; get: (key: string) => T; clear: (key: string) => void; }, userFactory: (cache: { set: (key: string, value: object) => object; get: (key: string) => object; clear: (key: string) => void; }) => import("./user").IPutioAnalyticsUser, apiFactory: (baseURL: string, cache: { set: (key: string, value: object) => object; get: (key: string) => object; clear: (key: string) => void; }) => { post: (path: string, body: object) => import("rxjs").Observable<import("rxjs/ajax").AjaxResponse>; }) => (config?: { apiURL: string; cache: { domain: string; expires: number; }; }) => { alias: (params: { id: string | number; hash: string; }) => void; identify: (params: { id: string | number; hash: string; properties: Record<string, any>; }) => void; track: (name: string, properties?: Record<string, any>) => void; pageView: () => void; clear: () => import("./user").IPutioAnalyticsUserAttributes; }; export declare const createClientFactory: () => (config?: { apiURL: string; cache: { domain: string; expires: number; }; }) => { alias: (params: { id: string | number; hash: string; }) => void; identify: (params: { id: string | number; hash: string; properties: Record<string, any>; }) => void; track: (name: string, properties?: Record<string, any>) => void; pageView: () => void; clear: () => import("./user").IPutioAnalyticsUserAttributes; }; export declare type PutioAnalyticsClient = ReturnType<ReturnType<typeof createClientFactory>>; export {};