WindowOrWorkerGlobalScope.idl 2.0 KB

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