export { macrotaskYield }; /** * Process-wide macrotask-boundary yield with sub-millisecond cost. * * `setTimeout(0)` would also yield to macrotasks but browsers clamp it to * ~4 ms after a few nested calls (HTML spec, "timer nesting level ≥ 5"), * which dominates the throttle budget. `MessageChannel.postMessage` is a * macrotask too but has no clamp — typical resume latency is sub-ms. * * Concurrent `yield()` calls coalesce: only one `postMessage` is in flight * at a time, and when its `onmessage` fires every queued waiter resumes in * enqueue order. So N senders that all need to breathe at once cost one * macrotask, not N. */ declare class MacrotaskYield { private channel; private waiters; private posted; yield(): Promise; /** Constructed on first yield, not at module load — some toolchains evaluate the * module in a context without `MessageChannel` (Cloudflare Vite plugin * pre-bundling). Workers / Node have it at runtime. */ private ensureChannel; } declare const macrotaskYield: MacrotaskYield;