Skip to content

Commit f7b2cd5

Browse files
NormanPerrinbrandon93s
authored andcommitted
add type declarations (#1)
1 parent f5241f9 commit f7b2cd5

File tree

4 files changed

+6093
-0
lines changed

4 files changed

+6093
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
.vscode/

index.d.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
declare module "html-table-to-json" {
2+
import * as cheerio from 'cheerio';
3+
4+
class HtmlTableToJson {
5+
headers: Array<any>;
6+
results: Array<any>;
7+
count: number;
8+
9+
constructor(html: string, opts?: Object);
10+
11+
static factory(html: string, opts?: Object): HtmlTableToJson;
12+
13+
private _process(): Array<any>;
14+
15+
private _processTable(tableIndex: number, table: CheerioElement): void;
16+
17+
private _processRow(
18+
tableIndex: number,
19+
index: number,
20+
row: CheerioElement
21+
): void;
22+
23+
private _buildHeaders(index: number, table: CheerioElement): void;
24+
25+
private _pruneEmptyRows(tableIndex: number): void;
26+
}
27+
28+
export = HtmlTableToJson;
29+
}

0 commit comments

Comments
 (0)