WindowOrWorkerGlobalScope.idl 2.1 KB

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