UNPKG

@monitoro/herd

Version:

Automate your browser, build AI web tools and MCP servers with Monitoro Herd

42 lines (41 loc) 1.15 kB
import { EventEmitter } from 'events'; import type { DeviceInfo } from './types.js'; import { Page } from './Page.js'; import type { HerdClient } from './HerdClient.js'; export declare class Device extends EventEmitter { private client; private info; private pageMap; constructor(client: HerdClient, info: DeviceInfo); get id(): string; get deviceId(): string; get type(): string; get name(): string | null; get status(): string; get lastActive(): Date | null; updateInfo(info: DeviceInfo): void; /** * Create a new page in the device */ newPage(): Promise<Page>; /** * List all pages in the device */ listPages(): Promise<Page[]>; /** * Get a specific page by ID */ getPage(id: number): Promise<Page>; /** * Subscribe to all events from this device */ onEvent(callback: (event: any) => void): () => void; /** * Subscribe to a specific event from this device */ on(eventName: string, callback: (event: any) => void): this; /** * Close the device and cleanup resources */ close(): Promise<void>; }