Package-level declarations

Types

Link copied to clipboard
open class IdleDeadline

The IdleDeadline interface is used as the data type of the input parameter to idle callbacks established by calling Window.requestIdleCallback().

Link copied to clipboard
typealias IdleRequestCallback = (deadline: IdleDeadline) -> Unit
Link copied to clipboard
sealed interface IdleRequestId
Link copied to clipboard
Link copied to clipboard
open class Scheduler

The Scheduler interface of the Prioritized Task Scheduling API provides methods for scheduling prioritized tasks.

Link copied to clipboard
typealias SchedulerPostTaskCallback<T> = () -> T
Link copied to clipboard
Link copied to clipboard
open class TaskController(init: TaskControllerInit = definedExternally) : AbortController

The TaskController interface of the Prioritized Task Scheduling API represents a controller object that can be used to both abort and change the priority of one or more prioritized tasks.

Link copied to clipboard
Link copied to clipboard
sealed interface TaskPriority
Link copied to clipboard

The TaskPriorityChangeEvent is the interface for the prioritychange event.

Link copied to clipboard
open class TaskSignal : AbortSignal

The TaskSignal interface of the Prioritized Task Scheduling API represents a signal object that allows you to communicate with a prioritized task, and abort it or change the priority (if required) via a TaskController object.

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
suspend fun awaitIdleCallback(options: IdleRequestOptions? = null): IdleDeadline
Link copied to clipboard

The window.cancelIdleCallback() method cancels a callback previously scheduled with window.requestIdleCallback().

Link copied to clipboard
suspend fun <T : JsAny?> Scheduler.postTask(callback: SchedulerPostTaskCallback<T>): T

The postTask() method of the Scheduler interface is used for adding tasks to be scheduled according to their priority.

Link copied to clipboard
external fun requestIdleCallback(callback: IdleRequestCallback, options: IdleRequestOptions? = definedExternally): IdleRequestId

The window.requestIdleCallback() method queues a function to be called during a browser's idle periods.

Link copied to clipboard
inline suspend fun Scheduler.yield()

The yield() method of the Scheduler interface is used for yielding to the main thread during a task and continuing execution later, with the continuation scheduled as a prioritized task (see the Prioritized Task Scheduling API for more information).