WindowOrWorkerGlobalScope.idl 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #import <Fetch/Request.idl>
  2. #import <Fetch/Response.idl>
  3. #import <HTML/MessagePort.idl>
  4. // FIXME: Support VoidFunction in the IDL parser
  5. callback VoidFunction = undefined ();
  6. // https://html.spec.whatwg.org/#timerhandler
  7. typedef (DOMString or Function) TimerHandler;
  8. // https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
  9. interface mixin WindowOrWorkerGlobalScope {
  10. [Replaceable] readonly attribute USVString origin;
  11. readonly attribute boolean isSecureContext;
  12. readonly attribute boolean crossOriginIsolated;
  13. // FIXME: undefined reportError(any e);
  14. // base64 utility methods
  15. DOMString btoa(DOMString data);
  16. ByteString atob(DOMString data);
  17. // timers
  18. long setTimeout(TimerHandler handler, optional long timeout = 0, any... arguments);
  19. undefined clearTimeout(optional long id = 0);
  20. long setInterval(TimerHandler handler, optional long timeout = 0, any... arguments);
  21. undefined clearInterval(optional long id = 0);
  22. // microtask queuing
  23. undefined queueMicrotask(VoidFunction callback);
  24. // ImageBitmap
  25. // FIXME: Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options = {});
  26. // FIXME: Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options = {});
  27. // structured cloning
  28. any structuredClone(any value, optional StructuredSerializeOptions options = {});
  29. // https://fetch.spec.whatwg.org/#fetch-method
  30. [NewObject] Promise<Response> fetch(RequestInfo input, optional RequestInit init = {});
  31. };