This commit is contained in:
tamaina
2023-02-12 12:20:19 +00:00
parent 7eb9cbb4a6
commit 199b247e85
30 changed files with 639 additions and 2 deletions

20
built/utils/got.d.ts vendored Normal file
View File

@ -0,0 +1,20 @@
import * as Got from 'got';
import * as cheerio from 'cheerio';
export declare let agent: Got.Agents;
export declare function setAgent(_agent: Got.Agents): void;
export declare type GotOptions = {
url: string;
method: 'GET' | 'POST' | 'HEAD';
body?: string;
headers: Record<string, string | undefined>;
typeFilter?: RegExp;
};
export declare function scpaping(url: string, opts?: {
lang?: string;
}): Promise<{
body: string;
$: cheerio.CheerioAPI;
response: Got.Response<string>;
}>;
export declare function get(url: string): Promise<string>;
export declare function head(url: string): Promise<Got.Response<string>>;