@wordpress/priority-queue 2.39.0 → 2.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/index.js +5 -20
- package/build/index.js.map +1 -1
- package/build/request-idle-callback.js +0 -5
- package/build/request-idle-callback.js.map +1 -1
- package/build-module/index.js +6 -17
- package/build-module/index.js.map +1 -1
- package/build-module/request-idle-callback.js +1 -2
- package/build-module/request-idle-callback.js.map +1 -1
- package/package.json +2 -2
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
package/build/index.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createQueue = void 0;
|
|
9
|
-
|
|
10
8
|
var _requestIdleCallback = _interopRequireDefault(require("./request-idle-callback"));
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* Internal dependencies
|
|
14
11
|
*/
|
|
@@ -80,6 +77,7 @@ const createQueue = () => {
|
|
|
80
77
|
/** @type {Map<WPPriorityQueueContext, WPPriorityQueueCallback>} */
|
|
81
78
|
const waitingList = new Map();
|
|
82
79
|
let isRunning = false;
|
|
80
|
+
|
|
83
81
|
/**
|
|
84
82
|
* Callback to process as much queue as time permits.
|
|
85
83
|
*
|
|
@@ -96,24 +94,21 @@ const createQueue = () => {
|
|
|
96
94
|
* @param {IdleDeadline|number} deadline Idle callback deadline object, or
|
|
97
95
|
* animation frame timestamp.
|
|
98
96
|
*/
|
|
99
|
-
|
|
100
97
|
const runWaitingList = deadline => {
|
|
101
98
|
for (const [nextElement, callback] of waitingList) {
|
|
102
99
|
waitingList.delete(nextElement);
|
|
103
100
|
callback();
|
|
104
|
-
|
|
105
101
|
if ('number' === typeof deadline || deadline.timeRemaining() <= 0) {
|
|
106
102
|
break;
|
|
107
103
|
}
|
|
108
104
|
}
|
|
109
|
-
|
|
110
105
|
if (waitingList.size === 0) {
|
|
111
106
|
isRunning = false;
|
|
112
107
|
return;
|
|
113
108
|
}
|
|
114
|
-
|
|
115
109
|
(0, _requestIdleCallback.default)(runWaitingList);
|
|
116
110
|
};
|
|
111
|
+
|
|
117
112
|
/**
|
|
118
113
|
* Add a callback to the queue for a given context.
|
|
119
114
|
*
|
|
@@ -127,16 +122,14 @@ const createQueue = () => {
|
|
|
127
122
|
* @param {WPPriorityQueueContext} element Context object.
|
|
128
123
|
* @param {WPPriorityQueueCallback} item Callback function.
|
|
129
124
|
*/
|
|
130
|
-
|
|
131
|
-
|
|
132
125
|
const add = (element, item) => {
|
|
133
126
|
waitingList.set(element, item);
|
|
134
|
-
|
|
135
127
|
if (!isRunning) {
|
|
136
128
|
isRunning = true;
|
|
137
129
|
(0, _requestIdleCallback.default)(runWaitingList);
|
|
138
130
|
}
|
|
139
131
|
};
|
|
132
|
+
|
|
140
133
|
/**
|
|
141
134
|
* Flushes queue for a given context, returning true if the flush was
|
|
142
135
|
* performed, or false if there is no queue for the given context.
|
|
@@ -147,19 +140,16 @@ const createQueue = () => {
|
|
|
147
140
|
*
|
|
148
141
|
* @return {boolean} Whether flush was performed.
|
|
149
142
|
*/
|
|
150
|
-
|
|
151
|
-
|
|
152
143
|
const flush = element => {
|
|
153
144
|
const callback = waitingList.get(element);
|
|
154
|
-
|
|
155
145
|
if (undefined === callback) {
|
|
156
146
|
return false;
|
|
157
147
|
}
|
|
158
|
-
|
|
159
148
|
waitingList.delete(element);
|
|
160
149
|
callback();
|
|
161
150
|
return true;
|
|
162
151
|
};
|
|
152
|
+
|
|
163
153
|
/**
|
|
164
154
|
* Clears the queue for a given context, cancelling the callbacks without
|
|
165
155
|
* executing them. Returns `true` if there were scheduled callbacks to cancel,
|
|
@@ -171,23 +161,19 @@ const createQueue = () => {
|
|
|
171
161
|
*
|
|
172
162
|
* @return {boolean} Whether any callbacks got cancelled.
|
|
173
163
|
*/
|
|
174
|
-
|
|
175
|
-
|
|
176
164
|
const cancel = element => {
|
|
177
165
|
return waitingList.delete(element);
|
|
178
166
|
};
|
|
167
|
+
|
|
179
168
|
/**
|
|
180
169
|
* Reset the queue without running the pending callbacks.
|
|
181
170
|
*
|
|
182
171
|
* @type {WPPriorityQueueReset}
|
|
183
172
|
*/
|
|
184
|
-
|
|
185
|
-
|
|
186
173
|
const reset = () => {
|
|
187
174
|
waitingList.clear();
|
|
188
175
|
isRunning = false;
|
|
189
176
|
};
|
|
190
|
-
|
|
191
177
|
return {
|
|
192
178
|
add,
|
|
193
179
|
flush,
|
|
@@ -195,6 +181,5 @@ const createQueue = () => {
|
|
|
195
181
|
reset
|
|
196
182
|
};
|
|
197
183
|
};
|
|
198
|
-
|
|
199
184
|
exports.createQueue = createQueue;
|
|
200
185
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_requestIdleCallback","_interopRequireDefault","require","createQueue","waitingList","Map","isRunning","runWaitingList","deadline","nextElement","callback","delete","timeRemaining","size","requestIdleCallback","add","element","item","set","flush","get","undefined","cancel","reset","clear","exports"],"sources":["@wordpress/priority-queue/src/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport requestIdleCallback from './request-idle-callback';\n\n/**\n * Enqueued callback to invoke once idle time permits.\n *\n * @typedef {()=>void} WPPriorityQueueCallback\n */\n\n/**\n * An object used to associate callbacks in a particular context grouping.\n *\n * @typedef {{}} WPPriorityQueueContext\n */\n\n/**\n * Function to add callback to priority queue.\n *\n * @typedef {(element:WPPriorityQueueContext,item:WPPriorityQueueCallback)=>void} WPPriorityQueueAdd\n */\n\n/**\n * Function to flush callbacks from priority queue.\n *\n * @typedef {(element:WPPriorityQueueContext)=>boolean} WPPriorityQueueFlush\n */\n\n/**\n * Reset the queue.\n *\n * @typedef {()=>void} WPPriorityQueueReset\n */\n\n/**\n * Priority queue instance.\n *\n * @typedef {Object} WPPriorityQueue\n *\n * @property {WPPriorityQueueAdd} add Add callback to queue for context.\n * @property {WPPriorityQueueFlush} flush Flush queue for context.\n * @property {WPPriorityQueueFlush} cancel Clear queue for context.\n * @property {WPPriorityQueueReset} reset Reset queue.\n */\n\n/**\n * Creates a context-aware queue that only executes\n * the last task of a given context.\n *\n * @example\n *```js\n * import { createQueue } from '@wordpress/priority-queue';\n *\n * const queue = createQueue();\n *\n * // Context objects.\n * const ctx1 = {};\n * const ctx2 = {};\n *\n * // For a given context in the queue, only the last callback is executed.\n * queue.add( ctx1, () => console.log( 'This will be printed first' ) );\n * queue.add( ctx2, () => console.log( 'This won\\'t be printed' ) );\n * queue.add( ctx2, () => console.log( 'This will be printed second' ) );\n *```\n *\n * @return {WPPriorityQueue} Queue object with `add`, `flush` and `reset` methods.\n */\nexport const createQueue = () => {\n\t/** @type {Map<WPPriorityQueueContext, WPPriorityQueueCallback>} */\n\tconst waitingList = new Map();\n\tlet isRunning = false;\n\n\t/**\n\t * Callback to process as much queue as time permits.\n\t *\n\t * Map Iteration follows the original insertion order. This means that here\n\t * we can iterate the queue and know that the first contexts which were\n\t * added will be run first. On the other hand, if anyone adds a new callback\n\t * for an existing context it will supplant the previously-set callback for\n\t * that context because we reassigned that map key's value.\n\t *\n\t * In the case that a callback adds a new callback to its own context then\n\t * the callback it adds will appear at the end of the iteration and will be\n\t * run only after all other existing contexts have finished executing.\n\t *\n\t * @param {IdleDeadline|number} deadline Idle callback deadline object, or\n\t * animation frame timestamp.\n\t */\n\tconst runWaitingList = ( deadline ) => {\n\t\tfor ( const [ nextElement, callback ] of waitingList ) {\n\t\t\twaitingList.delete( nextElement );\n\t\t\tcallback();\n\n\t\t\tif (\n\t\t\t\t'number' === typeof deadline ||\n\t\t\t\tdeadline.timeRemaining() <= 0\n\t\t\t) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( waitingList.size === 0 ) {\n\t\t\tisRunning = false;\n\t\t\treturn;\n\t\t}\n\n\t\trequestIdleCallback( runWaitingList );\n\t};\n\n\t/**\n\t * Add a callback to the queue for a given context.\n\t *\n\t * If errors with undefined callbacks are encountered double check that\n\t * all of your useSelect calls have the right dependencies set correctly\n\t * in their second parameter. Missing dependencies can cause unexpected\n\t * loops and race conditions in the queue.\n\t *\n\t * @type {WPPriorityQueueAdd}\n\t *\n\t * @param {WPPriorityQueueContext} element Context object.\n\t * @param {WPPriorityQueueCallback} item Callback function.\n\t */\n\tconst add = ( element, item ) => {\n\t\twaitingList.set( element, item );\n\t\tif ( ! isRunning ) {\n\t\t\tisRunning = true;\n\t\t\trequestIdleCallback( runWaitingList );\n\t\t}\n\t};\n\n\t/**\n\t * Flushes queue for a given context, returning true if the flush was\n\t * performed, or false if there is no queue for the given context.\n\t *\n\t * @type {WPPriorityQueueFlush}\n\t *\n\t * @param {WPPriorityQueueContext} element Context object.\n\t *\n\t * @return {boolean} Whether flush was performed.\n\t */\n\tconst flush = ( element ) => {\n\t\tconst callback = waitingList.get( element );\n\t\tif ( undefined === callback ) {\n\t\t\treturn false;\n\t\t}\n\n\t\twaitingList.delete( element );\n\t\tcallback();\n\n\t\treturn true;\n\t};\n\n\t/**\n\t * Clears the queue for a given context, cancelling the callbacks without\n\t * executing them. Returns `true` if there were scheduled callbacks to cancel,\n\t * or `false` if there was is no queue for the given context.\n\t *\n\t * @type {WPPriorityQueueFlush}\n\t *\n\t * @param {WPPriorityQueueContext} element Context object.\n\t *\n\t * @return {boolean} Whether any callbacks got cancelled.\n\t */\n\tconst cancel = ( element ) => {\n\t\treturn waitingList.delete( element );\n\t};\n\n\t/**\n\t * Reset the queue without running the pending callbacks.\n\t *\n\t * @type {WPPriorityQueueReset}\n\t */\n\tconst reset = () => {\n\t\twaitingList.clear();\n\t\tisRunning = false;\n\t};\n\n\treturn {\n\t\tadd,\n\t\tflush,\n\t\tcancel,\n\t\treset,\n\t};\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,WAAW,GAAGA,CAAA,KAAM;EAChC;EACA,MAAMC,WAAW,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC7B,IAAIC,SAAS,GAAG,KAAK;;EAErB;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMC,cAAc,GAAKC,QAAQ,IAAM;IACtC,KAAM,MAAM,CAAEC,WAAW,EAAEC,QAAQ,CAAE,IAAIN,WAAW,EAAG;MACtDA,WAAW,CAACO,MAAM,CAAEF,WAAY,CAAC;MACjCC,QAAQ,CAAC,CAAC;MAEV,IACC,QAAQ,KAAK,OAAOF,QAAQ,IAC5BA,QAAQ,CAACI,aAAa,CAAC,CAAC,IAAI,CAAC,EAC5B;QACD;MACD;IACD;IAEA,IAAKR,WAAW,CAACS,IAAI,KAAK,CAAC,EAAG;MAC7BP,SAAS,GAAG,KAAK;MACjB;IACD;IAEA,IAAAQ,4BAAmB,EAAEP,cAAe,CAAC;EACtC,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMQ,GAAG,GAAGA,CAAEC,OAAO,EAAEC,IAAI,KAAM;IAChCb,WAAW,CAACc,GAAG,CAAEF,OAAO,EAAEC,IAAK,CAAC;IAChC,IAAK,CAAEX,SAAS,EAAG;MAClBA,SAAS,GAAG,IAAI;MAChB,IAAAQ,4BAAmB,EAAEP,cAAe,CAAC;IACtC;EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMY,KAAK,GAAKH,OAAO,IAAM;IAC5B,MAAMN,QAAQ,GAAGN,WAAW,CAACgB,GAAG,CAAEJ,OAAQ,CAAC;IAC3C,IAAKK,SAAS,KAAKX,QAAQ,EAAG;MAC7B,OAAO,KAAK;IACb;IAEAN,WAAW,CAACO,MAAM,CAAEK,OAAQ,CAAC;IAC7BN,QAAQ,CAAC,CAAC;IAEV,OAAO,IAAI;EACZ,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMY,MAAM,GAAKN,OAAO,IAAM;IAC7B,OAAOZ,WAAW,CAACO,MAAM,CAAEK,OAAQ,CAAC;EACrC,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMO,KAAK,GAAGA,CAAA,KAAM;IACnBnB,WAAW,CAACoB,KAAK,CAAC,CAAC;IACnBlB,SAAS,GAAG,KAAK;EAClB,CAAC;EAED,OAAO;IACNS,GAAG;IACHI,KAAK;IACLG,MAAM;IACNC;EACD,CAAC;AACF,CAAC;AAACE,OAAA,CAAAtB,WAAA,GAAAA,WAAA"}
|
|
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createRequestIdleCallback = createRequestIdleCallback;
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
|
|
9
8
|
require("requestidlecallback");
|
|
10
|
-
|
|
11
9
|
/**
|
|
12
10
|
* External dependencies
|
|
13
11
|
*/
|
|
@@ -25,11 +23,8 @@ function createRequestIdleCallback() {
|
|
|
25
23
|
setTimeout(() => callback(Date.now()), 0);
|
|
26
24
|
};
|
|
27
25
|
}
|
|
28
|
-
|
|
29
26
|
return window.requestIdleCallback;
|
|
30
27
|
}
|
|
31
|
-
|
|
32
28
|
var _default = createRequestIdleCallback();
|
|
33
|
-
|
|
34
29
|
exports.default = _default;
|
|
35
30
|
//# sourceMappingURL=request-idle-callback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["require","createRequestIdleCallback","window","callback","setTimeout","Date","now","requestIdleCallback","_default","exports","default"],"sources":["@wordpress/priority-queue/src/request-idle-callback.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport 'requestidlecallback';\n\n/**\n * @typedef {( timeOrDeadline: IdleDeadline | number ) => void} Callback\n */\n\n/**\n * @return {(callback: Callback) => void} RequestIdleCallback\n */\nexport function createRequestIdleCallback() {\n\tif ( typeof window === 'undefined' ) {\n\t\treturn ( callback ) => {\n\t\t\tsetTimeout( () => callback( Date.now() ), 0 );\n\t\t};\n\t}\n\n\treturn window.requestIdleCallback;\n}\n\nexport default createRequestIdleCallback();\n"],"mappings":";;;;;;;AAGAA,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACO,SAASC,yBAAyBA,CAAA,EAAG;EAC3C,IAAK,OAAOC,MAAM,KAAK,WAAW,EAAG;IACpC,OAASC,QAAQ,IAAM;MACtBC,UAAU,CAAE,MAAMD,QAAQ,CAAEE,IAAI,CAACC,GAAG,CAAC,CAAE,CAAC,EAAE,CAAE,CAAC;IAC9C,CAAC;EACF;EAEA,OAAOJ,MAAM,CAACK,mBAAmB;AAClC;AAAC,IAAAC,QAAA,GAEcP,yBAAyB,CAAC,CAAC;AAAAQ,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
package/build-module/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import requestIdleCallback from './request-idle-callback';
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Enqueued callback to invoke once idle time permits.
|
|
7
8
|
*
|
|
@@ -65,11 +66,11 @@ import requestIdleCallback from './request-idle-callback';
|
|
|
65
66
|
*
|
|
66
67
|
* @return {WPPriorityQueue} Queue object with `add`, `flush` and `reset` methods.
|
|
67
68
|
*/
|
|
68
|
-
|
|
69
69
|
export const createQueue = () => {
|
|
70
70
|
/** @type {Map<WPPriorityQueueContext, WPPriorityQueueCallback>} */
|
|
71
71
|
const waitingList = new Map();
|
|
72
72
|
let isRunning = false;
|
|
73
|
+
|
|
73
74
|
/**
|
|
74
75
|
* Callback to process as much queue as time permits.
|
|
75
76
|
*
|
|
@@ -86,24 +87,21 @@ export const createQueue = () => {
|
|
|
86
87
|
* @param {IdleDeadline|number} deadline Idle callback deadline object, or
|
|
87
88
|
* animation frame timestamp.
|
|
88
89
|
*/
|
|
89
|
-
|
|
90
90
|
const runWaitingList = deadline => {
|
|
91
91
|
for (const [nextElement, callback] of waitingList) {
|
|
92
92
|
waitingList.delete(nextElement);
|
|
93
93
|
callback();
|
|
94
|
-
|
|
95
94
|
if ('number' === typeof deadline || deadline.timeRemaining() <= 0) {
|
|
96
95
|
break;
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
|
-
|
|
100
98
|
if (waitingList.size === 0) {
|
|
101
99
|
isRunning = false;
|
|
102
100
|
return;
|
|
103
101
|
}
|
|
104
|
-
|
|
105
102
|
requestIdleCallback(runWaitingList);
|
|
106
103
|
};
|
|
104
|
+
|
|
107
105
|
/**
|
|
108
106
|
* Add a callback to the queue for a given context.
|
|
109
107
|
*
|
|
@@ -117,16 +115,14 @@ export const createQueue = () => {
|
|
|
117
115
|
* @param {WPPriorityQueueContext} element Context object.
|
|
118
116
|
* @param {WPPriorityQueueCallback} item Callback function.
|
|
119
117
|
*/
|
|
120
|
-
|
|
121
|
-
|
|
122
118
|
const add = (element, item) => {
|
|
123
119
|
waitingList.set(element, item);
|
|
124
|
-
|
|
125
120
|
if (!isRunning) {
|
|
126
121
|
isRunning = true;
|
|
127
122
|
requestIdleCallback(runWaitingList);
|
|
128
123
|
}
|
|
129
124
|
};
|
|
125
|
+
|
|
130
126
|
/**
|
|
131
127
|
* Flushes queue for a given context, returning true if the flush was
|
|
132
128
|
* performed, or false if there is no queue for the given context.
|
|
@@ -137,19 +133,16 @@ export const createQueue = () => {
|
|
|
137
133
|
*
|
|
138
134
|
* @return {boolean} Whether flush was performed.
|
|
139
135
|
*/
|
|
140
|
-
|
|
141
|
-
|
|
142
136
|
const flush = element => {
|
|
143
137
|
const callback = waitingList.get(element);
|
|
144
|
-
|
|
145
138
|
if (undefined === callback) {
|
|
146
139
|
return false;
|
|
147
140
|
}
|
|
148
|
-
|
|
149
141
|
waitingList.delete(element);
|
|
150
142
|
callback();
|
|
151
143
|
return true;
|
|
152
144
|
};
|
|
145
|
+
|
|
153
146
|
/**
|
|
154
147
|
* Clears the queue for a given context, cancelling the callbacks without
|
|
155
148
|
* executing them. Returns `true` if there were scheduled callbacks to cancel,
|
|
@@ -161,23 +154,19 @@ export const createQueue = () => {
|
|
|
161
154
|
*
|
|
162
155
|
* @return {boolean} Whether any callbacks got cancelled.
|
|
163
156
|
*/
|
|
164
|
-
|
|
165
|
-
|
|
166
157
|
const cancel = element => {
|
|
167
158
|
return waitingList.delete(element);
|
|
168
159
|
};
|
|
160
|
+
|
|
169
161
|
/**
|
|
170
162
|
* Reset the queue without running the pending callbacks.
|
|
171
163
|
*
|
|
172
164
|
* @type {WPPriorityQueueReset}
|
|
173
165
|
*/
|
|
174
|
-
|
|
175
|
-
|
|
176
166
|
const reset = () => {
|
|
177
167
|
waitingList.clear();
|
|
178
168
|
isRunning = false;
|
|
179
169
|
};
|
|
180
|
-
|
|
181
170
|
return {
|
|
182
171
|
add,
|
|
183
172
|
flush,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["requestIdleCallback","createQueue","waitingList","Map","isRunning","runWaitingList","deadline","nextElement","callback","delete","timeRemaining","size","add","element","item","set","flush","get","undefined","cancel","reset","clear"],"sources":["@wordpress/priority-queue/src/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport requestIdleCallback from './request-idle-callback';\n\n/**\n * Enqueued callback to invoke once idle time permits.\n *\n * @typedef {()=>void} WPPriorityQueueCallback\n */\n\n/**\n * An object used to associate callbacks in a particular context grouping.\n *\n * @typedef {{}} WPPriorityQueueContext\n */\n\n/**\n * Function to add callback to priority queue.\n *\n * @typedef {(element:WPPriorityQueueContext,item:WPPriorityQueueCallback)=>void} WPPriorityQueueAdd\n */\n\n/**\n * Function to flush callbacks from priority queue.\n *\n * @typedef {(element:WPPriorityQueueContext)=>boolean} WPPriorityQueueFlush\n */\n\n/**\n * Reset the queue.\n *\n * @typedef {()=>void} WPPriorityQueueReset\n */\n\n/**\n * Priority queue instance.\n *\n * @typedef {Object} WPPriorityQueue\n *\n * @property {WPPriorityQueueAdd} add Add callback to queue for context.\n * @property {WPPriorityQueueFlush} flush Flush queue for context.\n * @property {WPPriorityQueueFlush} cancel Clear queue for context.\n * @property {WPPriorityQueueReset} reset Reset queue.\n */\n\n/**\n * Creates a context-aware queue that only executes\n * the last task of a given context.\n *\n * @example\n *```js\n * import { createQueue } from '@wordpress/priority-queue';\n *\n * const queue = createQueue();\n *\n * // Context objects.\n * const ctx1 = {};\n * const ctx2 = {};\n *\n * // For a given context in the queue, only the last callback is executed.\n * queue.add( ctx1, () => console.log( 'This will be printed first' ) );\n * queue.add( ctx2, () => console.log( 'This won\\'t be printed' ) );\n * queue.add( ctx2, () => console.log( 'This will be printed second' ) );\n *```\n *\n * @return {WPPriorityQueue} Queue object with `add`, `flush` and `reset` methods.\n */\nexport const createQueue = () => {\n\t/** @type {Map<WPPriorityQueueContext, WPPriorityQueueCallback>} */\n\tconst waitingList = new Map();\n\tlet isRunning = false;\n\n\t/**\n\t * Callback to process as much queue as time permits.\n\t *\n\t * Map Iteration follows the original insertion order. This means that here\n\t * we can iterate the queue and know that the first contexts which were\n\t * added will be run first. On the other hand, if anyone adds a new callback\n\t * for an existing context it will supplant the previously-set callback for\n\t * that context because we reassigned that map key's value.\n\t *\n\t * In the case that a callback adds a new callback to its own context then\n\t * the callback it adds will appear at the end of the iteration and will be\n\t * run only after all other existing contexts have finished executing.\n\t *\n\t * @param {IdleDeadline|number} deadline Idle callback deadline object, or\n\t * animation frame timestamp.\n\t */\n\tconst runWaitingList = ( deadline ) => {\n\t\tfor ( const [ nextElement, callback ] of waitingList ) {\n\t\t\twaitingList.delete( nextElement );\n\t\t\tcallback();\n\n\t\t\tif (\n\t\t\t\t'number' === typeof deadline ||\n\t\t\t\tdeadline.timeRemaining() <= 0\n\t\t\t) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( waitingList.size === 0 ) {\n\t\t\tisRunning = false;\n\t\t\treturn;\n\t\t}\n\n\t\trequestIdleCallback( runWaitingList );\n\t};\n\n\t/**\n\t * Add a callback to the queue for a given context.\n\t *\n\t * If errors with undefined callbacks are encountered double check that\n\t * all of your useSelect calls have the right dependencies set correctly\n\t * in their second parameter. Missing dependencies can cause unexpected\n\t * loops and race conditions in the queue.\n\t *\n\t * @type {WPPriorityQueueAdd}\n\t *\n\t * @param {WPPriorityQueueContext} element Context object.\n\t * @param {WPPriorityQueueCallback} item Callback function.\n\t */\n\tconst add = ( element, item ) => {\n\t\twaitingList.set( element, item );\n\t\tif ( ! isRunning ) {\n\t\t\tisRunning = true;\n\t\t\trequestIdleCallback( runWaitingList );\n\t\t}\n\t};\n\n\t/**\n\t * Flushes queue for a given context, returning true if the flush was\n\t * performed, or false if there is no queue for the given context.\n\t *\n\t * @type {WPPriorityQueueFlush}\n\t *\n\t * @param {WPPriorityQueueContext} element Context object.\n\t *\n\t * @return {boolean} Whether flush was performed.\n\t */\n\tconst flush = ( element ) => {\n\t\tconst callback = waitingList.get( element );\n\t\tif ( undefined === callback ) {\n\t\t\treturn false;\n\t\t}\n\n\t\twaitingList.delete( element );\n\t\tcallback();\n\n\t\treturn true;\n\t};\n\n\t/**\n\t * Clears the queue for a given context, cancelling the callbacks without\n\t * executing them. Returns `true` if there were scheduled callbacks to cancel,\n\t * or `false` if there was is no queue for the given context.\n\t *\n\t * @type {WPPriorityQueueFlush}\n\t *\n\t * @param {WPPriorityQueueContext} element Context object.\n\t *\n\t * @return {boolean} Whether any callbacks got cancelled.\n\t */\n\tconst cancel = ( element ) => {\n\t\treturn waitingList.delete( element );\n\t};\n\n\t/**\n\t * Reset the queue without running the pending callbacks.\n\t *\n\t * @type {WPPriorityQueueReset}\n\t */\n\tconst reset = () => {\n\t\twaitingList.clear();\n\t\tisRunning = false;\n\t};\n\n\treturn {\n\t\tadd,\n\t\tflush,\n\t\tcancel,\n\t\treset,\n\t};\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,mBAAmB,MAAM,yBAAyB;;AAEzD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGA,CAAA,KAAM;EAChC;EACA,MAAMC,WAAW,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC7B,IAAIC,SAAS,GAAG,KAAK;;EAErB;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMC,cAAc,GAAKC,QAAQ,IAAM;IACtC,KAAM,MAAM,CAAEC,WAAW,EAAEC,QAAQ,CAAE,IAAIN,WAAW,EAAG;MACtDA,WAAW,CAACO,MAAM,CAAEF,WAAY,CAAC;MACjCC,QAAQ,CAAC,CAAC;MAEV,IACC,QAAQ,KAAK,OAAOF,QAAQ,IAC5BA,QAAQ,CAACI,aAAa,CAAC,CAAC,IAAI,CAAC,EAC5B;QACD;MACD;IACD;IAEA,IAAKR,WAAW,CAACS,IAAI,KAAK,CAAC,EAAG;MAC7BP,SAAS,GAAG,KAAK;MACjB;IACD;IAEAJ,mBAAmB,CAAEK,cAAe,CAAC;EACtC,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMO,GAAG,GAAGA,CAAEC,OAAO,EAAEC,IAAI,KAAM;IAChCZ,WAAW,CAACa,GAAG,CAAEF,OAAO,EAAEC,IAAK,CAAC;IAChC,IAAK,CAAEV,SAAS,EAAG;MAClBA,SAAS,GAAG,IAAI;MAChBJ,mBAAmB,CAAEK,cAAe,CAAC;IACtC;EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMW,KAAK,GAAKH,OAAO,IAAM;IAC5B,MAAML,QAAQ,GAAGN,WAAW,CAACe,GAAG,CAAEJ,OAAQ,CAAC;IAC3C,IAAKK,SAAS,KAAKV,QAAQ,EAAG;MAC7B,OAAO,KAAK;IACb;IAEAN,WAAW,CAACO,MAAM,CAAEI,OAAQ,CAAC;IAC7BL,QAAQ,CAAC,CAAC;IAEV,OAAO,IAAI;EACZ,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMW,MAAM,GAAKN,OAAO,IAAM;IAC7B,OAAOX,WAAW,CAACO,MAAM,CAAEI,OAAQ,CAAC;EACrC,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMO,KAAK,GAAGA,CAAA,KAAM;IACnBlB,WAAW,CAACmB,KAAK,CAAC,CAAC;IACnBjB,SAAS,GAAG,KAAK;EAClB,CAAC;EAED,OAAO;IACNQ,GAAG;IACHI,KAAK;IACLG,MAAM;IACNC;EACD,CAAC;AACF,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import 'requestidlecallback';
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* @typedef {( timeOrDeadline: IdleDeadline | number ) => void} Callback
|
|
7
8
|
*/
|
|
@@ -9,14 +10,12 @@ import 'requestidlecallback';
|
|
|
9
10
|
/**
|
|
10
11
|
* @return {(callback: Callback) => void} RequestIdleCallback
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
13
|
export function createRequestIdleCallback() {
|
|
14
14
|
if (typeof window === 'undefined') {
|
|
15
15
|
return callback => {
|
|
16
16
|
setTimeout(() => callback(Date.now()), 0);
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
|
|
20
19
|
return window.requestIdleCallback;
|
|
21
20
|
}
|
|
22
21
|
export default createRequestIdleCallback();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["createRequestIdleCallback","window","callback","setTimeout","Date","now","requestIdleCallback"],"sources":["@wordpress/priority-queue/src/request-idle-callback.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport 'requestidlecallback';\n\n/**\n * @typedef {( timeOrDeadline: IdleDeadline | number ) => void} Callback\n */\n\n/**\n * @return {(callback: Callback) => void} RequestIdleCallback\n */\nexport function createRequestIdleCallback() {\n\tif ( typeof window === 'undefined' ) {\n\t\treturn ( callback ) => {\n\t\t\tsetTimeout( () => callback( Date.now() ), 0 );\n\t\t};\n\t}\n\n\treturn window.requestIdleCallback;\n}\n\nexport default createRequestIdleCallback();\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,qBAAqB;;AAE5B;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,SAASA,yBAAyBA,CAAA,EAAG;EAC3C,IAAK,OAAOC,MAAM,KAAK,WAAW,EAAG;IACpC,OAASC,QAAQ,IAAM;MACtBC,UAAU,CAAE,MAAMD,QAAQ,CAAEE,IAAI,CAACC,GAAG,CAAC,CAAE,CAAC,EAAE,CAAE,CAAC;IAC9C,CAAC;EACF;EAEA,OAAOJ,MAAM,CAACK,mBAAmB;AAClC;AAEA,eAAeN,yBAAyB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/priority-queue",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.40.0",
|
|
4
4
|
"description": "Generic browser priority queue.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "78a288d55b83a713b2f7d98d5a855c0771a2afc6"
|
|
38
38
|
}
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/@types/requestidlecallback/index.d.ts","./src/request-idle-callback.js","./src/index.js"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","d11a03592451da2d1065e09e61f4e2a9bf68f780f4f6623c18b57816a9679d17","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"34c839eaaa6d78c8674ae2c37af2236dee6831b13db7b4ef4df3ec889a04d4f2","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"ab7d58e6161a550ff92e5aff755dc37fe896245348332cd5f1e1203479fe0ed1","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"a4da0551fd39b90ca7ce5f68fb55d4dc0c1396d589b612e1902f68ee090aaada","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},{"version":"9b66eb641b8ff1824e4d04022ba1a051c5c10746ea94147b24c2f5e27c5f9c88","affectsGlobalScope":true},{"version":"d7da0a20216d07d275da4d90bef16c4229b9c3251e2d68ef0762f9bb20e70594","signature":"1748da63cbb8f4da8c66c35e51a00f398d0bca66a48f01656a241b8efb3a03a5"},{"version":"77efe10d427aee10bf7c467d6d9a0e4f0fcb84811d679be612d53b2e8dd17a76","signature":"2a57cbf1f516e1a2da6e22644f4517479c3ea3f28ff13aefcb1999c0d31c23f0"}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[57]],"referencedMap":[[58,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[56,11,13,12,2,14,15,16,17,18,19,20,21,3,4,25,22,23,24,26,27,28,5,29,30,31,32,6,36,33,34,35,37,7,38,43,44,39,40,41,42,8,48,45,46,47,49,9,50,51,52,53,54,1,10,55,58,57],"latestChangedDtsFile":"./build-types/index.d.ts"},"version":"4.9.5"}
|
|
1
|
+
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/requestidlecallback/index.d.ts","./src/request-idle-callback.js","./src/index.js"],"fileInfos":[{"version":"f59215c5f1d886b05395ee7aca73e0ac69ddfad2843aa88530e797879d511bad","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","f4e736d6c8d69ae5b3ab0ddfcaa3dc365c3e76909d6660af5b4e979b3934ac20","eeeb3aca31fbadef8b82502484499dfd1757204799a6f5b33116201c810676ec",{"version":"3dda5344576193a4ae48b8d03f105c86f20b2f2aff0a1d1fd7935f5d68649654","affectsGlobalScope":true},{"version":"9d9885c728913c1d16e0d2831b40341d6ad9a0ceecaabc55209b306ad9c736a5","affectsGlobalScope":true},{"version":"17bea081b9c0541f39dd1ae9bc8c78bdd561879a682e60e2f25f688c0ecab248","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"f06948deb2a51aae25184561c9640fb66afeddb34531a9212d011792b1d19e0a","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"25de46552b782d43cb7284df22fe2a265de387cf0248b747a7a1b647d81861f6","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"9b66eb641b8ff1824e4d04022ba1a051c5c10746ea94147b24c2f5e27c5f9c88","affectsGlobalScope":true},{"version":"d7da0a20216d07d275da4d90bef16c4229b9c3251e2d68ef0762f9bb20e70594","signature":"1748da63cbb8f4da8c66c35e51a00f398d0bca66a48f01656a241b8efb3a03a5"},{"version":"77efe10d427aee10bf7c467d6d9a0e4f0fcb84811d679be612d53b2e8dd17a76","signature":"2a57cbf1f516e1a2da6e22644f4517479c3ea3f28ff13aefcb1999c0d31c23f0"}],"root":[62,63],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[62]],"referencedMap":[[63,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[61,59,60,12,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,37,34,35,36,38,7,39,44,45,40,41,42,43,8,49,46,47,48,50,9,51,52,53,56,54,55,57,10,1,11,58,63,62],"latestChangedDtsFile":"./build-types/index.d.ts"},"version":"5.1.6"}
|