Skip to content

Commit a81c646

Browse files
authoredApr 24, 2020
Merge pull request #77 from rburns/type-annotations
Type annotations
2 parents 2b4e8a2 + 9b9eb35 commit a81c646

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/node_modules/
33
/lib
44
coverage
5+
.nyc_output

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"node": ">=8.0.0"
88
},
99
"scripts": {
10-
"build": "babel src --source-maps --out-dir lib",
10+
"build": "babel src --source-maps --copy-files --out-dir lib",
1111
"build:watch": "babel src --source-maps --out-dir lib --watch",
1212
"lint": "eslint .",
1313
"test": "nyc mocha --reporter tap",

‎src/ansi_to_html.d.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
declare module 'ansi-to-html' {
2+
interface ConverterOptions {
3+
/** The default foreground color used when reset color codes are encountered. */
4+
fg?: string
5+
/** The default background color used when reset color codes are encountered. */
6+
bg?: string
7+
/** Convert newline characters to `<br/>`. */
8+
newline?: boolean
9+
/** Generate HTML/XML entities. */
10+
escapeXML?: boolean
11+
/** Save style state across invocations of `toHtml()`. */
12+
stream?: boolean
13+
/** Can override specific colors or the entire ANSI palette. */
14+
colors?: string[] | {[code: number]: string}
15+
}
16+
17+
class Convert {
18+
constructor(options?: ConverterOptions)
19+
toHtml(data: string): string
20+
}
21+
22+
export = Convert
23+
}

0 commit comments

Comments
 (0)
Please sign in to comment.