import { Actionable } from "../action/actionable"; import { Awaitable } from "../../../util/data"; import { ActionStatements, LambdaHandler } from "./type"; import { Lambda } from "./condition"; export declare class Control extends Actionable { /** * Execute actions in order, waiting for each action to complete. * @param actions - The sequence of actions to run. * @chainable * @example * ```ts * Control.do([character.say("hello"), image.char("path.png")]); * ``` */ static do(actions: ActionStatements): ChainedControl; /** * Execute actions in order without waiting for completion. * @param actions - Actions to run sequentially. * @chainable * @example * ```ts * Control.doAsync([sound.play(), image.char("path.png")]); * ``` */ static doAsync(actions: ActionStatements): ChainedControl; /** * Execute actions concurrently, resolving once any finishes. * @param actions - Actions to run in parallel. * @chainable * @example * ```ts * Control.any([sound.play(), image.char("happy.png")]); * ``` */ static any(actions: ActionStatements): ChainedControl; /** * Execute actions concurrently and wait until all finish. * @param actions - Actions to run at the same time. * @chainable * @example * ```ts * Control.all([sound.play(), dialog.show()]); * ``` */ static all(actions: ActionStatements): ChainedControl; /** * Execute actions concurrently and continue without waiting. * @param actions - Actions to fire simultaneously. * @chainable */ static allAsync(actions: ActionStatements): ChainedControl; /** * Execute actions multiple times. * @param times - How many times to repeat. * @param actions - The actions to repeat. * @chainable * @example * ```ts * Control.repeat(3, [character.say("Again!")]); * ``` */ static repeat(times: number, actions: ActionStatements): ChainedControl; /** * Repeat actions while a condition stays true. * @param condition - Lambda to guard the loop. * @param actions - Body actions to run each iteration. * @chainable */ static whileLoop(condition: Lambda | LambdaHandler, actions: ActionStatements): ChainedControl; /** * Break out of the nearest repeating loop (repeat or while). * Can only be used inside a loop body. * @chainable */ static breakLoop(): ChainedControl; /** * Pause execution for a duration or until an `Awaitable` resolves. * @param duration - Milliseconds or awaitable controlling the pause length. * @chainable */ static sleep(duration: number | Awaitable | Promise): ChainedControl; /** * Pause execution until the user clicks anywhere on the stage (excluding GUI/Page elements). * Similar to inserting a pause with no duration in a Sentence. * @chainable * @example * ```ts * Control.waitForClick(); * ``` */ static waitForClick(): ChainedControl; constructor(/**@internal */ config?: Partial); /** * Execute actions in order, waiting for each action to complete * @chainable */ do(actions: ActionStatements): ChainedControl; /** * Execute actions in order, do not wait for this action to complete * @chainable */ doAsync(actions: ActionStatements): ChainedControl; /** * Execute all actions at the same time, waiting for any one action to complete * @chainable */ any(actions: ActionStatements): ChainedControl; /** * Execute all actions at the same time, waiting for all actions to complete * @chainable */ all(actions: ActionStatements): ChainedControl; /** * Execute all actions at the same time, do not wait for all actions to complete * @chainable */ allAsync(actions: ActionStatements): ChainedControl; /** * Execute actions multiple times * @chainable */ repeat(times: number, actions: ActionStatements): ChainedControl; /** * Execute actions while condition is true * @chainable */ whileLoop(condition: Lambda | LambdaHandler, actions: ActionStatements): ChainedControl; /** * Break the current loop (repeat/while) * Can only be used inside a loop body * @chainable */ breakLoop(): ChainedControl; /** * Sleep for a duration * @chainable */ sleep(duration: number | Awaitable | Promise): ChainedControl; /** * Wait for user to click the stage (excluding GUI elements) * @chainable */ waitForClick(): ChainedControl; }