mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add types for highlightjs (#37203)
This commit is contained in:
parent
60ecb72de2
commit
023221aaa8
9
types/highlightjs/highlightjs-tests.ts
Normal file
9
types/highlightjs/highlightjs-tests.ts
Normal 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
7
types/highlightjs/index.d.ts
vendored
Normal 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;
|
||||
23
types/highlightjs/tsconfig.json
Normal file
23
types/highlightjs/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/highlightjs/tslint.json
Normal file
1
types/highlightjs/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user