1.2.10 • Published 6 months ago

@types/website-scraper v1.2.10

Weekly downloads
242
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/website-scraper

Summary

This package contains type definitions for website-scraper (https://github.com/s0ph1e/node-website-scraper).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/website-scraper.

index.d.ts

// Type definitions for website-scraper v1.2.x
// Project: https://github.com/s0ph1e/node-website-scraper
// Definitions by: Christian Rackerseder <https://github.com/screendriver>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

/// <reference types="request" />

import * as request from 'request';

declare namespace websiteScraper {
    interface Url {
        url: string;
        filename: string;
    }

    interface SubDirectory {
        directory: string;
        extensions: string[];
    }

    interface Source {
        selector: string;
        attr?: string | undefined;
    }

    interface RequestOptions {
        headers: request.Headers;
    }

    interface Options {
        urls: (string | Url)[];
        directory: string;
        urlFilter?: ((url: string) => boolean) | undefined;
        filenameGenerator?: string | undefined;
        defaultFilename?: string | undefined;
        prettifyUrls?: boolean | undefined;
        sources?: Source[] | undefined;
        subdirectories?: SubDirectory[] | null | undefined;
        request?: RequestOptions | undefined;
        recursive?: boolean | undefined;
        maxDepth?: number | undefined;
        ignoreErrors?: boolean | undefined;
        maxRecursiveDepth?: number | undefined;
        requestConcurrency?: number | undefined;
        plugins?: object[] | undefined;
    }

    interface Resource {
        url: string;
        filename: string;
        assets: Resource[];
    }

    interface Callback {
        (error: any | null, result: Resource[] | null): void;
    }

    interface Scrape {
        (options: Options, callback: Callback): void;
        (options: Options): Promise<Resource[]>;
    }
}

declare const websiteScraper: websiteScraper.Scrape;

export = websiteScraper;

Additional Details

  • Last updated: Fri, 02 Jul 2021 18:05:34 GMT
  • Dependencies: @types/request
  • Global values: none

Credits

These definitions were written by Christian Rackerseder.

1.2.9

6 months ago

1.2.8

7 months ago

1.2.7

8 months ago

1.2.10

6 months ago

1.2.6

3 years ago

1.2.5

5 years ago

1.2.4

6 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

8 years ago