Skip to content

Commit

Permalink
allow mixture of string and enum type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
mazen-r committed Oct 4, 2024
1 parent e22de49 commit 6743cb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/scrapeconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>;
body?: string;
Expand All @@ -70,7 +70,7 @@ type ScrapeConfigOptions = {
rendering_wait?: number;
wait_for_selector?: string;
screenshots?: Rec<any>;
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;
Expand Down Expand Up @@ -102,7 +102,7 @@ export class ScrapeConfig {
session?: string;
tags: Set<string> = new Set<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<string>;
body?: string;
Expand All @@ -113,7 +113,7 @@ export class ScrapeConfig {
wait_for_selector?: string;
session_sticky_proxy = false;
screenshots?: Rec<any>;
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<any>;
Expand Down
4 changes: 2 additions & 2 deletions src/screenshotconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 6743cb2

Please sign in to comment.