@altertable/altertable-react 0.3.0
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/index.d.mts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.global.js +1494 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +69 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +47 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +65 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type FunnelStep = {
|
|
2
|
+
name: string;
|
|
3
|
+
properties: any;
|
|
4
|
+
};
|
|
5
|
+
type FunnelStepNames<T extends readonly FunnelStep[]> = T[number]['name'];
|
|
6
|
+
type FunnelStepProperties<T extends readonly FunnelStep[], N extends FunnelStepNames<T>> = Extract<T[number], {
|
|
7
|
+
name: N;
|
|
8
|
+
}>['properties'];
|
|
9
|
+
type FunnelMapping = Record<string, readonly FunnelStep[]>;
|
|
10
|
+
|
|
11
|
+
declare const useAltertable: <T extends FunnelMapping>() => {
|
|
12
|
+
useFunnel: <FunnelName extends keyof T>(_funnelName: FunnelName) => {
|
|
13
|
+
track: <Step extends FunnelStepNames<T[FunnelName]>>(step: Step, properties: FunnelStepProperties<T[FunnelName], Step>) => void;
|
|
14
|
+
};
|
|
15
|
+
identify: (userId: string) => void;
|
|
16
|
+
track: <Step extends FunnelStepNames<T[keyof T]>>(step: Step, properties: FunnelStepProperties<T[keyof T], Step>) => void;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { type FunnelMapping, type FunnelStep, type FunnelStepNames, type FunnelStepProperties, useAltertable };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type FunnelStep = {
|
|
2
|
+
name: string;
|
|
3
|
+
properties: any;
|
|
4
|
+
};
|
|
5
|
+
type FunnelStepNames<T extends readonly FunnelStep[]> = T[number]['name'];
|
|
6
|
+
type FunnelStepProperties<T extends readonly FunnelStep[], N extends FunnelStepNames<T>> = Extract<T[number], {
|
|
7
|
+
name: N;
|
|
8
|
+
}>['properties'];
|
|
9
|
+
type FunnelMapping = Record<string, readonly FunnelStep[]>;
|
|
10
|
+
|
|
11
|
+
declare const useAltertable: <T extends FunnelMapping>() => {
|
|
12
|
+
useFunnel: <FunnelName extends keyof T>(_funnelName: FunnelName) => {
|
|
13
|
+
track: <Step extends FunnelStepNames<T[FunnelName]>>(step: Step, properties: FunnelStepProperties<T[FunnelName], Step>) => void;
|
|
14
|
+
};
|
|
15
|
+
identify: (userId: string) => void;
|
|
16
|
+
track: <Step extends FunnelStepNames<T[keyof T]>>(step: Step, properties: FunnelStepProperties<T[keyof T], Step>) => void;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { type FunnelMapping, type FunnelStep, type FunnelStepNames, type FunnelStepProperties, useAltertable };
|