Reproduction:
import { createCanvas } from 'https://deno.land/x/canvas@v1.4.1/mod.ts';
const canvas = createCanvas(300, 100);
const ctx = canvas.getContext('2d');
ctx.canvas; // null
It matters because I want to be able to pass the ctx into other functions and be able to get the canvas.
According to mdn it can be null if there's no associated canvas. But in TypeScript it's never null.
Reproduction:
It matters because I want to be able to pass the
ctxinto other functions and be able to get the canvas.According to mdn it can be null if there's no associated canvas. But in TypeScript it's never null.