@types/matomo-tracker-react-native
TypeScript icon, indicating that this package has built-in type declarations

0.3.6 • Public • Published

Installation

npm install --save @types/matomo-tracker-react-native

Summary

This package contains type definitions for matomo-tracker-react-native (https://github.com/donni106/matomo-tracker-react-native).

Details

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

import * as React from "react";

export type UserInfo = {
    uid?: string;
    cid?: string;
    urlref?: string;
    lang?: string;
    ua?: string;
    _idvc?: string;
    new_visit?: number;
    _viewts?: number;
    _idts?: number;
    res?: number;
    h?: number;
    m?: number;
    s?: number;
    cookie?: number;
    uadata?: object;
} & Partial<Record<`dimension${number}`, string>>;

export interface AppStart {
    userInfo?: UserInfo;
}

export interface Action {
    name: string;
    userInfo?: UserInfo;
}

export interface Event {
    category: string;
    action: string;
    name?: string;
    value?: number;
    campaign?: string;
    userInfo?: UserInfo;
}

export interface SiteSearch {
    keyword: string;
    category?: string;
    count?: number;
    userInfo?: UserInfo;
}

export interface Link {
    link: string;
    userInfo?: UserInfo;
}

export interface Download {
    download: string;
    userInfo?: UserInfo;
}

export function useMatomo(): {
    trackAppStart: (params: AppStart) => undefined | Promise<Response>;
    trackScreenView: (params: Action) => undefined | Promise<Response>;
    trackAction: (params: Action) => undefined | Promise<Response>;
    trackEvent: (params: Event) => undefined | Promise<Response>;
    trackSiteSearch: (params: SiteSearch) => undefined | Promise<Response>;
    trackLink: (params: Link) => undefined | Promise<Response>;
    trackDownload: (params: Download) => undefined | Promise<Response>;
};

export interface MatomoProviderProps {
    instance: MatomoTracker;
    children: React.ReactElement;
}

export function MatomoProvider(props: MatomoProviderProps): React.JSX.Element;

export const MatomoContext: React.Context<{}>;
export interface InstanceProps {
    urlBase: string;
    siteId: number;
    trackerUrl?: string;
    userId?: string;
    disabled?: boolean;
    log?: boolean;
}

export default class MatomoTracker {
    constructor(props: InstanceProps);
    trackAppStart(params: AppStart): Promise<Response>;
    trackScreenView(params: Action): Promise<Response>;
    trackAction(params: Action): Promise<Response>;
    trackEvent(params: Event): Promise<Response>;
    trackSiteSearch(params: SiteSearch): Promise<Response>;
    trackLink(params: Link): Promise<Response>;
    trackDownload(params: Download): Promise<Response>;
}

Additional Details

  • Last updated: Mon, 06 Jan 2025 20:02:20 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Zeynep Ece Ergin.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.3.6536latest
0.3.6536ts5.6
0.3.6536ts5.8
0.3.6536ts5.7
0.3.6536ts5.0
0.3.6536ts5.1
0.3.6536ts5.2
0.3.6536ts5.3
0.3.6536ts5.4
0.3.6536ts5.5
0.3.6536ts5.9
0.3.5431ts4.6
0.3.5431ts4.9
0.3.5431ts4.7
0.3.5431ts4.8
0.3.133ts4.4
0.3.49ts4.5

Version History

VersionDownloads (Last 7 Days)Published
0.3.6536
0.3.5431
0.3.49
0.3.32
0.3.22
0.3.133
0.3.024

Package Sidebar

Install

npm i @types/matomo-tracker-react-native

Weekly Downloads

1,037

Version

0.3.6

License

MIT

Unpacked Size

7.48 kB

Total Files

5

Last publish

Collaborators

  • types