From 9e43bc3a91838c53ca46ceb1db34bccae69bedd0 Mon Sep 17 00:00:00 2001 From: Omar Khatib Date: Mon, 26 Apr 2021 10:47:56 +0200 Subject: [PATCH] fix typescript annotations --- index.d.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/index.d.ts b/index.d.ts index eeebbd2..e4c38cc 100644 --- a/index.d.ts +++ b/index.d.ts @@ -7,11 +7,6 @@ export interface SearchTypes { VIDEO: "EgIQAQ%3D%3D"; } -const Constants = { - SearchTypes, - YoutubeURL: URL.prototype, -} - export interface Thumbnail { url: string; width: number; @@ -79,16 +74,22 @@ export interface SearchOptions { language?: string; } -class Scraper { +declare class Scraper { private _lang: string; public constructor(language?: string); - private _extractData(json: Record): Record[]; - private _fetch(search_query: string, searchType?: keyof SearchTypes, requestedLang?: string): Promise; + private _extractData( + json: Record + ): Record[]; + private _fetch( + search_query: string, + searchType?: keyof SearchTypes, + requestedLang?: string + ): Promise; private _getSearchData(webPage: string): Record; private _parseData(data: Record[]): Results; - public async search(query: string, options?: SearchOptions): Promise; + public search(query: string, options?: SearchOptions): Promise; public setLang(language?: string): void; }