import { Abortable } from '../abortable/Abortable'; import { FrameworkError } from '../error/FrameworkError'; import type { EventBus } from '../event-bus/EventBus'; import type { AnyExecutionContext } from '../execution-context/ExecutionContext'; import type { NamedTask, Task, TaskParam, TaskReturn } from '../task/Types'; import { Deferred } from '../utils/Deferred'; import type { ThreadEvent } from './ThreadEventBus'; import { ThreadEventBus, ThreadEventType } from './ThreadEventBus'; export declare class ThreadTerminationError extends FrameworkError { readonly name = "ThreadTerminationError"; readonly threadStack: string[]; constructor(rootCause?: Error); } export declare class ThreadDisposedError extends FrameworkError { readonly name = "ThreadDisposedError"; constructor(message?: string); } export declare enum ThreadState { Idle = "idle", Disposing = "disposing", Disposed = "disposed" } export declare class Thread extends ThreadEventBus { readonly id: string; private readonly children; readonly abortController: AbortController; protected abortable?: Abortable; private threadState; private readonly executionDeferred; private readonly removeAbortListener; constructor(eventBus: EventBus); get onExit(): Deferred; get state(): ThreadState; createChild(name: string, handleError?: (error: Error) => boolean): Thread; private getChildAbortables; private waitForChildren; abort(reason?: Error): void; fork>>(context: CTX, task: ForkedTask, parameter: TaskParam): Abortable>; private handleError; private abortAndWaitForChildren; private removeChild; private dispose; }