main
js 150 lines 4.78 KB
Raw
1 /**
2 * @license React
3 *
4 * Copyright (c) Meta Platforms, Inc. and affiliates.
5 *
6 * This source code is licensed under the MIT license found in the
7 * LICENSE file in the root directory of this source tree.
8 */
9
10 'use strict';
11
12 (function (global, factory) {
13 // eslint-disable-next-line ft-flow/no-unused-expressions
14 typeof exports === 'object' && typeof module !== 'undefined'
15 ? (module.exports = factory(require('react')))
16 : typeof define === 'function' && define.amd // eslint-disable-line no-undef
17 ? define(['react'], factory) // eslint-disable-line no-undef
18 : (global.Scheduler = factory(global));
19 })(this, function (global) {
20 function unstable_now() {
21 return global.React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.Scheduler.unstable_now.apply(
22 this,
23 arguments
24 );
25 }
26
27 function unstable_scheduleCallback() {
28 return global.React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.Scheduler.unstable_scheduleCallback.apply(
29 this,
30 arguments
31 );
32 }
33
34 function unstable_cancelCallback() {
35 return global.React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.Scheduler.unstable_cancelCallback.apply(
36 this,
37 arguments
38 );
39 }
40
41 function unstable_shouldYield() {
42 return global.React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.Scheduler.unstable_shouldYield.apply(
43 this,
44 arguments
45 );
46 }
47
48 function unstable_requestPaint() {
49 return global.React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.Scheduler.unstable_requestPaint.apply(
50 this,
51 arguments
52 );
53 }
54
55 function unstable_runWithPriority() {
56 return global.React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.Scheduler.unstable_runWithPriority.apply(
57 this,
58 arguments
59 );
60 }
61
62 function unstable_next() {
63 return global.React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.Scheduler.unstable_next.apply(
64 this,
65 arguments
66 );
67 }
68
69 function unstable_wrapCallback() {
70 return global.React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.Scheduler.unstable_wrapCallback.apply(
71 this,
72 arguments
73 );
74 }
75
76 function unstable_getCurrentPriorityLevel() {
77 return global.React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.Scheduler.unstable_getCurrentPriorityLevel.apply(
78 this,
79 arguments
80 );
81 }
82
83 function unstable_getFirstCallbackNode() {
84 return global.React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.Scheduler.unstable_getFirstCallbackNode.apply(
85 this,
86 arguments
87 );
88 }
89
90 function unstable_pauseExecution() {
91 return undefined;
92 }
93
94 function unstable_continueExecution() {
95 return undefined;
96 }
97
98 function unstable_forceFrameRate() {
99 return global.React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.Scheduler.unstable_forceFrameRate.apply(
100 this,
101 arguments
102 );
103 }
104
105 return Object.freeze({
106 unstable_now: unstable_now,
107 unstable_scheduleCallback: unstable_scheduleCallback,
108 unstable_cancelCallback: unstable_cancelCallback,
109 unstable_shouldYield: unstable_shouldYield,
110 unstable_requestPaint: unstable_requestPaint,
111 unstable_runWithPriority: unstable_runWithPriority,
112 unstable_next: unstable_next,
113 unstable_wrapCallback: unstable_wrapCallback,
114 unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel,
115 unstable_continueExecution: unstable_continueExecution,
116 unstable_pauseExecution: unstable_pauseExecution,
117 unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
118 unstable_forceFrameRate: unstable_forceFrameRate,
119 get unstable_IdlePriority() {
120 return global.React
121 .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
122 .Scheduler.unstable_IdlePriority;
123 },
124 get unstable_ImmediatePriority() {
125 return global.React
126 .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
127 .Scheduler.unstable_ImmediatePriority;
128 },
129 get unstable_LowPriority() {
130 return global.React
131 .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
132 .Scheduler.unstable_LowPriority;
133 },
134 get unstable_NormalPriority() {
135 return global.React
136 .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
137 .Scheduler.unstable_NormalPriority;
138 },
139 get unstable_UserBlockingPriority() {
140 return global.React
141 .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
142 .Scheduler.unstable_UserBlockingPriority;
143 },
144 get unstable_Profiling() {
145 return global.React
146 .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
147 .Scheduler.unstable_Profiling;
148 },
149 });
150 });