0.0.3 • Published 6 months ago
@types/use-analytics v0.0.3
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
// Type definitions for use-analytics 0.0
// Project: https://github.com/DavidWells/analytics/tree/master/packages/use-analytics
// Definitions by: Harry Cruse <https://github.com/CruseCtrl>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as React from 'react';
import { AnalyticsInstance } from 'analytics';
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
- Last updated: Thu, 26 May 2022 08:01:33 GMT
- Dependencies: @types/react, @types/analytics
- Global values: none
Credits
These definitions were written by Harry Cruse.