@moser-inc/moser-labs-react 1.9.0 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/useAnalytics.d.ts +24 -0
- package/dist/lib/analytics/analyticsContext.d.ts +8 -0
- package/dist/lib/analytics/createAnalytics.d.ts +9 -0
- package/dist/lib/analytics/index.d.ts +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/moser-labs-react.cjs +83 -82
- package/dist/moser-labs-react.js +16454 -15064
- package/package.json +5 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="analytics" />
|
|
2
|
+
import type { User } from '../lib/auth';
|
|
3
|
+
export declare const useAnalytics: () => {
|
|
4
|
+
readonly trackEntity: (eventName: string, entityName?: string, entityId?: string, payload?: Record<string, unknown>) => void;
|
|
5
|
+
readonly trackUser: (user: User) => void;
|
|
6
|
+
readonly identify: (userId: string, traits?: any, options?: any, callback?: ((...params: any[]) => any) | undefined) => Promise<any>;
|
|
7
|
+
readonly track: (eventName: string, payload?: any, options?: any, callback?: ((...params: any[]) => any) | undefined) => Promise<any>;
|
|
8
|
+
readonly page: (data?: import("analytics").PageData<string> | undefined, options?: any, callback?: ((...params: any[]) => any) | undefined) => Promise<any>;
|
|
9
|
+
readonly user: (key?: string | undefined) => any;
|
|
10
|
+
readonly reset: (callback?: ((...params: any[]) => any) | undefined) => Promise<any>;
|
|
11
|
+
readonly ready: (callback: (...params: any[]) => any) => import("analytics").DetachListeners;
|
|
12
|
+
readonly on: (name: string, callback: (...params: any[]) => any) => import("analytics").DetachListeners;
|
|
13
|
+
readonly once: (name: string, callback: (...params: any[]) => any) => import("analytics").DetachListeners;
|
|
14
|
+
readonly getState: (key?: string | undefined) => any;
|
|
15
|
+
readonly storage: {
|
|
16
|
+
getItem: (key: string, options?: any) => any;
|
|
17
|
+
setItem: (key: string, value: any, options?: any) => void;
|
|
18
|
+
removeItem: (key: string, options?: any) => void;
|
|
19
|
+
};
|
|
20
|
+
readonly plugins: {
|
|
21
|
+
enable: (plugins: string | string[], callback?: ((...params: any[]) => any) | undefined) => Promise<any>;
|
|
22
|
+
disable: (plugins: string | string[], callback: (...params: any[]) => any) => Promise<any>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AnalyticsInstance } from 'analytics';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { CreateAnalyticsProps } from '../../lib/analytics/createAnalytics';
|
|
4
|
+
export declare const LabsAnalyticsContext: import("react").Context<AnalyticsInstance | null>;
|
|
5
|
+
export interface LabsAnalyticsProviderProps extends CreateAnalyticsProps {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const LabsAnalyticsProvider: ({ appName, children, options, }: LabsAnalyticsProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="analytics" />
|
|
2
|
+
export interface CreateAnalyticsProps {
|
|
3
|
+
appName: string;
|
|
4
|
+
options?: {
|
|
5
|
+
debug?: boolean;
|
|
6
|
+
tokenMixpanel?: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare const createAnalytics: ({ appName, options: optionsInit, }: CreateAnalyticsProps) => import("analytics").AnalyticsInstance;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './analyticsContext';
|
package/dist/main.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export * from './hooks/useBreakpoints';
|
|
|
24
24
|
export * from './layouts/Base.layout';
|
|
25
25
|
export * from './layouts/Centered.layout';
|
|
26
26
|
export * from './layouts/Main.layout';
|
|
27
|
+
export * from './lib/analytics';
|
|
27
28
|
export * from './lib/auth';
|
|
28
29
|
export * from './types/DirectoryValue.type';
|
|
29
30
|
export * from './types/ReactHookForm.type';
|