Skip to content

Commit c3e9393

Browse files
authored
Merge pull request #6 from omarkhatibco/master
fix typescript annotations, thanks @omarkhatibco
2 parents 03267b0 + 9e43bc3 commit c3e9393

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

index.d.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ export interface SearchTypes {
77
VIDEO: "EgIQAQ%3D%3D";
88
}
99

10-
const Constants = {
11-
SearchTypes,
12-
YoutubeURL: URL.prototype,
13-
}
14-
1510
export interface Thumbnail {
1611
url: string;
1712
width: number;
@@ -79,16 +74,22 @@ export interface SearchOptions {
7974
language?: string;
8075
}
8176

82-
class Scraper {
77+
declare class Scraper {
8378
private _lang: string;
8479

8580
public constructor(language?: string);
8681

87-
private _extractData(json: Record<string, unknown>): Record<string, unknown>[];
88-
private _fetch(search_query: string, searchType?: keyof SearchTypes, requestedLang?: string): Promise<string>;
82+
private _extractData(
83+
json: Record<string, unknown>
84+
): Record<string, unknown>[];
85+
private _fetch(
86+
search_query: string,
87+
searchType?: keyof SearchTypes,
88+
requestedLang?: string
89+
): Promise<string>;
8990
private _getSearchData(webPage: string): Record<string, unknown>;
9091
private _parseData(data: Record<string, unknown>[]): Results;
9192

92-
public async search(query: string, options?: SearchOptions): Promise<Results>;
93+
public search(query: string, options?: SearchOptions): Promise<Results>;
9394
public setLang(language?: string): void;
9495
}

0 commit comments

Comments
 (0)