From d4969272cde23438f97891462f9cfd13da27bcd3 Mon Sep 17 00:00:00 2001 From: karashiiro <49822414+karashiiro@users.noreply.github.com> Date: Mon, 31 May 2021 11:46:10 -0700 Subject: [PATCH] Add proper type annotations for canvasSize --- create-card.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/create-card.js b/create-card.js index 1863365..18fddbc 100644 --- a/create-card.js +++ b/create-card.js @@ -2,6 +2,12 @@ const fetch = require("node-fetch"); const path = require("path"); 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) { return path.join(__dirname, relativePath); } @@ -90,6 +96,7 @@ class CardCreator { /** * The canvas's dimensions. + * @type {CardCreator~CanvasDimensions} */ get canvasSize() { return {