import * as Fiber from "./Fiber.js"; import * as Observable from "./Observable/index.js"; export { Supervisor as t }; /** * Thrown when a terminated supervisor is given a new task to observe. */ export declare class TerminatedError extends Error { readonly name = "TerminatedError"; } /** * Thrown when a supervisor is given a new task to observe and it is already * observing a task with the same id. */ export declare class UniqueTaskIdError extends Error { readonly name = "UniqueTaskIdError"; } /** * A `Supervisor` is a fiber that observes a set of fibers, called tasks. When * a supervisor is terminated, all of its tasks will be terminated as well. */ export declare class Supervisor extends Fiber.t { #private; readonly taskCount: Observable.Observable; readonly tasks: Map; /** * Starts observing a new task. If an observed task terminates it will no * longer be observed. * * @throws {TerminatedError} If the supervisor is terminated. * * @throws {UniqueTaskIdError} If the supervisor is already observing a task with the same id. */ observe(task: Task): void; /** * Terminates all tasks and then terminates the supervisor. */ terminate(): void; } /** * Creates a new `Supervisor`. */ export declare const init: (id?: string) => Supervisor; //# sourceMappingURL=Supervisor.d.ts.map