From 2086a14ba0898071f22295c438713fe4dbbfad26 Mon Sep 17 00:00:00 2001 From: Max Knor Date: Sat, 22 Sep 2018 11:04:18 +0200 Subject: [PATCH 1/3] Added declarations for MarkdownIt-Lazy-Headers project --- types/markdown-it-lazy-headers/index.d.ts | 11 +++++++++ .../markdown-it-lazyheaders-tests.ts | 13 +++++++++++ types/markdown-it-lazy-headers/tsconfig.json | 23 +++++++++++++++++++ types/markdown-it-lazy-headers/tslint.json | 1 + 4 files changed, 48 insertions(+) create mode 100644 types/markdown-it-lazy-headers/index.d.ts create mode 100644 types/markdown-it-lazy-headers/markdown-it-lazyheaders-tests.ts create mode 100644 types/markdown-it-lazy-headers/tsconfig.json create mode 100644 types/markdown-it-lazy-headers/tslint.json diff --git a/types/markdown-it-lazy-headers/index.d.ts b/types/markdown-it-lazy-headers/index.d.ts new file mode 100644 index 0000000000..cde0f0f315 --- /dev/null +++ b/types/markdown-it-lazy-headers/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for MarkdownItLazyHeaders (markdown-it-lazy-headers) 0.13 +// Project: https://github.com/Galadirith/markdown-it-lazy-headers +// Definitions by: Knom +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { MarkdownIt, Core, Token } from 'markdown-it'; + +declare function lazyheaders(md: MarkdownIt): void; + +export = lazyheaders; diff --git a/types/markdown-it-lazy-headers/markdown-it-lazyheaders-tests.ts b/types/markdown-it-lazy-headers/markdown-it-lazyheaders-tests.ts new file mode 100644 index 0000000000..27230bfe1b --- /dev/null +++ b/types/markdown-it-lazy-headers/markdown-it-lazyheaders-tests.ts @@ -0,0 +1,13 @@ +import * as MarkdownIt from "markdown-it"; +import lazyHeaders = require("markdown-it-lazy-headers"); + +const md = new MarkdownIt(); + +md.use(lazyHeaders); + +const src = `# First header +Lorem ipsum. +## Next section! +This is totaly awesome.`; + +md.render(src); diff --git a/types/markdown-it-lazy-headers/tsconfig.json b/types/markdown-it-lazy-headers/tsconfig.json new file mode 100644 index 0000000000..353603784a --- /dev/null +++ b/types/markdown-it-lazy-headers/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", + "markdown-it-lazyheaders-tests.ts" + ] +} \ No newline at end of file diff --git a/types/markdown-it-lazy-headers/tslint.json b/types/markdown-it-lazy-headers/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/markdown-it-lazy-headers/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From d68aa4bbc6daf72f1ce6d0c69f594cc9ea4e0ff0 Mon Sep 17 00:00:00 2001 From: Max Knor Date: Sat, 22 Sep 2018 11:23:48 +0200 Subject: [PATCH 2/3] Changed filename of tests.ts --- ...t-lazyheaders-tests.ts => markdown-it-lazy-headers-tests.ts} | 0 types/markdown-it-lazy-headers/tsconfig.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename types/markdown-it-lazy-headers/{markdown-it-lazyheaders-tests.ts => markdown-it-lazy-headers-tests.ts} (100%) diff --git a/types/markdown-it-lazy-headers/markdown-it-lazyheaders-tests.ts b/types/markdown-it-lazy-headers/markdown-it-lazy-headers-tests.ts similarity index 100% rename from types/markdown-it-lazy-headers/markdown-it-lazyheaders-tests.ts rename to types/markdown-it-lazy-headers/markdown-it-lazy-headers-tests.ts diff --git a/types/markdown-it-lazy-headers/tsconfig.json b/types/markdown-it-lazy-headers/tsconfig.json index 353603784a..96e39b5ffe 100644 --- a/types/markdown-it-lazy-headers/tsconfig.json +++ b/types/markdown-it-lazy-headers/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "markdown-it-lazyheaders-tests.ts" + "markdown-it-lazy-headers-tests.ts" ] } \ No newline at end of file From a99074a2825fcc306f55a19ac1c214f0652a8fa2 Mon Sep 17 00:00:00 2001 From: knom Date: Wed, 26 Sep 2018 22:52:23 +0200 Subject: [PATCH 3/3] Fixed issues around wrong and unnecessary imports --- types/markdown-it-lazy-headers/index.d.ts | 2 +- .../markdown-it-lazy-headers/markdown-it-lazy-headers-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/markdown-it-lazy-headers/index.d.ts b/types/markdown-it-lazy-headers/index.d.ts index cde0f0f315..9eb8a54cf1 100644 --- a/types/markdown-it-lazy-headers/index.d.ts +++ b/types/markdown-it-lazy-headers/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -import { MarkdownIt, Core, Token } from 'markdown-it'; +import { MarkdownIt } from 'markdown-it'; declare function lazyheaders(md: MarkdownIt): void; diff --git a/types/markdown-it-lazy-headers/markdown-it-lazy-headers-tests.ts b/types/markdown-it-lazy-headers/markdown-it-lazy-headers-tests.ts index 27230bfe1b..4957dbadf8 100644 --- a/types/markdown-it-lazy-headers/markdown-it-lazy-headers-tests.ts +++ b/types/markdown-it-lazy-headers/markdown-it-lazy-headers-tests.ts @@ -1,4 +1,4 @@ -import * as MarkdownIt from "markdown-it"; +import MarkdownIt = require("markdown-it"); import lazyHeaders = require("markdown-it-lazy-headers"); const md = new MarkdownIt();