@types/parse-svg-path 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- parse-svg-path/LICENSE +21 -0
- parse-svg-path/README.md +48 -0
- parse-svg-path/index.d.ts +29 -0
- parse-svg-path/package.json +26 -0
parse-svg-path/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE
|
parse-svg-path/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
> `npm install --save @types/parse-svg-path`
|
|
3
|
+
|
|
4
|
+
# Summary
|
|
5
|
+
This package contains type definitions for parse-svg-path (https://github.com/jkroso/parse-svg-path).
|
|
6
|
+
|
|
7
|
+
# Details
|
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse-svg-path.
|
|
9
|
+
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse-svg-path/index.d.ts)
|
|
10
|
+
````ts
|
|
11
|
+
/**
|
|
12
|
+
* A parsed SVG path command.
|
|
13
|
+
* First element is the command letter (M, L, C, etc.), followed by numeric arguments.
|
|
14
|
+
*/
|
|
15
|
+
type PathCommand = [string, ...number[]];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Parse an SVG path data string into an array of commands.
|
|
19
|
+
*
|
|
20
|
+
* Each command is an array where the first element is the command letter
|
|
21
|
+
* and the remaining elements are the numeric arguments.
|
|
22
|
+
*
|
|
23
|
+
* @param path - SVG path data string (e.g., "M0 0 L10 10")
|
|
24
|
+
* @returns Array of parsed commands
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```javascript
|
|
28
|
+
* const parse = require('parse-svg-path');
|
|
29
|
+
*
|
|
30
|
+
* parse('M0 0 L10 10 Z');
|
|
31
|
+
* // => [['M', 0, 0], ['L', 10, 10], ['Z']]
|
|
32
|
+
*
|
|
33
|
+
* parse('m10 10 h5 v5');
|
|
34
|
+
* // => [['m', 10, 10], ['h', 5], ['v', 5]]
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare function parse(path: string): PathCommand[];
|
|
38
|
+
|
|
39
|
+
export = parse;
|
|
40
|
+
|
|
41
|
+
````
|
|
42
|
+
|
|
43
|
+
### Additional Details
|
|
44
|
+
* Last updated: Thu, 05 Feb 2026 08:45:22 GMT
|
|
45
|
+
* Dependencies: none
|
|
46
|
+
|
|
47
|
+
# Credits
|
|
48
|
+
These definitions were written by [gaspard](https://github.com/gasp).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A parsed SVG path command.
|
|
3
|
+
* First element is the command letter (M, L, C, etc.), followed by numeric arguments.
|
|
4
|
+
*/
|
|
5
|
+
type PathCommand = [string, ...number[]];
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Parse an SVG path data string into an array of commands.
|
|
9
|
+
*
|
|
10
|
+
* Each command is an array where the first element is the command letter
|
|
11
|
+
* and the remaining elements are the numeric arguments.
|
|
12
|
+
*
|
|
13
|
+
* @param path - SVG path data string (e.g., "M0 0 L10 10")
|
|
14
|
+
* @returns Array of parsed commands
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```javascript
|
|
18
|
+
* const parse = require('parse-svg-path');
|
|
19
|
+
*
|
|
20
|
+
* parse('M0 0 L10 10 Z');
|
|
21
|
+
* // => [['M', 0, 0], ['L', 10, 10], ['Z']]
|
|
22
|
+
*
|
|
23
|
+
* parse('m10 10 h5 v5');
|
|
24
|
+
* // => [['m', 10, 10], ['h', 5], ['v', 5]]
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare function parse(path: string): PathCommand[];
|
|
28
|
+
|
|
29
|
+
export = parse;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@types/parse-svg-path",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "TypeScript definitions for parse-svg-path",
|
|
5
|
+
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse-svg-path",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"contributors": [
|
|
8
|
+
{
|
|
9
|
+
"name": "gaspard",
|
|
10
|
+
"githubUsername": "gasp",
|
|
11
|
+
"url": "https://github.com/gasp"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"main": "",
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
19
|
+
"directory": "types/parse-svg-path"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {},
|
|
22
|
+
"dependencies": {},
|
|
23
|
+
"peerDependencies": {},
|
|
24
|
+
"typesPublisherContentHash": "faf909df571eced185c4c07b66c28efbd98d5ee3d9c444e80d4bedb400b3af4e",
|
|
25
|
+
"typeScriptVersion": "5.2"
|
|
26
|
+
}
|