File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ interface SchedulerPostTaskOptions {
2+ priority ?: "user-blocking" | "user-visible" | "background" ;
3+ delay ?: number ;
4+ signal ?: AbortSignal ;
5+ }
6+
7+ interface Scheduler {
8+ postTask < T > (
9+ callback : ( ) => T | Promise < T > ,
10+ options ?: SchedulerPostTaskOptions ,
11+ ) : Promise < T > ;
12+
13+ yield ?( ) : Promise < void > ;
14+ }
15+
16+ declare global {
17+ const scheduler : Scheduler | undefined ;
18+ }
19+
120/**
221 * @private
322 *
423 * Continues with the callback on the next tick.
524 */
6- export const nextTick : ( callback : ( ) => void ) => void = setTimeout ;
25+ export const nextTick : ( callback : ( ) => void ) => unknown =
26+ typeof scheduler === "object" && typeof scheduler . postTask === "function"
27+ ? scheduler . postTask . bind ( scheduler )
28+ : setTimeout ;
Original file line number Diff line number Diff line change 11declare module "random" {
22 export const random : ( length : number ) => number [ ] | Buffer ;
33}
4+
5+ declare module "nextTick" {
6+ export const nextTick : ( callback : ( ) => void ) => unknown ;
7+ }
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments