import { ActionBuilder, CheckBuilder, Duration, Session, SessionTo, Wrapper } from "@gatling.io/core";
import { RequestActionBuilder, RequestWithBodyActionBuilder } from "./request";
import JvmSseConnectActionBuilder = io.gatling.javaapi.http.SseConnectActionBuilder;
import JvmSseMessageCheck = io.gatling.javaapi.http.SseMessageCheck;
import JvmSseSetCheckActionBuilder = io.gatling.javaapi.http.SseSetCheckActionBuilder;
export interface SseUntypedCondition {
    /**
     * Define the checks to apply on inbound messages when a condition holds true.
     *
     * @param thenChecks - the checks
     * @returns a new Text instance
     */
    then(...thenChecks: Array<CheckBuilder>): SseMessageCheck;
}
export interface SseTypedCondition {
    /**
     * Define the checks to apply when the condition holds true.
     *
     * @param thenChecks - the checks
     * @returns a new Text instance
     */
    then(...thenChecks: Array<CheckBuilder>): SseMessageCheck;
}
export interface SseMessageCheck extends Wrapper<JvmSseMessageCheck> {
    /**
     * Define conditions that have to hold true to match inbound messages and apply the checks on them
     *
     * @param newMatchConditions - the conditions to match
     * @returns a new SseMessageCheck instance
     */
    matching(...newMatchConditions: Array<CheckBuilder>): SseMessageCheck;
    /**
     * Define the checks to apply on inbound messages
     *
     * @param checks - the checks
     * @returns a new SseMessageCheck instance
     */
    check(...checks: Array<CheckBuilder>): SseMessageCheck;
    /**
     * Define the checks to apply on inbound messages when a condition holds true.
     *
     * @param condition - a condition, expressed as a function
     * @returns the next DSL step
     */
    checkIf(condition: (session: Session) => boolean): SseUntypedCondition;
    /**
     * Define the checks to apply on inbound messages when a condition holds true.
     *
     * @param condition - a condition, expressed as a Gatling Expression Language String
     * @returns the next DSL step
     */
    checkIf(condition: string): SseUntypedCondition;
    /**
     * Define the checks to apply on inbound messages when a condition holds true.
     *
     * @param condition - a condition, expressed as a function that's aware of the HTTP response and the
     *     Session
     * @returns the next DSL step
     */
    checkIf(condition: (response: string, session: Session) => boolean): SseTypedCondition;
}
export interface SseAwaitActionBuilderOn<T> {
    /**
     * Define the checks to wait on
     *
     * @param checks - the checks
     * @returns a usable ActionBuilder
     */
    on(...checks: Array<SseMessageCheck>): T;
}
export interface SseAwaitActionBuilder<T> {
    /**
     * Boostrap a check that waits for a given duration
     *
     * @param timeout - the static wait duration
     * @returns the next DSL step
     */
    await(timeout: Duration): SseAwaitActionBuilderOn<T>;
    /**
     * Boostrap a check that waits for a given duration
     *
     * @param timeout - the wait duration, expressed as a Gatling Expression Language String
     * @returns the next DSL step
     */
    await(timeout: string): SseAwaitActionBuilderOn<T>;
    /**
     * Boostrap a check that waits for a given duration
     *
     * @param timeout - the wait duration, expressed as a function
     * @returns the next DSL step
     */
    await(timeout: SessionTo<Duration>): SseAwaitActionBuilderOn<T>;
}
export interface SseConnectActionBuilder extends SseAwaitActionBuilder<SseConnectActionBuilder>, RequestWithBodyActionBuilder<SseConnectActionBuilder>, RequestActionBuilder<SseConnectActionBuilder>, ActionBuilder {
    _underlying: JvmSseConnectActionBuilder;
}
export interface SseSetCheckActionBuilder extends SseAwaitActionBuilder<SseSetCheckActionBuilder>, ActionBuilder {
    _underlying: JvmSseSetCheckActionBuilder;
}
/**
 * DSL for building <a
 * href="https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events">SSE</a>
 * configurations
 *
 * <p>Immutable, so all methods return a new occurrence and leave the original unmodified.
 */
export interface Sse {
    /**
     * Define a custom stream name so multiple SSEs for the same virtual users don't conflict
     *
     * @param sseName - the name, expressed as a Gatling Expression Language String
     * @returns a new Sse instance
     */
    sseName(sseName: string): Sse;
    /**
     * Define a custom stream name so multiple SSEs for the same virtual users don't conflict
     *
     * @param sseName - the name, expressed as a function
     * @returns a new Sse instance
     */
    sseName(sseName: (session: Session) => string): Sse;
    /**
     * Boostrap an action to connect the SSE with a GET request
     *
     * @param url - the url to connect to, expressed as a Gatling Expression Language String
     * @returns the next DSL step
     */
    get(url: string): SseConnectActionBuilder;
    /**
     * Boostrap an action to connect the SSE with a POST request
     *
     * @param url - the url to connect to, expressed as a Gatling Expression Language String
     * @returns the next DSL step
     */
    post(url: string): SseConnectActionBuilder;
    /**
     * Boostrap an action to connect the SSE with a GET request
     *
     * @param url - the url to connect to, expressed as a Gatling Expression Language String
     * @returns the next DSL step
     */
    get(url: (session: Session) => string): SseConnectActionBuilder;
    /**
     * Boostrap an action to connect the SSE with a POST request
     *
     * @param url - the url to connect to, expressed as a Gatling Expression Language String
     * @returns the next DSL step
     */
    post(url: (session: Session) => string): SseConnectActionBuilder;
    /**
     * Boostrap an action to set a check
     *
     * @returns the next DSL step
     */
    setCheck(): SseSetCheckActionBuilder;
    /**
     * Create an action to close the stream
     *
     * @returns an ActionBuilder
     */
    close(): ActionBuilder;
}
export interface SseApply {
    /**
     * Bootstrap a <a
     * href="https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events">SSE</a> request
     * configuration
     *
     * @param name - the SSE request name, expressed as a Gatling Expression Language String
     * @param sseName - the name of the SSE stream so multiple SSE streams for the same virtual users
     *     don't conflict, expressed as a Gatling Expression Language String
     * @returns the next DSL step
     */
    (name: string, sseName?: string): Sse;
}
export interface SseInboundMessage {
    message(): string;
    timestamp(): number;
}
export interface SsePrefix {
    /**
     * Boostrap a SSE check
     *
     * @param name - the name of the check
     * @returns the next DSL step
     */
    checkMessage(name: string): SseMessageCheck;
    /**
     * Process the currently buffered inbound SSE messages and empty the buffer
     *
     * @param f - the function to process the buffered messages
     * @returns an ActionBuilder
     */
    processUnmatchedMessages(f: (messages: Array<SseInboundMessage>, session: Session) => Session): ActionBuilder;
    /**
     * Process the currently buffered inbound SSE messages and empty the buffer
     *
     * @param sseName - the name of the SSE stream, expressed as a Gatling Expression Language String
     * @param f - the function to process the buffered messages
     * @returns an ActionBuilder
     */
    processUnmatchedMessages(sseName: string, f: (messages: Array<SseInboundMessage>, session: Session) => Session): ActionBuilder;
    /**
     * Process the currently buffered inbound SSE messages and empty the buffer
     *
     * @param sseName - the name of the SSE stream, expressed as a function
     * @param f - the function to process the buffered messages
     * @returns an ActionBuilder
     */
    processUnmatchedMessages(sseName: (session: Session) => string, f: (messages: Array<SseInboundMessage>, session: Session) => Session): ActionBuilder;
}
export declare const sse: SseApply & SsePrefix;
