Function: createServerTransport()
function createServerTransport(device: {
connection: | {
kind: "webusb";
usbProductId: number;
usbSerialNumber?: string | null;
usbVendorId: number;
}
| {
host: string;
kind: "network";
port: number;
}
| {
kind: "qz";
printerName: string;
};
deviceType: "receipt_printer" | "cash_drawer" | "barcode_scanner";
drawerPin?: 2 | 5 | null;
id: string;
make?: string | null;
metadata?: Record<string, unknown> | null;
model?: string | null;
name: string;
organizationId: string;
paperWidthChars?: 32 | 35 | 42 | 44 | 48 | null;
printerLanguage?: "esc-pos" | "star-prnt" | "star-line" | null;
stationId?: string | null;
status: "active" | "inactive";
storeId?: string | null;
}): Promise<PrinterTransport>;Defined in: server/peripherals/create-server-transport.ts:11
Build a connected transport for a registry device, server-side. Only network devices are reachable from Node — WebUSB lives in the browser and QZ Tray's adapter is a planned follow-up.
Parameters
| Parameter | Type | Description |
|---|---|---|
device | { connection: | { kind: "webusb"; usbProductId: number; usbSerialNumber?: string | null; usbVendorId: number; } | { host: string; kind: "network"; port: number; } | { kind: "qz"; printerName: string; }; deviceType: "receipt_printer" | "cash_drawer" | "barcode_scanner"; drawerPin?: 2 | 5 | null; id: string; make?: string | null; metadata?: Record<string, unknown> | null; model?: string | null; name: string; organizationId: string; paperWidthChars?: 32 | 35 | 42 | 44 | 48 | null; printerLanguage?: "esc-pos" | "star-prnt" | "star-line" | null; stationId?: string | null; status: "active" | "inactive"; storeId?: string | null; } | - |
device.connection | | { kind: "webusb"; usbProductId: number; usbSerialNumber?: string | null; usbVendorId: number; } | { host: string; kind: "network"; port: number; } | { kind: "qz"; printerName: string; } | - |
device.deviceType | "receipt_printer" | "cash_drawer" | "barcode_scanner" | - |
device.drawerPin? | 2 | 5 | null | Drawer-kick pin — on printer rows (drawer wired to the printer) or standalone cash_drawer rows. |
device.id | string | - |
device.make? | string | null | - |
device.metadata? | Record<string, unknown> | null | - |
device.model? | string | null | - |
device.name | string | - |
device.organizationId | string | - |
device.paperWidthChars? | 32 | 35 | 42 | 44 | 48 | null | Character columns at the printer's default font. |
device.printerLanguage? | "esc-pos" | "star-prnt" | "star-line" | null | Required for receipt printers; meaningless for scanners. |
device.stationId? | string | null | - |
device.status | "active" | "inactive" | - |
device.storeId? | string | null | - |
Returns
Promise<PrinterTransport>