mentiq-sdk
Version:
A powerful analytics SDK for React and Next.js with heatmap tracking, session monitoring, and performance analytics
106 lines • 4.85 kB
TypeScript
import React, { ReactNode } from "react";
import { ExperimentAssignment, AssignmentOptions } from "./types";
interface ABTestProps {
experimentKey: string;
children: ReactNode;
fallback?: ReactNode;
loadingComponent?: ReactNode;
options?: AssignmentOptions;
}
export declare function ABTest({ experimentKey, children, fallback, loadingComponent, options, }: ABTestProps): import("react/jsx-runtime").JSX.Element;
interface VariantProps {
experimentKey: string;
variantKey: string;
children: ReactNode;
fallback?: ReactNode;
options?: AssignmentOptions;
}
export declare function Variant({ experimentKey, variantKey, children, fallback, options, }: VariantProps): import("react/jsx-runtime").JSX.Element | null;
interface ControlProps {
experimentKey: string;
children: ReactNode;
fallback?: ReactNode;
options?: AssignmentOptions;
}
export declare function Control({ experimentKey, children, fallback, options, }: ControlProps): import("react/jsx-runtime").JSX.Element | null;
interface VariantsProps {
experimentKey: string;
variants: Record<string, ReactNode>;
fallback?: ReactNode;
loadingComponent?: ReactNode;
options?: AssignmentOptions;
}
export declare function Variants({ experimentKey, variants, fallback, loadingComponent, options, }: VariantsProps): import("react/jsx-runtime").JSX.Element;
interface FeatureFlagProps {
experimentKey: string;
children: ReactNode;
fallback?: ReactNode;
loadingComponent?: ReactNode;
options?: AssignmentOptions;
}
export declare function FeatureFlag({ experimentKey, children, fallback, loadingComponent, options, }: FeatureFlagProps): import("react/jsx-runtime").JSX.Element;
interface ABTestValueProps<T> {
experimentKey: string;
controlValue: T;
variantValues: Record<string, T>;
children: (value: T, variant: string | undefined, isControl: boolean) => ReactNode;
fallback?: ReactNode;
loadingComponent?: ReactNode;
options?: AssignmentOptions;
}
export declare function ABTestValue<T>({ experimentKey, controlValue, variantValues, children, fallback, loadingComponent, options, }: ABTestValueProps<T>): import("react/jsx-runtime").JSX.Element;
export declare function withABTest<P extends object>(WrappedComponent: React.ComponentType<P>, experimentKey: string, options?: AssignmentOptions): (props: P) => import("react/jsx-runtime").JSX.Element | null;
interface ConversionTrackerProps {
experimentId: string;
eventName: string;
eventValue?: number;
properties?: Record<string, any>;
children?: ReactNode;
triggerOnMount?: boolean;
}
export declare function ConversionTracker({ experimentId, eventName, eventValue, properties, children, triggerOnMount, }: ConversionTrackerProps): import("react/jsx-runtime").JSX.Element | null;
interface ABTestConditionalProps {
experimentKey: string;
condition: (assignment: ExperimentAssignment) => boolean;
children: ReactNode;
fallback?: ReactNode;
options?: AssignmentOptions;
}
export declare function ABTestConditional({ experimentKey, condition, children, fallback, options, }: ABTestConditionalProps): import("react/jsx-runtime").JSX.Element | null;
interface ABTestEffectProps {
experimentKey: string;
effects: Record<string, () => void | (() => void)>;
options?: AssignmentOptions;
}
export declare function ABTestEffect({ experimentKey, effects, options, }: ABTestEffectProps): null;
interface ABTestWithStatesProps {
experimentKey: string;
children: (assignment: ExperimentAssignment) => ReactNode;
loadingComponent?: ReactNode;
errorComponent?: (error: string) => ReactNode;
fallbackComponent?: ReactNode;
options?: AssignmentOptions;
}
export declare function ABTestWithStates({ experimentKey, children, loadingComponent, errorComponent, fallbackComponent, options, }: ABTestWithStatesProps): import("react/jsx-runtime").JSX.Element;
interface ABTestButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
experimentKey: string;
variants: Record<string, {
text: string;
style?: React.CSSProperties;
}>;
onClick?: () => void;
onConversion?: () => void;
}
export declare function ABTestButton({ experimentKey, variants, onClick, onConversion, ...props }: ABTestButtonProps): import("react/jsx-runtime").JSX.Element | null;
interface ABTestTextProps {
experimentKey: string;
variants: Record<string, string>;
fallback?: string;
component?: React.ComponentType<{
children: string;
}> | keyof JSX.IntrinsicElements;
options?: AssignmentOptions;
}
export declare function ABTestText({ experimentKey, variants, fallback, component: Component, options, }: ABTestTextProps): import("react/jsx-runtime").JSX.Element;
export {};
//# sourceMappingURL=components-ab-testing.d.ts.map