You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sims-hq/apps/pos/electron/preload.ts

9 lines
356 B
TypeScript

import { contextBridge, ipcRenderer } from 'electron'
contextBridge.exposeInMainWorld('pos', {
listPrinters: (): Promise<{ name: string; displayName: string }[]> =>
ipcRenderer.invoke('printers:list'),
printRaw9100: (host: string, port: number, bytes: Uint8Array): Promise<string> =>
ipcRenderer.invoke('print:raw9100', host, port, bytes),
})