@signosoft/signpad-js 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +22 -3
- package/dist/signosoft-signpad.js +173 -155
- package/dist/signosoft-signpad.umd.cjs +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConnectionMode } from '@signosoft/tablet-driver';
|
|
1
2
|
import { CSSResult } from 'lit';
|
|
2
3
|
import { LitElement } from 'lit';
|
|
3
4
|
import { TemplateResult } from 'lit-html';
|
|
@@ -176,11 +177,12 @@ declare class ConnectionManager {
|
|
|
176
177
|
/**
|
|
177
178
|
* Initiates the connection process to a physical device or a mouse fallback.
|
|
178
179
|
*
|
|
179
|
-
* @param autoConnect -
|
|
180
|
+
* @param autoConnect - Connect mode: "manual" opens the browser device selection
|
|
181
|
+
* dialog; "auto"/"hotplug" attempt already-authorized devices silently.
|
|
180
182
|
* @param allowFallback - If true, enables mouse/pointer input if no physical device is found.
|
|
181
183
|
* @returns A promise resolving to true if connection (or fallback) was successful.
|
|
182
184
|
*/
|
|
183
|
-
connect(autoConnect?:
|
|
185
|
+
connect(autoConnect?: ConnectionMode, allowFallback?: boolean): Promise<boolean>;
|
|
184
186
|
/**
|
|
185
187
|
* Terminates the connection with the device and cleans up the driver instance.
|
|
186
188
|
* @returns Resolves when disconnection completes.
|
|
@@ -520,7 +522,8 @@ export declare class SignosoftSignpad extends LitElement {
|
|
|
520
522
|
dispatch(name: string, detail?: any): void;
|
|
521
523
|
/**
|
|
522
524
|
* Attempts to establish a connection with a signature tablet.
|
|
523
|
-
* @param autoConnect -
|
|
525
|
+
* @param autoConnect - Connect mode: "manual" opens the browser HID picker;
|
|
526
|
+
* "auto"/"hotplug" silently try already-authorized devices (see `ConnectionMode`).
|
|
524
527
|
* @param allowFallback - If true, enables mouse/touch signing if no device is found.
|
|
525
528
|
* @returns A promise resolving to true if connection (or fallback) succeeded.
|
|
526
529
|
*/
|
|
@@ -560,8 +563,24 @@ export declare class SignosoftSignpad extends LitElement {
|
|
|
560
563
|
* - if physical is not available, allow fallback as a secondary attempt
|
|
561
564
|
*/
|
|
562
565
|
connect: () => Promise<void>;
|
|
566
|
+
/**
|
|
567
|
+
* If currently in mouse fallback, tears that session down seamlessly
|
|
568
|
+
* (no DISCONNECTED UI flash) so a physical-device connect attempt can
|
|
569
|
+
* proceed cleanly.
|
|
570
|
+
*/
|
|
563
571
|
private prepareForManualConnect;
|
|
572
|
+
/**
|
|
573
|
+
* First step of the manual `connect()` flow: silently retries an
|
|
574
|
+
* already-authorized device (no HID picker) using "auto" mode.
|
|
575
|
+
* `allowFallback=false` ensures we only treat a real physical reconnect as success.
|
|
576
|
+
*/
|
|
564
577
|
private tryAuthorizedManualConnect;
|
|
578
|
+
/**
|
|
579
|
+
* Second step of the manual `connect()` flow, run only when the silent
|
|
580
|
+
* attempt above fails: opens the browser HID picker ("manual" mode) so
|
|
581
|
+
* the user can grant access to a new device. If the user cancels or no
|
|
582
|
+
* device is selected, falls back to one more silent "auto" attempt.
|
|
583
|
+
*/
|
|
565
584
|
private tryInteractiveManualConnectFallback;
|
|
566
585
|
/**
|
|
567
586
|
* UI disconnect action: delegates to the public disconnect method.
|