browser-commander 0.14.0

Universal browser automation library that supports multiple browser engines with a unified API
Documentation
// @generated by scripts/generate-puppeteer-bindings.mjs from
// rust/protocol/puppeteer/api.json. Do not edit by hand.

#![allow(clippy::all, missing_docs, unused_imports, non_snake_case)]

use serde_json::Value;

use super::*;
use crate::puppeteer::bridge::{binary, remote_type, BridgeError, JsFunction, Remote};

remote_type!(
    /// Puppeteer's `ScreenRecording` (puppeteer-core 25.10.0), a remote object
    /// served by `browser-commander serve --stdio`.
    ScreenRecording
);

impl ScreenRecording {
    /// `ScreenRecording.pipe`
    ///
    /// ```text
    /// pipe<T extends WritableStream<Uint8Array>>(destination: T): Promise<void>
    /// pipe<T extends WritableDestination>(destination: T): T
    /// ```
    pub async fn pipe(&self, destination: Value) -> Result<Value, BridgeError> {
        self.remote.call("pipe", vec![Some(destination)]).await
    }

    /// `ScreenRecording.stop`
    ///
    /// ```text
    /// stop(): Promise<void>
    /// ```
    pub async fn stop(&self) -> Result<(), BridgeError> {
        self.remote.call("stop", vec![]).await
    }
}