@types/use-analytics
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Installation

npm install --save @types/use-analytics

Summary

This package contains type definitions for use-analytics (https://github.com/DavidWells/analytics/tree/master/packages/use-analytics).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/use-analytics.

index.d.ts

import { AnalyticsInstance } from "analytics";
import * as React from "react";

export function useAnalytics(): AnalyticsInstance;

export function useTrack(): AnalyticsInstance["track"];
export function usePage(): AnalyticsInstance["page"];
export function useIdentify(): AnalyticsInstance["identify"];

export const AnalyticsContext: React.Context<AnalyticsInstance>;

export interface AnalyticsProviderProps {
    children: React.ReactNode;
    instance: AnalyticsInstance;
}

export const AnalyticsProvider: React.ComponentType<AnalyticsProviderProps>;

export const AnalyticsConsumer: typeof AnalyticsContext.Consumer;

export interface WithAnalyticsProps {
    analytics: AnalyticsInstance;
}

export function withAnalytics<T extends WithAnalyticsProps>(
    Component: React.ComponentType<T>,
): React.ComponentType<Omit<T, "analytics">>;

Additional Details

Credits

These definitions were written by Harry Cruse.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/use-analytics

Weekly Downloads

6,825

Version

0.0.3

License

MIT

Unpacked Size

4.46 kB

Total Files

5

Last publish

Collaborators

  • types