UNPKG

narraleaf-react

Version:

A React visual novel player framework

77 lines (76 loc) 2.53 kB
import { Actionable } from "../action/actionable"; import { Awaitable } from "../../../util/data"; import { ActionStatements } from "./type"; export declare class Control extends Actionable { /** * Execute actions in order, waiting for each action to complete * @chainable */ static do(actions: ActionStatements): ChainedControl; /** * Execute actions in order, do not wait for this action to complete * @chainable */ static doAsync(actions: ActionStatements): ChainedControl; /** * Execute all actions at the same time, waiting for any one action to complete * @chainable */ static any(actions: ActionStatements): ChainedControl; /** * Execute all actions at the same time, waiting for all actions to complete * @chainable */ static all(actions: ActionStatements): ChainedControl; /** * Execute all actions at the same time, do not wait for all actions to complete * @chainable */ static allAsync(actions: ActionStatements): ChainedControl; /** * Execute actions multiple times * @chainable */ static repeat(times: number, actions: ActionStatements): ChainedControl; /** * Sleep for a duration * @chainable */ static sleep(duration: number | Awaitable<any> | Promise<any>): ChainedControl; constructor(/**@internal */ config?: Partial<ControlConfig>); /** * 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; /** * Sleep for a duration * @chainable */ sleep(duration: number | Awaitable<any> | Promise<any>): ChainedControl; }