///
import type { Experimentation } from './lib/client-experimentation/index';
import type { Experiment as SdkExperiment } from '@optimizely/optimizely-sdk/dist/shared_types';
import { Geolocation } from './edge-decider/lib/location';
export declare class ExperienceConfig {
accountId: string;
namespace: string;
revision: string;
anonymizeIP: boolean;
enableForceParameters: boolean;
experimental: {};
projectId: string;
snippetId: string;
layers: Experience[];
groups: ExclusionGroup[];
audiences: Audience[];
visitorAttributes: [];
visitorIdLocator: VisitorIdLocator;
integrationSettings: [];
views: View[];
events: [];
dimensions: [];
interestGroups: [];
tagGroups: [];
plugins: [];
projectJS: any;
dcpKeyfieldLocators: any;
dcpServiceId: string;
listTargetingKeys: any[];
listTargetingCookies: string[];
dynamicWebsiteSupport?: boolean;
constructor(DATA: any);
}
export declare class Action {
pageId: string | null;
viewId: string | null;
changes: Change[];
transforms: Experimentation.Transform[];
constructor(DATA: any);
}
export declare class Variation {
id: string;
name: string | null;
actions: Action[];
constructor(DATA: any);
}
export declare class Change {
id: string | number;
src?: string | null;
dest?: string | null;
name?: string | null;
type: string | null;
dependencies: any[];
css?: {} | null;
attributes?: {} | null;
selector?: string | null;
transform: Experimentation.Transform[];
preserveParameters?: boolean;
allowAdditionalRedirect?: boolean;
value?: any;
constructor(DATA: any);
}
export declare class Experiment {
id: string;
name: string | null;
audienceIds: any[];
variations: Variation[];
integrationSettings: any[];
weightDistributions: any[];
bucketingStrategy: string | null;
changes: Change[];
groupId?: string | null;
layerId?: string | null;
percentageIncluded?: number | null;
constructor(DATA: any);
}
export declare class Experience {
changes: Change[];
id: string;
name: string | null;
commitId: string;
groupId: string | null;
holdback: number;
activation: {};
integrationSettings: {};
integrationStringVersion: number;
experiments: Experiment[];
policy: string;
viewIds: [];
weightDistributions: string | null;
decisionMetadata: any;
constructor(DATA: any);
}
export declare class Decision {
layerId: string;
experimentId: string | null;
variationId?: string | null;
isLayerHoldback: boolean;
reason: string | null;
error: any;
apiName: string | null;
viewId: string | null;
stickyDecision?: boolean;
constructor(DATA: any);
}
export declare class View {
id: string;
category: string;
apiName: string;
name: string | null;
staticConditions: any[];
activationType: string;
activationCode: any;
deactivationEnabled: boolean;
undoOnDeactivation: boolean;
tags: Tag[];
constructor(DATA: any);
}
export declare class Tag {
category: string;
apiName: string;
locator: any;
locatorType: string;
valueType: string;
constructor(DATA: any);
}
export declare class Audience {
id: string;
name: string | null;
conditions: any[];
constructor(DATA: any);
}
export type Condition = {
name: string;
type: string;
match?: string;
value: string | number | boolean | null;
};
declare enum Operator {
AND = "and",
OR = "or",
NOT = "not"
}
type ConditionOrOperator = Operator | Condition;
export type Conditions = ConditionOrOperator[];
export declare class ExperienceQueue {
unevaluatedViewsIds: string[];
unevaluatedAudiencesIds: string[];
undecidedLayerIds: string[];
unappliedChangesets: Change[];
unappliedChangesetsIds: string[];
constructor(DATA: any);
}
export declare class ExperienceResults {
activeViewsIds: string[];
inactiveViewsIds: string[];
activeAudiencesIds: string[];
inactiveAudiencesIds: string[];
activeLayerIds: string[];
inactiveLayerIds: string[];
appliedChangesets: Change[];
appliedChangesetsIds: string[];
decisions: Decision[];
constructor(DATA: any);
}
export type TimeContext = {
current: number;
timezone: string | null;
timezoneOffset: number | null;
};
export declare class Inputs {
requestType?: string;
metadata?: any;
visitorId?: string;
cookies?: Record;
cookieDomain?: string;
cookieExpirationDays?: number;
first_session?: boolean;
language?: string;
queryParams?: URLSearchParams;
requestHeaders?: Headers;
redirectInfo?: Object;
url?: string;
userAgent?: string;
visitorIp?: string;
location?: Geolocation | null;
referrer?: string | null;
time?: TimeContext;
bypassLogSampling?: boolean;
forceVariationIds?: Array;
logLevel?: string;
priorRedirectCookie?: string;
webManifestS3Bucket?: string | null;
bustSnippetCache?: boolean;
optIn?: boolean;
isDebugMode?: boolean;
constructor({ requestType, metadata, cookies, cookieDomain, cookieExpirationDays, queryParams, requestHeaders, redirectInfo, url, userAgent, visitorIp, bypassLogSampling, forceVariationIds, logLevel, priorRedirectCookie, webManifestS3Bucket, bustSnippetCache, optIn, isDebugMode, }?: {
requestType?: string | undefined;
metadata?: {} | undefined;
cookies?: {} | undefined;
cookieDomain?: string | undefined;
cookieExpirationDays?: number | undefined;
queryParams?: URLSearchParams | undefined;
requestHeaders?: Headers | undefined;
redirectInfo?: {} | undefined;
url?: string | undefined;
userAgent?: string | undefined;
visitorIp?: string | undefined;
bypassLogSampling?: boolean | undefined;
forceVariationIds?: never[] | undefined;
logLevel?: string | undefined;
priorRedirectCookie?: string | undefined;
webManifestS3Bucket?: string | undefined;
bustSnippetCache?: boolean | undefined;
optIn?: boolean | undefined;
isDebugMode?: boolean | undefined;
});
}
export type CacheControl = {
targetTTL?: number;
dataTTL?: number;
browserTTL?: number;
};
export type VisitorIdLocator = {
name: string;
type: string;
} | null;
export type Environments = 'dev' | 'prod';
export declare class Options {
accountId?: number;
snippetId?: string | number;
isProd?: boolean;
isSnippetless?: boolean;
nonce?: string;
position?: string;
cacheTTLs?: CacheControl;
deployId?: string;
fallback?: string;
existingSnippet?: string;
kvNamespace?: KVNamespace;
webhookSecret?: string;
fixCSPForOptimizely?: boolean;
control?: Response;
rewriter?: HTMLRewriter;
environment: 'dev' | 'prod';
dev_host?: string;
dev_protocol?: string;
dev_port?: string;
dev_pathname?: string;
DATA?: any;
useEdgeDeliverySnippet?: boolean;
logLevel?: 'debug' | 'info' | 'warning' | 'warn' | 'error';
constructor({ accountId, snippetId, isProd, isSnippetless, nonce, position, cacheTTLs, deployId, fallback, existingSnippet, kvNamespace, webhookSecret, control, rewriter, environment, dev_host, dev_protocol, dev_port, dev_pathname, DATA, logLevel, useEdgeDeliverySnippet, }: Options);
}
export type VisitorProfile = {
profile: Record;
metadata: Record;
};
export type ProfileAttributes = Record;
export interface VisitorProfileProvider {
provide: string;
isSticky: boolean;
isTransient: boolean;
shouldTrack: boolean;
getValue: (inputs: Inputs) => Promise;
}
export type DevUrl = {
dev_host?: string;
dev_protocol?: string;
dev_port?: string;
dev_pathname?: string;
};
export interface ExclusionGroup {
id: string;
weightDistributions: WeightDistribution[];
name: string;
experiments?: Experiment[] | SdkExperiment[];
}
export interface WeightDistribution {
entityId: string;
endOfRange: number;
}
export {};