npm.io
0.3.7 • Published 10 months ago

@types/matomo-tracker-react-native

Licence
MIT
Version
0.3.7
Deps
1
Size
7 kB
Vulns
0
Weekly
0
Stars
51.5K

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.

index.d.ts

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;
    url?: string;
    userInfo?: UserInfo;
}

export interface Event {
    category: string;
    action: string;
    name?: string;
    value?: number;
    campaign?: string;
    url?: 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: Sat, 10 Jan 2026 0254 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Zeynep Ece Ergin.