Skip to content
Mondrian

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.

Property Type
clientHeight? number
clientWidth? number
height number
style? { height: string; width: string; }
style.height string
style.width string
width number
getContext(type: "2d", options?: {
alpha?: boolean;
}):
| CanvaslikeRenderingContext2D
| null;
Parameter Type
type "2d"
options? { alpha?: boolean; }
options.alpha? boolean

| CanvaslikeRenderingContext2D | null