Skip to content

Commit

Permalink
Merge pull request #6 from omarkhatibco/master
Browse files Browse the repository at this point in the history
fix typescript annotations, thanks @omarkhatibco
  • Loading branch information
Yimura authored Apr 26, 2021
2 parents 03267b0 + 9e43bc3 commit c3e9393
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ export interface SearchTypes {
VIDEO: "EgIQAQ%3D%3D";
}

const Constants = {
SearchTypes,
YoutubeURL: URL.prototype,
}

export interface Thumbnail {
url: string;
width: number;
Expand Down Expand Up @@ -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<string, unknown>): Record<string, unknown>[];
private _fetch(search_query: string, searchType?: keyof SearchTypes, requestedLang?: string): Promise<string>;
private _extractData(
json: Record<string, unknown>
): Record<string, unknown>[];
private _fetch(
search_query: string,
searchType?: keyof SearchTypes,
requestedLang?: string
): Promise<string>;
private _getSearchData(webPage: string): Record<string, unknown>;
private _parseData(data: Record<string, unknown>[]): Results;

public async search(query: string, options?: SearchOptions): Promise<Results>;
public search(query: string, options?: SearchOptions): Promise<Results>;
public setLang(language?: string): void;
}

0 comments on commit c3e9393

Please sign in to comment.