Skip to content

Canvaslike

type Canvaslike = {
clientHeight?: number;
clientWidth?: number;
height: number;
style?: {
height: string;
width: string;
};
width: number;
getContext: | CanvaslikeRenderingContext2D
| null;
};

Any Canvas-like interface. We’ve typed it minimally so that server based canvas implementations don’t complain.

PropertyType
clientHeight?number
clientWidth?number
heightnumber
style?{ height: string; width: string; }
style.heightstring
style.widthstring
widthnumber
getContext(type: "2d", options?: {
alpha?: boolean;
}):
| CanvaslikeRenderingContext2D
| null;
ParameterType
type"2d"
options?{ alpha?: boolean; }
options.alpha?boolean

| CanvaslikeRenderingContext2D | null