diff --git a/types/svg-parser/index.d.ts b/types/svg-parser/index.d.ts new file mode 100644 index 0000000000..4d3bdad0e1 --- /dev/null +++ b/types/svg-parser/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for svg-parser 1.0 +// Project: https://gitlab.com/Rich-Harris/svg-parser#README +// Definitions by: mrmlnc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export interface Node { + name: string; + attributes: Record; + children: Node[]; + metadata?: string; +} + +export function parse(content: string): Node; diff --git a/types/svg-parser/svg-parser-tests.ts b/types/svg-parser/svg-parser-tests.ts new file mode 100644 index 0000000000..47c53b8db9 --- /dev/null +++ b/types/svg-parser/svg-parser-tests.ts @@ -0,0 +1,4 @@ +import * as parser from 'svg-parser'; + +// $ExpectType Node +parser.parse(''); diff --git a/types/svg-parser/tsconfig.json b/types/svg-parser/tsconfig.json new file mode 100644 index 0000000000..c24afbd999 --- /dev/null +++ b/types/svg-parser/tsconfig.json @@ -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" + ] +} diff --git a/types/svg-parser/tslint.json b/types/svg-parser/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/svg-parser/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }