-import type { Worker as ClusterWorker } from 'cluster'
-import type { MessagePort } from 'worker_threads'
-import type { IPoolWorker } from './pools/pool-worker'
-import type { KillBehavior } from './worker/worker-options'
+import type { AsyncResource } from 'node:async_hooks'
+import type { EventLoopUtilization } from 'node:perf_hooks'
+import type { MessagePort, TransferListItem } from 'node:worker_threads'
+
+import type { WorkerChoiceStrategy } from './pools/selection-strategies/selection-strategies-types.js'
+import type { KillBehavior } from './worker/worker-options.js'
+
+/**
+ * Worker error.
+ * @typeParam Data - Type of data sent to the worker triggering an error. This can only be structured-cloneable data.
+ */
+export interface WorkerError<Data = unknown> {
+ /**
+ * Data triggering the error.
+ */
+ readonly data?: Data
+ /**
+ * Error message.
+ */
+ readonly message: string
+ /**
+ * Task function name triggering the error.
+ */
+ readonly name: string
+}
+
+/**
+ * Task performance.
+ * @internal
+ */
+export interface TaskPerformance {
+ /**
+ * Task event loop utilization.
+ */
+ readonly elu?: EventLoopUtilization
+ /**
+ * Task name.
+ */
+ readonly name: string
+ /**
+ * Task runtime.
+ */
+ readonly runTime?: number
+ /**
+ * Task performance timestamp.
+ */
+ readonly timestamp: number
+}
+
+/**
+ * Worker task performance statistics computation settings.
+ * @internal
+ */
+export interface WorkerStatistics {
+ /**
+ * Whether the worker computes the task event loop utilization (ELU) or not.
+ */
+ readonly elu: boolean
+ /**
+ * Whether the worker computes the task runtime or not.
+ */
+ readonly runTime: boolean
+}