2023-03-07 18:15:52 +00:00
#import <Fetch/Request.idl>
#import <Fetch/Response.idl>
2023-03-07 18:21:49 +00:00
#import <HTML/MessagePort.idl>
2023-03-07 18:15:52 +00:00
2023-03-07 18:25:18 +00:00
// FIXME: Support VoidFunction in the IDL parser
callback VoidFunction = undefined ();
2023-03-14 07:28:08 -04:00
// https://html.spec.whatwg.org/#timerhandler
typedef (DOMString or Function) TimerHandler;
2022-07-27 20:36:21 +01:00
// https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
interface mixin WindowOrWorkerGlobalScope {
[Replaceable] readonly attribute USVString origin;
readonly attribute boolean isSecureContext;
readonly attribute boolean crossOriginIsolated;
// FIXME: undefined reportError(any e);
// base64 utility methods
DOMString btoa(DOMString data);
ByteString atob(DOMString data);
// timers
2023-03-14 07:28:08 -04:00
long setTimeout(TimerHandler handler, optional long timeout = 0, any... arguments);
undefined clearTimeout(optional long id = 0);
long setInterval(TimerHandler handler, optional long timeout = 0, any... arguments);
undefined clearInterval(optional long id = 0);
2022-07-27 20:36:21 +01:00
// microtask queuing
2023-03-07 18:25:18 +00:00
undefined queueMicrotask(VoidFunction callback);
2022-07-27 20:36:21 +01:00
// ImageBitmap
// FIXME: Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options = {});
// FIXME: Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options = {});
// structured cloning
2023-03-07 18:21:49 +00:00
any structuredClone(any value, optional StructuredSerializeOptions options = {});
2023-03-07 18:15:52 +00:00
// https://fetch.spec.whatwg.org/#fetch-method
[NewObject] Promise<Response> fetch(RequestInfo input, optional RequestInit init = {});
2022-07-27 20:36:21 +01:00
};