Skip to content

marklife


marklife / web/src / fromSerialPort

Function: fromSerialPort()

fromSerialPort(port, modelKey, baudRate?): Promise<WebMarklifePrinter>

Convenience: build a printer from an already-picked Web Serial port.

port is typed as unknown to avoid a dependency on @types/w3c-web-serial; the underlying WebSerialTransport.fromPort accepts a SerialPort from the browser global namespace.

Parameters

port

unknown

modelKey

DeviceKey

baudRate?

number

Returns

Promise<WebMarklifePrinter>

Deprecated

Use requestPrinters({ transport: 'serial', deviceKey }) from ./request-printers.ts. Removed once consumers migrate (plan 11).