index.d.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. Check if the code is running in a web browser environment.
  3. */
  4. export const isBrowser: boolean;
  5. /**
  6. Check if the code is running in a [Node.js](https://nodejs.org) environment.
  7. */
  8. export const isNode: boolean;
  9. /**
  10. Check if the code is running in a [Bun](https://bun.sh) environment.
  11. */
  12. export const isBun: boolean;
  13. /**
  14. Check if the code is running in a Deno environment.
  15. */
  16. export const isDeno: boolean;
  17. /**
  18. Check if the code is running in an Electron environment.
  19. */
  20. export const isElectron: boolean;
  21. /**
  22. Check if the code is running in a [jsdom](https://github.com/jsdom/jsdom) environment.
  23. */
  24. export const isJsDom: boolean;
  25. /**
  26. Check if the code is running in a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API#worker_global_contexts_and_functions) environment, which could be either a dedicated worker, shared worker, or service worker.
  27. */
  28. export const isWebWorker: boolean;
  29. /**
  30. Check if the code is running in a [Dedicated Worker](https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope) environment.
  31. */
  32. export const isDedicatedWorker: boolean;
  33. /**
  34. Check if the code is running in a [Shared Worker](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorkerGlobalScope) environment.
  35. */
  36. export const isSharedWorker: boolean;
  37. /**
  38. Check if the code is running in a [Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope) environment.
  39. */
  40. export const isServiceWorker: boolean;
  41. /**
  42. Check if the code is running on macOS.
  43. */
  44. export const isMacOs: boolean;
  45. /**
  46. Check if the code is running on Windows.
  47. */
  48. export const isWindows: boolean;
  49. /**
  50. Check if the code is running on Linux.
  51. */
  52. export const isLinux: boolean;
  53. /**
  54. Check if the code is running on iOS.
  55. */
  56. export const isIos: boolean;
  57. /**
  58. Check if the code is running on Android.
  59. */
  60. export const isAndroid: boolean;