//#region src/environment.d.ts
/**
 * Runtime-environment shapes used by the headless core APIs.
 *
 * These are intentionally structural rather than aliases to browser globals
 * like `Worker`, `MessageEvent`, or `AbortSignal`. Browser, Node, and test
 * implementations can satisfy the same contract without forcing consumers of
 * `@hashintel/petrinaut-core` to include DOM types.
 */
type WorkerMessageEnvelope<TMessage = unknown> = {
  readonly data: TMessage;
};
type WorkerMessageHandler<TMessage = unknown> = (event: WorkerMessageEnvelope<TMessage>) => void;
interface WorkerLike<TOutboundMessage = unknown, TInboundMessage = unknown> {
  postMessage(message: TOutboundMessage): void;
  addEventListener(type: "message", listener: WorkerMessageHandler<TInboundMessage>): void;
  removeEventListener?(type: "message", listener: WorkerMessageHandler<TInboundMessage>): void;
  terminate(): void;
}
type WorkerFactoryLike<TOutboundMessage = unknown, TInboundMessage = unknown> = () => WorkerLike<TOutboundMessage, TInboundMessage> | Promise<WorkerLike<TOutboundMessage, TInboundMessage>>;
interface AbortSignalLike {
  readonly aborted: boolean;
  addEventListener(type: "abort", listener: () => void, options?: {
    readonly once?: boolean;
  }): void;
  removeEventListener(type: "abort", listener: () => void): void;
}
//#endregion
export { WorkerFactoryLike as n, WorkerLike as r, AbortSignalLike as t };
//# sourceMappingURL=environment-Cg8b3IqY.d.ts.map