|
1 | | -// deno-lint-ignore no-explicit-any |
2 | | -export type EngineParameters = Record<string, any>; |
| 1 | +import type http from "node:http"; |
| 2 | + |
| 3 | +// Keep this list at the engine-name level. Per-engine parameter schemas are |
| 4 | +// intentionally out of scope for this minimal TypeScript coverage layer. |
| 5 | +export type EngineName = |
| 6 | + | "amazon" |
| 7 | + | "amazon_product" |
| 8 | + | "apple_maps" |
| 9 | + | "apple_maps_places" |
| 10 | + | "baidu" |
| 11 | + | "baidu_news" |
| 12 | + | "bing" |
| 13 | + | "bing_copilot" |
| 14 | + | "bing_images" |
| 15 | + | "bing_maps" |
| 16 | + | "bing_news" |
| 17 | + | "bing_product" |
| 18 | + | "bing_reverse_image" |
| 19 | + | "bing_shopping" |
| 20 | + | "bing_videos" |
| 21 | + | "brave_ai_mode" |
| 22 | + | "duckduckgo" |
| 23 | + | "duckduckgo_light" |
| 24 | + | "duckduckgo_maps" |
| 25 | + | "duckduckgo_news" |
| 26 | + | "ebay" |
| 27 | + | "ebay_product" |
| 28 | + | "facebook_profile" |
| 29 | + | "google" |
| 30 | + | "google_about_this_result" |
| 31 | + | "google_ads" |
| 32 | + | "google_ads_transparency_center" |
| 33 | + | "google_ads_transparency_center_ad_details" |
| 34 | + | "google_ai_mode" |
| 35 | + | "google_ai_overview" |
| 36 | + | "google_autocomplete" |
| 37 | + | "google_events" |
| 38 | + | "google_finance" |
| 39 | + | "google_finance_markets" |
| 40 | + | "google_flights" |
| 41 | + | "google_flights_autocomplete" |
| 42 | + | "google_flights_deals" |
| 43 | + | "google_forums" |
| 44 | + | "google_hotels" |
| 45 | + | "google_hotels_autocomplete" |
| 46 | + | "google_hotels_photos" |
| 47 | + | "google_hotels_reviews" |
| 48 | + | "google_images" |
| 49 | + | "google_images_light" |
| 50 | + | "google_images_related_content" |
| 51 | + | "google_immersive_product" |
| 52 | + | "google_jobs" |
| 53 | + | "google_jobs_listing" |
| 54 | + | "google_lens" |
| 55 | + | "google_light" |
| 56 | + | "google_local" |
| 57 | + | "google_local_services" |
| 58 | + | "google_maps" |
| 59 | + | "google_maps_autocomplete" |
| 60 | + | "google_maps_contributor_reviews" |
| 61 | + | "google_maps_directions" |
| 62 | + | "google_maps_photo_meta" |
| 63 | + | "google_maps_photos" |
| 64 | + | "google_maps_posts" |
| 65 | + | "google_maps_reviews" |
| 66 | + | "google_news" |
| 67 | + | "google_news_light" |
| 68 | + | "google_patents" |
| 69 | + | "google_patents_details" |
| 70 | + | "google_play" |
| 71 | + | "google_play_product" |
| 72 | + | "google_related_questions" |
| 73 | + | "google_scholar" |
| 74 | + | "google_scholar_author" |
| 75 | + | "google_scholar_case_law" |
| 76 | + | "google_scholar_cite" |
| 77 | + | "google_scholar_profiles" |
| 78 | + | "google_shopping" |
| 79 | + | "google_shopping_filters" |
| 80 | + | "google_shopping_light" |
| 81 | + | "google_short_videos" |
| 82 | + | "google_travel_explore" |
| 83 | + | "google_trends" |
| 84 | + | "google_videos" |
| 85 | + | "google_videos_light" |
| 86 | + | "home_depot" |
| 87 | + | "home_depot_product" |
| 88 | + | "instagram_profile" |
| 89 | + | "naver" |
| 90 | + | "naver_ai_overview" |
| 91 | + | "open_table_reviews" |
| 92 | + | "tripadvisor" |
| 93 | + | "tripadvisor_place" |
| 94 | + | "tripadvisor_reviews" |
| 95 | + | "walmart" |
| 96 | + | "walmart_product" |
| 97 | + | "walmart_product_reviews" |
| 98 | + | "walmart_product_sellers" |
| 99 | + | "yahoo" |
| 100 | + | "yahoo_images" |
| 101 | + | "yahoo_shopping" |
| 102 | + | "yahoo_videos" |
| 103 | + | "yandex" |
| 104 | + | "yandex_images" |
| 105 | + | "yandex_videos" |
| 106 | + | "yelp" |
| 107 | + | "yelp_place" |
| 108 | + | "yelp_reviews" |
| 109 | + | "youtube" |
| 110 | + | "youtube_video" |
| 111 | + | "youtube_video_transcript"; |
| 112 | + |
| 113 | +type BaseParameters = { |
| 114 | + api_key?: string | null; |
| 115 | + async?: boolean; |
| 116 | + device?: "desktop" | "tablet" | "mobile"; |
| 117 | + no_cache?: boolean; |
| 118 | + output?: "json" | "html"; |
| 119 | + q?: string; |
| 120 | + requestOptions?: http.RequestOptions; |
| 121 | + timeout?: number; |
| 122 | + zero_trace?: boolean; |
| 123 | +}; |
| 124 | + |
| 125 | +export type EngineParameters<EngineRequired = true> = |
| 126 | + & (EngineRequired extends true ? { engine: EngineName } |
| 127 | + : { engine?: EngineName }) |
| 128 | + & BaseParameters |
| 129 | + & Record<string, unknown>; |
3 | 130 |
|
4 | 131 | // deno-lint-ignore no-explicit-any |
5 | 132 | export type BaseResponse = Record<string, any>; |
|
0 commit comments