Skip to content

Commit 8882173

Browse files
committed
πŸ‘¨β€πŸ’» Follow new ESLint rules + rebuild
1 parent 5dfccd8 commit 8882173

File tree

7 files changed

+72
-8
lines changed

7 files changed

+72
-8
lines changed

β€Ždist/index.cjs.mapβ€Ž

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/index.d.tsβ€Ž

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
export declare enum Transport {
2+
Fetch = "fetch",
3+
Beacon = "beacon",
4+
Img = "img"
5+
}
6+
export declare const SUPPORTED_TRANSPORTS: readonly [Transport.Fetch, Transport.Beacon, Transport.Img];
7+
export interface OstrioWebAnalyticsDynamicConfig {
8+
trackHash?: boolean;
9+
trackQuery?: boolean;
10+
transport?: Transport;
11+
serviceUrl?: string;
12+
}
13+
export interface OstrioWebAnalyticsConfig extends OstrioWebAnalyticsDynamicConfig {
14+
auto?: boolean;
15+
trackErrors?: boolean;
16+
ignoredQueries?: Array<string>;
17+
ignoredPaths?: Array<string | RegExp>;
18+
}
19+
type TrackCb = () => void;
20+
type EventCb = (key: string, value: number | string) => void;
21+
export declare class OstrioWebAnalytics {
22+
readonly sid: string;
23+
readonly version: number;
24+
sending: boolean;
25+
readonly loc: Location;
26+
current: string;
27+
trackHash: boolean;
28+
trackQuery: boolean;
29+
readonly ignoredQueries: Set<string>;
30+
readonly auto: boolean;
31+
readonly trackErrors: boolean;
32+
transport: Transport;
33+
serviceUrl: string;
34+
private readonly ignoredPaths;
35+
private readonly onTrackArr;
36+
private readonly onEventArr;
37+
private readonly cachedErrors;
38+
private readonly eventRemovers;
39+
private autoTimer;
40+
private lastTrackTimestamp;
41+
constructor(sid: string, opts?: OstrioWebAnalyticsConfig | boolean);
42+
private on;
43+
applySettings(cfg: OstrioWebAnalyticsDynamicConfig): void;
44+
setTransport(t: Transport): void;
45+
ignorePath(path: string | RegExp): void;
46+
ignorePaths(paths: Array<string | RegExp>): void;
47+
ignoreQuery(queryKey: string): void;
48+
ignoreQueries(queryKeys: Array<string>): void;
49+
onPushEvent(callback: EventCb): void;
50+
onTrack(callback: TrackCb): void;
51+
pushEvent(rawKey: string, rawValue: number | string): void;
52+
track(): boolean;
53+
private send;
54+
private fetch;
55+
private initAutoTracking;
56+
private initGlobalErrors;
57+
private isIgnored;
58+
private getCurrentUrl;
59+
destroy(): void;
60+
private readonly warn;
61+
}
62+
export default OstrioWebAnalytics;
63+
//# sourceMappingURL=index.d.ts.map

β€Ždist/index.d.ts.mapβ€Ž

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/index.js.mapβ€Ž

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/ostrio-analytics.min.js.mapβ€Ž

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/ostrio-analytics.umd.js.mapβ€Ž

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žsrc/index.tsβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export interface OstrioWebAnalyticsConfig extends OstrioWebAnalyticsDynamicConfi
7373
type EvtRemvr = () => void;
7474
type FetchCb = () => void;
7575
type TrackCb = () => void;
76-
type EventCb = (key: string, value: number|string) => void;
76+
type EventCb = (key: string, value: number | string) => void;
7777

7878
export class OstrioWebAnalytics {
7979
public readonly sid: string;
@@ -185,7 +185,7 @@ export class OstrioWebAnalytics {
185185
}
186186
}
187187

188-
public pushEvent(rawKey: string, rawValue: number|string): void {
188+
public pushEvent(rawKey: string, rawValue: number | string): void {
189189
let key = String(rawKey).trim();
190190
let value = String(rawValue).trim();
191191

@@ -312,7 +312,7 @@ export class OstrioWebAnalytics {
312312

313313
private initGlobalErrors(): void {
314314
const prev = window.onerror as OnErrorEventHandlerNonNull | null;
315-
window.onerror = ((msg: Event|string, url: string, line: number, column: number, error: Error): void => {
315+
window.onerror = ((msg: Event | string, url: string, line: number, column: number, error: Error): void => {
316316
const m = String(msg || DEFAULTS.globalError.msg);
317317
const u = String(url || DEFAULTS.globalError.url);
318318
const ln = String(line || DEFAULTS.globalError.line);
@@ -392,7 +392,7 @@ export class OstrioWebAnalytics {
392392
}
393393
}
394394

395-
private readonly warn = function (..._args: unknown[]) {
395+
private readonly warn = function(..._args: unknown[]) {
396396
if (typeof console === 'undefined') return;
397397
/* eslint-disable no-console,no-nested-ternary */
398398
const fn = typeof console.warn === 'function' ? console.warn : typeof console.log === 'function' ? console.log : null;

0 commit comments

Comments
Β (0)