We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I believe that the fixes provided in #116 were not correctly merged and hence not included in the 5.1.1 release of scrape-it.
The index.d.ts in current scrape-it 5.1.1
declare namespace scrapeIt { export interface ScrapeOptions { [key: string]: string | ScrapeOptionListWithData | ScrapeOptionListWithConvert | ScrapeOptionElement; } export interface ScrapeOptionElement { selector?: string; convert?: (value: any) => any; how?: string | ((element: CheerioSelector) => any); attr?: string; trim?: boolean; closest?: string; eq?: number; texteq?: number; } export interface ScrapeOptionList { listItem: string; data?: ScrapeOptions; convert?: (value: any) => any; } export interface ScrapeResult<T> { data: T, $: Cheerio, response: any, body: string } export function scrapeHTML<T>(body: CheerioStatic | string, options: ScrapeOptions): T; } declare function scrapeIt<T>(url: string | object, opts: scrapeIt.ScrapeOptions): Promise<scrapeIt.ScrapeResult<T>>; declare function scrapeIt<T>(url: string | object, opts: scrapeIt.ScrapeOptions, cb: (err: any, res: scrapeIt.ScrapeResult<T>) => void): void; export = scrapeIt;
The fixed version of index.d.ts (as provided in the pull request) should be
declare namespace scrapeIt { export interface ScrapeOptions { [key: string]: string | ScrapeOptionList | ScrapeOptionElement; } export interface ScrapeOptionElement { selector?: string; convert?: (value: any) => any; how?: string | ((element: CheerioSelector) => any); attr?: string; trim?: boolean; closest?: string; eq?: number; texteq?: number; } export interface ScrapeOptionList { listItem: string; data?: ScrapeOptions; convert?: (value: any) => any; } export interface ScrapeResult<T> { data: T, $: Cheerio, response: any, body: string } export function scrapeHTML<T>(body: CheerioStatic | string, options: ScrapeOptions): T; } declare function scrapeIt<T>(url: string | object, opts: scrapeIt.ScrapeOptions): Promise<scrapeIt.ScrapeResult<T>>; declare function scrapeIt<T>(url: string | object, opts: scrapeIt.ScrapeOptions, cb: (err: any, res: scrapeIt.ScrapeResult<T>) => void): void; export = scrapeIt;
So with the current 5.1.1 release Typescript is (still) complaining:
node_modules/scrape-it/lib/index.d.ts:3:33 - error TS2304: Cannot find name 'ScrapeOptionListWithData'. 3 [key: string]: string | ScrapeOptionListWithData | ScrapeOptionListWithConvert | ScrapeOptionElement; ~~~~~~~~~~~~~~~~~~~~~~~~ node_modules/scrape-it/lib/index.d.ts:3:60 - error TS2304: Cannot find name 'ScrapeOptionListWithConvert'. 3 [key: string]: string | ScrapeOptionListWithData | ScrapeOptionListWithConvert | ScrapeOptionElement;
@IonicaBizau, could you kindly recheck the pull request and release an updated library version?
Greets -act
The text was updated successfully, but these errors were encountered:
same problem
Sorry, something went wrong.
Can you check now?
Perfect, works! Thank you @IonicaBizau!
-act
No branches or pull requests
I believe that the fixes provided in #116 were not correctly merged and hence not included in the 5.1.1 release of scrape-it.
The index.d.ts in current scrape-it 5.1.1
The fixed version of index.d.ts (as provided in the pull request) should be
So with the current 5.1.1 release Typescript is (still) complaining:
@IonicaBizau, could you kindly recheck the pull request and release an updated library version?
Greets
-act
The text was updated successfully, but these errors were encountered: