Add proper type annotations for canvasSize

This commit is contained in:
karashiiro 2021-05-31 11:46:10 -07:00
parent 1e6aeda945
commit d4969272cd

View file

@ -2,6 +2,12 @@ const fetch = require("node-fetch");
const path = require("path"); const path = require("path");
const { createCanvas, loadImage, registerFont } = require("canvas"); const { createCanvas, loadImage, registerFont } = require("canvas");
/**
* @typedef {Object} CardCreator~CanvasDimensions
* @property {number} width The width of the canvas.
* @property {number} height The height of the canvas.
*/
function absolute(relativePath) { function absolute(relativePath) {
return path.join(__dirname, relativePath); return path.join(__dirname, relativePath);
} }
@ -90,6 +96,7 @@ class CardCreator {
/** /**
* The canvas's dimensions. * The canvas's dimensions.
* @type {CardCreator~CanvasDimensions}
*/ */
get canvasSize() { get canvasSize() {
return { return {