@types/scheduler
Advanced tools
Comparing version 0.16.3 to 0.16.4
@@ -10,7 +10,7 @@ // Type definitions for scheduler 0.16 | ||
export interface CallbackNode { | ||
callback: FrameCallbackType; | ||
priorityLevel: number; | ||
expirationTime: number; | ||
next: CallbackNode | null; | ||
prev: CallbackNode | null; | ||
callback: FrameCallbackType; | ||
priorityLevel: number; | ||
expirationTime: number; | ||
next: CallbackNode | null; | ||
prev: CallbackNode | null; | ||
} | ||
@@ -24,3 +24,7 @@ | ||
export function unstable_runWithPriority<T>(priorityLevel: number, eventHandler: () => T): T; | ||
export function unstable_scheduleCallback(priorityLevel: number, callback: FrameCallbackType, options?: { delay?: number | undefined, timeout?: number | undefined}): CallbackNode; | ||
export function unstable_scheduleCallback( | ||
priorityLevel: number, | ||
callback: FrameCallbackType, | ||
options?: { delay?: number | undefined; timeout?: number | undefined }, | ||
): CallbackNode; | ||
export function unstable_next<T>(eventHandler: () => T): T; | ||
@@ -27,0 +31,0 @@ export function unstable_cancelCallback(callbackNode: CallbackNode): void; |
{ | ||
"name": "@types/scheduler", | ||
"version": "0.16.3", | ||
"version": "0.16.4", | ||
"description": "TypeScript definitions for scheduler", | ||
@@ -28,4 +28,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/scheduler", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "33d8a6caa0110d038d21fa03caf7f899065858878f8ea9acaa7f755a8627732d", | ||
"typeScriptVersion": "4.3" | ||
"typesPublisherContentHash": "95aa381db95b885d52bd28f4ef43293beed4cffd2b1732b8b24ffcf36d510c20", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Wed, 22 Mar 2023 23:02:44 GMT | ||
* Last updated: Mon, 25 Sep 2023 13:39:06 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
@@ -16,81 +16,77 @@ // disable automatic export | ||
export type EnableSchedulerTracing = Build extends { type: infer BuildType } | ||
? BuildType extends "production" | "profiling" | ||
? false | ||
: BuildType extends "development" | ||
? true | ||
? BuildType extends "production" | "profiling" ? false | ||
: BuildType extends "development" ? true | ||
: undefined | ||
: undefined; | ||
: undefined; | ||
type TypeByBuildFlag< | ||
Flag extends boolean | undefined, | ||
WhenTrue, | ||
WhenFalse | ||
> = Flag extends undefined | ||
? (WhenTrue | WhenFalse) | ||
: Flag extends true | ||
? WhenTrue | ||
: WhenFalse; | ||
Flag extends boolean | undefined, | ||
WhenTrue, | ||
WhenFalse, | ||
> = Flag extends undefined ? (WhenTrue | WhenFalse) | ||
: Flag extends true ? WhenTrue | ||
: WhenFalse; | ||
type IfSchedulerTracing<WhenTrue, WhenFalse> = TypeByBuildFlag< | ||
EnableSchedulerTracing, | ||
WhenTrue, | ||
WhenFalse | ||
EnableSchedulerTracing, | ||
WhenTrue, | ||
WhenFalse | ||
>; | ||
export interface Interaction { | ||
__count: number; | ||
id: number; | ||
name: string; | ||
timestamp: number; | ||
__count: number; | ||
id: number; | ||
name: string; | ||
timestamp: number; | ||
} | ||
export interface Subscriber { | ||
/** | ||
* A new interaction has been created via the trace() method. | ||
*/ | ||
onInteractionTraced: (interaction: Interaction) => void; | ||
/** | ||
* A new interaction has been created via the trace() method. | ||
*/ | ||
onInteractionTraced: (interaction: Interaction) => void; | ||
/** | ||
* All scheduled async work for an interaction has finished. | ||
*/ | ||
onInteractionScheduledWorkCompleted: (interaction: Interaction) => void; | ||
/** | ||
* All scheduled async work for an interaction has finished. | ||
*/ | ||
onInteractionScheduledWorkCompleted: (interaction: Interaction) => void; | ||
/** | ||
* New async work has been scheduled for a set of interactions. | ||
* When this work is later run, onWorkStarted/onWorkStopped will be called. | ||
* A batch of async/yieldy work may be scheduled multiple times before completing. | ||
* In that case, onWorkScheduled may be called more than once before onWorkStopped. | ||
* Work is scheduled by a "thread" which is identified by a unique ID. | ||
*/ | ||
onWorkScheduled: (interactions: Set<Interaction>, threadID: number) => void; | ||
/** | ||
* New async work has been scheduled for a set of interactions. | ||
* When this work is later run, onWorkStarted/onWorkStopped will be called. | ||
* A batch of async/yieldy work may be scheduled multiple times before completing. | ||
* In that case, onWorkScheduled may be called more than once before onWorkStopped. | ||
* Work is scheduled by a "thread" which is identified by a unique ID. | ||
*/ | ||
onWorkScheduled: (interactions: Set<Interaction>, threadID: number) => void; | ||
/** | ||
* A batch of scheduled work has been canceled. | ||
* Work is done by a "thread" which is identified by a unique ID. | ||
*/ | ||
onWorkCanceled: (interactions: Set<Interaction>, threadID: number) => void; | ||
/** | ||
* A batch of scheduled work has been canceled. | ||
* Work is done by a "thread" which is identified by a unique ID. | ||
*/ | ||
onWorkCanceled: (interactions: Set<Interaction>, threadID: number) => void; | ||
/** | ||
* A batch of work has started for a set of interactions. | ||
* When this work is complete, onWorkStopped will be called. | ||
* Work is not always completed synchronously; yielding may occur in between. | ||
* A batch of async/yieldy work may also be re-started before completing. | ||
* In that case, onWorkStarted may be called more than once before onWorkStopped. | ||
* Work is done by a "thread" which is identified by a unique ID. | ||
*/ | ||
onWorkStarted: (interactions: Set<Interaction>, threadID: number) => void; | ||
/** | ||
* A batch of work has started for a set of interactions. | ||
* When this work is complete, onWorkStopped will be called. | ||
* Work is not always completed synchronously; yielding may occur in between. | ||
* A batch of async/yieldy work may also be re-started before completing. | ||
* In that case, onWorkStarted may be called more than once before onWorkStopped. | ||
* Work is done by a "thread" which is identified by a unique ID. | ||
*/ | ||
onWorkStarted: (interactions: Set<Interaction>, threadID: number) => void; | ||
/** | ||
* A batch of work has completed for a set of interactions. | ||
* Work is done by a "thread" which is identified by a unique ID. | ||
*/ | ||
onWorkStopped: (interactions: Set<Interaction>, threadID: number) => void; | ||
/** | ||
* A batch of work has completed for a set of interactions. | ||
* Work is done by a "thread" which is identified by a unique ID. | ||
*/ | ||
onWorkStopped: (interactions: Set<Interaction>, threadID: number) => void; | ||
} | ||
export interface InteractionsRef { | ||
current: Set<Interaction>; | ||
current: Set<Interaction>; | ||
} | ||
export interface SubscriberRef { | ||
current: Subscriber | null; | ||
current: Subscriber | null; | ||
} | ||
@@ -108,10 +104,10 @@ | ||
export function unstable_trace<T>( | ||
name: string, | ||
timestamp: number, | ||
callback: () => T, | ||
threadID?: number | ||
name: string, | ||
timestamp: number, | ||
callback: () => T, | ||
threadID?: number, | ||
): T; | ||
export type WrappedFunction<T extends (...args: any[]) => any> = T & { | ||
cancel: () => void; | ||
cancel: () => void; | ||
}; | ||
@@ -127,4 +123,4 @@ | ||
export function unstable_wrap<T extends (...args: any[]) => any>( | ||
callback: T, | ||
threadID?: number | ||
callback: T, | ||
threadID?: number, | ||
): IfSchedulerTracing<WrappedFunction<T>, T>; | ||
@@ -131,0 +127,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8496