import type { State } from "../state/state.js"; import { ConditionsMethods } from "./allMethods.js"; import { ConditionsContextBase } from "./types.js"; declare class Conditions, S = Context["state"]> extends Function { /** * @param state game's state reference * @param subjects additional data to be available while running conditions * @param defaultSubject which of the initial subjects to pick back after each assertion? If left empty, `state` will be picked instead. */ constructor(context: Context, defaultSubjectKey?: keyof Context); } interface Conditions, S extends State = Context["state"]> { /** * Provide custom error message. It will be sent to the client when one * of the assertions fail in given chain. * * > TODO: it would be nice to have an object or error code sent to client additionally. * > Front-end could then have it pick the message in player's language * * @example * ```ts * test("Wait for your turn!").itsPlayersTurn() * test("Can't perform this action until round 5").its("round").is.aboveEq(5) * ``` */ (errorMessage?: string): ConditionsMethods; /** * For internal use only. Get direct reference to the core, without having to * call the Conditions function * @ignore */ getCore(): ConditionsMethods; } export { Conditions };