Skip to content

Commit 98c44aa

Browse files
committedApr 24, 2020
add ansi_to_html.d.ts. include it in build output
1 parent deeeee7 commit 98c44aa

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed
 

‎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 --out-dir lib && cp ./src/ansi_to_html.d.ts ./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.