/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ /** * TODO(incremental-hydration): Remove this file entirely once PromiseWithResolvers lands in stable * node / TS. */ export interface PromiseWithResolvers { promise: Promise; resolve: (value: T | PromiseLike) => void; reject: (reason?: any) => void; } export interface PromiseConstructor { /** * Creates a new Promise and returns it in an object, along with its resolve and reject functions. * @returns An object with the properties `promise`, `resolve`, and `reject`. * * ```ts * const { promise, resolve, reject } = Promise.withResolvers(); * ``` */ withResolvers(): PromiseWithResolvers; } /** * Replace with `Promise.withResolvers()` once it's available. * NET September 2026 * * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers. */ export declare function promiseWithResolvers(): { promise: Promise; resolve: (value: T | PromiseLike) => void; reject: (reason?: any) => void; };