import { type EmulatedCanvas2D } from "https://deno.land/x/canvaseno@v1.0.2/mod.ts";
Methods
decodeImage(bytes: ArrayBuffer | Uint8Array): SkImage
Decodes an image with the given bytes.
getContext(type: "2d"): EmulatedCanvas2DContext
Returns an emulated canvas2d context if type == '2d', null otherwise.
null is not added as return type here, but '2d' is the ONLY valid context here.
Loads the given font with the given descriptors. Emulates new FontFace().
Registers a font into Canvas. (node-canvas compatibility)
makePath2D(str?: string): EmulatedPath2D
Returns an new emulated Path2D object.
Returns the current canvas as a base64 encoded image string.
toBuffer(options: BufferOptions & { buffer: true; }): Buffer
Returns Buffer containing Image data.
toBuffer(options?: BufferOptions & { buffer?: false; }): Uint8Array
toBuffer(options?: BufferOptions): Uint8Array | Buffer