import { SerialEvent, Subscription, SerialOpenRequest, SerialOpenResult } from '@napplet/core'; /** * Napplet NAP serial sdk entrypoint. * * @module */ /** * @napplet/nap/serial -- SDK helpers wrapping window.napplet.serial. * * These convenience functions delegate to `window.napplet.serial.*` at call time. * The shim must be imported somewhere to install the global. */ /** * Ask the runtime to select and open a serial session. * * @param request Filters, options, and optional chooser label * @returns Promise resolving to the runtime-assigned serial open result */ declare function serialOpen(request: SerialOpenRequest): Promise; /** * Write bytes to an open serial session. * * @param sessionId Runtime-assigned serial session id * @param data Byte values to write * @returns Promise resolving after the runtime acknowledges the write */ declare function serialWrite(sessionId: string, data: Uint8Array | number[]): Promise; /** * Close an open serial session. * * @param sessionId Runtime-assigned serial session id * @param reason Optional reason for the close request * @returns Promise resolving after the runtime acknowledges the close */ declare function serialClose(sessionId: string, reason?: string): Promise; /** * Register for shell-pushed serial events. * * @param handler Called with each serial event * @returns A Subscription with `close()` to stop listening */ declare function serialOnEvent(handler: (event: SerialEvent) => void): Subscription; export { serialClose, serialOnEvent, serialOpen, serialWrite };