@@ -142,6 +142,19 @@ export class Computer extends APIResource {
142142 } ) ;
143143 }
144144
145+ /**
146+ * Read text from the clipboard on the browser instance
147+ *
148+ * @example
149+ * ```ts
150+ * const response =
151+ * await client.browsers.computer.readClipboard('id');
152+ * ```
153+ */
154+ readClipboard ( id : string , options ?: RequestOptions ) : APIPromise < ComputerReadClipboardResponse > {
155+ return this . _client . post ( path `/browsers/${ id } /computer/clipboard/read` , options ) ;
156+ }
157+
145158 /**
146159 * Scroll the mouse wheel at a position on the host computer
147160 *
@@ -194,6 +207,24 @@ export class Computer extends APIResource {
194207 headers : buildHeaders ( [ { Accept : '*/*' } , options ?. headers ] ) ,
195208 } ) ;
196209 }
210+
211+ /**
212+ * Write text to the clipboard on the browser instance
213+ *
214+ * @example
215+ * ```ts
216+ * await client.browsers.computer.writeClipboard('id', {
217+ * text: 'text',
218+ * });
219+ * ```
220+ */
221+ writeClipboard ( id : string , body : ComputerWriteClipboardParams , options ?: RequestOptions ) : APIPromise < void > {
222+ return this . _client . post ( path `/browsers/${ id } /computer/clipboard/write` , {
223+ body,
224+ ...options ,
225+ headers : buildHeaders ( [ { Accept : '*/*' } , options ?. headers ] ) ,
226+ } ) ;
227+ }
197228}
198229
199230export interface ComputerGetMousePositionResponse {
@@ -208,6 +239,13 @@ export interface ComputerGetMousePositionResponse {
208239 y : number ;
209240}
210241
242+ export interface ComputerReadClipboardResponse {
243+ /**
244+ * Current clipboard text content
245+ */
246+ text : string ;
247+ }
248+
211249/**
212250 * Generic OK response.
213251 */
@@ -606,9 +644,17 @@ export interface ComputerTypeTextParams {
606644 delay ?: number ;
607645}
608646
647+ export interface ComputerWriteClipboardParams {
648+ /**
649+ * Text to write to the system clipboard
650+ */
651+ text : string ;
652+ }
653+
609654export declare namespace Computer {
610655 export {
611656 type ComputerGetMousePositionResponse as ComputerGetMousePositionResponse ,
657+ type ComputerReadClipboardResponse as ComputerReadClipboardResponse ,
612658 type ComputerSetCursorVisibilityResponse as ComputerSetCursorVisibilityResponse ,
613659 type ComputerBatchParams as ComputerBatchParams ,
614660 type ComputerCaptureScreenshotParams as ComputerCaptureScreenshotParams ,
@@ -619,5 +665,6 @@ export declare namespace Computer {
619665 type ComputerScrollParams as ComputerScrollParams ,
620666 type ComputerSetCursorVisibilityParams as ComputerSetCursorVisibilityParams ,
621667 type ComputerTypeTextParams as ComputerTypeTextParams ,
668+ type ComputerWriteClipboardParams as ComputerWriteClipboardParams ,
622669 } ;
623670}
0 commit comments