You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 787f92f
Browse filesBrowse the repository at this point in the historyBrowse files
* @param ColorScheme|value-of<ColorScheme> $colorScheme Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.
119
120
* @param string $directURL A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, the styleguide is extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.
120
121
* @param string $domain Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.
121
122
* @param int $maxAgeMs Maximum age in milliseconds for cached data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year.
@@ -125,6 +126,7 @@ public function extractFonts(
125
126
* @throws APIException
126
127
*/
127
128
publicfunctionextractStyleguide(
129
+
ColorScheme|string|null$colorScheme = null,
128
130
?string$directURL = null,
129
131
?string$domain = null,
130
132
int$maxAgeMs = 7776000000,
@@ -135,7 +137,7 @@ public function extractStyleguide(
135
137
/**
136
138
* @api
137
139
*
138
-
* @param ColorScheme|value-of<ColorScheme> $colorScheme Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances.
140
+
* @param \ContextDev\Web\WebScreenshotParams\ColorScheme|value-of<\ContextDev\Web\WebScreenshotParams\ColorScheme> $colorScheme Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances.
139
141
* @param Country|value-of<Country> $country Two-letter ISO 3166-1 alpha-2 country code for the website request location. When provided, Context.dev fetches the target page from that country.
140
142
* @param string $directURL A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https://example.com/pricing'). When provided, the screenshot is taken of this exact URL. You must provide either 'domain' or 'directUrl', but not both.
141
143
* @param string $domain Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.
@@ -152,7 +154,7 @@ public function extractStyleguide(
* Extract a comprehensive design system from a website including colors, typography, spacing, shadows, and UI components.
192
192
*
193
+
* @param ColorScheme|value-of<ColorScheme> $colorScheme Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.
193
194
* @param string $directURL A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, the styleguide is extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.
194
195
* @param string $domain Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.
195
196
* @param int $maxAgeMs Maximum age in milliseconds for cached data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year.
@@ -199,6 +200,7 @@ public function extractFonts(
199
200
* @throws APIException
200
201
*/
201
202
publicfunctionextractStyleguide(
203
+
ColorScheme|string|null$colorScheme = null,
202
204
?string$directURL = null,
203
205
?string$domain = null,
204
206
int$maxAgeMs = 7776000000,
@@ -207,6 +209,7 @@ public function extractStyleguide(
207
209
): WebExtractStyleguideResponse {
208
210
$params = Util::removeNulls(
209
211
[
212
+
'colorScheme' => $colorScheme,
210
213
'directURL' => $directURL,
211
214
'domain' => $domain,
212
215
'maxAgeMs' => $maxAgeMs,
@@ -225,7 +228,7 @@ public function extractStyleguide(
225
228
*
226
229
* Capture a screenshot of a website.
227
230
*
228
-
* @param ColorScheme|value-of<ColorScheme> $colorScheme Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances.
231
+
* @param \ContextDev\Web\WebScreenshotParams\ColorScheme|value-of<\ContextDev\Web\WebScreenshotParams\ColorScheme> $colorScheme Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances.
229
232
* @param Country|value-of<Country> $country Two-letter ISO 3166-1 alpha-2 country code for the website request location. When provided, Context.dev fetches the target page from that country.
230
233
* @param string $directURL A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https://example.com/pricing'). When provided, the screenshot is taken of this exact URL. You must provide either 'domain' or 'directUrl', but not both.
231
234
* @param string $domain Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.
@@ -242,7 +245,7 @@ public function extractStyleguide(
@@ -27,6 +29,14 @@ final class WebExtractStyleguideParams implements BaseModel
27
29
use SdkModel;
28
30
use SdkParams;
29
31
32
+
/**
33
+
* Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.
34
+
*
35
+
* @var value-of<ColorScheme>|null $colorScheme
36
+
*/
37
+
#[Optional(enum: ColorScheme::class)]
38
+
public ?string$colorScheme;
39
+
30
40
/**
31
41
* A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, the styleguide is extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.
32
42
*/
@@ -60,15 +70,19 @@ public function __construct()
60
70
* Construct an instance from the required parameters.
61
71
*
62
72
* You must use named parameters to construct any parameters with a default value.
* A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, the styleguide is extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.
0 commit comments