WindowOrWorkerGlobalScope.idl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. // https://html.spec.whatwg.org/#timerhandler
  9. typedef (DOMString or Function) TimerHandler;
  10. // https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
  11. interface mixin WindowOrWorkerGlobalScope {
  12. [Replaceable] readonly attribute USVString origin;
  13. readonly attribute boolean isSecureContext;
  14. readonly attribute boolean crossOriginIsolated;
  15. // https://html.spec.whatwg.org/multipage/webappapis.html#dom-reporterror
  16. undefined reportError(any e);
  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. // ImageBitmap
  23. Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options = {});
  24. Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options = {});
  25. // https://fetch.spec.whatwg.org/#fetch-method
  26. [NewObject] Promise<Response> fetch(RequestInfo input, optional RequestInit init = {});
  27. // https://w3c.github.io/hr-time/#the-performance-attribute
  28. [Replaceable] readonly attribute Performance performance;
  29. // https://w3c.github.io/IndexedDB/#factory-interface
  30. [SameObject] readonly attribute IDBFactory indexedDB;
  31. // https://w3c.github.io/webcrypto/#crypto-interface
  32. [SameObject] readonly attribute Crypto crypto;
  33. };