5.0.4 • Published 6 months ago

@types/ackee-tracker v5.0.4

Weekly downloads
142
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/ackee-tracker

Summary

This package contains type definitions for ackee-tracker (https://github.com/electerious/ackee-tracker).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ackee-tracker.

index.d.ts

// Type definitions for ackee-tracker 5.0
// Project: https://github.com/electerious/ackee-tracker
// Definitions by: Pablo Sáez <https://github.com/PabloSzx>
//                 Spencer Elliott <https://github.com/elliottsj>
//                 Sebastian Krüger <https://github.com/mathe42>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export interface TrackingOptions {
    /**
     * Defaults to `true`
     */
    ignoreLocalhost?: boolean | undefined;
    /**
     * Defaults to `false`
     */
    detailed?: boolean | undefined;
    /**
     * Defaults to `true`
     */
    ignoreOwnVisits?: boolean | undefined;
}

export interface AckeeTrackingReturn {
    stop: () => void;
}

export interface ActionAttributes {
    /**
     * Key that will be used to group similar actions in the Ackee UI.
     */
    key: string;
    /**
     * Positive float value that is added to all other numerical values of the key.
     */
    value?: number | undefined;
}

export interface AckeeInstance {
    record: (domainId: string, attrs?: ReturnType<typeof attributes>) => AckeeTrackingReturn;
    updateRecord: (recordId: string) => AckeeTrackingReturn;
    action: (eventId: string, attributes: ActionAttributes, callback?: (actionId: string) => void) => void;
    updateAction: (actionId: string, attributes: ActionAttributes) => void;
}

export interface DefaultData {
    siteLocation: string;
    siteReferrer: string;
}

// Based on https://github.com/bestiejs/platform.js/blob/master/platform.js
export interface DetailedData {
    siteLanguage: string;
    screenWidth: number;
    screenHeight: number;
    screenColorDepth: number;
    deviceName: string | null;
    deviceManufacturer: string | null;
    osName: string | null;
    osVersion: string | null;
    browserName: string | null;
    browserVersion: string | null;
    browserWidth: number;
    browserHeight: number;
}

export function create(server: string, options?: TrackingOptions): AckeeInstance;

export function attributes(detailed?: false): DefaultData;
export function attributes(detailed: true): DefaultData & DetailedData;
export function attributes(detailed?: boolean): DefaultData | (DefaultData & DetailedData);

export function detect(): void;

Additional Details

  • Last updated: Wed, 01 Dec 2021 17:01:05 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Pablo Sáez, Spencer Elliott, and Sebastian Krüger.

5.0.4

6 months ago

5.0.3

7 months ago

5.0.2

2 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.0.0

4 years ago