screenshotone-api-sdk 1.1.7 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -149,6 +149,28 @@ export declare class TakeOptions {
149
149
  * Sets response format, one of: "png", "jpeg", "webp" or "jpg".
150
150
  */
151
151
  format(format: string): TakeOptions;
152
+ /**
153
+ * When the site responds within the range of 200-299 status code,
154
+ * you can ignore errors and take a screenshot of the error page anyway.
155
+ * To do that, set the option ignore_host_errors to true.
156
+ * It is false by default.
157
+ *
158
+ * It is helpful when you want to create a gallery of error pages or,
159
+ * for some reason, you need to render error pages.
160
+ */
161
+ ignoreHostErrors(ignore: boolean): TakeOptions;
162
+ /**
163
+ * Use wait_until to wait until an event occurred before taking a screenshot or rendering HTML or PDF.
164
+ *
165
+ * The default value of wait_until is ['load']. Allowed values are:
166
+ * - load: the navigation is successful when the load even is fired;
167
+ * - domcontentloaded: the navigation is finished when the DOMContentLoaded even is fired;
168
+ * - networkidle0: the navigation is finished when there are no more than 0 network connections for at least 500 ms;
169
+ * - networkidle2: consider navigation to be finished when there are no more than 2 network connections for at least 500 ms.
170
+ *
171
+ * The parameter accepts many values. It means that screenshots will be taken after all events occur altogether.
172
+ */
173
+ waitUntil(...until: string[]): TakeOptions;
152
174
  /**
153
175
  * Sets IP country code.
154
176
  */
package/dist/main.js CHANGED
@@ -302,6 +302,34 @@ class TakeOptions {
302
302
  this.put("format", format);
303
303
  return this;
304
304
  }
305
+ /**
306
+ * When the site responds within the range of 200-299 status code,
307
+ * you can ignore errors and take a screenshot of the error page anyway.
308
+ * To do that, set the option ignore_host_errors to true.
309
+ * It is false by default.
310
+ *
311
+ * It is helpful when you want to create a gallery of error pages or,
312
+ * for some reason, you need to render error pages.
313
+ */
314
+ ignoreHostErrors(ignore) {
315
+ this.put("ignore_host_errors", ignore ? "true" : "false");
316
+ return this;
317
+ }
318
+ /**
319
+ * Use wait_until to wait until an event occurred before taking a screenshot or rendering HTML or PDF.
320
+ *
321
+ * The default value of wait_until is ['load']. Allowed values are:
322
+ * - load: the navigation is successful when the load even is fired;
323
+ * - domcontentloaded: the navigation is finished when the DOMContentLoaded even is fired;
324
+ * - networkidle0: the navigation is finished when there are no more than 0 network connections for at least 500 ms;
325
+ * - networkidle2: consider navigation to be finished when there are no more than 2 network connections for at least 500 ms.
326
+ *
327
+ * The parameter accepts many values. It means that screenshots will be taken after all events occur altogether.
328
+ */
329
+ waitUntil(...until) {
330
+ this.put("wait_until", ...until);
331
+ return this;
332
+ }
305
333
  /**
306
334
  * Sets IP country code.
307
335
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "screenshotone-api-sdk",
3
3
  "homepage": "https://screenshotone.com",
4
- "version": "1.1.7",
4
+ "version": "1.1.8",
5
5
  "description": "Use ScreenshotOne.com API to generate screenshots of any website.",
6
6
  "repository": {
7
7
  "type": "git",
package/src/main.ts CHANGED
@@ -380,6 +380,38 @@ export class TakeOptions {
380
380
  return this;
381
381
  }
382
382
 
383
+ /**
384
+ * When the site responds within the range of 200-299 status code,
385
+ * you can ignore errors and take a screenshot of the error page anyway.
386
+ * To do that, set the option ignore_host_errors to true.
387
+ * It is false by default.
388
+ *
389
+ * It is helpful when you want to create a gallery of error pages or,
390
+ * for some reason, you need to render error pages.
391
+ */
392
+ ignoreHostErrors(ignore: boolean): TakeOptions {
393
+ this.put("ignore_host_errors", ignore ? "true" : "false");
394
+
395
+ return this;
396
+ }
397
+
398
+ /**
399
+ * Use wait_until to wait until an event occurred before taking a screenshot or rendering HTML or PDF.
400
+ *
401
+ * The default value of wait_until is ['load']. Allowed values are:
402
+ * - load: the navigation is successful when the load even is fired;
403
+ * - domcontentloaded: the navigation is finished when the DOMContentLoaded even is fired;
404
+ * - networkidle0: the navigation is finished when there are no more than 0 network connections for at least 500 ms;
405
+ * - networkidle2: consider navigation to be finished when there are no more than 2 network connections for at least 500 ms.
406
+ *
407
+ * The parameter accepts many values. It means that screenshots will be taken after all events occur altogether.
408
+ */
409
+ waitUntil(...until: string[]): TakeOptions {
410
+ this.put("wait_until", ...until);
411
+
412
+ return this;
413
+ }
414
+
383
415
  /**
384
416
  * Sets IP country code.
385
417
  */