Switch lib.d.ts to use /** @deferred */

This commit is contained in:
Anders Hejlsberg
2024-07-11 15:12:26 -07:00
parent 96e692174d
commit 37e625893f
2 changed files with 4 additions and 4 deletions

View File

@@ -8,5 +8,5 @@ interface Promise<T> {
* @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
* @returns A Promise for the completion of the callback.
*/
finally(deferred onfinally?: (() => void) | undefined | null): Promise<T>;
finally(/** @deferred */ onfinally?: (() => void) | undefined | null): Promise<T>;
}

6
src/lib/es5.d.ts vendored
View File

@@ -1516,7 +1516,7 @@ interface PromiseLike<T> {
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult1 = T, TResult2 = never>(deferred onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, deferred onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
then<TResult1 = T, TResult2 = never>(/** @deferred */ onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, /** @deferred */ onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
}
/**
@@ -1529,14 +1529,14 @@ interface Promise<T> {
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult1 = T, TResult2 = never>(deferred onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, deferred onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
then<TResult1 = T, TResult2 = never>(/** @deferred */ onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, /** @deferred */ onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
/**
* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.
*/
catch<TResult = never>(deferred onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
catch<TResult = never>(/** @deferred */ onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
}
/**