diff --git a/src/tasks.ts b/src/tasks.ts index 384b4de..b56e2a7 100644 --- a/src/tasks.ts +++ b/src/tasks.ts @@ -10,7 +10,7 @@ export type Task = { /** * Adds a task to the queue and returns the new task. - * @param priority {('background' | 'user-visible')} The priority of the new task. + * @param priority {SchedulingPriority} The priority of the new task. */ export function createTask(priority: SchedulingPriority): Task { const item = { priority, deferred: new Deferred() } diff --git a/src/yieldControl.ts b/src/yieldControl.ts index 20fd617..1687bb0 100644 --- a/src/yieldControl.ts +++ b/src/yieldControl.ts @@ -2,9 +2,9 @@ import state from './state' import queueTask from './queueTask' import isTimeToYield from './isTimeToYield' import hasValidContext from './hasValidContext' +import SchedulingPriority from './SchedulingPriority' import { createTask, nextTask, removeTask } from './tasks' import { cancelPromiseEscape, requestPromiseEscape } from './promiseEscape' -import SchedulingPriority from './SchedulingPriority' let promiseEscapeId: number | undefined @@ -13,7 +13,7 @@ let promiseEscapeId: number | undefined * multiple times will create a LIFO(last in, first out) queue – the last call to * `yieldControl()` will get resolved first. * - * @param priority {('user-visible' | 'background')} The priority of the task being run. + * @param priority {SchedulingPriority} The priority of the task being run. * `user-visible` priority will always be resolved first. `background` priority will always be * resolved second. * @returns {Promise} The promise that will be resolved when the queue