@mocanvas/editor · interface

TLEnvironment

interface TLEnvironment

Fixed facts about the browser and platform, detected once at load.


Properties · 8

hasCanvasSupport: boolean

Whether raster export can work at all: Promise and HTMLCanvasElement both exist.

isAndroid: boolean
isChromeForIos: boolean
isDarwin: boolean

macOS, iOS included — i.e. "the accelerator key is Cmd".

isFirefox: boolean
isIos: boolean

iPad or iPhone.

isSafari: boolean

Safari proper. Chrome and Firefox on iOS are WebKit but are *not* Safari.

isTouchDevice: boolean

Whether the *hardware* has a touch screen. Stays true on a touchscreen laptop while a mouse is in use — for the pointer actually in use read TLReactiveEnvironment.isCoarsePointer.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.