From 7403b216029995bc86b6a14a795e6f43b88ff967 Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Fri, 19 Jan 2024 18:08:37 +0100 Subject: [PATCH] fix: add missing types for parseDataPath function (#2527) Types references were copied from the original repository, but type definitions were not. This fixes that. --- packages/pdfkit/src/path.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/pdfkit/src/path.js b/packages/pdfkit/src/path.js index 464a685b4..6f061700c 100644 --- a/packages/pdfkit/src/path.js +++ b/packages/pdfkit/src/path.js @@ -6,6 +6,16 @@ cx = cy = px = py = sx = sy = 0; // parseDataPath copy pasted from svgo // https://github.com/svg/svgo/blob/e4918ccdd1a2b5831defe0f00c1286744b479448/lib/path.js +/** + * @typedef {'M' | 'm' | 'Z' | 'z' | 'L' | 'l' | 'H' | 'h' | 'V' | 'v' | 'C' | 'c' | 'S' | 's' | 'Q' | 'q' | 'T' | 't' | 'A' | 'a'} PathDataCommand + */ + +/** + * @typedef {Object} PathDataItem + * @property {PathDataCommand} command + * @property {number[]} args + */ + const argsCountPerCommand = { M: 2, m: 2,