-import type { Worker as ClusterWorker } from 'node:cluster'
-import type { MessagePort } from 'node:worker_threads'
-import type { KillBehavior } from './worker/worker-options'
-import type { IWorker } from './pools/worker'
+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> {
+ /**
+ * Task function name triggering the error.
+ */
+ readonly name: string
+ /**
+ * Error message.
+ */
+ readonly message: string
+ /**
+ * Data triggering the error.
+ */
+ readonly data?: Data
+}
+
+/**
+ * Task performance.
+ * @internal
+ */
+export interface TaskPerformance {
+ /**
+ * Task name.
+ */
+ readonly name: string
+ /**
+ * Task performance timestamp.
+ */
+ readonly timestamp: number
+ /**
+ * Task runtime.
+ */
+ readonly runTime?: number
+ /**
+ * Task event loop utilization.
+ */
+ readonly elu?: EventLoopUtilization
+}