Skip to content

Commit

Permalink
Add getCanvas() as part of Canvas class (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
bogoshipda authored Jan 2, 2024
1 parent 62243ed commit a2bb722
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/util/Canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export class Canvas {
return (this._canvas as HTMLCanvasElement).width
}

public getCanvas (): HTMLCanvasElement | InstanceType<typeof Jimp> {
return this._canvas;
}

public getBufferAsync (mime: string): Promise<Uint8Array> {
if (typeof window === 'undefined') {
return (this._canvas as InstanceType<typeof Jimp>).getBufferAsync(mime)
Expand Down

0 comments on commit a2bb722

Please sign in to comment.