0.3.5 • Published 5 months ago

@types/matomo-tracker-react-native v0.3.5

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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

// Type definitions for matomo-tracker-react-native 0.3
// Project: https://github.com/donni106/matomo-tracker-react-native
// Definitions by: Zeynep Ece Ergin <https://github.com/zecergin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 4.4

import * as React from 'react';

export interface AppStart {
  userInfo?: {
    uid?: string
  };
}

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

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

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

export interface Link {
  link: string;
  url?: string;
  userInfo?: {
    uid?: string
  };
}

export interface Download {
  download: string;
  url?: string;
  userInfo?: {
    uid?: string
  };
}

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): 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, 29 Nov 2021 08:01:03 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

These definitions were written by Zeynep Ece Ergin.

0.3.5

5 months ago

0.3.2

8 months ago

0.3.4

6 months ago

0.3.3

7 months ago

0.3.1

2 years ago

0.3.0

2 years ago