Skip to Content
Mika Scraper 1.1.1 is released πŸŽ‰
🍩 MIKA TYPE ALIASType Alias: ScreenshotResponse

Type Alias: ScreenshotResponse

ScreenshotResponse = ScreenshotResponseSuccess | ScreenshotResponseError

Defined in: src/_other-scraper/ssweb.ts:35

Overview

The ScreenshotResponse type alias represents a combined response type for screenshot requests, indicating either a successful operation or an error. This type is particularly useful for handling multiple outcome scenarios in a type-safe manner, ensuring that your code can appropriately manage both success and error cases.

Usage

Developers can utilize the ScreenshotResponse type to define the return type of functions that perform screenshot operations. Depending on the operation’s outcome, the response will conform either to ScreenshotResponseSuccess, which indicates that the screenshot was successfully captured, or ScreenshotResponseError, which provides details about any encountered issues.

Type Definitions

  • ScreenshotResponseSuccess: A response indicating a successful screenshot capture.
  • ScreenshotResponseError: A response reporting an error that occurred during the screenshot capture process.

Example

The following example demonstrates the use of the ScreenshotResponse type alias in a function that captures a screenshot:

function captureScreenshot(): ScreenshotResponse { // Implementation... }

Diagram: Mika Scraper

Last updated on