/
githubmirror
/
TypeScript
Обзор
Документация
Войти
/
githubmirror
/
TypeScript
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/lib/es2024.promise.d.ts
17 строк
553 B
Kenta Moriuchi
Introduce ES2024 target and fix some types (#58573)
27 сен 2024, 21:58
Не верифицирован
27 сен 2024, 21:58
9d98874
Код
Авторство
О чём код?
interface PromiseWithResolvers<T> { promise: Promise<T>; resolve: (value: T | PromiseLike<T>) => void; reject: (reason?: any) => void; } 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<T>(); * ``` */ withResolvers<T>(): PromiseWithResolvers<T>; }