From 6743cb278b6926a8ed66fb69b19773aa03bd6b92 Mon Sep 17 00:00:00 2001 From: mazen-r Date: Fri, 4 Oct 2024 11:56:08 +0300 Subject: [PATCH] allow mixture of string and enum type hints --- src/scrapeconfig.ts | 8 ++++---- src/screenshotconfig.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/scrapeconfig.ts b/src/scrapeconfig.ts index 892ed54..91017c6 100644 --- a/src/scrapeconfig.ts +++ b/src/scrapeconfig.ts @@ -60,7 +60,7 @@ type ScrapeConfigOptions = { session?: string; tags?: string[]; format?: 'json' | 'text' | 'markdown' | 'clean_html' | 'raw' | Format; - format_options?: ('no_links' | 'no_images' | 'only_content')[] | FormatOption[]; + format_options?: ('no_links' | 'no_images' | 'only_content' | FormatOption)[]; correlation_id?: string; cookies?: Rec; body?: string; @@ -70,7 +70,7 @@ type ScrapeConfigOptions = { rendering_wait?: number; wait_for_selector?: string; screenshots?: Rec; - screenshot_flags?: ('load_images' | 'dark_mode' | 'block_banners' | 'print_media_format' | 'high_quality')[] | ScreenshotFlags[]; + screenshot_flags?: ('load_images' | 'dark_mode' | 'block_banners' | 'print_media_format' | 'high_quality' | ScreenshotFlags)[]; session_sticky_proxy?: boolean; webhook?: string; timeout?: number; @@ -102,7 +102,7 @@ export class ScrapeConfig { session?: string; tags: Set = new Set(); format?: 'json' | 'text' | 'markdown' | 'clean_html' | 'raw' | Format; - format_options?: ('no_links' | 'no_images' | 'only_content')[] | FormatOption[]; + format_options?: ('no_links' | 'no_images' | 'only_content' | FormatOption)[]; correlation_id?: string; cookies?: Rec; body?: string; @@ -113,7 +113,7 @@ export class ScrapeConfig { wait_for_selector?: string; session_sticky_proxy = false; screenshots?: Rec; - screenshot_flags?: ('load_images' | 'dark_mode' | 'block_banners' | 'print_media_format' | 'high_quality')[] | ScreenshotFlags[]; + screenshot_flags?: ('load_images' | 'dark_mode' | 'block_banners' | 'print_media_format' | 'high_quality' | ScreenshotFlags)[]; webhook?: string; timeout?: number; // in milliseconds js_scenario?: Rec; diff --git a/src/screenshotconfig.ts b/src/screenshotconfig.ts index 76a3fd6..eff96b4 100644 --- a/src/screenshotconfig.ts +++ b/src/screenshotconfig.ts @@ -41,7 +41,7 @@ type ScreenshotConfigOptions = { timeout?: number; rendering_wait?: number; wait_for_selector?: string; - options?: ('load_images' | 'dark_mode' | 'block_banners' | 'print_media_format')[] | Options[]; + options?: ('load_images' | 'dark_mode' | 'block_banners' | 'print_media_format' | Options)[]; auto_scroll?: boolean; js?: string; cache?: boolean; @@ -59,7 +59,7 @@ export class ScreenshotConfig { timeout?: number; rendering_wait?: number; wait_for_selector?: string; - options?: ('load_images' | 'dark_mode' | 'block_banners' | 'print_media_format')[] | Options[]; + options?: ('load_images' | 'dark_mode' | 'block_banners' | 'print_media_format' | Options)[]; auto_scroll?: boolean; js?: string; cache?: boolean;