import { TogglingApi, TogglingApiByActivationContext } from '../client'; import { Response, Request, NextFunction } from 'express-serve-static-core'; import { Extractor, ForcedToggleExtractor } from './extractors'; export declare type ExpressConfig = { client: TogglingApiByActivationContext; /** * Customize request extractors */ extractors?: { /** * Visitor UUID extractor */ uuid?: Extractor; /** * Forced-toggles extractor */ forcedToggles?: ForcedToggleExtractor; /** * Extractors for different toggle attributes * The value extracted from the request will be used to compared against the toggle attribute to determine activation */ attributes?: Array<{ attribute: string; extractor: Extractor; }>; }; }; /** * An Express-middleware that provides toggle computation based on the Request information */ export declare const middleware: (config: ExpressConfig) => (req: Request, _: Response, next: NextFunction) => void; /** * A refinement of the base toguru client that extracts activation information from the request */ export declare const expressClient: (config: ExpressConfig) => (req: Request) => TogglingApi;