@reservation-studio/electron-types 0.0.18 → 0.0.19

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.
@@ -106,96 +106,114 @@ export interface ApiInterface {
106
106
  */
107
107
  getActiveDevice(): Promise<FiscalDeviceResponse>;
108
108
  /**
109
- * Gets detailed information about the active device.
109
+ * Gets detailed information about a fiscal device.
110
110
  *
111
+ * @param {string} [serial] - Optional serial number of the device to get information for. If not provided, uses the active device.
111
112
  * @return {Promise<DeviceInfo>} A promise that resolves to the detailed device information.
112
- * @throws {Error} If no active device is set.
113
+ * @throws {Error} If no active device is set and no serial is provided, or if the device with the specified serial is not found.
113
114
  */
114
- getDeviceInfo(): Promise<DeviceInfo>;
115
+ getDeviceInfo(serial?: string): Promise<DeviceInfo>;
115
116
  /**
116
- * Prints a fiscal receipt using the active device.
117
+ * Prints a fiscal receipt using a fiscal device.
117
118
  *
118
119
  * @param {FiscalReceipt} receipt - The receipt to print.
120
+ * @param {string} [serial] - Optional serial number of the device to use. If not provided, uses the active device.
119
121
  * @return {Promise<FiscalResponse>} A promise that resolves to the fiscal response.
122
+ * @throws {Error} If no active device is set and no serial is provided, or if the device with the specified serial is not found.
120
123
  */
121
- printReceipt(receipt: FiscalReceipt): Promise<FiscalResponse>;
124
+ printReceipt(receipt: FiscalReceipt, serial?: string): Promise<FiscalResponse>;
122
125
  /**
123
- * Prints a non-fiscal receipt using the given receipt data.
126
+ * Prints a non-fiscal receipt using a fiscal device.
124
127
  *
125
128
  * @param {FiscalReceipt} receipt - The receipt object containing details to be printed as a non-fiscal receipt.
129
+ * @param {string} [serial] - Optional serial number of the device to use. If not provided, uses the active device.
126
130
  * @return {Promise<FiscalResponse>} A promise that resolves to a FiscalResponse object indicating the result of the operation.
131
+ * @throws {Error} If no active device is set and no serial is provided, or if the device with the specified serial is not found.
127
132
  */
128
- printNonFiscalReceipt(receipt: FiscalReceipt): Promise<FiscalResponse>;
133
+ printNonFiscalReceipt(receipt: FiscalReceipt, serial?: string): Promise<FiscalResponse>;
129
134
  /**
130
- * Prints a reversal receipt using the active device.
135
+ * Prints a reversal receipt using a fiscal device.
131
136
  *
132
137
  * @param {ReversalReceipt} receipt - The reversal receipt to print.
138
+ * @param {string} [serial] - Optional serial number of the device to use. If not provided, uses the active device.
133
139
  * @return {Promise<FiscalResponse>} A promise that resolves to the fiscal response.
140
+ * @throws {Error} If no active device is set and no serial is provided, or if the device with the specified serial is not found.
134
141
  */
135
- printReversalReceipt(receipt: ReversalReceipt): Promise<FiscalResponse>;
136
- /**
137
- * Prints a non-fiscal text using the active device.
138
- *
139
- * @param {string} text - The text to print.
140
- * @return {Promise<boolean>} A promise that resolves to true if printing was successful.
141
- */
142
- printText(text: string): Promise<boolean>;
142
+ printReversalReceipt(receipt: ReversalReceipt, serial?: string): Promise<FiscalResponse>;
143
143
  /**
144
- * Gets the last fiscal memory record from the active device.
144
+ * Gets the last fiscal memory record from a fiscal device.
145
145
  *
146
+ * @param {string} [serial] - Optional serial number of the device to use. If not provided, uses the active device.
146
147
  * @return {Promise<FiscalMemoryRecord>} A promise that resolves to the last fiscal memory record.
148
+ * @throws {Error} If no active device is set and no serial is provided, or if the device with the specified serial is not found.
147
149
  */
148
- getLastFiscalRecord(): Promise<FiscalMemoryRecord>;
150
+ getLastFiscalRecord(serial?: string): Promise<FiscalMemoryRecord>;
149
151
  /**
150
- * Gets the status of the active device.
152
+ * Gets the status of a fiscal device.
151
153
  *
152
- * @return {Promise<FiscalDeviceStatus>} A promise that resolves to the status of the active device.
154
+ * @param {string} [serial] - Optional serial number of the device to get status for. If not provided, uses the active device.
155
+ * @return {Promise<FiscalDeviceStatus>} A promise that resolves to the status of the device.
156
+ * @throws {Error} If no active device is set and no serial is provided, or if the device with the specified serial is not found.
153
157
  */
154
- getStatus(): Promise<FiscalDeviceStatus>;
158
+ getStatus(serial?: string): Promise<FiscalDeviceStatus>;
155
159
  /**
156
- * Prints an X report (daily financial report without reset) using the active device.
160
+ * Prints an X report (daily financial report without reset) using a fiscal device.
157
161
  *
162
+ * @param {string} [serial] - Optional serial number of the device to use. If not provided, uses the active device.
158
163
  * @return {Promise<boolean>} A promise that resolves to true if printing was successful.
164
+ * @throws {Error} If no active device is set and no serial is provided, or if the device with the specified serial is not found.
159
165
  */
160
- printXReport(): Promise<boolean>;
166
+ printXReport(serial?: string): Promise<boolean>;
161
167
  /**
162
- * Prints a Z report (daily financial report with reset) using the active device.
168
+ * Prints a Z report (daily financial report with reset) using a fiscal device.
163
169
  *
170
+ * @param {string} [serial] - Optional serial number of the device to use. If not provided, uses the active device.
164
171
  * @return {Promise<boolean>} A promise that resolves to true if printing was successful.
172
+ * @throws {Error} If no active device is set and no serial is provided, or if the device with the specified serial is not found.
165
173
  */
166
- printZReport(): Promise<boolean>;
174
+ printZReport(serial?: string): Promise<boolean>;
167
175
  /**
168
- * Deposits money into the cash register using the active device.
176
+ * Deposits money into the cash register using a fiscal device.
169
177
  *
170
178
  * @param {number} amount - The amount to deposit.
179
+ * @param {string} [serial] - Optional serial number of the device to use. If not provided, uses the active device.
171
180
  * @return {Promise<boolean>} A promise that resolves to true if the deposit was successful.
181
+ * @throws {Error} If no active device is set and no serial is provided, or if the device with the specified serial is not found.
172
182
  */
173
- depositMoney(amount: number): Promise<boolean>;
183
+ depositMoney(amount: number, serial?: string): Promise<boolean>;
174
184
  /**
175
- * Withdraws money from the cash register using the active device.
185
+ * Withdraws money from the cash register using a fiscal device.
176
186
  *
177
187
  * @param {number} amount - The amount to withdraw.
188
+ * @param {string} [serial] - Optional serial number of the device to use. If not provided, uses the active device.
178
189
  * @return {Promise<boolean>} A promise that resolves to true if the withdrawal was successful.
190
+ * @throws {Error} If no active device is set and no serial is provided, or if the device with the specified serial is not found.
179
191
  */
180
- withdrawMoney(amount: number): Promise<boolean>;
192
+ withdrawMoney(amount: number, serial?: string): Promise<boolean>;
181
193
  /**
182
- * Gets the current cash amount in the register using the active device.
194
+ * Gets the current cash amount in the register using a fiscal device.
183
195
  *
196
+ * @param {string} [serial] - Optional serial number of the device to use. If not provided, uses the active device.
184
197
  * @return {Promise<number>} A promise that resolves to the current cash amount.
198
+ * @throws {Error} If no active device is set and no serial is provided, or if the device with the specified serial is not found.
185
199
  */
186
- getCashAmount(): Promise<number>;
200
+ getCashAmount(serial?: string): Promise<number>;
187
201
  /**
188
- * Sets the date and time on the active device.
202
+ * Sets the date and time on a fiscal device.
189
203
  *
190
204
  * @param {Date} dateTime - The date and time to set.
205
+ * @param {string} [serial] - Optional serial number of the device to use. If not provided, uses the active device.
191
206
  * @return {Promise<boolean>} A promise that resolves to true if setting was successful.
207
+ * @throws {Error} If no active device is set and no serial is provided, or if the device with the specified serial is not found.
192
208
  */
193
- setDateTime(dateTime: Date): Promise<boolean>;
209
+ setDateTime(dateTime: Date, serial?: string): Promise<boolean>;
194
210
  /**
195
- * Prints a duplicate of the last receipt using the active device.
211
+ * Prints a duplicate of the last receipt using a fiscal device.
196
212
  *
213
+ * @param {string} [serial] - Optional serial number of the device to use. If not provided, uses the active device.
197
214
  * @return {Promise<boolean>} A promise that resolves to true if printing was successful.
215
+ * @throws {Error} If no active device is set and no serial is provided, or if the device with the specified serial is not found.
198
216
  */
199
- printDuplicate(): Promise<boolean>;
217
+ printDuplicate(serial?: string): Promise<boolean>;
200
218
  };
201
219
  }
@@ -57,13 +57,6 @@ export interface FiscalDeviceInterface {
57
57
  * @returns {Promise<FiscalResponse>} A promise that resolves to the fiscal response
58
58
  */
59
59
  printReversalReceipt(receipt: ReversalReceipt): Promise<FiscalResponse>;
60
- /**
61
- * Prints a non-fiscal text
62
- *
63
- * @param {string} text - The text to print
64
- * @returns {Promise<boolean>} A promise that resolves to true if printing was successful
65
- */
66
- printText(text: string): Promise<boolean>;
67
60
  /**
68
61
  * Gets the last fiscal memory record
69
62
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reservation-studio/electron-types",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "TypeScript типове за ReservationStudioElectron",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.json",