/**
 * Node 20+ compatible implementation of Promise.withResolvers()
 * Falls back to native Promise.withResolvers when available (Node 22+)
 */
export function promiseWithResolvers() {
    // Use native implementation if available
    if (typeof Promise.withResolvers === "function") {
        return Promise.withResolvers();
    }
    // Fallback implementation for Node 20+
    let resolve;
    let reject;
    const promise = new Promise((res, rej) => {
        resolve = res;
        reject = rej;
    });
    return { promise, resolve, reject };
}
//# sourceMappingURL=promise-with-resolvers.js.map