@techallee/foodverse 1.0.0 → 1.0.1
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/package.json +8 -2
- package/src/types/api/menu.d.ts +5 -5
- package/src/types/api/order.d.ts +28 -10
- package/src/types/api/printer.d.ts +14 -14
- package/src/types/api/restaurant.d.ts +8 -8
- package/src/types/api/socketEvent.d.ts +3 -3
- package/src/types/api/user.d.ts +4 -4
- package/src/types/app/map.d.ts +0 -8
- package/.idea/material_theme_project_new.xml +0 -12
- package/src/types/app/vue3-smooth-dnd.d.ts +0 -59
- package/src/types/general/escpos.d.ts +0 -346
- package/src/types/general/global.d.ts +0 -54
- package/tsconfig.json +0 -7
package/package.json
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techallee/foodverse",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"src"
|
|
8
|
+
],
|
|
6
9
|
"scripts": {
|
|
7
10
|
"build": "tsc"
|
|
8
11
|
},
|
|
9
12
|
"keywords": [],
|
|
10
13
|
"author": "",
|
|
11
14
|
"license": "ISC",
|
|
12
|
-
"type": "commonjs"
|
|
15
|
+
"type": "commonjs",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"leaflet": "^1.9.4"
|
|
18
|
+
}
|
|
13
19
|
}
|
package/src/types/api/menu.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type MenuSource = 'foodverse' | 'lieferando' | 'wolt' | 'uber_eats';
|
|
2
2
|
|
|
3
|
-
interface Specification {
|
|
3
|
+
declare interface Specification {
|
|
4
4
|
id: string;
|
|
5
5
|
externalId?: string | null;
|
|
6
6
|
source: MenuSource;
|
|
@@ -14,7 +14,7 @@ interface Specification {
|
|
|
14
14
|
restaurantId: string;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
interface OptionGroup {
|
|
17
|
+
declare interface OptionGroup {
|
|
18
18
|
id: string;
|
|
19
19
|
externalId?: string | null;
|
|
20
20
|
source: MenuSource;
|
|
@@ -23,7 +23,7 @@ interface OptionGroup {
|
|
|
23
23
|
specifications: Specification[];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
interface Variant {
|
|
26
|
+
declare interface Variant {
|
|
27
27
|
id: string;
|
|
28
28
|
externalId?: string | null;
|
|
29
29
|
source: MenuSource;
|
|
@@ -36,7 +36,7 @@ interface Variant {
|
|
|
36
36
|
productId: string;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
interface Product {
|
|
39
|
+
declare interface Product {
|
|
40
40
|
id: string;
|
|
41
41
|
externalId?: string | null;
|
|
42
42
|
source: MenuSource;
|
|
@@ -55,7 +55,7 @@ interface Product {
|
|
|
55
55
|
optionGroups: OptionGroup[];
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
interface Category {
|
|
58
|
+
declare interface Category {
|
|
59
59
|
id: string;
|
|
60
60
|
externalId?: string | null;
|
|
61
61
|
source: MenuSource;
|
package/src/types/api/order.d.ts
CHANGED
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
type OrderSource = 'foodverse_web' | 'foodverse_local' | 'foodverse_terminal' | 'foodverse_app' | 'lieferando' | 'wolt' | 'uber_eats';
|
|
2
|
-
type PrintStatus = 'pending' | 'success' | 'error';
|
|
3
|
-
type OrderStatus = 'created' | 'confirmed' | 'prepared' | 'delivered' | 'cancelled'
|
|
4
|
-
type DeliveryType = 'service' | 'in_house' | 'pickup' | 'delivery';
|
|
5
|
-
type PaymentType = 'cash' | 'online' | 'card';
|
|
1
|
+
declare type OrderSource = 'foodverse_web' | 'foodverse_local' | 'foodverse_terminal' | 'foodverse_app' | 'lieferando' | 'wolt' | 'uber_eats';
|
|
2
|
+
declare type PrintStatus = 'pending' | 'success' | 'error';
|
|
3
|
+
declare type OrderStatus = 'created' | 'confirmed' | 'prepared' | 'delivered' | 'cancelled'
|
|
4
|
+
declare type DeliveryType = 'service' | 'in_house' | 'pickup' | 'delivery';
|
|
5
|
+
declare type PaymentType = 'cash' | 'online' | 'card';
|
|
6
6
|
|
|
7
|
-
interface
|
|
7
|
+
declare interface Price {
|
|
8
|
+
price: number;
|
|
9
|
+
pickupPrice: number;
|
|
10
|
+
deliveryPrice: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare interface ItemAttributes {
|
|
14
|
+
depositAmount?: string;
|
|
15
|
+
volume?: string;
|
|
16
|
+
alcoholVolume?: string;
|
|
17
|
+
caffeineAmount?: string;
|
|
18
|
+
isAlcoholic: boolean;
|
|
19
|
+
isVegan: boolean;
|
|
20
|
+
isVegetarian: boolean;
|
|
21
|
+
isGlutenFree: boolean;
|
|
22
|
+
isLactoseFree: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare interface OrderSpecification {
|
|
8
26
|
name: string;
|
|
9
27
|
quantity: number;
|
|
10
28
|
price: number;
|
|
11
29
|
}
|
|
12
30
|
|
|
13
|
-
interface OrderProduct {
|
|
31
|
+
declare interface OrderProduct {
|
|
14
32
|
name: string;
|
|
15
33
|
categoryName: string;
|
|
16
34
|
code?: string | null;
|
|
@@ -21,14 +39,14 @@ interface OrderProduct {
|
|
|
21
39
|
specifications: OrderSpecification[];
|
|
22
40
|
}
|
|
23
41
|
|
|
24
|
-
interface OrderPrices {
|
|
42
|
+
declare interface OrderPrices {
|
|
25
43
|
deliveryFee: number;
|
|
26
44
|
discountTotal: number;
|
|
27
45
|
subTotal: number;
|
|
28
46
|
totalPrice: number;
|
|
29
47
|
}
|
|
30
48
|
|
|
31
|
-
interface Address {
|
|
49
|
+
declare interface Address {
|
|
32
50
|
id: string;
|
|
33
51
|
fullName: string;
|
|
34
52
|
street: string | null;
|
|
@@ -47,7 +65,7 @@ interface Address {
|
|
|
47
65
|
userId: string | null;
|
|
48
66
|
}
|
|
49
67
|
|
|
50
|
-
interface Order {
|
|
68
|
+
declare interface Order {
|
|
51
69
|
id: string;
|
|
52
70
|
externalId?: string | null;
|
|
53
71
|
placedDate: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
type StationPrinterType = 'hardware' | 'software';
|
|
2
|
-
type CounterType = 'main_counter' | 'sub_counter';
|
|
3
|
-
type CounterOperator = 'equals' | 'contains' | 'starts_with' | 'ends_with';
|
|
4
|
-
type CounterPropertyType = 'product' | 'variant' | 'specification';
|
|
5
|
-
type PrintedProductStatus = 0 | 1 | 2 | 3; // 0: nothing, 1: drink, 2: food, 3: both
|
|
1
|
+
declare type StationPrinterType = 'hardware' | 'software';
|
|
2
|
+
declare type CounterType = 'main_counter' | 'sub_counter';
|
|
3
|
+
declare type CounterOperator = 'equals' | 'contains' | 'starts_with' | 'ends_with';
|
|
4
|
+
declare type CounterPropertyType = 'product' | 'variant' | 'specification';
|
|
5
|
+
declare type PrintedProductStatus = 0 | 1 | 2 | 3; // 0: nothing, 1: drink, 2: food, 3: both
|
|
6
6
|
|
|
7
|
-
interface CounterProperty {
|
|
7
|
+
declare interface CounterProperty {
|
|
8
8
|
id: string;
|
|
9
9
|
operator: CounterOperator;
|
|
10
10
|
property: CounterPropertyType;
|
|
@@ -13,7 +13,7 @@ interface CounterProperty {
|
|
|
13
13
|
counterId: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
interface PrintedProduct {
|
|
16
|
+
declare interface PrintedProduct {
|
|
17
17
|
id: string;
|
|
18
18
|
stationPrinterId: string;
|
|
19
19
|
productName: string;
|
|
@@ -21,7 +21,7 @@ interface PrintedProduct {
|
|
|
21
21
|
showDetail: boolean;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
interface Counter {
|
|
24
|
+
declare interface Counter {
|
|
25
25
|
id: string;
|
|
26
26
|
name: string;
|
|
27
27
|
color: string;
|
|
@@ -31,9 +31,9 @@ interface Counter {
|
|
|
31
31
|
counterProperties: CounterProperty[];
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
interface StationPrinterOptions {
|
|
34
|
+
declare interface StationPrinterOptions {
|
|
35
35
|
enabled: boolean;
|
|
36
|
-
deliveryTypes:
|
|
36
|
+
deliveryTypes: DeliveryType[];
|
|
37
37
|
mainCounters: boolean;
|
|
38
38
|
subCounters: boolean;
|
|
39
39
|
comboCounters: boolean;
|
|
@@ -57,9 +57,9 @@ interface StationPrinterOptions {
|
|
|
57
57
|
bigSize: boolean;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
type StationPrinterOptionKey = keyof StationPrinterOptions;
|
|
60
|
+
declare type StationPrinterOptionKey = keyof StationPrinterOptions;
|
|
61
61
|
|
|
62
|
-
interface StationPrinter {
|
|
62
|
+
declare interface StationPrinter {
|
|
63
63
|
id: string;
|
|
64
64
|
name: string;
|
|
65
65
|
printerName: string;
|
|
@@ -73,13 +73,13 @@ interface StationPrinter {
|
|
|
73
73
|
products?: string[];
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
interface CategoryOption {
|
|
76
|
+
declare interface CategoryOption {
|
|
77
77
|
name: string;
|
|
78
78
|
products: string[];
|
|
79
79
|
selected: boolean;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
interface DeliveryTypeOption {
|
|
82
|
+
declare interface DeliveryTypeOption {
|
|
83
83
|
value: DeliveryType,
|
|
84
84
|
text: string,
|
|
85
85
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
type State = 'NATIONAL' | 'BW' | 'BY' | 'BE' | 'BB' | 'HB' | 'HH' | 'HE' | 'MV' | 'NI' | 'NW' | 'RP' | 'SL' | 'SN' | 'ST' | 'SH' | 'TH';
|
|
1
|
+
declare type State = 'NATIONAL' | 'BW' | 'BY' | 'BE' | 'BB' | 'HB' | 'HH' | 'HE' | 'MV' | 'NI' | 'NW' | 'RP' | 'SL' | 'SN' | 'ST' | 'SH' | 'TH';
|
|
2
2
|
|
|
3
|
-
interface Floor {
|
|
3
|
+
declare interface Floor {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
6
6
|
displayName?: string | null;
|
|
@@ -10,7 +10,7 @@ interface Floor {
|
|
|
10
10
|
onlineShopId: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
interface MapGeoJsonFeature {
|
|
13
|
+
declare interface MapGeoJsonFeature {
|
|
14
14
|
id: string;
|
|
15
15
|
type: 'Feature';
|
|
16
16
|
geometry: {
|
|
@@ -23,14 +23,14 @@ interface MapGeoJsonFeature {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
interface MapGeoJson {
|
|
26
|
+
declare interface MapGeoJson {
|
|
27
27
|
id: string;
|
|
28
28
|
type: 'FeatureCollection';
|
|
29
29
|
areaId: string;
|
|
30
30
|
features: MapGeoJsonFeature[];
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
interface Area {
|
|
33
|
+
declare interface Area {
|
|
34
34
|
id: string;
|
|
35
35
|
radius: number;
|
|
36
36
|
deliveryFee: number;
|
|
@@ -38,7 +38,7 @@ interface Area {
|
|
|
38
38
|
geojson: MapGeoJson;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
interface OnlineShop {
|
|
41
|
+
declare interface OnlineShop {
|
|
42
42
|
id: string;
|
|
43
43
|
active: boolean;
|
|
44
44
|
preorderStart: number;
|
|
@@ -53,14 +53,14 @@ interface OnlineShop {
|
|
|
53
53
|
areas: Area[];
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
interface Tab {
|
|
56
|
+
declare interface Tab {
|
|
57
57
|
id: string;
|
|
58
58
|
name: string;
|
|
59
59
|
icon: number;
|
|
60
60
|
restaurantId: string;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
interface Restaurant {
|
|
63
|
+
declare interface Restaurant {
|
|
64
64
|
id: string;
|
|
65
65
|
name: string;
|
|
66
66
|
street: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
declare interface SocketEventData<T> {
|
|
2
2
|
data: T;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
declare interface OrderCreatedData {
|
|
6
6
|
order: Order;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
declare interface OrderUpdatedData {
|
|
10
10
|
order: Partial<Order>;
|
|
11
11
|
}
|
package/src/types/api/user.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
type StaffStatus = 'active' | 'inactive' | 'locked';
|
|
2
|
-
type Role = 'admin' | 'waiter' | 'station' | 'manager' | 'kitchen' | 'courier';
|
|
1
|
+
declare type StaffStatus = 'active' | 'inactive' | 'locked';
|
|
2
|
+
declare type Role = 'admin' | 'waiter' | 'station' | 'manager' | 'kitchen' | 'courier';
|
|
3
3
|
|
|
4
|
-
interface Staff {
|
|
4
|
+
declare interface Staff {
|
|
5
5
|
id: string;
|
|
6
6
|
name: string;
|
|
7
7
|
firstName: string;
|
|
@@ -10,7 +10,7 @@ interface Staff {
|
|
|
10
10
|
fullTime: boolean;
|
|
11
11
|
onDuty: boolean;
|
|
12
12
|
status: StaffStatus;
|
|
13
|
-
currentRole?:
|
|
13
|
+
currentRole?: Role;
|
|
14
14
|
currentRoleId?: string;
|
|
15
15
|
teamId: string;
|
|
16
16
|
lastActive?: string;
|
package/src/types/app/map.d.ts
CHANGED
|
@@ -5,14 +5,6 @@ interface SmoothZoomOptions {
|
|
|
5
5
|
duration?: number
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
interface DropController<T> {
|
|
9
|
-
onenter: () => void;
|
|
10
|
-
ondrop: (dropResult: DropResult<T>) => void;
|
|
11
|
-
payload: (index: number) => string;
|
|
12
|
-
accept: (_sourceContainerOptions, payload: T) => boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
type OrderDropController = Record<string, DropController<Order>>
|
|
16
8
|
type SelectedDriver = Record<string, Staff>
|
|
17
9
|
|
|
18
10
|
interface Polyline {
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="MaterialThemeProjectNewConfig">
|
|
4
|
-
<option name="metadata">
|
|
5
|
-
<MTProjectMetadataState>
|
|
6
|
-
<option name="migrated" value="true" />
|
|
7
|
-
<option name="pristineConfig" value="false" />
|
|
8
|
-
<option name="userId" value="2d81b51f:190131dc07c:-7ffe" />
|
|
9
|
-
</MTProjectMetadataState>
|
|
10
|
-
</option>
|
|
11
|
-
</component>
|
|
12
|
-
</project>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
declare module 'vue3-smooth-dnd' {
|
|
2
|
-
import Vue from 'vue';
|
|
3
|
-
|
|
4
|
-
type Payload = any;
|
|
5
|
-
|
|
6
|
-
interface DropResult<T> {
|
|
7
|
-
removedIndex: number;
|
|
8
|
-
addedIndex: number;
|
|
9
|
-
payload: T;
|
|
10
|
-
element: Element;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface DragEvent {
|
|
14
|
-
isSource: boolean;
|
|
15
|
-
payload: Payload;
|
|
16
|
-
willAcceptDrop: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface NodeDescription {
|
|
20
|
-
value: string;
|
|
21
|
-
props: Vue.VNodeData;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface ContainerProps {
|
|
25
|
-
orientation?: string;
|
|
26
|
-
behaviour?: string;
|
|
27
|
-
tag?: string | NodeDescription;
|
|
28
|
-
groupName?: string;
|
|
29
|
-
lockAxis?: string;
|
|
30
|
-
dragHandleSelector?: string;
|
|
31
|
-
nonDragAreaSelector?: string;
|
|
32
|
-
dragBeginDelay?: number;
|
|
33
|
-
animationDuration?: number;
|
|
34
|
-
autoScrollEnabled?: boolean;
|
|
35
|
-
dragClass?: string;
|
|
36
|
-
dropClass?: string;
|
|
37
|
-
removeOnDropOut?: boolean;
|
|
38
|
-
getChildPayload?: (index: number) => Payload;
|
|
39
|
-
shouldAnimateDrop?: (sourceContainerOptions: ContainerProps, payload: Payload) => boolean;
|
|
40
|
-
shouldAcceptDrop?: (sourceContainerOptions: ContainerProps, payload: Payload) => boolean;
|
|
41
|
-
getGhostParent: () => Element;
|
|
42
|
-
onDragStart?: (dragEvent: DragEvent) => void;
|
|
43
|
-
onDragEnd?: (dragEvent: DragEvent) => void;
|
|
44
|
-
onDrop?: (dropResult: DropResult) => void;
|
|
45
|
-
onDragEnter?: () => void;
|
|
46
|
-
onDragLeave?: () => void;
|
|
47
|
-
onDropReady?: (dropResult: DropResult) => void;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
class Container extends Vue {
|
|
51
|
-
props: ContainerProps
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
class Draggable extends Vue {
|
|
55
|
-
props: {
|
|
56
|
-
tag?: string | NodeDescription;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
// types/escpos.d.ts
|
|
2
|
-
declare module 'escpos' {
|
|
3
|
-
export interface PrinterOptions {
|
|
4
|
-
encoding?: string;
|
|
5
|
-
width?: number;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface ImageOptions {
|
|
9
|
-
type?: 'bmp' | 'png' | 'jpg';
|
|
10
|
-
mode?: 'dhdw' | 'dwh' | 'dhw' | 'dw' | 'dh' | 'normal';
|
|
11
|
-
density?: 'd8' | 'd24';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface BarcodeOptions {
|
|
15
|
-
width?: number;
|
|
16
|
-
height?: number;
|
|
17
|
-
includeParity?: boolean;
|
|
18
|
-
position?: 'off' | 'abv' | 'blw' | 'bth';
|
|
19
|
-
font?: 'a' | 'b';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface QRCodeOptions {
|
|
23
|
-
version?: number;
|
|
24
|
-
level?: 'l' | 'm' | 'q' | 'h';
|
|
25
|
-
size?: number;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface CashDrawerOptions {
|
|
29
|
-
pin?: number;
|
|
30
|
-
time?: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Base adapter interface that all adapters should implement
|
|
34
|
-
export interface Adapter {
|
|
35
|
-
open(callback?: (error?: Error) => void): void;
|
|
36
|
-
close(callback?: (error?: Error) => void): void;
|
|
37
|
-
write(data: Buffer | Uint8Array | string, callback?: (error?: Error) => void): void;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// The main Printer class - this is the only class exported by escpos
|
|
41
|
-
export class Printer {
|
|
42
|
-
constructor(adapter: Adapter, options?: PrinterOptions);
|
|
43
|
-
|
|
44
|
-
// Text methods
|
|
45
|
-
text(content: string): this;
|
|
46
|
-
encode(encoding: string): this;
|
|
47
|
-
raw(data: Buffer | Uint8Array | string): this;
|
|
48
|
-
|
|
49
|
-
// Formatting methods
|
|
50
|
-
align(alignment: 'lt' | 'ct' | 'rt'): this;
|
|
51
|
-
font(family: 'a' | 'b' | 'c'): this;
|
|
52
|
-
size(width: number, height: number): this;
|
|
53
|
-
bold(enable?: boolean): this;
|
|
54
|
-
underline(enable?: boolean): this;
|
|
55
|
-
underlineThick(enable?: boolean): this;
|
|
56
|
-
upsideDown(enable?: boolean): this;
|
|
57
|
-
invert(enable?: boolean): this;
|
|
58
|
-
|
|
59
|
-
// Feed and cut methods
|
|
60
|
-
feed(lines?: number): this;
|
|
61
|
-
control(ctrl: string): this;
|
|
62
|
-
cut(mode?: boolean, lines?: number): this;
|
|
63
|
-
|
|
64
|
-
// Table methods
|
|
65
|
-
table(data: string[][]): this;
|
|
66
|
-
tableCustom(data: Array<{text: string, align?: string, width?: number}>): this;
|
|
67
|
-
|
|
68
|
-
// Barcode methods
|
|
69
|
-
barcode(data: string, type: string, options?: BarcodeOptions): this;
|
|
70
|
-
qrcode(data: string, version?: number, level?: string, size?: number): this;
|
|
71
|
-
qrcode(data: string, options?: QRCodeOptions): this;
|
|
72
|
-
|
|
73
|
-
// Image methods
|
|
74
|
-
image(image: Buffer | string, options?: ImageOptions): this;
|
|
75
|
-
raster(image: Buffer): this;
|
|
76
|
-
|
|
77
|
-
// Hardware methods
|
|
78
|
-
beep(times?: number, duration?: number): this;
|
|
79
|
-
cashdraw(pin?: number, time?: number): this;
|
|
80
|
-
cashdraw(options?: CashDrawerOptions): this;
|
|
81
|
-
|
|
82
|
-
// Connection methods
|
|
83
|
-
close(callback?: (error?: Error) => void): this;
|
|
84
|
-
then(onFulfilled?: () => void, onRejected?: (error: Error) => void): Promise<void>;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Constants that might be available
|
|
88
|
-
export const ALIGN_CENTER: string;
|
|
89
|
-
export const ALIGN_LEFT: string;
|
|
90
|
-
export const ALIGN_RIGHT: string;
|
|
91
|
-
export const COLOR_1: number;
|
|
92
|
-
export const COLOR_2: number;
|
|
93
|
-
export const FONT_A: string;
|
|
94
|
-
export const FONT_B: string;
|
|
95
|
-
export const FONT_C: string;
|
|
96
|
-
export const TXT_NORMAL: number;
|
|
97
|
-
export const TXT_2HEIGHT: number;
|
|
98
|
-
export const TXT_2WIDTH: number;
|
|
99
|
-
export const TXT_4SQUARE: number;
|
|
100
|
-
export const TXT_UNDERL_OFF: number;
|
|
101
|
-
export const TXT_UNDERL_ON: number;
|
|
102
|
-
export const TXT_UNDERL2_ON: number;
|
|
103
|
-
export const TXT_BOLD_OFF: number;
|
|
104
|
-
export const TXT_BOLD_ON: number;
|
|
105
|
-
export const TXT_FONT_A: number;
|
|
106
|
-
export const TXT_FONT_B: number;
|
|
107
|
-
export const TXT_FONT_C: number;
|
|
108
|
-
export const TXT_ALIGN_LT: number;
|
|
109
|
-
export const TXT_ALIGN_CT: number;
|
|
110
|
-
export const TXT_ALIGN_RT: number;
|
|
111
|
-
|
|
112
|
-
// Barcode types
|
|
113
|
-
export const BARCODE_TXT_OFF: number;
|
|
114
|
-
export const BARCODE_TXT_ABV: number;
|
|
115
|
-
export const BARCODE_TXT_BLW: number;
|
|
116
|
-
export const BARCODE_TXT_BTH: number;
|
|
117
|
-
export const BARCODE_FONT_A: number;
|
|
118
|
-
export const BARCODE_FONT_B: number;
|
|
119
|
-
export const BARCODE_HEIGHT: number;
|
|
120
|
-
export const BARCODE_WIDTH: number;
|
|
121
|
-
export const BARCODE_UPC_A: number;
|
|
122
|
-
export const BARCODE_UPC_E: number;
|
|
123
|
-
export const BARCODE_EAN13: number;
|
|
124
|
-
export const BARCODE_EAN8: number;
|
|
125
|
-
export const BARCODE_CODE39: number;
|
|
126
|
-
export const BARCODE_ITF: number;
|
|
127
|
-
export const BARCODE_NW7: number;
|
|
128
|
-
export const BARCODE_CODE93: number;
|
|
129
|
-
export const BARCODE_CODE128: number;
|
|
130
|
-
|
|
131
|
-
// Paper cut types
|
|
132
|
-
export const PAPER_FULL_CUT: number;
|
|
133
|
-
export const PAPER_PART_CUT: number;
|
|
134
|
-
|
|
135
|
-
// Hardware
|
|
136
|
-
export const HW_INIT: string;
|
|
137
|
-
export const HW_SELECT: string;
|
|
138
|
-
export const HW_RESET: string;
|
|
139
|
-
|
|
140
|
-
// Cash drawer
|
|
141
|
-
export const CD_KICK_2: string;
|
|
142
|
-
export const CD_KICK_5: string;
|
|
143
|
-
|
|
144
|
-
// Paper
|
|
145
|
-
export const PAPER: any;
|
|
146
|
-
|
|
147
|
-
// Colors
|
|
148
|
-
export const COLORS: any;
|
|
149
|
-
|
|
150
|
-
// Image processing utilities
|
|
151
|
-
export namespace Image {
|
|
152
|
-
function load(path: string, callback: (image: any) => void): void;
|
|
153
|
-
function load(path: string): Promise<any>;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// Export Printer as default export only
|
|
157
|
-
export = Printer;
|
|
158
|
-
|
|
159
|
-
// Screen buffer
|
|
160
|
-
export class Screen {
|
|
161
|
-
constructor();
|
|
162
|
-
clear(): this;
|
|
163
|
-
move(x: number, y: number): this;
|
|
164
|
-
text(text: string, encoding?: string): this;
|
|
165
|
-
background(color: 'none' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white'): this;
|
|
166
|
-
display(): this;
|
|
167
|
-
close(): this;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// Image processing utilities
|
|
171
|
-
export namespace Image {
|
|
172
|
-
function load(path: string, callback: (image: any) => void): void;
|
|
173
|
-
function load(path: string): Promise<any>;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// Constants
|
|
177
|
-
export const ALIGN_CENTER: string;
|
|
178
|
-
export const ALIGN_LEFT: string;
|
|
179
|
-
export const ALIGN_RIGHT: string;
|
|
180
|
-
export const COLOR_1: number;
|
|
181
|
-
export const COLOR_2: number;
|
|
182
|
-
export const FONT_A: string;
|
|
183
|
-
export const FONT_B: string;
|
|
184
|
-
export const FONT_C: string;
|
|
185
|
-
export const TXT_NORMAL: number;
|
|
186
|
-
export const TXT_2HEIGHT: number;
|
|
187
|
-
export const TXT_2WIDTH: number;
|
|
188
|
-
export const TXT_4SQUARE: number;
|
|
189
|
-
export const TXT_UNDERL_OFF: number;
|
|
190
|
-
export const TXT_UNDERL_ON: number;
|
|
191
|
-
export const TXT_UNDERL2_ON: number;
|
|
192
|
-
export const TXT_BOLD_OFF: number;
|
|
193
|
-
export const TXT_BOLD_ON: number;
|
|
194
|
-
export const TXT_FONT_A: number;
|
|
195
|
-
export const TXT_FONT_B: number;
|
|
196
|
-
export const TXT_FONT_C: number;
|
|
197
|
-
export const TXT_ALIGN_LT: number;
|
|
198
|
-
export const TXT_ALIGN_CT: number;
|
|
199
|
-
export const TXT_ALIGN_RT: number;
|
|
200
|
-
|
|
201
|
-
// Barcode types
|
|
202
|
-
export const BARCODE_TXT_OFF: number;
|
|
203
|
-
export const BARCODE_TXT_ABV: number;
|
|
204
|
-
export const BARCODE_TXT_BLW: number;
|
|
205
|
-
export const BARCODE_TXT_BTH: number;
|
|
206
|
-
export const BARCODE_FONT_A: number;
|
|
207
|
-
export const BARCODE_FONT_B: number;
|
|
208
|
-
export const BARCODE_HEIGHT: number;
|
|
209
|
-
export const BARCODE_WIDTH: number;
|
|
210
|
-
export const BARCODE_UPC_A: number;
|
|
211
|
-
export const BARCODE_UPC_E: number;
|
|
212
|
-
export const BARCODE_EAN13: number;
|
|
213
|
-
export const BARCODE_EAN8: number;
|
|
214
|
-
export const BARCODE_CODE39: number;
|
|
215
|
-
export const BARCODE_ITF: number;
|
|
216
|
-
export const BARCODE_NW7: number;
|
|
217
|
-
export const BARCODE_CODE93: number;
|
|
218
|
-
export const BARCODE_CODE128: number;
|
|
219
|
-
|
|
220
|
-
// Paper cut types
|
|
221
|
-
export const PAPER_FULL_CUT: number;
|
|
222
|
-
export const PAPER_PART_CUT: number;
|
|
223
|
-
|
|
224
|
-
// Hardware
|
|
225
|
-
export const HW_INIT: string;
|
|
226
|
-
export const HW_SELECT: string;
|
|
227
|
-
export const HW_RESET: string;
|
|
228
|
-
|
|
229
|
-
// Cash drawer
|
|
230
|
-
export const CD_KICK_2: string;
|
|
231
|
-
export const CD_KICK_5: string;
|
|
232
|
-
|
|
233
|
-
// Paper
|
|
234
|
-
export const PAPER: any;
|
|
235
|
-
|
|
236
|
-
// Colors
|
|
237
|
-
export const COLORS: any;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// types/escpos-network.d.ts
|
|
241
|
-
declare module 'escpos-network' {
|
|
242
|
-
export interface NetworkOptions {
|
|
243
|
-
address: string;
|
|
244
|
-
port?: number;
|
|
245
|
-
timeout?: number;
|
|
246
|
-
retry?: number;
|
|
247
|
-
family?: number;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
export class Network {
|
|
251
|
-
constructor(address: string, port?: number);
|
|
252
|
-
constructor(options: NetworkOptions);
|
|
253
|
-
|
|
254
|
-
address: string;
|
|
255
|
-
port: number;
|
|
256
|
-
timeout: number;
|
|
257
|
-
retry: number;
|
|
258
|
-
family: number;
|
|
259
|
-
|
|
260
|
-
open(callback?: (error?: Error) => void): void;
|
|
261
|
-
close(callback?: (error?: Error) => void): void;
|
|
262
|
-
write(data: Buffer | Uint8Array | string, callback?: (error?: Error) => void): void;
|
|
263
|
-
|
|
264
|
-
// Event emitter methods
|
|
265
|
-
on(event: 'connect' | 'close' | 'error' | 'timeout', callback: (data?: any) => void): this;
|
|
266
|
-
once(event: 'connect' | 'close' | 'error' | 'timeout', callback: (data?: any) => void): this;
|
|
267
|
-
emit(event: string, data?: any): boolean;
|
|
268
|
-
removeListener(event: string, callback: Function): this;
|
|
269
|
-
removeAllListeners(event?: string): this;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
export = Network;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// types/escpos-usb.d.ts (bonus)
|
|
276
|
-
declare module 'escpos-usb' {
|
|
277
|
-
export interface USBDevice {
|
|
278
|
-
deviceDescriptor: {
|
|
279
|
-
idVendor: number;
|
|
280
|
-
idProduct: number;
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
export interface USBOptions {
|
|
285
|
-
vid?: number;
|
|
286
|
-
pid?: number;
|
|
287
|
-
type?: string;
|
|
288
|
-
endpoint?: number;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
export class USB {
|
|
292
|
-
constructor(vid?: number, pid?: number);
|
|
293
|
-
constructor(options?: USBOptions);
|
|
294
|
-
|
|
295
|
-
device: USBDevice | null;
|
|
296
|
-
|
|
297
|
-
open(callback?: (error?: Error) => void): void;
|
|
298
|
-
close(callback?: (error?: Error) => void): void;
|
|
299
|
-
write(data: Buffer | Uint8Array | string, callback?: (error?: Error) => void): void;
|
|
300
|
-
|
|
301
|
-
static findPrinter(): USBDevice[];
|
|
302
|
-
|
|
303
|
-
// Event emitter methods
|
|
304
|
-
on(event: 'connect' | 'disconnect' | 'error', callback: (data?: any) => void): this;
|
|
305
|
-
once(event: 'connect' | 'disconnect' | 'error', callback: (data?: any) => void): this;
|
|
306
|
-
emit(event: string, data?: any): boolean;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
export = USB;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
// types/escpos-serialport.d.ts (bonus)
|
|
313
|
-
declare module 'escpos-serialport' {
|
|
314
|
-
export interface SerialOptions {
|
|
315
|
-
baudRate?: number;
|
|
316
|
-
dataBits?: number;
|
|
317
|
-
stopBits?: number;
|
|
318
|
-
parity?: 'none' | 'even' | 'mark' | 'odd' | 'space';
|
|
319
|
-
rtscts?: boolean;
|
|
320
|
-
xon?: boolean;
|
|
321
|
-
xoff?: boolean;
|
|
322
|
-
xany?: boolean;
|
|
323
|
-
autoOpen?: boolean;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
export class Serial {
|
|
327
|
-
constructor(port: string, options?: SerialOptions);
|
|
328
|
-
|
|
329
|
-
port: string;
|
|
330
|
-
options: SerialOptions;
|
|
331
|
-
|
|
332
|
-
open(callback?: (error?: Error) => void): void;
|
|
333
|
-
close(callback?: (error?: Error) => void): void;
|
|
334
|
-
write(data: Buffer | Uint8Array | string, callback?: (error?: Error) => void): void;
|
|
335
|
-
|
|
336
|
-
// Event emitter methods
|
|
337
|
-
on(event: 'open' | 'close' | 'error' | 'data', callback: (data?: any) => void): this;
|
|
338
|
-
once(event: 'open' | 'close' | 'error' | 'data', callback: (data?: any) => void): this;
|
|
339
|
-
emit(event: string, data?: any): boolean;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
export = Serial;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
// types/index.d.ts (optional - for barrel exports)
|
|
346
|
-
/// <reference path="./escpos.d.ts" />
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type {Handler} from "leaflet";
|
|
2
|
-
import type {PrinterInfo} from "electron";
|
|
3
|
-
import {OrderCreatedData, OrderUpdatedData, SocketEventData} from "../api/socketEvent.js";
|
|
4
|
-
|
|
5
|
-
type MainProcessEvent<T> = (callback: (data: T) => void) => void
|
|
6
|
-
|
|
7
|
-
interface ElectronAPI {
|
|
8
|
-
/** Send to main process */
|
|
9
|
-
getRequest: <T>(url: string) => Promise<T>;
|
|
10
|
-
postRequest: <T>(url: string, payload: unknown) => Promise<T>;
|
|
11
|
-
patchRequest: <T>(url: string, payload: unknown) => Promise<T>;
|
|
12
|
-
deleteRequest: <T>(url: string, payload: unknown) => Promise<T>;
|
|
13
|
-
updateToken: (token: string) => Promise<Restaurant>;
|
|
14
|
-
connectSocket: (token: string, restaurantId: string) => Promise<void>;
|
|
15
|
-
|
|
16
|
-
isTokenLoaded: () => Promise<string | null | undefined>;
|
|
17
|
-
|
|
18
|
-
getSystemPrinters: () => Promise<PrinterInfo[]>;
|
|
19
|
-
|
|
20
|
-
printOnce: (order: Order, printer: StationPrinter, restaurant: Restaurant) => Promise<boolean>;
|
|
21
|
-
printTest: (printerName: string) => Promise<boolean>;
|
|
22
|
-
|
|
23
|
-
/** Receive from main process */
|
|
24
|
-
onOrderCreated: MainProcessEvent<OrderCreatedData>;
|
|
25
|
-
onOrderUpdated: MainProcessEvent<OrderUpdatedData>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
declare global {
|
|
29
|
-
interface Map {
|
|
30
|
-
SmoothWheelZoom: Handler
|
|
31
|
-
}
|
|
32
|
-
interface Window {
|
|
33
|
-
api: ElectronAPI;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
interface Price {
|
|
39
|
-
price: number;
|
|
40
|
-
pickupPrice: number;
|
|
41
|
-
deliveryPrice: number;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface ItemAttribute {
|
|
45
|
-
depositAmount?: string;
|
|
46
|
-
volume?: string;
|
|
47
|
-
alcoholVolume?: string;
|
|
48
|
-
caffeineAmount?: string;
|
|
49
|
-
isAlcoholic: boolean;
|
|
50
|
-
isVegan: boolean;
|
|
51
|
-
isVegetarian: boolean;
|
|
52
|
-
isGlutenFree: boolean;
|
|
53
|
-
isLactoseFree: boolean;
|
|
54
|
-
}
|