/** * The wrapper of the SPExperiment modules in \@ms/sp-experiment. * see https://onedrive.visualstudio.com/OneDriveWeb/_git/odsp-common?path=%2Fsp-experiments%2FREADME.md&version=GBmaster&_a=preview */ /** * @internal */ export interface IExperimentContext { /** * Assignment information and metadata for active Flights on Rails experiments, in a compressed format. */ readonly experimentData: string; /** * Additional assignment information and metadata for active Flights on Rails experiments, in a compressed format. */ readonly experimentDataLookup: string[]; /** * Server time when page was pushed to client. */ readonly serverTime: string; /** * Unique site identifier, used for caching logic. */ readonly siteId?: string; /** * Unique user identifier, used for caching logic. */ readonly aadUserId?: string; } /** * We don't want people to use _getVariantWithoutLogging except in SPPerfExperiment, so this interface is to keep * that function private. * * @internal */ export interface IPrivateSPExperiment { _getVariantWithoutLogging(experimentId: number): number; } /** * The wrapper of sp-experiment to check experiment status in sp-client. * * @internal */ export declare class SPExperiment { /** * The experiment overrides where key is experiment id and value is the variant. * RESERVED FOR INTERNAL USAGE. This is only supposed to be used by SPPerfExperiment to * share debug experiment overrides. Production code should not access it. * It will be undefined debug experiments are not supported. */ static experimentOverrides: Map | undefined; private static _experimentContext; private static _isInitialized; /** * Initialize/Re-initialize experiments with latest page context info. * @param experimentContext - The context to identify the experiment environment. */ static initialize(experimentContext: IExperimentContext): void; /** * @internal * Retrieves the variant assignment for the given Flights on Rails experiment from the given page context. * This method automatically logs the assignment data to the experiment stream, so it is crucial that * this method is called only when the differences between variants would become visible to the end user. * If the assignment must be retrieved earlier, call getExperiment to get an ISpExperiment * object and use variantToDisplay and logExposure() at the appropriate times. * @param experimentId - The automatically generated experiment id in Flights on Rails. * Check the flighting page at aka.ms/flightsui to find this value. * @returns The variant to display to the end user. A value of 0 indicates that the original, control * experience should be shown, whereas a value of n greater than 0 indicates that the nth treatment * group should be shown. */ static getVariantAndLogExposure(experimentId: number): number; /** * RESERVED FOR INTERNAL USAGE. This method is invoked automatically by the system shell. * The application code should not call it directly. * * @param expOverrides - The experiment overrides string. * e.g. '[[90023,1],[90034,0]]' which means experiment 90023 will be forced on treatment experience and * experiment 90034 will be forced on control experience. */ static setDebugExperiments(expOverrides: string): void; /** * @internal * DO NOT USE UNLESS THERE IS NO NEED FOR SCORECARDS - this API will not log exposure to the experiment * Retrieves the variant assignment for the given Flights on Rails experiment from the given page context. This method does not log exposure * to the experiment, only returns the variant. This should be used only in cases where you want to retrieve the assignment, but do not want * the data to be logged. When using this API, the experimentation dashboard at aka.ms/odspexp and the automated SRM detection would * also be unavailable. * @param experimentId - The automatically generated experiment id in Flights on Rails. Check the flighting page at aka.ms/flightsui to find * this value. * @returns The variant to display to the end user. A value of 0 indicates that the original, control experience should be shown, whereas * a value of n \> 0 indicates that the nth treatment group should be shown. */ private static _getVariantWithoutLogging; } //# sourceMappingURL=SPExperiment.d.ts.map