@types/parse-svg-path
v0.1.0
Published
TypeScript definitions for parse-svg-path
Downloads
1,236
Readme
Installation
npm install --save @types/parse-svg-path
Summary
This package contains type definitions for parse-svg-path (https://github.com/jkroso/parse-svg-path).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse-svg-path.
index.d.ts
/**
* A parsed SVG path command.
* First element is the command letter (M, L, C, etc.), followed by numeric arguments.
*/
type PathCommand = [string, ...number[]];
/**
* Parse an SVG path data string into an array of commands.
*
* Each command is an array where the first element is the command letter
* and the remaining elements are the numeric arguments.
*
* @param path - SVG path data string (e.g., "M0 0 L10 10")
* @returns Array of parsed commands
*
* @example
* ```javascript
* const parse = require('parse-svg-path');
*
* parse('M0 0 L10 10 Z');
* // => [['M', 0, 0], ['L', 10, 10], ['Z']]
*
* parse('m10 10 h5 v5');
* // => [['m', 10, 10], ['h', 5], ['v', 5]]
* ```
*/
declare function parse(path: string): PathCommand[];
export = parse;
Additional Details
- Last updated: Thu, 05 Feb 2026 08:45:22 GMT
- Dependencies: none
Credits
These definitions were written by gaspard.
