(canvas: SupportedCanvas)
| 38 | |
| 39 | /** Reliable type guard - instanceof works in workers where HTMLCanvasElement is undefined. */ |
| 40 | export function isHTMLCanvasElement(canvas: SupportedCanvas): canvas is HTMLCanvasElement { |
| 41 | return typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement; |
| 42 | } |
| 43 | |
| 44 | /** Gets display dimensions - clientWidth/Height for HTMLCanvasElement, width/height for OffscreenCanvas. */ |
| 45 | function getCanvasDimensions(canvas: SupportedCanvas): { width: number; height: number } { |
no outgoing calls
no test coverage detected