This commit is contained in:
Lukian LEIZOUR 2022-11-19 01:49:12 +01:00
parent be4fd23bcf
commit 0bd53741af
728 changed files with 86573 additions and 0 deletions

139
node_modules/googlethis/typings/core/main.d.ts generated vendored Normal file
View file

@ -0,0 +1,139 @@
/**
* Retrieves news from Google.
*
* @param {string} [language] - two digits language code.
* @param {string} [region] - two digits region code.
*
* @returns {Promise.<{
* headline_stories: {
* title: string;
* url: string;
* image: string;
* published: string;
* by: string;
* }[]
* }>}
*/
export function getTopNews(language?: string, region?: string): Promise<{
headline_stories: {
title: string;
url: string;
image: string;
published: string;
by: string;
}[];
}>;
/**
* Searches a given query on Google.
* @param {string | object} query - The query to search for.
* @param {object} [options] - Search options.
* @param {boolean} [options.ris] - Weather this is a reverse image search or not.
* @param {boolean} [options.safe] - Weather to use safe search or not.
* @param {number} [options.page] - Page number.
* @param {boolean} [options.parse_ads] - Weather or not to parse ads.
* @param {boolean} [options.use_mobile_ua] - Weather or not to use a mobile user agent.
* @param {object} [options.additional_params] - parameters that will be passed to Google
*/
export function search(query: string | object, options?: {
ris?: boolean;
safe?: boolean;
page?: number;
parse_ads?: boolean;
use_mobile_ua?: boolean;
additional_params?: object;
}): Promise<{
results: {
title: string;
description: string;
url: string;
is_sponsored: boolean;
favicons: {
high_res: string;
low_res: string;
};
}[];
videos: {
id: string;
url: string;
title: string;
author: string;
duration: string;
}[];
knowledge_panel: KnowledgeGraph;
featured_snippet: FeaturedSnippet;
did_you_mean: string;
weather: Weather;
time: Time;
location: Location;
dictionary: Dictionary;
translation: Translation;
top_stories: {
description: string;
url: string;
}[];
unit_converter: Converters;
people_also_ask: string[];
people_also_search: {
title: string;
thumbnail: string;
}[];
}>;
/**
* Google image search.
*
* @param {string} query - The query to search for.
* @param {object} [options] - Search options.
* @param {boolean} [options.safe] - Weather to use safe search or not.
* @param {object} [options.additional_params] - Additional parameters that will be passed to Google.
* @returns {Promise.<{
* id: string;
* url: string;
* width: number;
* height: number;
* color: number;
* preview: {
* url: string;
* width: number;
* height: number;
* },
* origin: {
* title: string;
* website: {
* name: string;
* domain: string;
* url: string;
* }
* }
*}[]>}
*/
export function image(query: string, options?: {
safe?: boolean;
additional_params?: object;
}): Promise<{
id: string;
url: string;
width: number;
height: number;
color: number;
preview: {
url: string;
width: number;
height: number;
};
origin: {
title: string;
website: {
name: string;
domain: string;
url: string;
};
};
}[]>;
import KnowledgeGraph = require("./nodes/KnowledgeGraph");
import FeaturedSnippet = require("./nodes/FeaturedSnippet");
import Weather = require("./nodes/Weather");
import Time = require("./nodes/Time");
import Location = require("./nodes/Location");
import Dictionary = require("./nodes/Dictionary");
import Translation = require("./nodes/Translation");
import Converters = require("./nodes/Converters");

View file

@ -0,0 +1,7 @@
export = Converters;
declare class Converters {
constructor($: any);
input: any;
output: any;
formula: any;
}

View file

@ -0,0 +1,14 @@
export = Dictionary;
declare class Dictionary {
constructor($: any);
/** @type {string | null} */
word: string | null;
/** @type {string | null} */
phonetic: string | null;
/** @type {string | null} */
audio: string | null;
/** @type {string[]} */
definitions: string[];
/** @type {string[]} */
examples: string[];
}

View file

@ -0,0 +1,10 @@
export = FeaturedSnippet;
declare class FeaturedSnippet {
constructor($: any);
/** @type {string | null} */
title: string | null;
/** @type {string | null} */
description: string | null;
/** @type {string | null} */
url: string | null;
}

View file

@ -0,0 +1,55 @@
export = KnowledgeGraph;
declare class KnowledgeGraph {
constructor(data: any, $: any);
/** @type {string | null} */
type: string | null;
/** @type {string | null} */
title: string | null;
/** @type {string | null} */
description: string | null;
/** @type {string | null} */
url: string | null;
/** @type {{ title: string; value: string }[]} */
metadata: {
title: string;
value: string;
}[];
/** @type {{ title: string; year: string; }[]} */
books: {
title: string;
year: string;
}[];
/** @type {{ title: string; year: string; }[]} */
tv_shows_and_movies: {
title: string;
year: string;
}[];
ratings: any[];
/** @type {string[]} */
available_on: string[];
/** @type {{ url: string; source: string }[]} */
images: {
url: string;
source: string;
}[];
/** @type {{ title: string; album: string }[]} */
songs: {
title: string;
album: string;
}[];
/** @type {Social[]} */
socials: Social[];
/** @type {string | null} */
demonstration: string | null;
/** @type {string | null} */
lyrics: string | null;
}
declare class Social {
constructor(data: any);
/** @type {string} */
name: string;
/** @type {string} */
url: string;
/** @type {string} */
icon: string;
}

View file

@ -0,0 +1,10 @@
export = Location;
declare class Location {
constructor($: any);
/** @type {string | null} */
title: string | null;
/** @type {string | null} */
distance: string | null;
/** @type {string | null} */
map: string | null;
}

View file

@ -0,0 +1,25 @@
export = OrganicResults;
declare class OrganicResults {
/**
* @returns {{
* title: string;
* description: string;
* url: string;
* is_sponsored: boolean;
* favicons: {
* high_res: string;
* low_res: string;
* }
* }[]}
*/
static parse($: any, parse_ads?: boolean, is_mobile?: boolean): {
title: string;
description: string;
url: string;
is_sponsored: boolean;
favicons: {
high_res: string;
low_res: string;
};
}[];
}

4
node_modules/googlethis/typings/core/nodes/PAA.d.ts generated vendored Normal file
View file

@ -0,0 +1,4 @@
export = PAA;
declare class PAA {
static parse($: any, data: any): string[];
}

7
node_modules/googlethis/typings/core/nodes/PAS.d.ts generated vendored Normal file
View file

@ -0,0 +1,7 @@
export = PAS;
declare class PAS {
static parse($: any): {
title: string;
thumbnail: string;
}[];
}

8
node_modules/googlethis/typings/core/nodes/Time.d.ts generated vendored Normal file
View file

@ -0,0 +1,8 @@
export = Time;
declare class Time {
constructor($: any);
/** @type {string | null} */
hours: string | null;
/** @type {string | null} */
date: string | null;
}

View file

@ -0,0 +1,7 @@
export = TopStories;
declare class TopStories {
static parse($: any): {
description: string;
url: string;
}[];
}

View file

@ -0,0 +1,12 @@
export = Translation;
declare class Translation {
constructor($: any);
/** @type {string | null} */
source_language: string | null;
/** @type {string | null} */
target_language: string | null;
/** @type {string | null} */
source_text: string | null;
/** @type {string | null} */
target_text: string | null;
}

10
node_modules/googlethis/typings/core/nodes/Videos.d.ts generated vendored Normal file
View file

@ -0,0 +1,10 @@
export = Videos;
declare class Videos {
static parse($: any): {
id: string;
url: string;
title: string;
author: string;
duration: string;
}[];
}

View file

@ -0,0 +1,16 @@
export = Weather;
declare class Weather {
constructor($: any);
/** @type {string | null} */
location: string | null;
/** @type {string | null} */
forecast: string | null;
/** @type {string | null} */
precipitation: string | null;
/** @type {string | null} */
humidity: string | null;
/** @type {string | null} */
temperature: string | null;
/** @type {string | null} */
wind: string | null;
}

2
node_modules/googlethis/typings/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,2 @@
declare const _exports: typeof import("./core/main");
export = _exports;

68
node_modules/googlethis/typings/utils/constants.d.ts generated vendored Normal file
View file

@ -0,0 +1,68 @@
export namespace URLS {
const GIS: string;
const GOOGLE: string;
const W_GOOGLE: string;
const GOOGLE_NEWS: string;
const FAVICONKIT: string;
}
export namespace SELECTORS {
const TITLE: string;
const DESCRIPTION: string;
const URL: string;
const DID_YOU_MEAN: string;
const KNO_PANEL_TITLE: string[];
const KNO_PANEL_DESCRIPTION: string;
const KNO_PANEL_URL: string;
const KNO_PANEL_METADATA: string;
const KNO_PANEL_TYPE: string;
const KNO_PANEL_SONG_LYRICS: string;
const KNO_PANEL_AVAILABLE_ON: string;
const KNO_PANEL_IMAGES: string;
const KNO_PANEL_SONGS: string;
const KNO_PANEL_BOOKS: string;
const KNO_PANEL_TV_SHOWS_AND_MOVIES: string;
const KNO_PANEL_FILM_GOOGLEUSERS_RATING: string;
const KNO_PANEL_FILM_RATINGS: string[];
const KNO_PANEL_SOCIALS: string;
const VIDEOS: string;
const FEATURED_SNIPPET_TITLE: string[];
const FEATURED_SNIPPET_DESC: string[];
const FEATURED_SNIPPET_URL: string;
const UNIT_CONVERTER_INPUT: string;
const UNIT_CONVERTER_OUTPUT: string;
const UNIT_CONVERTER_FORMULA: string;
const INPUT_CURRENCY_NAME: string;
const OUTPUT_CURRENCY_NAME: string;
const CURRENCY_CONVERTER_INPUT: string;
const CURRENCY_CONVERTER_OUTPUT: string;
const WEATHER_LOCATION: string;
const WEATHER_FORECAST: string;
const PRECIPITATION: string;
const AIR_HUMIDITY: string;
const TEMPERATURE: string;
const WIND_SPEED: string;
const CURRENT_TIME_HOUR: string;
const CURRENT_TIME_DATE: string;
const LOCATION_TITLE: string;
const LOCATION_DISTANCE: string;
const LOCATION_IMAGE: string;
const GD_WORD: string;
const GD_PHONETIC: string;
const GD_AUDIO: string;
const GD_DEFINITIONS: string;
const GD_EXAMPLES: string;
const TR_SOURCE_LANGUAGE: string;
const TR_TARGET_LANGUAGE: string;
const TR_SOURCE_TEXT: string;
const TR_TARGET_TEXT: string;
const TOP_STORIES_DESCRIPTION: string[];
const TOP_STORIES_URL: string;
const TOP_STORIES_SNIPPET: string;
const TOP_STORIES_WEBSITE: string;
const PAA: string[];
const PASF: string;
const PUBLISHER: string;
const STORY_TITLE: string;
const STORY_IMG: string;
const STORY_TIME: string;
}

48
node_modules/googlethis/typings/utils/utils.d.ts generated vendored Normal file
View file

@ -0,0 +1,48 @@
export class SearchError extends Error {
constructor(message: any, info: any);
info: any;
date: Date;
version: any;
}
/**
* Returns headers with a random user agent.
*
* @param {boolean} is_mobile
* @returns {string}
*/
export function getHeaders(options?: {
mobile: boolean;
}): string;
/**
* Gets a string between two delimiters.
*
* @param {string} data - The data.
* @param {string} start_string - Start string.
* @param {string} end_string - End string.
*
* @returns {string}
*/
export function getStringBetweenStrings(data: string, start_string: string, end_string: string): string;
/**
* Generates a random string with a given length.
* @param {number} length
* @returns {string}
*/
export function generateRandomString(length: number): string;
/**
* Returns a random integer between two values.
*
* @param {number} min
* @param {number} max
*
* @returns {number}
*/
export function getRandomInt(min: number, max: number): number;
/**
* Refines the html.
*
* @param {string} data - Raw html data.
* @param {boolean} parse_ads - Whether to parse ads or not.
* @returns {string}
*/
export function refineData(data: string, parse_ads?: boolean, is_mobile?: boolean): string;