@nice2dev/ui-platform 1.1.9 → 1.2.0

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 CHANGED
@@ -1099,6 +1099,12 @@ export declare interface NiceBatchScannerProps {
1099
1099
  children?: default_2.ReactNode;
1100
1100
  }
1101
1101
 
1102
+ /**
1103
+ * Shares a NiceBatchScanner's items and actions with everything below the provider, not only
1104
+ * with the scanner's own children: `useBatchScanner()` works beside the scanner too. Without a
1105
+ * scanner below it, the hook sees an empty, idle batch (and the actions warn in development).
1106
+ * It used to render its children and nothing else, so the hook threw under it.
1107
+ */
1102
1108
  export declare const NiceBatchScannerProvider: default_2.FC<{
1103
1109
  children: default_2.ReactNode;
1104
1110
  }>;
@@ -1796,6 +1802,14 @@ export declare interface NiceRemoteManagementProps {
1796
1802
  onCommandReceived?: (command: RemoteCommand) => void;
1797
1803
  /** On custom command */
1798
1804
  onCustomCommand?: (command: RemoteCommand) => Promise<unknown>;
1805
+ /**
1806
+ * Takes the screenshot for the server's `screenshot` command and for `captureScreenshot()`:
1807
+ * return the image, e.g. as a data URL. A page cannot capture itself without asking the user,
1808
+ * so the capture comes from the host — html2canvas / html-to-image, or the kiosk shell
1809
+ * (Electron's `webContents.capturePage()` and the like). Without it the command reports an
1810
+ * error to the server.
1811
+ */
1812
+ onCaptureScreenshot?: () => Promise<string | undefined>;
1799
1813
  /** Children */
1800
1814
  children?: ReactNode;
1801
1815
  }
@@ -1817,7 +1831,10 @@ export declare interface NiceRemoteManagementRef {
1817
1831
  reportCommandResult: (commandId: string, result: unknown, error?: string) => Promise<void>;
1818
1832
  /** Send log */
1819
1833
  sendLog: (level: string, message: string, data?: unknown) => void;
1820
- /** Capture screenshot */
1834
+ /**
1835
+ * Capture a screenshot through `onCaptureScreenshot`; `undefined` when screenshots are off,
1836
+ * there is no handler or it failed.
1837
+ */
1821
1838
  captureScreenshot: () => Promise<string | undefined>;
1822
1839
  /** Get device info */
1823
1840
  getDeviceInfo: () => DeviceInfo;
@@ -2361,7 +2378,10 @@ export declare interface RemoteManagementConfig {
2361
2378
  enableHealthMonitoring?: boolean;
2362
2379
  /** Health report interval (ms) */
2363
2380
  healthReportInterval?: number;
2364
- /** Enable screenshot capture */
2381
+ /**
2382
+ * Answer the server's `screenshot` command (default true). The image itself comes from
2383
+ * `onCaptureScreenshot`; with this off, or without that prop, the command reports an error.
2384
+ */
2365
2385
  enableScreenshot?: boolean;
2366
2386
  /** Enable log collection */
2367
2387
  enableLogs?: boolean;
@@ -2680,6 +2700,10 @@ export declare const useAutoStart: () => AutoStartContextValue;
2680
2700
 
2681
2701
  export declare const useBackgroundSync: () => BackgroundSyncContextValue;
2682
2702
 
2703
+ /**
2704
+ * The scanned items and the scanner's actions — inside a NiceBatchScanner (its children), or
2705
+ * anywhere below a NiceBatchScannerProvider that has a NiceBatchScanner somewhere under it.
2706
+ */
2683
2707
  export declare const useBatchScanner: () => BatchScannerContextValue;
2684
2708
 
2685
2709
  export declare function useCachedFetch<T = unknown>(url: string | null, options?: FetchOptions): {