File tree Expand file tree Collapse file tree 2 files changed +26
-16
lines changed
core/ecommerce/src/receipts Expand file tree Collapse file tree 2 files changed +26
-16
lines changed Original file line number Diff line number Diff line change 1
- type PrinterDriver = {
2
- print : ( receipt : Receipt ) => void
3
- cleanUp : ( ) => void
4
- checkStatus : ( ) => void
1
+ interface PrinterDriver {
2
+ print : ( receipt : Receipt ) => Promise < void >
3
+ cleanUp : ( ) => Promise < void >
4
+ checkStatus : ( ) => Promise < boolean >
5
5
}
6
6
7
+ type Path = string
8
+
7
9
type Receipt = {
8
- id : string
10
+ id : string | number
9
11
name : string
10
12
price : number
11
13
quantity : number
12
- image : string
14
+ template : Path
13
15
}
14
16
15
- const printer : PrinterDriver = {
16
- print ( receipt : Receipt ) {
17
- console . log ( receipt )
18
- } ,
17
+ class TSPIVPrinter implements PrinterDriver {
18
+ async print ( receipt : Receipt ) : Promise < void > {
19
+ console . log ( 'TSP IV Printer: Printing receipt' , receipt )
20
+ // Implement actual printing logic here
21
+ }
19
22
20
- cleanUp ( ) {
21
- console . log ( 'Cleaning up print job...' )
22
- } ,
23
+ async cleanUp ( ) : Promise < void > {
24
+ console . log ( 'TSP IV Printer: Cleaning up print job...' )
25
+ // Implement actual cleanup logic here
26
+ }
23
27
24
- checkStatus ( ) {
25
- console . log ( 'Checking online status...' )
26
- } ,
28
+ async checkStatus ( ) : Promise < boolean > {
29
+ console . log ( 'TSP IV Printer: Checking online status...' )
30
+ // Implement actual status check logic here
31
+ return true // Return actual status
32
+ }
27
33
}
34
+
35
+ // Export the TSP IV printer instance
36
+ export const tspIVPrinter = new TSPIVPrinter ( )
Original file line number Diff line number Diff line change 315
315
treeshaking
316
316
triggerable
317
317
tsdoc
318
+ TSPIV
318
319
tsup
319
320
twoslash
320
321
typecheck
You can’t perform that action at this time.
0 commit comments