import { AbilityType, Actor } from './actor'; /** * Type definition for task interactions. */ export interface TaskInteraction

{ invoke(param: P): void | Promise; } /** * Type definition for tasks. * * An task is a list of interactions that accept a parameter of type P and don't * yield a result, but modify the state as a side effect. */ type TaskType

= { new (actor: Actor): TaskInteraction

; }; export type Task

= TaskType

| TaskType

[]; export type TaskProcedure = (ability: AbilityType, param: P) => void | Promise; /** * Shorthand for creating tasks using a specific ability. * * @param ability * A constructor for an ability service. * @param procedure * The procedure to fulfill this task. */ export declare function createTask(ability: { new (): A; }, procedure: TaskProcedure): { new (actor: Actor): { /** * A ability service object to invoke commands on. */ ability?: A | undefined; /** * An actor to perform sub-tasks. */ actor?: Actor | undefined; invoke(param: P): void | Promise; }; }; export {};