From f117a3d70cc006091bb072342d4a4702dd54a608 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Wed, 8 Apr 2026 19:15:56 -0600 Subject: [PATCH] Update API docs --- docs/Plugin API/documentscanner.md | 46 ++++++++++++++++++++++++++++++ docs/Plugin API/mailboxes.md | 5 ++-- docs/Plugin API/ui.md | 10 +++++-- 3 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 docs/Plugin API/documentscanner.md diff --git a/docs/Plugin API/documentscanner.md b/docs/Plugin API/documentscanner.md new file mode 100644 index 0000000..7b944f2 --- /dev/null +++ b/docs/Plugin API/documentscanner.md @@ -0,0 +1,46 @@ + + +## documentscanner : object +Scan documents from flatbed/ADF scanners. + +**Kind**: global namespace + +* [documentscanner](#documentscanner) : object + * [.discoverScanners()](#documentscanner.discoverScanners) ⇒ Promise.<Array> + * [.scanToPDF(scannerObj, opts)](#documentscanner.scanToPDF) ⇒ Promise.<Blob> + + + +### documentscanner.discoverScanners() ⇒ Promise.<Array> +Get a list of document scanners found on the network. Supports eSCL/AirPrint. + +**Kind**: static method of [documentscanner](#documentscanner) +**Example** +```js +[{ + protocol: "http", + host: "ip or hostname", + port: 80, + rs: "eSCL", + uuid: "1234etc", + icon: "http://hostname/icon.png", // Icon supplied by the scanner to represent itself visually to the user. + name: "ScanTron 9000", + note: "", // Whatever is set as the scanner's human-readable location in its settings + hasAdf: true, // Has an automatic document/page feeder + hasPlaten: true, // Has a flatbed + hasDuplex: false // Can do automatic duplex scanning + }] +``` + + +### documentscanner.scanToPDF(scannerObj, opts) ⇒ Promise.<Blob> +Scan a document to PDF. Supports eSCL/AirPrint. + +**Kind**: static method of [documentscanner](#documentscanner) +**Returns**: Promise.<Blob> - PDF file. + +| Param | Type | Description | +| --- | --- | --- | +| scannerObj | Object | A scanner object from discoverScanners() | +| opts | Object | Scanning options: dpi?: number, // default 300 colorMode?: string, // "RGB24" | "Grayscale8" | "BlackAndWhite1", default "RGB24" source?: string, // Where the document is physically located: "Platen" or "Feeder". Default is "Feeder" (if scanner has one and it isn't empty) or unset (so scanner can autodetect media). intent?: string, // default is unset. "Document" | "TextAndGraphic" | "Photo" | "Preview" duplex?: boolean, // default true if the scanner supports it. scanHeight?: number, // Height in inches. Default 11. scanWidth?: number // Width in inches. Default 8.5. | + diff --git a/docs/Plugin API/mailboxes.md b/docs/Plugin API/mailboxes.md index 99114a6..4095427 100644 --- a/docs/Plugin API/mailboxes.md +++ b/docs/Plugin API/mailboxes.md @@ -16,7 +16,7 @@ Add, modify, and delete mailboxes and mailbox customers. * [.deleteMailbox(number)](#mailboxes.deleteMailbox) ⇒ Promise * [.closeMailbox(number)](#mailboxes.closeMailbox) ⇒ Promise * [.mailboxExists(number)](#mailboxes.mailboxExists) ⇒ Promise.<boolean> - * [.addOrUpdateBoxholder(boxNumber, info)](#mailboxes.addOrUpdateBoxholder) ⇒ Promise + * [.addOrUpdateBoxholder(boxNumber, info, setPrimary)](#mailboxes.addOrUpdateBoxholder) ⇒ Promise * [.removeBoxholder(boxNumber, uuid)](#mailboxes.removeBoxholder) ⇒ Promise * [.get1583(boxNumber, uuid, archiveNumber)](#mailboxes.get1583) ⇒ Promise.<FormPS1583> * [.set1583(boxNumber, uuid, formps1583)](#mailboxes.set1583) ⇒ Promise @@ -158,7 +158,7 @@ Returns true if the mailbox number exists, false if it doesn't. -### mailboxes.addOrUpdateBoxholder(boxNumber, info) ⇒ Promise +### mailboxes.addOrUpdateBoxholder(boxNumber, info, setPrimary) ⇒ Promise Modify or add a boxholder to a mailbox. info is the boxholder structure below. If the uuid given already belongs to a boxholder, their info is updated with what you supply. Otherwise, the info is added as a new boxholder. @@ -169,6 +169,7 @@ Otherwise, the info is added as a new boxholder. | --- | --- | --- | | boxNumber | string | Mailbox number | | info | Object | Boxholder information. | +| setPrimary | Boolean \| undefined | If true, this boxholder will become the primary boxholder. Default is false. | **Example** ```js diff --git a/docs/Plugin API/ui.md b/docs/Plugin API/ui.md index 7aacd21..3ca9d17 100644 --- a/docs/Plugin API/ui.md +++ b/docs/Plugin API/ui.md @@ -236,6 +236,8 @@ if (type == "html") { ### ui.collectSignatureFromCustomerScreen(title, terms, termstype) Show a signature pad on the customer-facing display. +Signature pad may appear on main employee display in some hardware configurations +(for example, no customer display and main screen is touch-capable). When the customer indicates the signature is finished, the customerSignatureCollected event is emitted with the data {"svg": "data:image/svg+xml;base64,...", "png": "data:image/png;base64,..."} @@ -281,10 +283,14 @@ global.apis.ui.clearSignaturePad(); ### ui.getCustomerDisplayInfo() ⇒ Object Describes if the customer-facing display is currently enabled, -and if it supports customer touch interaction. +and if it supports customer touch interaction, and if it's possible to +get a signature via `collectSignatureFromCustomerScreen()`. +Note that it may be possible to get a signature even if `enabled` and/or `touch` are `false`, +because if the main PostalPoint display is on a touch-capable monitor, a signature popup +will be displayed there instead of on the customer screen. **Kind**: static method of [ui](#ui) -**Returns**: Object - {"enabled": true, "touch": true} +**Returns**: Object - {"enabled": true, "touch": true, "signature": true} **Example** ```js var info = global.apis.ui.getCustomerDisplayInfo();