@tanstack/query-core 5.101.4 → 5.102.1
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/build/legacy/classPrivateFieldSet2-Bo0ZyOIv.cjs +56 -0
- package/build/legacy/classPrivateFieldSet2-CV7wyte-.js +27 -0
- package/build/legacy/classPrivateMethodInitSpec-CBwa_Y7C.js +7 -0
- package/build/legacy/classPrivateMethodInitSpec-DVhcLejn.cjs +12 -0
- package/build/legacy/environmentManager.cjs +25 -46
- package/build/legacy/environmentManager.cjs.map +1 -1
- package/build/legacy/environmentManager.d.cts +18 -2
- package/build/legacy/environmentManager.d.cts.map +1 -0
- package/build/legacy/environmentManager.d.ts +18 -2
- package/build/legacy/environmentManager.d.ts.map +1 -0
- package/build/legacy/environmentManager.js +23 -22
- package/build/legacy/environmentManager.js.map +1 -1
- package/build/legacy/focusManager.cjs +63 -104
- package/build/legacy/focusManager.cjs.map +1 -1
- package/build/legacy/focusManager.d.cts +18 -2
- package/build/legacy/focusManager.d.cts.map +1 -0
- package/build/legacy/focusManager.d.ts +18 -2
- package/build/legacy/focusManager.d.ts.map +1 -0
- package/build/legacy/focusManager.js +60 -76
- package/build/legacy/focusManager.js.map +1 -1
- package/build/legacy/hydration-BhSbkfZj.d.cts +1374 -0
- package/build/legacy/hydration-BhSbkfZj.d.cts.map +1 -0
- package/build/legacy/hydration-Hebl6yHM.d.ts +1374 -0
- package/build/legacy/hydration-Hebl6yHM.d.ts.map +1 -0
- package/build/legacy/hydration.cjs +111 -194
- package/build/legacy/hydration.cjs.map +1 -1
- package/build/legacy/hydration.d.cts +2 -7
- package/build/legacy/hydration.d.ts +2 -7
- package/build/legacy/hydration.js +105 -167
- package/build/legacy/hydration.js.map +1 -1
- package/build/legacy/index.cjs +59 -111
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +10 -141
- package/build/legacy/index.d.ts +10 -141
- package/build/legacy/index.js +16 -66
- package/build/legacy/index.js.map +1 -1
- package/build/legacy/infiniteQueryBehavior.cjs +92 -135
- package/build/legacy/infiniteQueryBehavior.cjs.map +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +14 -3
- package/build/legacy/infiniteQueryBehavior.d.cts.map +1 -0
- package/build/legacy/infiniteQueryBehavior.d.ts +14 -3
- package/build/legacy/infiniteQueryBehavior.d.ts.map +1 -0
- package/build/legacy/infiniteQueryBehavior.js +89 -115
- package/build/legacy/infiniteQueryBehavior.js.map +1 -1
- package/build/legacy/infiniteQueryObserver.cjs +59 -88
- package/build/legacy/infiniteQueryObserver.cjs.map +1 -1
- package/build/legacy/infiniteQueryObserver.d.cts +20 -1
- package/build/legacy/infiniteQueryObserver.d.cts.map +1 -0
- package/build/legacy/infiniteQueryObserver.d.ts +20 -1
- package/build/legacy/infiniteQueryObserver.d.ts.map +1 -0
- package/build/legacy/infiniteQueryObserver.js +57 -64
- package/build/legacy/infiniteQueryObserver.js.map +1 -1
- package/build/legacy/mutation.cjs +236 -329
- package/build/legacy/mutation.cjs.map +1 -1
- package/build/legacy/mutation.d.cts +2 -4
- package/build/legacy/mutation.d.ts +2 -4
- package/build/legacy/mutation.js +231 -299
- package/build/legacy/mutation.js.map +1 -1
- package/build/legacy/mutationCache.cjs +121 -166
- package/build/legacy/mutationCache.cjs.map +1 -1
- package/build/legacy/mutationCache.d.cts +2 -2
- package/build/legacy/mutationCache.d.ts +2 -2
- package/build/legacy/mutationCache.js +117 -130
- package/build/legacy/mutationCache.js.map +1 -1
- package/build/legacy/mutationObserver.cjs +134 -187
- package/build/legacy/mutationObserver.cjs.map +1 -1
- package/build/legacy/mutationObserver.d.cts +2 -1
- package/build/legacy/mutationObserver.d.ts +2 -1
- package/build/legacy/mutationObserver.js +132 -160
- package/build/legacy/mutationObserver.js.map +1 -1
- package/build/legacy/notifyManager.cjs +76 -110
- package/build/legacy/notifyManager.cjs.map +1 -1
- package/build/legacy/notifyManager.d.cts +48 -3
- package/build/legacy/notifyManager.d.cts.map +1 -0
- package/build/legacy/notifyManager.d.ts +48 -3
- package/build/legacy/notifyManager.d.ts.map +1 -0
- package/build/legacy/notifyManager.js +73 -84
- package/build/legacy/notifyManager.js.map +1 -1
- package/build/legacy/onlineManager.cjs +57 -93
- package/build/legacy/onlineManager.cjs.map +1 -1
- package/build/legacy/onlineManager.d.cts +17 -2
- package/build/legacy/onlineManager.d.cts.map +1 -0
- package/build/legacy/onlineManager.d.ts +17 -2
- package/build/legacy/onlineManager.d.ts.map +1 -0
- package/build/legacy/onlineManager.js +54 -65
- package/build/legacy/onlineManager.js.map +1 -1
- package/build/legacy/queriesObserver.cjs +203 -262
- package/build/legacy/queriesObserver.cjs.map +1 -1
- package/build/legacy/queriesObserver.d.cts +23 -2
- package/build/legacy/queriesObserver.d.cts.map +1 -0
- package/build/legacy/queriesObserver.d.ts +23 -2
- package/build/legacy/queriesObserver.d.ts.map +1 -0
- package/build/legacy/queriesObserver.js +199 -233
- package/build/legacy/queriesObserver.js.map +1 -1
- package/build/legacy/query.cjs +409 -491
- package/build/legacy/query.cjs.map +1 -1
- package/build/legacy/query.d.cts +2 -9
- package/build/legacy/query.d.ts +2 -9
- package/build/legacy/query.js +402 -467
- package/build/legacy/query.js.map +1 -1
- package/build/legacy/queryCache.cjs +99 -128
- package/build/legacy/queryCache.cjs.map +1 -1
- package/build/legacy/queryCache.d.cts +2 -3
- package/build/legacy/queryCache.d.ts +2 -3
- package/build/legacy/queryCache.js +96 -100
- package/build/legacy/queryCache.js.map +1 -1
- package/build/legacy/queryClient.cjs +295 -345
- package/build/legacy/queryClient.cjs.map +1 -1
- package/build/legacy/queryClient.d.cts +2 -1
- package/build/legacy/queryClient.d.ts +2 -1
- package/build/legacy/queryClient.js +292 -318
- package/build/legacy/queryClient.js.map +1 -1
- package/build/legacy/queryObserver.cjs +350 -502
- package/build/legacy/queryObserver.cjs.map +1 -1
- package/build/legacy/queryObserver.d.cts +2 -1
- package/build/legacy/queryObserver.d.ts +2 -1
- package/build/legacy/queryObserver.js +345 -480
- package/build/legacy/queryObserver.js.map +1 -1
- package/build/legacy/removable-DeMjhW5M.d.cts +13 -0
- package/build/legacy/removable-DeMjhW5M.d.cts.map +1 -0
- package/build/legacy/removable-DeMjhW5M.d.ts +13 -0
- package/build/legacy/removable-DeMjhW5M.d.ts.map +1 -0
- package/build/legacy/removable.cjs +31 -67
- package/build/legacy/removable.cjs.map +1 -1
- package/build/legacy/removable.d.cts +2 -1
- package/build/legacy/removable.d.ts +2 -1
- package/build/legacy/removable.js +28 -39
- package/build/legacy/removable.js.map +1 -1
- package/build/legacy/retryer.cjs +127 -155
- package/build/legacy/retryer.cjs.map +1 -1
- package/build/legacy/retryer.d.cts +2 -7
- package/build/legacy/retryer.d.ts +2 -7
- package/build/legacy/retryer.js +121 -127
- package/build/legacy/retryer.js.map +1 -1
- package/build/legacy/streamedQuery.cjs +49 -78
- package/build/legacy/streamedQuery.cjs.map +1 -1
- package/build/legacy/streamedQuery.d.cts +33 -1
- package/build/legacy/streamedQuery.d.cts.map +1 -0
- package/build/legacy/streamedQuery.d.ts +33 -1
- package/build/legacy/streamedQuery.d.ts.map +1 -0
- package/build/legacy/streamedQuery.js +47 -54
- package/build/legacy/streamedQuery.js.map +1 -1
- package/build/legacy/subscribable-CbifVTKz.d.cts +12 -0
- package/build/legacy/subscribable-CbifVTKz.d.cts.map +1 -0
- package/build/legacy/subscribable-CbifVTKz.d.ts +12 -0
- package/build/legacy/subscribable-CbifVTKz.d.ts.map +1 -0
- package/build/legacy/subscribable.cjs +22 -48
- package/build/legacy/subscribable.cjs.map +1 -1
- package/build/legacy/subscribable.d.cts +2 -1
- package/build/legacy/subscribable.d.ts +2 -1
- package/build/legacy/subscribable.js +21 -25
- package/build/legacy/subscribable.js.map +1 -1
- package/build/legacy/timeoutManager.cjs +64 -105
- package/build/legacy/timeoutManager.cjs.map +1 -1
- package/build/legacy/timeoutManager.d.cts +60 -7
- package/build/legacy/timeoutManager.d.cts.map +1 -0
- package/build/legacy/timeoutManager.d.ts +60 -7
- package/build/legacy/timeoutManager.d.ts.map +1 -0
- package/build/legacy/timeoutManager.js +60 -76
- package/build/legacy/timeoutManager.js.map +1 -1
- package/build/legacy/types.cjs +10 -35
- package/build/legacy/types.cjs.map +1 -1
- package/build/legacy/types.d.cts +2 -94
- package/build/legacy/types.d.ts +2 -94
- package/build/legacy/types.js +7 -10
- package/build/legacy/types.js.map +1 -1
- package/build/legacy/utils.cjs +175 -300
- package/build/legacy/utils.cjs.map +1 -1
- package/build/legacy/utils.d.cts +2 -30
- package/build/legacy/utils.d.ts +2 -30
- package/build/legacy/utils.js +149 -252
- package/build/legacy/utils.js.map +1 -1
- package/build/modern/environmentManager.cjs +25 -46
- package/build/modern/environmentManager.cjs.map +1 -1
- package/build/modern/environmentManager.d.cts +18 -2
- package/build/modern/environmentManager.d.cts.map +1 -0
- package/build/modern/environmentManager.d.ts +18 -2
- package/build/modern/environmentManager.d.ts.map +1 -0
- package/build/modern/environmentManager.js +23 -20
- package/build/modern/environmentManager.js.map +1 -1
- package/build/modern/focusManager.cjs +56 -90
- package/build/modern/focusManager.cjs.map +1 -1
- package/build/modern/focusManager.d.cts +18 -2
- package/build/modern/focusManager.d.cts.map +1 -0
- package/build/modern/focusManager.d.ts +18 -2
- package/build/modern/focusManager.d.ts.map +1 -0
- package/build/modern/focusManager.js +53 -63
- package/build/modern/focusManager.js.map +1 -1
- package/build/modern/hydration-BhSbkfZj.d.cts +1374 -0
- package/build/modern/hydration-BhSbkfZj.d.cts.map +1 -0
- package/build/modern/hydration-Hebl6yHM.d.ts +1374 -0
- package/build/modern/hydration-Hebl6yHM.d.ts.map +1 -0
- package/build/modern/hydration.cjs +102 -189
- package/build/modern/hydration.cjs.map +1 -1
- package/build/modern/hydration.d.cts +2 -7
- package/build/modern/hydration.d.ts +2 -7
- package/build/modern/hydration.js +96 -160
- package/build/modern/hydration.js.map +1 -1
- package/build/modern/index.cjs +59 -111
- package/build/modern/index.cjs.map +1 -1
- package/build/modern/index.d.cts +10 -141
- package/build/modern/index.d.ts +10 -141
- package/build/modern/index.js +16 -64
- package/build/modern/index.js.map +1 -1
- package/build/modern/infiniteQueryBehavior.cjs +89 -131
- package/build/modern/infiniteQueryBehavior.cjs.map +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +14 -3
- package/build/modern/infiniteQueryBehavior.d.cts.map +1 -0
- package/build/modern/infiniteQueryBehavior.d.ts +14 -3
- package/build/modern/infiniteQueryBehavior.d.ts.map +1 -0
- package/build/modern/infiniteQueryBehavior.js +86 -109
- package/build/modern/infiniteQueryBehavior.js.map +1 -1
- package/build/modern/infiniteQueryObserver.cjs +58 -87
- package/build/modern/infiniteQueryObserver.cjs.map +1 -1
- package/build/modern/infiniteQueryObserver.d.cts +20 -1
- package/build/modern/infiniteQueryObserver.d.cts.map +1 -0
- package/build/modern/infiniteQueryObserver.d.ts +20 -1
- package/build/modern/infiniteQueryObserver.d.ts.map +1 -0
- package/build/modern/infiniteQueryObserver.js +56 -61
- package/build/modern/infiniteQueryObserver.js.map +1 -1
- package/build/modern/mutation.cjs +221 -303
- package/build/modern/mutation.cjs.map +1 -1
- package/build/modern/mutation.d.cts +2 -4
- package/build/modern/mutation.d.ts +2 -4
- package/build/modern/mutation.js +216 -274
- package/build/modern/mutation.js.map +1 -1
- package/build/modern/mutationCache.cjs +111 -145
- package/build/modern/mutationCache.cjs.map +1 -1
- package/build/modern/mutationCache.d.cts +2 -2
- package/build/modern/mutationCache.d.ts +2 -2
- package/build/modern/mutationCache.js +107 -117
- package/build/modern/mutationCache.js.map +1 -1
- package/build/modern/mutationObserver.cjs +115 -162
- package/build/modern/mutationObserver.cjs.map +1 -1
- package/build/modern/mutationObserver.d.cts +2 -1
- package/build/modern/mutationObserver.d.ts +2 -1
- package/build/modern/mutationObserver.js +113 -136
- package/build/modern/mutationObserver.js.map +1 -1
- package/build/modern/notifyManager.cjs +76 -110
- package/build/modern/notifyManager.cjs.map +1 -1
- package/build/modern/notifyManager.d.cts +48 -3
- package/build/modern/notifyManager.d.cts.map +1 -0
- package/build/modern/notifyManager.d.ts +48 -3
- package/build/modern/notifyManager.d.ts.map +1 -0
- package/build/modern/notifyManager.js +73 -82
- package/build/modern/notifyManager.js.map +1 -1
- package/build/modern/onlineManager.cjs +51 -80
- package/build/modern/onlineManager.cjs.map +1 -1
- package/build/modern/onlineManager.d.cts +17 -2
- package/build/modern/onlineManager.d.cts.map +1 -0
- package/build/modern/onlineManager.d.ts +17 -2
- package/build/modern/onlineManager.d.ts.map +1 -0
- package/build/modern/onlineManager.js +48 -53
- package/build/modern/onlineManager.js.map +1 -1
- package/build/modern/queriesObserver.cjs +185 -237
- package/build/modern/queriesObserver.cjs.map +1 -1
- package/build/modern/queriesObserver.d.cts +23 -2
- package/build/modern/queriesObserver.d.cts.map +1 -0
- package/build/modern/queriesObserver.d.ts +23 -2
- package/build/modern/queriesObserver.d.ts.map +1 -0
- package/build/modern/queriesObserver.js +181 -209
- package/build/modern/queriesObserver.js.map +1 -1
- package/build/modern/query.cjs +384 -464
- package/build/modern/query.cjs.map +1 -1
- package/build/modern/query.d.cts +2 -9
- package/build/modern/query.d.ts +2 -9
- package/build/modern/query.js +377 -441
- package/build/modern/query.js.map +1 -1
- package/build/modern/queryCache.cjs +97 -119
- package/build/modern/queryCache.cjs.map +1 -1
- package/build/modern/queryCache.d.cts +2 -3
- package/build/modern/queryCache.d.ts +2 -3
- package/build/modern/queryCache.js +94 -92
- package/build/modern/queryCache.js.map +1 -1
- package/build/modern/queryClient.cjs +281 -318
- package/build/modern/queryClient.cjs.map +1 -1
- package/build/modern/queryClient.d.cts +2 -1
- package/build/modern/queryClient.d.ts +2 -1
- package/build/modern/queryClient.js +278 -299
- package/build/modern/queryClient.js.map +1 -1
- package/build/modern/queryObserver.cjs +329 -475
- package/build/modern/queryObserver.cjs.map +1 -1
- package/build/modern/queryObserver.d.cts +2 -1
- package/build/modern/queryObserver.d.ts +2 -1
- package/build/modern/queryObserver.js +324 -454
- package/build/modern/queryObserver.js.map +1 -1
- package/build/modern/removable-DeMjhW5M.d.cts +13 -0
- package/build/modern/removable-DeMjhW5M.d.cts.map +1 -0
- package/build/modern/removable-DeMjhW5M.d.ts +13 -0
- package/build/modern/removable-DeMjhW5M.d.ts.map +1 -0
- package/build/modern/removable.cjs +27 -56
- package/build/modern/removable.cjs.map +1 -1
- package/build/modern/removable.d.cts +2 -1
- package/build/modern/removable.d.ts +2 -1
- package/build/modern/removable.js +24 -29
- package/build/modern/removable.js.map +1 -1
- package/build/modern/retryer.cjs +121 -151
- package/build/modern/retryer.cjs.map +1 -1
- package/build/modern/retryer.d.cts +2 -7
- package/build/modern/retryer.d.ts +2 -7
- package/build/modern/retryer.js +115 -121
- package/build/modern/retryer.js.map +1 -1
- package/build/modern/streamedQuery.cjs +49 -78
- package/build/modern/streamedQuery.cjs.map +1 -1
- package/build/modern/streamedQuery.d.cts +33 -1
- package/build/modern/streamedQuery.d.cts.map +1 -0
- package/build/modern/streamedQuery.d.ts +33 -1
- package/build/modern/streamedQuery.d.ts.map +1 -0
- package/build/modern/streamedQuery.js +47 -52
- package/build/modern/streamedQuery.js.map +1 -1
- package/build/modern/subscribable-CbifVTKz.d.cts +12 -0
- package/build/modern/subscribable-CbifVTKz.d.cts.map +1 -0
- package/build/modern/subscribable-CbifVTKz.d.ts +12 -0
- package/build/modern/subscribable-CbifVTKz.d.ts.map +1 -0
- package/build/modern/subscribable.cjs +22 -48
- package/build/modern/subscribable.cjs.map +1 -1
- package/build/modern/subscribable.d.cts +2 -1
- package/build/modern/subscribable.d.ts +2 -1
- package/build/modern/subscribable.js +21 -23
- package/build/modern/subscribable.js.map +1 -1
- package/build/modern/timeoutManager.cjs +59 -93
- package/build/modern/timeoutManager.cjs.map +1 -1
- package/build/modern/timeoutManager.d.cts +60 -7
- package/build/modern/timeoutManager.d.cts.map +1 -0
- package/build/modern/timeoutManager.d.ts +60 -7
- package/build/modern/timeoutManager.d.ts.map +1 -0
- package/build/modern/timeoutManager.js +55 -65
- package/build/modern/timeoutManager.js.map +1 -1
- package/build/modern/types.cjs +10 -35
- package/build/modern/types.cjs.map +1 -1
- package/build/modern/types.d.cts +2 -94
- package/build/modern/types.d.ts +2 -94
- package/build/modern/types.js +8 -9
- package/build/modern/types.js.map +1 -1
- package/build/modern/utils.cjs +175 -300
- package/build/modern/utils.cjs.map +1 -1
- package/build/modern/utils.d.cts +2 -30
- package/build/modern/utils.d.ts +2 -30
- package/build/modern/utils.js +149 -250
- package/build/modern/utils.js.map +1 -1
- package/package.json +3 -5
- package/src/hydration.ts +65 -56
- package/src/index.ts +1 -0
- package/src/mutation.ts +14 -6
- package/src/mutationObserver.ts +8 -0
- package/src/queriesObserver.ts +14 -8
- package/src/query.ts +14 -6
- package/src/queryClient.ts +90 -2
- package/src/queryObserver.ts +41 -64
- package/src/retryer.ts +20 -12
- package/src/types.ts +70 -58
- package/build/legacy/_tsup-dts-rollup.d.cts +0 -2188
- package/build/legacy/_tsup-dts-rollup.d.ts +0 -2188
- package/build/legacy/chunk-PXG64RU4.js +0 -25
- package/build/legacy/chunk-PXG64RU4.js.map +0 -1
- package/build/legacy/thenable.cjs +0 -76
- package/build/legacy/thenable.cjs.map +0 -1
- package/build/legacy/thenable.d.cts +0 -6
- package/build/legacy/thenable.d.ts +0 -6
- package/build/legacy/thenable.js +0 -52
- package/build/legacy/thenable.js.map +0 -1
- package/build/modern/_tsup-dts-rollup.d.cts +0 -2188
- package/build/modern/_tsup-dts-rollup.d.ts +0 -2188
- package/build/modern/thenable.cjs +0 -75
- package/build/modern/thenable.cjs.map +0 -1
- package/build/modern/thenable.d.cts +0 -6
- package/build/modern/thenable.d.ts +0 -6
- package/build/modern/thenable.js +0 -49
- package/build/modern/thenable.js.map +0 -1
- package/src/thenable.ts +0 -111
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable<TListener extends Function> {\n protected listeners = new Set<TListener>()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"subscribable.js","names":[],"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable<TListener extends Function> {\n protected listeners = new Set<TListener>()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";AAAA,IAAa,eAAb,MAAsD;CAGpD,cAAc;EAFQ,KAAA,4BAAA,IAAI,IAAe;EAGvC,KAAK,YAAY,KAAK,UAAU,KAAK,IAAI;CAC3C;CAEA,UAAU,UAAiC;EACzC,KAAK,UAAU,IAAI,QAAQ;EAE3B,KAAK,YAAY;EAEjB,aAAa;GACX,KAAK,UAAU,OAAO,QAAQ;GAC9B,KAAK,cAAc;EACrB;CACF;CAEA,eAAwB;EACtB,OAAO,KAAK,UAAU,OAAO;CAC/B;CAEA,cAA8B,CAE9B;CAEA,gBAAgC,CAEhC;AACF"}
|
|
@@ -1,99 +1,65 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/timeoutManager.ts
|
|
21
|
-
var timeoutManager_exports = {};
|
|
22
|
-
__export(timeoutManager_exports, {
|
|
23
|
-
TimeoutManager: () => TimeoutManager,
|
|
24
|
-
defaultTimeoutProvider: () => defaultTimeoutProvider,
|
|
25
|
-
systemSetTimeoutZero: () => systemSetTimeoutZero,
|
|
26
|
-
timeoutManager: () => timeoutManager
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(timeoutManager_exports);
|
|
29
|
-
var defaultTimeoutProvider = {
|
|
30
|
-
// We need the wrapper function syntax below instead of direct references to
|
|
31
|
-
// global setTimeout etc.
|
|
32
|
-
//
|
|
33
|
-
// BAD: `setTimeout: setTimeout`
|
|
34
|
-
// GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
|
|
35
|
-
//
|
|
36
|
-
// If we use direct references here, then anything that wants to spy on or
|
|
37
|
-
// replace the global setTimeout (like tests) won't work since we'll already
|
|
38
|
-
// have a hard reference to the original implementation at the time when this
|
|
39
|
-
// file was imported.
|
|
40
|
-
setTimeout: (callback, delay) => setTimeout(callback, delay),
|
|
41
|
-
clearTimeout: (timeoutId) => clearTimeout(timeoutId),
|
|
42
|
-
setInterval: (callback, delay) => setInterval(callback, delay),
|
|
43
|
-
clearInterval: (intervalId) => clearInterval(intervalId)
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/timeoutManager.ts
|
|
3
|
+
const defaultTimeoutProvider = {
|
|
4
|
+
setTimeout: (callback, delay) => setTimeout(callback, delay),
|
|
5
|
+
clearTimeout: (timeoutId) => clearTimeout(timeoutId),
|
|
6
|
+
setInterval: (callback, delay) => setInterval(callback, delay),
|
|
7
|
+
clearInterval: (intervalId) => clearInterval(intervalId)
|
|
44
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* Allows customization of how timeouts are created.
|
|
11
|
+
*
|
|
12
|
+
* @tanstack/query-core makes liberal use of timeouts to implement `staleTime`
|
|
13
|
+
* and `gcTime`. The default TimeoutManager provider uses the platform's global
|
|
14
|
+
* `setTimeout` implementation, which is known to have scalability issues with
|
|
15
|
+
* thousands of timeouts on the event loop.
|
|
16
|
+
*
|
|
17
|
+
* If you hit this limitation, consider providing a custom TimeoutProvider that
|
|
18
|
+
* coalesces timeouts.
|
|
19
|
+
*/
|
|
45
20
|
var TimeoutManager = class {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
return this.#provider.setTimeout(callback, delay);
|
|
74
|
-
}
|
|
75
|
-
clearTimeout(timeoutId) {
|
|
76
|
-
this.#provider.clearTimeout(timeoutId);
|
|
77
|
-
}
|
|
78
|
-
setInterval(callback, delay) {
|
|
79
|
-
if (process.env.NODE_ENV !== "production") {
|
|
80
|
-
this.#providerCalled = true;
|
|
81
|
-
}
|
|
82
|
-
return this.#provider.setInterval(callback, delay);
|
|
83
|
-
}
|
|
84
|
-
clearInterval(intervalId) {
|
|
85
|
-
this.#provider.clearInterval(intervalId);
|
|
86
|
-
}
|
|
21
|
+
#provider = defaultTimeoutProvider;
|
|
22
|
+
#providerCalled = false;
|
|
23
|
+
setTimeoutProvider(provider) {
|
|
24
|
+
if (process.env.NODE_ENV !== "production") {
|
|
25
|
+
if (this.#providerCalled && provider !== this.#provider) console.error(`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, {
|
|
26
|
+
previous: this.#provider,
|
|
27
|
+
provider
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
this.#provider = provider;
|
|
31
|
+
if (process.env.NODE_ENV !== "production") this.#providerCalled = false;
|
|
32
|
+
}
|
|
33
|
+
setTimeout(callback, delay) {
|
|
34
|
+
if (process.env.NODE_ENV !== "production") this.#providerCalled = true;
|
|
35
|
+
return this.#provider.setTimeout(callback, delay);
|
|
36
|
+
}
|
|
37
|
+
clearTimeout(timeoutId) {
|
|
38
|
+
this.#provider.clearTimeout(timeoutId);
|
|
39
|
+
}
|
|
40
|
+
setInterval(callback, delay) {
|
|
41
|
+
if (process.env.NODE_ENV !== "production") this.#providerCalled = true;
|
|
42
|
+
return this.#provider.setInterval(callback, delay);
|
|
43
|
+
}
|
|
44
|
+
clearInterval(intervalId) {
|
|
45
|
+
this.#provider.clearInterval(intervalId);
|
|
46
|
+
}
|
|
87
47
|
};
|
|
88
|
-
|
|
48
|
+
const timeoutManager = new TimeoutManager();
|
|
49
|
+
/**
|
|
50
|
+
* In many cases code wants to delay to the next event loop tick; this is not
|
|
51
|
+
* mediated by {@link timeoutManager}.
|
|
52
|
+
*
|
|
53
|
+
* This function is provided to make auditing the `tanstack/query-core` for
|
|
54
|
+
* incorrect use of system `setTimeout` easier.
|
|
55
|
+
*/
|
|
89
56
|
function systemSetTimeoutZero(callback) {
|
|
90
|
-
|
|
57
|
+
setTimeout(callback, 0);
|
|
91
58
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
});
|
|
59
|
+
//#endregion
|
|
60
|
+
exports.TimeoutManager = TimeoutManager;
|
|
61
|
+
exports.defaultTimeoutProvider = defaultTimeoutProvider;
|
|
62
|
+
exports.systemSetTimeoutZero = systemSetTimeoutZero;
|
|
63
|
+
exports.timeoutManager = timeoutManager;
|
|
64
|
+
|
|
99
65
|
//# sourceMappingURL=timeoutManager.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/timeoutManager.ts"],"sourcesContent":["/**\n * {@link TimeoutManager} does not support passing arguments to the callback.\n *\n * `(_: void)` is the argument type inferred by TypeScript's default typings for\n * `setTimeout(cb, number)`.\n * If we don't accept a single void argument, then\n * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.\n */\nexport type TimeoutCallback = (_: void) => void\n\n/**\n * Wrapping `setTimeout` is awkward from a typing perspective because platform\n * typings may extend the return type of `setTimeout`. For example, NodeJS\n * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be\n * able to return such a type.\n */\nexport type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number }\n\n/**\n * Backend for timer functions.\n */\nexport type TimeoutProvider<TTimerId extends ManagedTimerId = ManagedTimerId> =\n {\n readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearTimeout: (timeoutId: TTimerId | undefined) => void\n\n readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearInterval: (intervalId: TTimerId | undefined) => void\n }\n\ntype SystemTimerId = ReturnType<typeof setTimeout>\n\nexport const defaultTimeoutProvider: TimeoutProvider = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) =>\n clearTimeout(timeoutId as SystemTimerId | undefined),\n\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) =>\n clearInterval(intervalId as SystemTimerId | undefined),\n}\n\n/**\n * Allows customization of how timeouts are created.\n *\n * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n * and `gcTime`. The default TimeoutManager provider uses the platform's global\n * `setTimeout` implementation, which is known to have scalability issues with\n * thousands of timeouts on the event loop.\n *\n * If you hit this limitation, consider providing a custom TimeoutProvider that\n * coalesces timeouts.\n */\nexport class TimeoutManager implements Omit<TimeoutProvider, 'name'> {\n // We cannot have TimeoutManager<T> as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support the default provider's concrete timer ID, which is\n // infeasible across environments.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider: TimeoutProvider<any> = defaultTimeoutProvider\n #providerCalled = false\n\n setTimeoutProvider<TTimerId extends ManagedTimerId>(\n provider: TimeoutProvider<TTimerId>,\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (this.#providerCalled && provider !== this.#provider) {\n // After changing providers, `clearTimeout` will not work as expected for\n // timeouts from the previous provider.\n //\n // Since they may allocate the same timeout ID, clearTimeout may cancel an\n // arbitrary different timeout, or unexpected no-op.\n //\n // We could protect against this by mixing the timeout ID bits\n // deterministically with some per-provider bits.\n //\n // We could internally queue `setTimeout` calls to `TimeoutManager` until\n // some API call to set the initial provider.\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider },\n )\n }\n }\n\n this.#provider = provider\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = false\n }\n }\n\n setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setTimeout(callback, delay)\n }\n\n clearTimeout(timeoutId: ManagedTimerId | undefined): void {\n this.#provider.clearTimeout(timeoutId)\n }\n\n setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setInterval(callback, delay)\n }\n\n clearInterval(intervalId: ManagedTimerId | undefined): void {\n this.#provider.clearInterval(intervalId)\n }\n}\n\nexport const timeoutManager = new TimeoutManager()\n\n/**\n * In many cases code wants to delay to the next event loop tick; this is not\n * mediated by {@link timeoutManager}.\n *\n * This function is provided to make auditing the `tanstack/query-core` for\n * incorrect use of system `setTimeout` easier.\n */\nexport function systemSetTimeoutZero(callback: TimeoutCallback): void {\n setTimeout(callback, 0)\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"timeoutManager.cjs","names":["#providerCalled","#provider"],"sources":["../../src/timeoutManager.ts"],"sourcesContent":["/**\n * {@link TimeoutManager} does not support passing arguments to the callback.\n *\n * `(_: void)` is the argument type inferred by TypeScript's default typings for\n * `setTimeout(cb, number)`.\n * If we don't accept a single void argument, then\n * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.\n */\nexport type TimeoutCallback = (_: void) => void\n\n/**\n * Wrapping `setTimeout` is awkward from a typing perspective because platform\n * typings may extend the return type of `setTimeout`. For example, NodeJS\n * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be\n * able to return such a type.\n */\nexport type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number }\n\n/**\n * Backend for timer functions.\n */\nexport type TimeoutProvider<TTimerId extends ManagedTimerId = ManagedTimerId> =\n {\n readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearTimeout: (timeoutId: TTimerId | undefined) => void\n\n readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearInterval: (intervalId: TTimerId | undefined) => void\n }\n\ntype SystemTimerId = ReturnType<typeof setTimeout>\n\nexport const defaultTimeoutProvider: TimeoutProvider = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) =>\n clearTimeout(timeoutId as SystemTimerId | undefined),\n\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) =>\n clearInterval(intervalId as SystemTimerId | undefined),\n}\n\n/**\n * Allows customization of how timeouts are created.\n *\n * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n * and `gcTime`. The default TimeoutManager provider uses the platform's global\n * `setTimeout` implementation, which is known to have scalability issues with\n * thousands of timeouts on the event loop.\n *\n * If you hit this limitation, consider providing a custom TimeoutProvider that\n * coalesces timeouts.\n */\nexport class TimeoutManager implements Omit<TimeoutProvider, 'name'> {\n // We cannot have TimeoutManager<T> as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support the default provider's concrete timer ID, which is\n // infeasible across environments.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider: TimeoutProvider<any> = defaultTimeoutProvider\n #providerCalled = false\n\n setTimeoutProvider<TTimerId extends ManagedTimerId>(\n provider: TimeoutProvider<TTimerId>,\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (this.#providerCalled && provider !== this.#provider) {\n // After changing providers, `clearTimeout` will not work as expected for\n // timeouts from the previous provider.\n //\n // Since they may allocate the same timeout ID, clearTimeout may cancel an\n // arbitrary different timeout, or unexpected no-op.\n //\n // We could protect against this by mixing the timeout ID bits\n // deterministically with some per-provider bits.\n //\n // We could internally queue `setTimeout` calls to `TimeoutManager` until\n // some API call to set the initial provider.\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider },\n )\n }\n }\n\n this.#provider = provider\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = false\n }\n }\n\n setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setTimeout(callback, delay)\n }\n\n clearTimeout(timeoutId: ManagedTimerId | undefined): void {\n this.#provider.clearTimeout(timeoutId)\n }\n\n setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setInterval(callback, delay)\n }\n\n clearInterval(intervalId: ManagedTimerId | undefined): void {\n this.#provider.clearInterval(intervalId)\n }\n}\n\nexport const timeoutManager = new TimeoutManager()\n\n/**\n * In many cases code wants to delay to the next event loop tick; this is not\n * mediated by {@link timeoutManager}.\n *\n * This function is provided to make auditing the `tanstack/query-core` for\n * incorrect use of system `setTimeout` easier.\n */\nexport function systemSetTimeoutZero(callback: TimeoutCallback): void {\n setTimeout(callback, 0)\n}\n"],"mappings":";;AAgCA,MAAa,yBAA0C;CAWrD,aAAa,UAAU,UAAU,WAAW,UAAU,KAAK;CAC3D,eAAe,cACb,aAAa,SAAsC;CAErD,cAAc,UAAU,UAAU,YAAY,UAAU,KAAK;CAC7D,gBAAgB,eACd,cAAc,UAAuC;AACzD;;;;;;;;;;;;AAaA,IAAa,iBAAb,MAAqE;CAQnE,YAAkC;CAClC,kBAAkB;CAElB,mBACE,UACM;EACN,IAAI,QAAQ,IAAI,aAAa,cACvB;OAAA,KAAKA,mBAAmB,aAAa,KAAKC,WAY5C,QAAQ,MACN,8GACA;IAAE,UAAU,KAAKA;IAAW;GAAS,CACvC;EAAA;EAIJ,KAAKA,YAAY;EACjB,IAAI,QAAQ,IAAI,aAAa,cAC3B,KAAKD,kBAAkB;CAE3B;CAEA,WAAW,UAA2B,OAA+B;EACnE,IAAI,QAAQ,IAAI,aAAa,cAC3B,KAAKA,kBAAkB;EAEzB,OAAO,KAAKC,UAAU,WAAW,UAAU,KAAK;CAClD;CAEA,aAAa,WAA6C;EACxD,KAAKA,UAAU,aAAa,SAAS;CACvC;CAEA,YAAY,UAA2B,OAA+B;EACpE,IAAI,QAAQ,IAAI,aAAa,cAC3B,KAAKD,kBAAkB;EAEzB,OAAO,KAAKC,UAAU,YAAY,UAAU,KAAK;CACnD;CAEA,cAAc,YAA8C;EAC1D,KAAKA,UAAU,cAAc,UAAU;CACzC;AACF;AAEA,MAAa,iBAAiB,IAAI,eAAe;;;;;;;;AASjD,SAAgB,qBAAqB,UAAiC;CACpE,WAAW,UAAU,CAAC;AACxB"}
|
|
@@ -1,7 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region src/timeoutManager.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* {@link TimeoutManager} does not support passing arguments to the callback.
|
|
4
|
+
*
|
|
5
|
+
* `(_: void)` is the argument type inferred by TypeScript's default typings for
|
|
6
|
+
* `setTimeout(cb, number)`.
|
|
7
|
+
* If we don't accept a single void argument, then
|
|
8
|
+
* `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.
|
|
9
|
+
*/
|
|
10
|
+
type TimeoutCallback = (_: void) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Wrapping `setTimeout` is awkward from a typing perspective because platform
|
|
13
|
+
* typings may extend the return type of `setTimeout`. For example, NodeJS
|
|
14
|
+
* typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be
|
|
15
|
+
* able to return such a type.
|
|
16
|
+
*/
|
|
17
|
+
type ManagedTimerId = number | {
|
|
18
|
+
[Symbol.toPrimitive]: () => number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Backend for timer functions.
|
|
22
|
+
*/
|
|
23
|
+
type TimeoutProvider<TTimerId extends ManagedTimerId = ManagedTimerId> = {
|
|
24
|
+
readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId;
|
|
25
|
+
readonly clearTimeout: (timeoutId: TTimerId | undefined) => void;
|
|
26
|
+
readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId;
|
|
27
|
+
readonly clearInterval: (intervalId: TTimerId | undefined) => void;
|
|
28
|
+
};
|
|
29
|
+
declare const defaultTimeoutProvider: TimeoutProvider;
|
|
30
|
+
/**
|
|
31
|
+
* Allows customization of how timeouts are created.
|
|
32
|
+
*
|
|
33
|
+
* @tanstack/query-core makes liberal use of timeouts to implement `staleTime`
|
|
34
|
+
* and `gcTime`. The default TimeoutManager provider uses the platform's global
|
|
35
|
+
* `setTimeout` implementation, which is known to have scalability issues with
|
|
36
|
+
* thousands of timeouts on the event loop.
|
|
37
|
+
*
|
|
38
|
+
* If you hit this limitation, consider providing a custom TimeoutProvider that
|
|
39
|
+
* coalesces timeouts.
|
|
40
|
+
*/
|
|
41
|
+
declare class TimeoutManager implements Omit<TimeoutProvider, 'name'> {
|
|
42
|
+
#private;
|
|
43
|
+
setTimeoutProvider<TTimerId extends ManagedTimerId>(provider: TimeoutProvider<TTimerId>): void;
|
|
44
|
+
setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId;
|
|
45
|
+
clearTimeout(timeoutId: ManagedTimerId | undefined): void;
|
|
46
|
+
setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId;
|
|
47
|
+
clearInterval(intervalId: ManagedTimerId | undefined): void;
|
|
48
|
+
}
|
|
49
|
+
declare const timeoutManager: TimeoutManager;
|
|
50
|
+
/**
|
|
51
|
+
* In many cases code wants to delay to the next event loop tick; this is not
|
|
52
|
+
* mediated by {@link timeoutManager}.
|
|
53
|
+
*
|
|
54
|
+
* This function is provided to make auditing the `tanstack/query-core` for
|
|
55
|
+
* incorrect use of system `setTimeout` easier.
|
|
56
|
+
*/
|
|
57
|
+
declare function systemSetTimeoutZero(callback: TimeoutCallback): void;
|
|
58
|
+
//#endregion
|
|
59
|
+
export { ManagedTimerId, TimeoutCallback, TimeoutManager, TimeoutProvider, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager };
|
|
60
|
+
//# sourceMappingURL=timeoutManager.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeoutManager.d.cts","names":[],"sources":["../../src/timeoutManager.ts"],"mappings":";;;;;;;;;KAQY,mBAAmB;;;;;;;KAQnB;GAA6B,OAAO;;;;;KAKpC,gBAAgB,iBAAiB,iBAAiB;WAEjD,aAAa,UAAU,iBAAiB,kBAAkB;WAC1D,eAAe,WAAW;WAE1B,cAAc,UAAU,iBAAiB,kBAAkB;WAC3D,gBAAgB,YAAY;;cAK5B,wBAAwB;;;;;;;;;;;;cA+BxB,0BAA0B,KAAK;;EAW1C,mBAAmB,iBAAiB,gBAClC,UAAU,gBAAgB;EA4B5B,WAAW,UAAU,iBAAiB,gBAAgB;EAOtD,aAAa,WAAW;EAIxB,YAAY,UAAU,iBAAiB,gBAAgB;EAOvD,cAAc,YAAY;;cAKf,gBAAc;;;;;;;;iBASX,qBAAqB,UAAU"}
|
|
@@ -1,7 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region src/timeoutManager.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* {@link TimeoutManager} does not support passing arguments to the callback.
|
|
4
|
+
*
|
|
5
|
+
* `(_: void)` is the argument type inferred by TypeScript's default typings for
|
|
6
|
+
* `setTimeout(cb, number)`.
|
|
7
|
+
* If we don't accept a single void argument, then
|
|
8
|
+
* `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.
|
|
9
|
+
*/
|
|
10
|
+
type TimeoutCallback = (_: void) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Wrapping `setTimeout` is awkward from a typing perspective because platform
|
|
13
|
+
* typings may extend the return type of `setTimeout`. For example, NodeJS
|
|
14
|
+
* typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be
|
|
15
|
+
* able to return such a type.
|
|
16
|
+
*/
|
|
17
|
+
type ManagedTimerId = number | {
|
|
18
|
+
[Symbol.toPrimitive]: () => number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Backend for timer functions.
|
|
22
|
+
*/
|
|
23
|
+
type TimeoutProvider<TTimerId extends ManagedTimerId = ManagedTimerId> = {
|
|
24
|
+
readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId;
|
|
25
|
+
readonly clearTimeout: (timeoutId: TTimerId | undefined) => void;
|
|
26
|
+
readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId;
|
|
27
|
+
readonly clearInterval: (intervalId: TTimerId | undefined) => void;
|
|
28
|
+
};
|
|
29
|
+
declare const defaultTimeoutProvider: TimeoutProvider;
|
|
30
|
+
/**
|
|
31
|
+
* Allows customization of how timeouts are created.
|
|
32
|
+
*
|
|
33
|
+
* @tanstack/query-core makes liberal use of timeouts to implement `staleTime`
|
|
34
|
+
* and `gcTime`. The default TimeoutManager provider uses the platform's global
|
|
35
|
+
* `setTimeout` implementation, which is known to have scalability issues with
|
|
36
|
+
* thousands of timeouts on the event loop.
|
|
37
|
+
*
|
|
38
|
+
* If you hit this limitation, consider providing a custom TimeoutProvider that
|
|
39
|
+
* coalesces timeouts.
|
|
40
|
+
*/
|
|
41
|
+
declare class TimeoutManager implements Omit<TimeoutProvider, 'name'> {
|
|
42
|
+
#private;
|
|
43
|
+
setTimeoutProvider<TTimerId extends ManagedTimerId>(provider: TimeoutProvider<TTimerId>): void;
|
|
44
|
+
setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId;
|
|
45
|
+
clearTimeout(timeoutId: ManagedTimerId | undefined): void;
|
|
46
|
+
setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId;
|
|
47
|
+
clearInterval(intervalId: ManagedTimerId | undefined): void;
|
|
48
|
+
}
|
|
49
|
+
declare const timeoutManager: TimeoutManager;
|
|
50
|
+
/**
|
|
51
|
+
* In many cases code wants to delay to the next event loop tick; this is not
|
|
52
|
+
* mediated by {@link timeoutManager}.
|
|
53
|
+
*
|
|
54
|
+
* This function is provided to make auditing the `tanstack/query-core` for
|
|
55
|
+
* incorrect use of system `setTimeout` easier.
|
|
56
|
+
*/
|
|
57
|
+
declare function systemSetTimeoutZero(callback: TimeoutCallback): void;
|
|
58
|
+
//#endregion
|
|
59
|
+
export { ManagedTimerId, TimeoutCallback, TimeoutManager, TimeoutProvider, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager };
|
|
60
|
+
//# sourceMappingURL=timeoutManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeoutManager.d.ts","names":[],"sources":["../../src/timeoutManager.ts"],"mappings":";;;;;;;;;KAQY,mBAAmB;;;;;;;KAQnB;GAA6B,OAAO;;;;;KAKpC,gBAAgB,iBAAiB,iBAAiB;WAEjD,aAAa,UAAU,iBAAiB,kBAAkB;WAC1D,eAAe,WAAW;WAE1B,cAAc,UAAU,iBAAiB,kBAAkB;WAC3D,gBAAgB,YAAY;;cAK5B,wBAAwB;;;;;;;;;;;;cA+BxB,0BAA0B,KAAK;;EAW1C,mBAAmB,iBAAiB,gBAClC,UAAU,gBAAgB;EA4B5B,WAAW,UAAU,iBAAiB,gBAAgB;EAOtD,aAAa,WAAW;EAIxB,YAAY,UAAU,iBAAiB,gBAAgB;EAOvD,cAAc,YAAY;;cAKf,gBAAc;;;;;;;;iBASX,qBAAqB,UAAU"}
|
|
@@ -1,71 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
|
|
8
|
-
//
|
|
9
|
-
// If we use direct references here, then anything that wants to spy on or
|
|
10
|
-
// replace the global setTimeout (like tests) won't work since we'll already
|
|
11
|
-
// have a hard reference to the original implementation at the time when this
|
|
12
|
-
// file was imported.
|
|
13
|
-
setTimeout: (callback, delay) => setTimeout(callback, delay),
|
|
14
|
-
clearTimeout: (timeoutId) => clearTimeout(timeoutId),
|
|
15
|
-
setInterval: (callback, delay) => setInterval(callback, delay),
|
|
16
|
-
clearInterval: (intervalId) => clearInterval(intervalId)
|
|
1
|
+
//#region src/timeoutManager.ts
|
|
2
|
+
const defaultTimeoutProvider = {
|
|
3
|
+
setTimeout: (callback, delay) => setTimeout(callback, delay),
|
|
4
|
+
clearTimeout: (timeoutId) => clearTimeout(timeoutId),
|
|
5
|
+
setInterval: (callback, delay) => setInterval(callback, delay),
|
|
6
|
+
clearInterval: (intervalId) => clearInterval(intervalId)
|
|
17
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Allows customization of how timeouts are created.
|
|
10
|
+
*
|
|
11
|
+
* @tanstack/query-core makes liberal use of timeouts to implement `staleTime`
|
|
12
|
+
* and `gcTime`. The default TimeoutManager provider uses the platform's global
|
|
13
|
+
* `setTimeout` implementation, which is known to have scalability issues with
|
|
14
|
+
* thousands of timeouts on the event loop.
|
|
15
|
+
*
|
|
16
|
+
* If you hit this limitation, consider providing a custom TimeoutProvider that
|
|
17
|
+
* coalesces timeouts.
|
|
18
|
+
*/
|
|
18
19
|
var TimeoutManager = class {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
return this.#provider.setTimeout(callback, delay);
|
|
47
|
-
}
|
|
48
|
-
clearTimeout(timeoutId) {
|
|
49
|
-
this.#provider.clearTimeout(timeoutId);
|
|
50
|
-
}
|
|
51
|
-
setInterval(callback, delay) {
|
|
52
|
-
if (process.env.NODE_ENV !== "production") {
|
|
53
|
-
this.#providerCalled = true;
|
|
54
|
-
}
|
|
55
|
-
return this.#provider.setInterval(callback, delay);
|
|
56
|
-
}
|
|
57
|
-
clearInterval(intervalId) {
|
|
58
|
-
this.#provider.clearInterval(intervalId);
|
|
59
|
-
}
|
|
20
|
+
#provider = defaultTimeoutProvider;
|
|
21
|
+
#providerCalled = false;
|
|
22
|
+
setTimeoutProvider(provider) {
|
|
23
|
+
if (process.env.NODE_ENV !== "production") {
|
|
24
|
+
if (this.#providerCalled && provider !== this.#provider) console.error(`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, {
|
|
25
|
+
previous: this.#provider,
|
|
26
|
+
provider
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
this.#provider = provider;
|
|
30
|
+
if (process.env.NODE_ENV !== "production") this.#providerCalled = false;
|
|
31
|
+
}
|
|
32
|
+
setTimeout(callback, delay) {
|
|
33
|
+
if (process.env.NODE_ENV !== "production") this.#providerCalled = true;
|
|
34
|
+
return this.#provider.setTimeout(callback, delay);
|
|
35
|
+
}
|
|
36
|
+
clearTimeout(timeoutId) {
|
|
37
|
+
this.#provider.clearTimeout(timeoutId);
|
|
38
|
+
}
|
|
39
|
+
setInterval(callback, delay) {
|
|
40
|
+
if (process.env.NODE_ENV !== "production") this.#providerCalled = true;
|
|
41
|
+
return this.#provider.setInterval(callback, delay);
|
|
42
|
+
}
|
|
43
|
+
clearInterval(intervalId) {
|
|
44
|
+
this.#provider.clearInterval(intervalId);
|
|
45
|
+
}
|
|
60
46
|
};
|
|
61
|
-
|
|
47
|
+
const timeoutManager = new TimeoutManager();
|
|
48
|
+
/**
|
|
49
|
+
* In many cases code wants to delay to the next event loop tick; this is not
|
|
50
|
+
* mediated by {@link timeoutManager}.
|
|
51
|
+
*
|
|
52
|
+
* This function is provided to make auditing the `tanstack/query-core` for
|
|
53
|
+
* incorrect use of system `setTimeout` easier.
|
|
54
|
+
*/
|
|
62
55
|
function systemSetTimeoutZero(callback) {
|
|
63
|
-
|
|
56
|
+
setTimeout(callback, 0);
|
|
64
57
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
systemSetTimeoutZero,
|
|
69
|
-
timeoutManager
|
|
70
|
-
};
|
|
58
|
+
//#endregion
|
|
59
|
+
export { TimeoutManager, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager };
|
|
60
|
+
|
|
71
61
|
//# sourceMappingURL=timeoutManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/timeoutManager.ts"],"sourcesContent":["/**\n * {@link TimeoutManager} does not support passing arguments to the callback.\n *\n * `(_: void)` is the argument type inferred by TypeScript's default typings for\n * `setTimeout(cb, number)`.\n * If we don't accept a single void argument, then\n * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.\n */\nexport type TimeoutCallback = (_: void) => void\n\n/**\n * Wrapping `setTimeout` is awkward from a typing perspective because platform\n * typings may extend the return type of `setTimeout`. For example, NodeJS\n * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be\n * able to return such a type.\n */\nexport type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number }\n\n/**\n * Backend for timer functions.\n */\nexport type TimeoutProvider<TTimerId extends ManagedTimerId = ManagedTimerId> =\n {\n readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearTimeout: (timeoutId: TTimerId | undefined) => void\n\n readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearInterval: (intervalId: TTimerId | undefined) => void\n }\n\ntype SystemTimerId = ReturnType<typeof setTimeout>\n\nexport const defaultTimeoutProvider: TimeoutProvider = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) =>\n clearTimeout(timeoutId as SystemTimerId | undefined),\n\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) =>\n clearInterval(intervalId as SystemTimerId | undefined),\n}\n\n/**\n * Allows customization of how timeouts are created.\n *\n * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n * and `gcTime`. The default TimeoutManager provider uses the platform's global\n * `setTimeout` implementation, which is known to have scalability issues with\n * thousands of timeouts on the event loop.\n *\n * If you hit this limitation, consider providing a custom TimeoutProvider that\n * coalesces timeouts.\n */\nexport class TimeoutManager implements Omit<TimeoutProvider, 'name'> {\n // We cannot have TimeoutManager<T> as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support the default provider's concrete timer ID, which is\n // infeasible across environments.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider: TimeoutProvider<any> = defaultTimeoutProvider\n #providerCalled = false\n\n setTimeoutProvider<TTimerId extends ManagedTimerId>(\n provider: TimeoutProvider<TTimerId>,\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (this.#providerCalled && provider !== this.#provider) {\n // After changing providers, `clearTimeout` will not work as expected for\n // timeouts from the previous provider.\n //\n // Since they may allocate the same timeout ID, clearTimeout may cancel an\n // arbitrary different timeout, or unexpected no-op.\n //\n // We could protect against this by mixing the timeout ID bits\n // deterministically with some per-provider bits.\n //\n // We could internally queue `setTimeout` calls to `TimeoutManager` until\n // some API call to set the initial provider.\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider },\n )\n }\n }\n\n this.#provider = provider\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = false\n }\n }\n\n setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setTimeout(callback, delay)\n }\n\n clearTimeout(timeoutId: ManagedTimerId | undefined): void {\n this.#provider.clearTimeout(timeoutId)\n }\n\n setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setInterval(callback, delay)\n }\n\n clearInterval(intervalId: ManagedTimerId | undefined): void {\n this.#provider.clearInterval(intervalId)\n }\n}\n\nexport const timeoutManager = new TimeoutManager()\n\n/**\n * In many cases code wants to delay to the next event loop tick; this is not\n * mediated by {@link timeoutManager}.\n *\n * This function is provided to make auditing the `tanstack/query-core` for\n * incorrect use of system `setTimeout` easier.\n */\nexport function systemSetTimeoutZero(callback: TimeoutCallback): void {\n setTimeout(callback, 0)\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"timeoutManager.js","names":["#providerCalled","#provider"],"sources":["../../src/timeoutManager.ts"],"sourcesContent":["/**\n * {@link TimeoutManager} does not support passing arguments to the callback.\n *\n * `(_: void)` is the argument type inferred by TypeScript's default typings for\n * `setTimeout(cb, number)`.\n * If we don't accept a single void argument, then\n * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.\n */\nexport type TimeoutCallback = (_: void) => void\n\n/**\n * Wrapping `setTimeout` is awkward from a typing perspective because platform\n * typings may extend the return type of `setTimeout`. For example, NodeJS\n * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be\n * able to return such a type.\n */\nexport type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number }\n\n/**\n * Backend for timer functions.\n */\nexport type TimeoutProvider<TTimerId extends ManagedTimerId = ManagedTimerId> =\n {\n readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearTimeout: (timeoutId: TTimerId | undefined) => void\n\n readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearInterval: (intervalId: TTimerId | undefined) => void\n }\n\ntype SystemTimerId = ReturnType<typeof setTimeout>\n\nexport const defaultTimeoutProvider: TimeoutProvider = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) =>\n clearTimeout(timeoutId as SystemTimerId | undefined),\n\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) =>\n clearInterval(intervalId as SystemTimerId | undefined),\n}\n\n/**\n * Allows customization of how timeouts are created.\n *\n * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n * and `gcTime`. The default TimeoutManager provider uses the platform's global\n * `setTimeout` implementation, which is known to have scalability issues with\n * thousands of timeouts on the event loop.\n *\n * If you hit this limitation, consider providing a custom TimeoutProvider that\n * coalesces timeouts.\n */\nexport class TimeoutManager implements Omit<TimeoutProvider, 'name'> {\n // We cannot have TimeoutManager<T> as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support the default provider's concrete timer ID, which is\n // infeasible across environments.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider: TimeoutProvider<any> = defaultTimeoutProvider\n #providerCalled = false\n\n setTimeoutProvider<TTimerId extends ManagedTimerId>(\n provider: TimeoutProvider<TTimerId>,\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (this.#providerCalled && provider !== this.#provider) {\n // After changing providers, `clearTimeout` will not work as expected for\n // timeouts from the previous provider.\n //\n // Since they may allocate the same timeout ID, clearTimeout may cancel an\n // arbitrary different timeout, or unexpected no-op.\n //\n // We could protect against this by mixing the timeout ID bits\n // deterministically with some per-provider bits.\n //\n // We could internally queue `setTimeout` calls to `TimeoutManager` until\n // some API call to set the initial provider.\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider },\n )\n }\n }\n\n this.#provider = provider\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = false\n }\n }\n\n setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setTimeout(callback, delay)\n }\n\n clearTimeout(timeoutId: ManagedTimerId | undefined): void {\n this.#provider.clearTimeout(timeoutId)\n }\n\n setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setInterval(callback, delay)\n }\n\n clearInterval(intervalId: ManagedTimerId | undefined): void {\n this.#provider.clearInterval(intervalId)\n }\n}\n\nexport const timeoutManager = new TimeoutManager()\n\n/**\n * In many cases code wants to delay to the next event loop tick; this is not\n * mediated by {@link timeoutManager}.\n *\n * This function is provided to make auditing the `tanstack/query-core` for\n * incorrect use of system `setTimeout` easier.\n */\nexport function systemSetTimeoutZero(callback: TimeoutCallback): void {\n setTimeout(callback, 0)\n}\n"],"mappings":";AAgCA,MAAa,yBAA0C;CAWrD,aAAa,UAAU,UAAU,WAAW,UAAU,KAAK;CAC3D,eAAe,cACb,aAAa,SAAsC;CAErD,cAAc,UAAU,UAAU,YAAY,UAAU,KAAK;CAC7D,gBAAgB,eACd,cAAc,UAAuC;AACzD;;;;;;;;;;;;AAaA,IAAa,iBAAb,MAAqE;CAQnE,YAAkC;CAClC,kBAAkB;CAElB,mBACE,UACM;EACN,IAAI,QAAQ,IAAI,aAAa,cACvB;OAAA,KAAKA,mBAAmB,aAAa,KAAKC,WAY5C,QAAQ,MACN,8GACA;IAAE,UAAU,KAAKA;IAAW;GAAS,CACvC;EAAA;EAIJ,KAAKA,YAAY;EACjB,IAAI,QAAQ,IAAI,aAAa,cAC3B,KAAKD,kBAAkB;CAE3B;CAEA,WAAW,UAA2B,OAA+B;EACnE,IAAI,QAAQ,IAAI,aAAa,cAC3B,KAAKA,kBAAkB;EAEzB,OAAO,KAAKC,UAAU,WAAW,UAAU,KAAK;CAClD;CAEA,aAAa,WAA6C;EACxD,KAAKA,UAAU,aAAa,SAAS;CACvC;CAEA,YAAY,UAA2B,OAA+B;EACpE,IAAI,QAAQ,IAAI,aAAa,cAC3B,KAAKD,kBAAkB;EAEzB,OAAO,KAAKC,UAAU,YAAY,UAAU,KAAK;CACnD;CAEA,cAAc,YAA8C;EAC1D,KAAKA,UAAU,cAAc,UAAU;CACzC;AACF;AAEA,MAAa,iBAAiB,IAAI,eAAe;;;;;;;;AASjD,SAAgB,qBAAqB,UAAiC;CACpE,WAAW,UAAU,CAAC;AACxB"}
|
package/build/modern/types.cjs
CHANGED
|
@@ -1,37 +1,12 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/types.ts
|
|
3
|
+
/* istanbul ignore file */
|
|
4
|
+
const dataTagSymbol = Symbol("dataTagSymbol");
|
|
5
|
+
const dataTagErrorSymbol = Symbol("dataTagErrorSymbol");
|
|
6
|
+
const unsetMarker = Symbol("unsetMarker");
|
|
7
|
+
//#endregion
|
|
8
|
+
exports.dataTagErrorSymbol = dataTagErrorSymbol;
|
|
9
|
+
exports.dataTagSymbol = dataTagSymbol;
|
|
10
|
+
exports.unsetMarker = unsetMarker;
|
|
19
11
|
|
|
20
|
-
// src/types.ts
|
|
21
|
-
var types_exports = {};
|
|
22
|
-
__export(types_exports, {
|
|
23
|
-
dataTagErrorSymbol: () => dataTagErrorSymbol,
|
|
24
|
-
dataTagSymbol: () => dataTagSymbol,
|
|
25
|
-
unsetMarker: () => unsetMarker
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(types_exports);
|
|
28
|
-
var dataTagSymbol = /* @__PURE__ */ Symbol("dataTagSymbol");
|
|
29
|
-
var dataTagErrorSymbol = /* @__PURE__ */ Symbol("dataTagErrorSymbol");
|
|
30
|
-
var unsetMarker = /* @__PURE__ */ Symbol("unsetMarker");
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
dataTagErrorSymbol,
|
|
34
|
-
dataTagSymbol,
|
|
35
|
-
unsetMarker
|
|
36
|
-
});
|
|
37
12
|
//# sourceMappingURL=types.cjs.map
|