ab-test-jsx
Version:
React (JS) AB testing consumption
6 lines (5 loc) • 804 B
TypeScript
import * as React from 'react';
import { ABTests } from '../ABTestsContext';
export declare type withABTestHoC<T extends ABTests> = <TAProps extends Record<string, unknown>, TBProps extends Record<string, unknown>, TABTestName extends Extract<keyof T, string | number>>(AVariantComponent: React.ComponentType<TAProps>, BVariantComponent: React.ComponentType<TBProps>, abTestName: TABTestName) => React.FC<TAProps & TBProps>;
declare const withABTest: <TAProps extends Record<string, unknown>, TBProps extends Record<string, unknown>, TABTests extends ABTests, TABTestName extends Extract<keyof TABTests, string | number>>(AVariantComponent: React.ComponentType<TAProps>, BVariantComponent: React.ComponentType<TBProps>, abTestName: TABTestName) => React.FC<TAProps & TBProps>;
export default withABTest;