posthog-js
Version:
Posthog-js allows you to automatically capture usage and send events to PostHog.
25 lines (24 loc) • 1.12 kB
TypeScript
import { PostHog } from './posthog-core';
import { WebExperimentsCallback, WebExperimentUrlMatchType } from './web-experiments-types';
import { Extension } from './extensions/types';
export declare const webExperimentUrlValidationMap: Record<WebExperimentUrlMatchType, (conditionsUrl: string, href: string) => boolean>;
export declare class WebExperiments implements Extension {
private _instance;
private _flagToExperiments?;
private get _config();
constructor(_instance: PostHog);
initialize(): void;
onFeatureFlags(flags: string[]): void;
previewWebExperiment(): void;
loadIfEnabled(): void;
getWebExperimentsAndEvaluateDisplayLogic: (forceReload?: boolean) => void;
getWebExperiments(callback: WebExperimentsCallback, forceReload: boolean, previewing?: boolean): void;
private _showPreviewWebExperiment;
private static _matchesTestVariant;
private static _matchUrlConditions;
static getWindowLocation(): Location | undefined;
private static _matchUTMConditions;
private static _logInfo;
private _applyTransforms;
_is_bot(): boolean | undefined;
}