import type { IntBuffer } from "@thi.ng/pixel" ; import type { NumOrElement } from "@thi.ng/rdom" ; import { Component } from "@thi.ng/rdom/component" ; export class PixelCanvas extends Component { constructor ( protected buffer ) { super ( ) ; } async mount ( parent , index ? ) { const buf = this . buffer ; this . el = this . $el ( "canvas" , { width : buf . width , height : buf . height , class : "dib v-top" } , null , parent , index ) ; buf . blitCanvas ( < HTMLCanvasElement > this . el ) ; return this . el ; } }