@livingroot/yandex-metrica-ab-react
Version:
Fork of yandex-metrica-ab-react by firnis
21 lines (20 loc) • 873 B
TypeScript
import React, { ReactNode } from 'react';
import { ReturnType, NamedReturnType } from './types';
import { UseExperiments } from './useExperiments';
export declare const MetricaExperimentsContext: React.Context<ReturnType>;
interface ContextExperiments extends UseExperiments {
children: ReactNode;
enableAntiflicker?: boolean;
antiflickerTimeout?: number;
}
export declare const MetricaExperimentsProvider: React.FC<ContextExperiments>;
export declare const useExperimentsContext: <T extends Record<string, string>>() => NamedReturnType<T>;
export declare function useFlagContext<T extends Record<string, string>>(name: keyof T, takeFirst?: false): {
ready: boolean;
value: Array<string>;
};
export declare function useFlagContext<T extends Record<string, string>>(name: keyof T, takeFirst: true): {
ready: boolean;
value: string;
};
export {};