Victor Porof | 6e09692 | 2022-06-10 13:01:05 +0000 | [diff] [blame] | 1 | // GENERATED CONTENT - DO NOT EDIT |
| 2 | // Content was automatically extracted by Reffy into webref |
| 3 | // (https://github.com/w3c/webref) |
| 4 | // Source: Prioritized Task Scheduling (https://wicg.github.io/scheduling-apis/) |
| 5 | |
| 6 | enum TaskPriority { |
| 7 | "user-blocking", |
| 8 | "user-visible", |
| 9 | "background" |
| 10 | }; |
| 11 | |
| 12 | dictionary SchedulerPostTaskOptions { |
| 13 | AbortSignal signal; |
| 14 | TaskPriority priority; |
| 15 | [EnforceRange] unsigned long long delay = 0; |
| 16 | }; |
| 17 | |
| 18 | callback SchedulerPostTaskCallback = any (); |
| 19 | |
| 20 | [Exposed=(Window, Worker)] |
| 21 | interface Scheduler { |
| 22 | Promise<any> postTask(SchedulerPostTaskCallback callback, |
| 23 | optional SchedulerPostTaskOptions options = {}); |
| 24 | }; |
| 25 | |
| 26 | [Exposed=(Window, Worker)] |
| 27 | interface TaskPriorityChangeEvent : Event { |
| 28 | constructor(DOMString type, TaskPriorityChangeEventInit priorityChangeEventInitDict); |
| 29 | |
| 30 | readonly attribute TaskPriority previousPriority; |
| 31 | }; |
| 32 | |
| 33 | dictionary TaskPriorityChangeEventInit : EventInit { |
| 34 | required TaskPriority previousPriority; |
| 35 | }; |
| 36 | |
| 37 | dictionary TaskControllerInit { |
| 38 | TaskPriority priority = "user-visible"; |
| 39 | }; |
| 40 | |
| 41 | [Exposed=(Window,Worker)] |
| 42 | interface TaskController : AbortController { |
| 43 | constructor(optional TaskControllerInit init = {}); |
| 44 | |
| 45 | undefined setPriority(TaskPriority priority); |
| 46 | }; |
| 47 | |
| 48 | [Exposed=(Window, Worker)] |
| 49 | interface TaskSignal : AbortSignal { |
| 50 | readonly attribute TaskPriority priority; |
| 51 | |
| 52 | attribute EventHandler onprioritychange; |
| 53 | }; |
| 54 | |
| 55 | partial interface mixin WindowOrWorkerGlobalScope { |
| 56 | [Replaceable] readonly attribute Scheduler scheduler; |
| 57 | }; |