mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 07:40:10 +00:00
[scheduler] Update to v0.12
This commit is contained in:
15
types/scheduler/index.d.ts
vendored
15
types/scheduler/index.d.ts
vendored
@@ -1,14 +1,10 @@
|
||||
// Type definitions for scheduler 0.10
|
||||
// Type definitions for scheduler 0.12
|
||||
// Project: https://reactjs.org/
|
||||
// Definitions by: Nathan Bierema <https://github.com/Methuselah96>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export interface Deadline {
|
||||
timeRemaining(): number;
|
||||
didTimeout: boolean;
|
||||
}
|
||||
export type FrameCallbackType = (deadline: Deadline) => FrameCallbackType | void;
|
||||
export type FrameCallbackType = () => FrameCallbackType | void;
|
||||
export interface CallbackNode {
|
||||
callback: FrameCallbackType;
|
||||
priorityLevel: number;
|
||||
@@ -20,10 +16,15 @@ export interface CallbackNode {
|
||||
export const unstable_ImmediatePriority = 1;
|
||||
export const unstable_UserBlockingPriority = 2;
|
||||
export const unstable_NormalPriority = 3;
|
||||
export const unstable_IdlePriority = 4;
|
||||
export const unstable_IdlePriority = 5;
|
||||
export const unstable_LowPriority = 4;
|
||||
export function unstable_runWithPriority<T>(priorityLevel: number, eventHandler: () => T): T | undefined;
|
||||
export function unstable_scheduleCallback(callback: FrameCallbackType, deprecated_options?: { timeout: number}): CallbackNode;
|
||||
export function unstable_cancelCallback(callbackNode: CallbackNode): void;
|
||||
export function unstable_wrapCallback(callback: FrameCallbackType): () => FrameCallbackType | undefined;
|
||||
export function unstable_getCurrentPriorityLevel(): number;
|
||||
export function unstable_shouldYield(): boolean;
|
||||
export function unstable_continueExecution(): void;
|
||||
export function unstable_pauseExecution(): void;
|
||||
export function unstable_getFirstCallbackNode(): CallbackNode | null;
|
||||
export function unstable_now(): number;
|
||||
|
||||
Reference in New Issue
Block a user