Add types for highlightjs (#37203)

This commit is contained in:
Florian Keller 2019-08-05 19:56:52 +02:00 committed by Jesse Trinity
parent 60ecb72de2
commit 023221aaa8
4 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,9 @@
import hljs = require('highlightjs');
const code = "using System;\npublic class Test\n{\npublic static void Main()\n{\n// your code goes here\n}\n}";
const lang = "cs";
hljs.configure({ tabReplace: " " }); // 4 spaces
let hl = hljs.highlight(lang, code).value;
hl = hljs.highlightAuto(code).value;

7
types/highlightjs/index.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
// Type definitions for highlightjs 9.12
// Project: https://github.com/isagalaev/highlight.js
// Definitions by: Florian Keller <https://github.com/ffflorian>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import highlightjs = require('highlight.js');
export = highlightjs;

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",
"highlightjs-tests.ts"
]
}

View File

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