UNPKG

@gatling.io/core

Version:

Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).

27 lines (26 loc) 1.1 kB
import { SessionTo } from "../session"; import { ChoiceWithKey } from "./choices"; import JvmDoSwitch = io.gatling.javaapi.core.condition.DoSwitch; export interface On<T> { on(...choices: ChoiceWithKey[]): T; } export interface DoSwitchFunction<T extends DoSwitch<T>> { /** * Execute one of the "choices" when the actual value is equal to the possibility's one. * * @param actual - the actual value expressed as a Gatling Expression Language String * @returns a DSL component for defining the "choices" */ (actual: string): On<T>; /** * Execute one of the "choices" when the actual value is equal to the possibility's one. * * @param actual - the actual value expressed as a function * @returns a DSL component for defining the "choices" */ (actual: SessionTo<unknown>): On<T>; } export interface DoSwitch<T extends DoSwitch<T>> { doSwitch: DoSwitchFunction<T>; } export declare const doSwitchImpl: <J2, J1 extends JvmDoSwitch<J2, any>, T extends DoSwitch<T>>(jvmDoSwitch: J1, wrap: (wrapped: J2) => T) => DoSwitchFunction<T>;