ab-test-jsx
Advanced tools
Comparing version 3.0.2 to 3.0.3
import * as React from 'react'; | ||
import { ABTests } from '../ABTestsContext'; | ||
export declare type withABTestHoC<T extends ABTests> = <TAProps extends {}, TBProps extends {}, 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 {}, TBProps extends {}, 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 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; |
import * as React from 'react'; | ||
import { ABTests } from '../ABTestsContext'; | ||
export declare type withABTestsProviderHoC<T extends ABTests> = <TProps extends {}>(Component: React.ComponentType<TProps>, abTests: T | ABTestsSetter<TProps, T>, defaultVariant?: 'A' | 'B' | 'Z') => React.FunctionComponent<TProps>; | ||
declare type ABTestsSetter<TProps extends {}, T> = (componentProps: TProps) => T; | ||
declare const withABTestsProvider: <T extends ABTests, TProps extends {}>(Component: React.ComponentType<TProps>, abTests: T | ABTestsSetter<TProps, T>, defaultVariant?: "A" | "B" | "Z" | undefined) => React.FC<TProps>; | ||
export declare type withABTestsProviderHoC<T extends ABTests> = <TProps extends Record<string, unknown>>(Component: React.ComponentType<TProps>, abTests: T | ABTestsSetter<TProps, T>, defaultVariant?: 'A' | 'B' | 'Z') => React.FunctionComponent<TProps>; | ||
declare type ABTestsSetter<TProps extends Record<string, unknown>, T> = (componentProps: TProps) => T; | ||
declare const withABTestsProvider: <T extends ABTests, TProps extends Record<string, unknown>>(Component: React.ComponentType<TProps>, abTests: T | ABTestsSetter<TProps, T>, defaultVariant?: "A" | "B" | "Z" | undefined) => React.FC<TProps>; | ||
export default withABTestsProvider; |
{ | ||
"name": "ab-test-jsx", | ||
"description": "React (JS) AB testing consumption", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "author": "Maciej Malkowski <monkey3310@gmail.com>", |
25633