Skip to content

Commit

Permalink
fix: add missing types for parseDataPath function (#2527)
Browse files Browse the repository at this point in the history
Types references were copied from the original repository, but type definitions were not. This fixes that.
  • Loading branch information
wojtekmaj authored Jan 19, 2024
1 parent 64f7bba commit 7403b21
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/pdfkit/src/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7403b21

Please sign in to comment.