🤖 Merge PR #65825 [markdown-it-source-map] Add types by @feliskio

* [markdown-it-source-map] Add types

* Export as default
This commit is contained in:
Felix Wotschofsky
2023-06-23 20:03:32 +02:00
committed by GitHub
parent ac95fe6086
commit b8255df610
4 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
// Type definitions for markdown-it-source-map 0.1
// Project: https://github.com/tylingsoft/markdown-it-source-map#readme
// Definitions by: Felix Wotschofsky <https://github.com/feliskio>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import MarkdownIt = require('markdown-it');
declare const markdownItSourceMap: MarkdownIt.PluginSimple;
export default markdownItSourceMap;

View File

@@ -0,0 +1,10 @@
// From original package README
// https://github.com/tylingsoft/markdown-it-source-map/blob/b5c374465ebd2a182b90720b99809f4c1b48b178/README.md
import * as markdownIt from 'markdown-it';
import markdownItSourceMap from 'markdown-it-source-map';
const mdi = markdownIt();
mdi.use(markdownItSourceMap);
mdi.render('# hello world'); // <h1 data-source-line="1">hello world</h1>

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"markdown-it-source-map-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "@definitelytyped/dtslint/dt.json" }