From 1af286a1ed4abce20d5fe29ff97f168a119dcb87 Mon Sep 17 00:00:00 2001 From: Denis Malinochkin Date: Sun, 12 Nov 2017 00:54:52 +0300 Subject: [PATCH] feat(types): Add typings for "svg-parser" package --- types/svg-parser/index.d.ts | 14 ++++++++++++++ types/svg-parser/svg-parser-tests.ts | 4 ++++ types/svg-parser/tsconfig.json | 23 +++++++++++++++++++++++ types/svg-parser/tslint.json | 1 + 4 files changed, 42 insertions(+) create mode 100644 types/svg-parser/index.d.ts create mode 100644 types/svg-parser/svg-parser-tests.ts create mode 100644 types/svg-parser/tsconfig.json create mode 100644 types/svg-parser/tslint.json 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" }