Documentation
    Preparing search index...

    Interface SerialServiceContext

    Context passed to host-provided NAP-SERIAL hooks.

    interface SerialServiceContext {
        signal?: ApprovalSignal;
        windowId: string;
        authorizeDevice?<T>(
            scope: string,
            execute: (signal: ApprovalSignal) => T | Promise<T>,
        ): Promise<T>;
        emit(event: SerialEvent): void;
    }
    Index

    Properties

    Active approval lifetime for this host operation.

    windowId: string

    Window id of the requesting napplet.

    Methods

    • Authorize one host-private selected device before opening it.

      Browser projections call this after their chooser resolves and before the port is opened. The device key is never sent on the napplet wire.

      Type Parameters

      • T

      Parameters

      Returns Promise<T>