Skip to content

Commit 35b79ce

Browse files
igoro00scriptcoded
andauthored
feature(typescript): add TypeScript type definitions (#28)
Co-authored-by: Malcolm Nihlén <[email protected]>
1 parent 329e86f commit 35b79ce

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

lib/index.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
declare module 'sql-highlight' {
2+
export interface HighlightOptions {
3+
html?: boolean;
4+
classPrefix?: string;
5+
colors?: {
6+
keyword: string;
7+
function: string;
8+
number: string;
9+
string: string;
10+
special: string;
11+
bracket: string;
12+
clear: string;
13+
};
14+
}
15+
16+
export function highlight(sqlString: string, options?: HighlightOptions): string;
17+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "4.0.1",
44
"description": "A simple and lightweight syntax highlighting library for SQL",
55
"main": "lib/index.js",
6+
"types": "./lib/index.d.ts",
67
"repository": {
78
"type": "git",
89
"url": "https://github.com/scriptcoded/sql-highlight.git"

0 commit comments

Comments
 (0)