mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Merge pull request #21442 from mrmlnc/svg_parser
[svg-parser] Add typings for "svg-parser" package
This commit is contained in:
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// Type definitions for svg-parser 1.0
|
||||
// Project: https://gitlab.com/Rich-Harris/svg-parser#README
|
||||
// Definitions by: mrmlnc <https://github.com/mrmlnc>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export interface Node {
|
||||
name: string;
|
||||
attributes: Record<string, string | number>;
|
||||
children: Node[];
|
||||
metadata?: string;
|
||||
}
|
||||
|
||||
export function parse(content: string): Node;
|
||||
@@ -0,0 +1,4 @@
|
||||
import * as parser from 'svg-parser';
|
||||
|
||||
// $ExpectType Node
|
||||
parser.parse('<svg></svg>');
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"svg-parser-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user