@gatling.io/core
Version:
Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).
38 lines (37 loc) • 1.87 kB
TypeScript
import { SessionTo } from "../session";
import { On } from "./on";
import JvmForEach = io.gatling.javaapi.core.loop.ForEach;
export interface ForEachFunction<T extends ForEach<T>> {
/**
* Define a loop that will iterate over a list of values.
*
* @param seq - the static list of values to iterate over
* @param attributeName - the key to store the current element in the Session
* @param counterName - the name of the loop counter, as stored in the Session
* @returns a DSL component to define the loop content
*/
(seq: unknown[], attributeName: string, counterName?: string): On<T>;
/**
* Define a loop that will iterate over a list of values.
*
* @param seq - the list of values to iterate over, expressed as a Gatling Expression Language String, must evaluate
* to an array
* @param attributeName - the key to store the current element in the Session
* @param counterName - the name of the loop counter, as stored in the Session
* @returns a DSL component to define the loop content
*/
(seq: string, attributeName: string, counterName?: string): On<T>;
/**
* Define a loop that will iterate over a list of values.
*
* @param seq - the list of values to iterate over, expressed as a function
* @param attributeName - the key to store the current element in the Session
* @param counterName - the name of the loop counter, as stored in the Session
* @returns a DSL component to define the loop content
*/
(seq: SessionTo<Array<unknown>>, attributeName: string, counterName?: string): On<T>;
}
export interface ForEach<T extends ForEach<T>> {
foreach: ForEachFunction<T>;
}
export declare const foreachImpl: <J2, J1 extends JvmForEach<J2, any>, T extends ForEach<T>>(jvmForEach: J1, wrap: (wrapped: J2) => T) => ForEachFunction<T>;