@reservation-studio/electron-types 0.0.32 → 0.0.34
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/README.md
CHANGED
|
@@ -272,7 +272,7 @@ interface OperatorInfo {
|
|
|
272
272
|
|
|
273
273
|
### FiscalReceipt
|
|
274
274
|
|
|
275
|
-
|
|
275
|
+
```typescript
|
|
276
276
|
interface FiscalReceipt {
|
|
277
277
|
operator: OperatorInfo;
|
|
278
278
|
uniqueSaleNumber: string; // numeric string up to 7 digits
|
|
@@ -280,6 +280,7 @@ interface FiscalReceipt {
|
|
|
280
280
|
payments: FiscalPayment[];
|
|
281
281
|
client?: FiscalClient;
|
|
282
282
|
}
|
|
283
|
+
```
|
|
283
284
|
|
|
284
285
|
### NonFiscalReceipt
|
|
285
286
|
|
|
@@ -290,9 +291,7 @@ interface NonFiscalReceipt {
|
|
|
290
291
|
payments?: FiscalPayment[];
|
|
291
292
|
client?: FiscalClient;
|
|
292
293
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
````
|
|
294
|
+
```
|
|
296
295
|
|
|
297
296
|
### FiscalReceiptItem
|
|
298
297
|
|
|
@@ -304,7 +303,7 @@ interface FiscalReceiptItem {
|
|
|
304
303
|
vatGroup: FiscalVATGroup;
|
|
305
304
|
discount?: number;
|
|
306
305
|
}
|
|
307
|
-
|
|
306
|
+
```
|
|
308
307
|
|
|
309
308
|
### FiscalPayment
|
|
310
309
|
|
|
@@ -366,14 +365,20 @@ interface FiscalMemoryRecord {
|
|
|
366
365
|
|
|
367
366
|
```typescript
|
|
368
367
|
interface FiscalDeviceStatus {
|
|
369
|
-
connected
|
|
370
|
-
|
|
371
|
-
fiscalMemoryFull
|
|
372
|
-
fiscalReceiptOpen
|
|
373
|
-
nonFiscalReceiptOpen
|
|
374
|
-
|
|
368
|
+
connected: boolean;
|
|
369
|
+
paperStatus: PaperStatus;
|
|
370
|
+
fiscalMemoryFull: boolean;
|
|
371
|
+
fiscalReceiptOpen: boolean;
|
|
372
|
+
nonFiscalReceiptOpen: boolean;
|
|
373
|
+
readyToPrint: boolean;
|
|
375
374
|
messages: FiscalResponseMessage[];
|
|
376
375
|
}
|
|
376
|
+
|
|
377
|
+
enum PaperStatus {
|
|
378
|
+
Ok = 'ok',
|
|
379
|
+
Low = 'low',
|
|
380
|
+
Out = 'out'
|
|
381
|
+
}
|
|
377
382
|
```
|
|
378
383
|
|
|
379
384
|
### FiscalResponseMessage
|
|
@@ -386,6 +391,11 @@ interface FiscalResponseMessage {
|
|
|
386
391
|
}
|
|
387
392
|
```
|
|
388
393
|
|
|
394
|
+
### Fiscal IPC Errors
|
|
395
|
+
|
|
396
|
+
Fiscal IPC calls throw a structured `FiscalDeviceErrorPayload` on failure. Consumers should display the payload `message` and use optional `details`, `status`, and `validationErrors` for diagnostics.
|
|
397
|
+
Because Electron IPC serializes thrown values, payloads are encoded as JSON in the error message when crossing the renderer boundary.
|
|
398
|
+
|
|
389
399
|
### ReversalReceipt
|
|
390
400
|
|
|
391
401
|
```typescript
|
|
@@ -46,31 +46,36 @@ export interface FiscalMemoryRecord {
|
|
|
46
46
|
/**
|
|
47
47
|
* Interface for fiscal device status
|
|
48
48
|
*/
|
|
49
|
+
export declare enum PaperStatus {
|
|
50
|
+
Ok = "ok",
|
|
51
|
+
Low = "low",
|
|
52
|
+
Out = "out"
|
|
53
|
+
}
|
|
49
54
|
export interface FiscalDeviceStatus {
|
|
50
55
|
/**
|
|
51
|
-
*
|
|
56
|
+
* High-level paper status derived from device flags.
|
|
52
57
|
*/
|
|
53
|
-
|
|
58
|
+
paperStatus: PaperStatus;
|
|
54
59
|
/**
|
|
55
|
-
* Whether the device
|
|
60
|
+
* Whether the device is connected
|
|
56
61
|
*/
|
|
57
|
-
|
|
62
|
+
connected: boolean;
|
|
58
63
|
/**
|
|
59
64
|
* Whether the fiscal memory is full
|
|
60
65
|
*/
|
|
61
|
-
fiscalMemoryFull
|
|
66
|
+
fiscalMemoryFull: boolean;
|
|
62
67
|
/**
|
|
63
68
|
* Whether a fiscal receipt is currently open
|
|
64
69
|
*/
|
|
65
|
-
fiscalReceiptOpen
|
|
70
|
+
fiscalReceiptOpen: boolean;
|
|
66
71
|
/**
|
|
67
72
|
* Whether a non-fiscal receipt is currently open
|
|
68
73
|
*/
|
|
69
|
-
nonFiscalReceiptOpen
|
|
74
|
+
nonFiscalReceiptOpen: boolean;
|
|
70
75
|
/**
|
|
71
|
-
* Whether
|
|
76
|
+
* Whether the device is ready to accept print commands.
|
|
72
77
|
*/
|
|
73
|
-
|
|
78
|
+
readyToPrint: boolean;
|
|
74
79
|
/**
|
|
75
80
|
* The messages returned by the fiscal device
|
|
76
81
|
*/
|
|
@@ -212,7 +217,8 @@ export interface FiscalResponseMessage {
|
|
|
212
217
|
*/
|
|
213
218
|
type: 'info' | 'warning' | 'error';
|
|
214
219
|
/**
|
|
215
|
-
* The code of the message (if applicable)
|
|
220
|
+
* The code of the message (if applicable).
|
|
221
|
+
* Daisy example codes: E301 (out of paper), W301/W302 (paper low), E999 (general error).
|
|
216
222
|
*/
|
|
217
223
|
code?: string;
|
|
218
224
|
/**
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaperStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Interface for fiscal device status
|
|
6
|
+
*/
|
|
7
|
+
var PaperStatus;
|
|
8
|
+
(function (PaperStatus) {
|
|
9
|
+
PaperStatus["Ok"] = "ok";
|
|
10
|
+
PaperStatus["Low"] = "low";
|
|
11
|
+
PaperStatus["Out"] = "out";
|
|
12
|
+
})(PaperStatus || (exports.PaperStatus = PaperStatus = {}));
|