Skip to content

Truly independent web browser

1.4 KB
Raw Blame
// https://html.spec.whatwg.org/multipage/webappapis.html#timerhandler
typedef (DOMString or Function or TrustedScript) TimerHandler;

// FIXME: Support VoidFunction in the IDL parser
callback VoidFunction = undefined ();

// 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;

    undefined reportError(any e);

    // base64 utility methods
    DOMString btoa(DOMString data);
    ByteString atob(DOMString data);

    // timers
    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);

    // microtask queuing
    undefined queueMicrotask(VoidFunction callback);

    // ImageBitmap
    [CreatesPromise] Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options = {});
    [CreatesPromise] Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options = {});

    // structured cloning
    any structuredClone(any value, optional StructuredSerializeOptions options = {});
};