@teincfood/core 0.9.7 → 0.9.8
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/hooks/delivery.hooks.d.ts +24 -24
- package/dist/hooks/rider.hooks.d.ts +48 -48
- package/dist/hooks/use-infinite-list.d.ts +24 -24
- package/dist/hooks/wallet.hooks.d.ts +24 -24
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/printer/company.d.ts +21 -0
- package/dist/printer/company.js +30 -0
- package/dist/printer/receipt.d.ts +13 -7
- package/dist/printer/receipt.js +186 -43
- package/dist/printer/service.d.ts +5 -1
- package/dist/printer/service.js +14 -4
- package/dist/types/api/seller.api.d.ts +15 -0
- package/package.json +1 -1
|
@@ -32,10 +32,10 @@ export declare function useBusinessDeliveriesQuery(enabled?: boolean, filters?:
|
|
|
32
32
|
isRefetching: boolean;
|
|
33
33
|
isStale: boolean;
|
|
34
34
|
isEnabled: boolean;
|
|
35
|
-
refetch: (options?: import("@tanstack/
|
|
36
|
-
fetchStatus: import("@tanstack/
|
|
37
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
38
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
35
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
36
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
37
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
38
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
39
39
|
hasNextPage: boolean;
|
|
40
40
|
hasPreviousPage: boolean;
|
|
41
41
|
isFetchingNextPage: boolean;
|
|
@@ -66,10 +66,10 @@ export declare function useBusinessDeliveriesQuery(enabled?: boolean, filters?:
|
|
|
66
66
|
isRefetching: boolean;
|
|
67
67
|
isStale: boolean;
|
|
68
68
|
isEnabled: boolean;
|
|
69
|
-
refetch: (options?: import("@tanstack/
|
|
70
|
-
fetchStatus: import("@tanstack/
|
|
71
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
72
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
69
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
70
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
71
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
72
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
73
73
|
hasNextPage: boolean;
|
|
74
74
|
hasPreviousPage: boolean;
|
|
75
75
|
isFetchingNextPage: boolean;
|
|
@@ -101,10 +101,10 @@ export declare function useBusinessDeliveriesQuery(enabled?: boolean, filters?:
|
|
|
101
101
|
isRefetching: boolean;
|
|
102
102
|
isStale: boolean;
|
|
103
103
|
isEnabled: boolean;
|
|
104
|
-
refetch: (options?: import("@tanstack/
|
|
105
|
-
fetchStatus: import("@tanstack/
|
|
106
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
107
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
104
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
105
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
106
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
107
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
108
108
|
hasNextPage: boolean;
|
|
109
109
|
hasPreviousPage: boolean;
|
|
110
110
|
isFetchingNextPage: boolean;
|
|
@@ -134,10 +134,10 @@ export declare function useBusinessDeliveriesQuery(enabled?: boolean, filters?:
|
|
|
134
134
|
isRefetching: boolean;
|
|
135
135
|
isStale: boolean;
|
|
136
136
|
isEnabled: boolean;
|
|
137
|
-
refetch: (options?: import("@tanstack/
|
|
138
|
-
fetchStatus: import("@tanstack/
|
|
139
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
140
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
137
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
138
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
139
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
140
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
141
141
|
hasNextPage: boolean;
|
|
142
142
|
hasPreviousPage: boolean;
|
|
143
143
|
isFetchingNextPage: boolean;
|
|
@@ -168,10 +168,10 @@ export declare function useBusinessDeliveriesQuery(enabled?: boolean, filters?:
|
|
|
168
168
|
isRefetching: boolean;
|
|
169
169
|
isStale: boolean;
|
|
170
170
|
isEnabled: boolean;
|
|
171
|
-
refetch: (options?: import("@tanstack/
|
|
172
|
-
fetchStatus: import("@tanstack/
|
|
173
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
174
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
171
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
172
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
173
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
174
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
175
175
|
hasNextPage: boolean;
|
|
176
176
|
hasPreviousPage: boolean;
|
|
177
177
|
isFetchNextPageError: boolean;
|
|
@@ -202,10 +202,10 @@ export declare function useBusinessDeliveriesQuery(enabled?: boolean, filters?:
|
|
|
202
202
|
isRefetching: boolean;
|
|
203
203
|
isStale: boolean;
|
|
204
204
|
isEnabled: boolean;
|
|
205
|
-
refetch: (options?: import("@tanstack/
|
|
206
|
-
fetchStatus: import("@tanstack/
|
|
207
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
208
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
205
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
206
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
207
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
208
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
209
209
|
hasNextPage: boolean;
|
|
210
210
|
hasPreviousPage: boolean;
|
|
211
211
|
isFetchingNextPage: boolean;
|
|
@@ -47,10 +47,10 @@ export declare function useRiderDeliveriesQuery(enabled?: boolean, filters?: {
|
|
|
47
47
|
isRefetching: boolean;
|
|
48
48
|
isStale: boolean;
|
|
49
49
|
isEnabled: boolean;
|
|
50
|
-
refetch: (options?: import("@tanstack/
|
|
51
|
-
fetchStatus: import("@tanstack/
|
|
52
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
53
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
50
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
51
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
52
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
53
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
54
54
|
hasNextPage: boolean;
|
|
55
55
|
hasPreviousPage: boolean;
|
|
56
56
|
isFetchingNextPage: boolean;
|
|
@@ -81,10 +81,10 @@ export declare function useRiderDeliveriesQuery(enabled?: boolean, filters?: {
|
|
|
81
81
|
isRefetching: boolean;
|
|
82
82
|
isStale: boolean;
|
|
83
83
|
isEnabled: boolean;
|
|
84
|
-
refetch: (options?: import("@tanstack/
|
|
85
|
-
fetchStatus: import("@tanstack/
|
|
86
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
87
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
84
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
85
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
86
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
87
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
88
88
|
hasNextPage: boolean;
|
|
89
89
|
hasPreviousPage: boolean;
|
|
90
90
|
isFetchingNextPage: boolean;
|
|
@@ -116,10 +116,10 @@ export declare function useRiderDeliveriesQuery(enabled?: boolean, filters?: {
|
|
|
116
116
|
isRefetching: boolean;
|
|
117
117
|
isStale: boolean;
|
|
118
118
|
isEnabled: boolean;
|
|
119
|
-
refetch: (options?: import("@tanstack/
|
|
120
|
-
fetchStatus: import("@tanstack/
|
|
121
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
122
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
119
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
120
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
121
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
122
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
123
123
|
hasNextPage: boolean;
|
|
124
124
|
hasPreviousPage: boolean;
|
|
125
125
|
isFetchingNextPage: boolean;
|
|
@@ -149,10 +149,10 @@ export declare function useRiderDeliveriesQuery(enabled?: boolean, filters?: {
|
|
|
149
149
|
isRefetching: boolean;
|
|
150
150
|
isStale: boolean;
|
|
151
151
|
isEnabled: boolean;
|
|
152
|
-
refetch: (options?: import("@tanstack/
|
|
153
|
-
fetchStatus: import("@tanstack/
|
|
154
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
155
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
152
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
153
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
154
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
155
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
156
156
|
hasNextPage: boolean;
|
|
157
157
|
hasPreviousPage: boolean;
|
|
158
158
|
isFetchingNextPage: boolean;
|
|
@@ -183,10 +183,10 @@ export declare function useRiderDeliveriesQuery(enabled?: boolean, filters?: {
|
|
|
183
183
|
isRefetching: boolean;
|
|
184
184
|
isStale: boolean;
|
|
185
185
|
isEnabled: boolean;
|
|
186
|
-
refetch: (options?: import("@tanstack/
|
|
187
|
-
fetchStatus: import("@tanstack/
|
|
188
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
189
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
186
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
187
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
188
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
189
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
190
190
|
hasNextPage: boolean;
|
|
191
191
|
hasPreviousPage: boolean;
|
|
192
192
|
isFetchNextPageError: boolean;
|
|
@@ -217,10 +217,10 @@ export declare function useRiderDeliveriesQuery(enabled?: boolean, filters?: {
|
|
|
217
217
|
isRefetching: boolean;
|
|
218
218
|
isStale: boolean;
|
|
219
219
|
isEnabled: boolean;
|
|
220
|
-
refetch: (options?: import("@tanstack/
|
|
221
|
-
fetchStatus: import("@tanstack/
|
|
222
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
223
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
220
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
221
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
222
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
223
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
224
224
|
hasNextPage: boolean;
|
|
225
225
|
hasPreviousPage: boolean;
|
|
226
226
|
isFetchingNextPage: boolean;
|
|
@@ -261,10 +261,10 @@ export declare function useRiderWalletHistoryQuery(enabled?: boolean): {
|
|
|
261
261
|
isRefetching: boolean;
|
|
262
262
|
isStale: boolean;
|
|
263
263
|
isEnabled: boolean;
|
|
264
|
-
refetch: (options?: import("@tanstack/
|
|
265
|
-
fetchStatus: import("@tanstack/
|
|
266
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
267
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
264
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
265
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
266
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
267
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
268
268
|
hasNextPage: boolean;
|
|
269
269
|
hasPreviousPage: boolean;
|
|
270
270
|
isFetchingNextPage: boolean;
|
|
@@ -295,10 +295,10 @@ export declare function useRiderWalletHistoryQuery(enabled?: boolean): {
|
|
|
295
295
|
isRefetching: boolean;
|
|
296
296
|
isStale: boolean;
|
|
297
297
|
isEnabled: boolean;
|
|
298
|
-
refetch: (options?: import("@tanstack/
|
|
299
|
-
fetchStatus: import("@tanstack/
|
|
300
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
301
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
298
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
299
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
300
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
301
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
302
302
|
hasNextPage: boolean;
|
|
303
303
|
hasPreviousPage: boolean;
|
|
304
304
|
isFetchingNextPage: boolean;
|
|
@@ -330,10 +330,10 @@ export declare function useRiderWalletHistoryQuery(enabled?: boolean): {
|
|
|
330
330
|
isRefetching: boolean;
|
|
331
331
|
isStale: boolean;
|
|
332
332
|
isEnabled: boolean;
|
|
333
|
-
refetch: (options?: import("@tanstack/
|
|
334
|
-
fetchStatus: import("@tanstack/
|
|
335
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
336
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
333
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
334
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
335
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
336
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
337
337
|
hasNextPage: boolean;
|
|
338
338
|
hasPreviousPage: boolean;
|
|
339
339
|
isFetchingNextPage: boolean;
|
|
@@ -363,10 +363,10 @@ export declare function useRiderWalletHistoryQuery(enabled?: boolean): {
|
|
|
363
363
|
isRefetching: boolean;
|
|
364
364
|
isStale: boolean;
|
|
365
365
|
isEnabled: boolean;
|
|
366
|
-
refetch: (options?: import("@tanstack/
|
|
367
|
-
fetchStatus: import("@tanstack/
|
|
368
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
369
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
366
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
367
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
368
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
369
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
370
370
|
hasNextPage: boolean;
|
|
371
371
|
hasPreviousPage: boolean;
|
|
372
372
|
isFetchingNextPage: boolean;
|
|
@@ -397,10 +397,10 @@ export declare function useRiderWalletHistoryQuery(enabled?: boolean): {
|
|
|
397
397
|
isRefetching: boolean;
|
|
398
398
|
isStale: boolean;
|
|
399
399
|
isEnabled: boolean;
|
|
400
|
-
refetch: (options?: import("@tanstack/
|
|
401
|
-
fetchStatus: import("@tanstack/
|
|
402
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
403
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
400
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
401
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
402
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
403
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
404
404
|
hasNextPage: boolean;
|
|
405
405
|
hasPreviousPage: boolean;
|
|
406
406
|
isFetchNextPageError: boolean;
|
|
@@ -431,10 +431,10 @@ export declare function useRiderWalletHistoryQuery(enabled?: boolean): {
|
|
|
431
431
|
isRefetching: boolean;
|
|
432
432
|
isStale: boolean;
|
|
433
433
|
isEnabled: boolean;
|
|
434
|
-
refetch: (options?: import("@tanstack/
|
|
435
|
-
fetchStatus: import("@tanstack/
|
|
436
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
437
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
434
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
435
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
436
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
437
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
438
438
|
hasNextPage: boolean;
|
|
439
439
|
hasPreviousPage: boolean;
|
|
440
440
|
isFetchingNextPage: boolean;
|
|
@@ -50,10 +50,10 @@ export declare function useInfiniteList<T>(options: InfiniteListOptions<T>): {
|
|
|
50
50
|
isRefetching: boolean;
|
|
51
51
|
isStale: boolean;
|
|
52
52
|
isEnabled: boolean;
|
|
53
|
-
refetch: (options?: import("@tanstack/
|
|
54
|
-
fetchStatus: import("@tanstack/
|
|
55
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
56
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
53
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
54
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
55
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
56
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
57
57
|
hasNextPage: boolean;
|
|
58
58
|
hasPreviousPage: boolean;
|
|
59
59
|
isFetchingNextPage: boolean;
|
|
@@ -84,10 +84,10 @@ export declare function useInfiniteList<T>(options: InfiniteListOptions<T>): {
|
|
|
84
84
|
isRefetching: boolean;
|
|
85
85
|
isStale: boolean;
|
|
86
86
|
isEnabled: boolean;
|
|
87
|
-
refetch: (options?: import("@tanstack/
|
|
88
|
-
fetchStatus: import("@tanstack/
|
|
89
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
90
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
87
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
88
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
89
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
90
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
91
91
|
hasNextPage: boolean;
|
|
92
92
|
hasPreviousPage: boolean;
|
|
93
93
|
isFetchingNextPage: boolean;
|
|
@@ -119,10 +119,10 @@ export declare function useInfiniteList<T>(options: InfiniteListOptions<T>): {
|
|
|
119
119
|
isRefetching: boolean;
|
|
120
120
|
isStale: boolean;
|
|
121
121
|
isEnabled: boolean;
|
|
122
|
-
refetch: (options?: import("@tanstack/
|
|
123
|
-
fetchStatus: import("@tanstack/
|
|
124
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
125
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
122
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
123
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
124
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
125
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
126
126
|
hasNextPage: boolean;
|
|
127
127
|
hasPreviousPage: boolean;
|
|
128
128
|
isFetchingNextPage: boolean;
|
|
@@ -152,10 +152,10 @@ export declare function useInfiniteList<T>(options: InfiniteListOptions<T>): {
|
|
|
152
152
|
isRefetching: boolean;
|
|
153
153
|
isStale: boolean;
|
|
154
154
|
isEnabled: boolean;
|
|
155
|
-
refetch: (options?: import("@tanstack/
|
|
156
|
-
fetchStatus: import("@tanstack/
|
|
157
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
158
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
155
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
156
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
157
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
158
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
159
159
|
hasNextPage: boolean;
|
|
160
160
|
hasPreviousPage: boolean;
|
|
161
161
|
isFetchingNextPage: boolean;
|
|
@@ -186,10 +186,10 @@ export declare function useInfiniteList<T>(options: InfiniteListOptions<T>): {
|
|
|
186
186
|
isRefetching: boolean;
|
|
187
187
|
isStale: boolean;
|
|
188
188
|
isEnabled: boolean;
|
|
189
|
-
refetch: (options?: import("@tanstack/
|
|
190
|
-
fetchStatus: import("@tanstack/
|
|
191
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
192
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
189
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
190
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
191
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
192
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
193
193
|
hasNextPage: boolean;
|
|
194
194
|
hasPreviousPage: boolean;
|
|
195
195
|
isFetchNextPageError: boolean;
|
|
@@ -220,10 +220,10 @@ export declare function useInfiniteList<T>(options: InfiniteListOptions<T>): {
|
|
|
220
220
|
isRefetching: boolean;
|
|
221
221
|
isStale: boolean;
|
|
222
222
|
isEnabled: boolean;
|
|
223
|
-
refetch: (options?: import("@tanstack/
|
|
224
|
-
fetchStatus: import("@tanstack/
|
|
225
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
226
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
223
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
224
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
225
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
226
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
227
227
|
hasNextPage: boolean;
|
|
228
228
|
hasPreviousPage: boolean;
|
|
229
229
|
isFetchingNextPage: boolean;
|
|
@@ -26,10 +26,10 @@ export declare function useWalletHistoryQuery(enabled?: boolean): {
|
|
|
26
26
|
isRefetching: boolean;
|
|
27
27
|
isStale: boolean;
|
|
28
28
|
isEnabled: boolean;
|
|
29
|
-
refetch: (options?: import("@tanstack/
|
|
30
|
-
fetchStatus: import("@tanstack/
|
|
31
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
32
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
29
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
30
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
31
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
32
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
33
33
|
hasNextPage: boolean;
|
|
34
34
|
hasPreviousPage: boolean;
|
|
35
35
|
isFetchingNextPage: boolean;
|
|
@@ -60,10 +60,10 @@ export declare function useWalletHistoryQuery(enabled?: boolean): {
|
|
|
60
60
|
isRefetching: boolean;
|
|
61
61
|
isStale: boolean;
|
|
62
62
|
isEnabled: boolean;
|
|
63
|
-
refetch: (options?: import("@tanstack/
|
|
64
|
-
fetchStatus: import("@tanstack/
|
|
65
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
66
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
63
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
64
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
65
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
66
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
67
67
|
hasNextPage: boolean;
|
|
68
68
|
hasPreviousPage: boolean;
|
|
69
69
|
isFetchingNextPage: boolean;
|
|
@@ -95,10 +95,10 @@ export declare function useWalletHistoryQuery(enabled?: boolean): {
|
|
|
95
95
|
isRefetching: boolean;
|
|
96
96
|
isStale: boolean;
|
|
97
97
|
isEnabled: boolean;
|
|
98
|
-
refetch: (options?: import("@tanstack/
|
|
99
|
-
fetchStatus: import("@tanstack/
|
|
100
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
101
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
98
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
99
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
100
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
101
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
102
102
|
hasNextPage: boolean;
|
|
103
103
|
hasPreviousPage: boolean;
|
|
104
104
|
isFetchingNextPage: boolean;
|
|
@@ -128,10 +128,10 @@ export declare function useWalletHistoryQuery(enabled?: boolean): {
|
|
|
128
128
|
isRefetching: boolean;
|
|
129
129
|
isStale: boolean;
|
|
130
130
|
isEnabled: boolean;
|
|
131
|
-
refetch: (options?: import("@tanstack/
|
|
132
|
-
fetchStatus: import("@tanstack/
|
|
133
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
134
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
131
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
132
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
133
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
134
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
135
135
|
hasNextPage: boolean;
|
|
136
136
|
hasPreviousPage: boolean;
|
|
137
137
|
isFetchingNextPage: boolean;
|
|
@@ -162,10 +162,10 @@ export declare function useWalletHistoryQuery(enabled?: boolean): {
|
|
|
162
162
|
isRefetching: boolean;
|
|
163
163
|
isStale: boolean;
|
|
164
164
|
isEnabled: boolean;
|
|
165
|
-
refetch: (options?: import("@tanstack/
|
|
166
|
-
fetchStatus: import("@tanstack/
|
|
167
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
168
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
165
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
166
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
167
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
168
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
169
169
|
hasNextPage: boolean;
|
|
170
170
|
hasPreviousPage: boolean;
|
|
171
171
|
isFetchNextPageError: boolean;
|
|
@@ -196,10 +196,10 @@ export declare function useWalletHistoryQuery(enabled?: boolean): {
|
|
|
196
196
|
isRefetching: boolean;
|
|
197
197
|
isStale: boolean;
|
|
198
198
|
isEnabled: boolean;
|
|
199
|
-
refetch: (options?: import("@tanstack/
|
|
200
|
-
fetchStatus: import("@tanstack/
|
|
201
|
-
fetchNextPage: (options?: import("@tanstack/
|
|
202
|
-
fetchPreviousPage: (options?: import("@tanstack/
|
|
199
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
200
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
201
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
202
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
203
203
|
hasNextPage: boolean;
|
|
204
204
|
hasPreviousPage: boolean;
|
|
205
205
|
isFetchingNextPage: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -123,6 +123,7 @@ export { SELLER_ORDERS_KEYS, BUSINESS_DELIVERIES_KEYS, MENU_KEYS, REFERENCE_KEYS
|
|
|
123
123
|
export * from "./printer/types";
|
|
124
124
|
export * from "./printer/store";
|
|
125
125
|
export * from "./printer/receipt";
|
|
126
|
+
export * from "./printer/company";
|
|
126
127
|
export * from "./printer/service";
|
|
127
128
|
export * from "./printer/hooks";
|
|
128
129
|
export * from "./cart/store";
|
package/dist/index.js
CHANGED
|
@@ -130,6 +130,7 @@ export { SELLER_ORDERS_KEYS, BUSINESS_DELIVERIES_KEYS, MENU_KEYS, REFERENCE_KEYS
|
|
|
130
130
|
export * from "./printer/types";
|
|
131
131
|
export * from "./printer/store";
|
|
132
132
|
export * from "./printer/receipt";
|
|
133
|
+
export * from "./printer/company";
|
|
133
134
|
export * from "./printer/service";
|
|
134
135
|
export * from "./printer/hooks";
|
|
135
136
|
// ── Cart (device-local) ──
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Company footer info for receipts — platform/brand block printed under
|
|
3
|
+
* the receipt footer ("Powered by" section).
|
|
4
|
+
*
|
|
5
|
+
* Defaults match docs/receipt-template.md §4. Host apps override at boot
|
|
6
|
+
* from env (desktop: VITE_COMPANY_*, mobile: EXPO_PUBLIC_COMPANY_*) via
|
|
7
|
+
* setCompanyInfo; unset fields fall back to defaults. The backend reads
|
|
8
|
+
* COMPANY_* OS env with the same defaults.
|
|
9
|
+
*/
|
|
10
|
+
export interface CompanyInfo {
|
|
11
|
+
/** Company name, e.g. "TeincFood". */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Consumer brand line, e.g. "TeincFood Business". */
|
|
14
|
+
brand: string;
|
|
15
|
+
address: string;
|
|
16
|
+
website: string;
|
|
17
|
+
supportEmail: string;
|
|
18
|
+
phone: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function setCompanyInfo(partial: Partial<CompanyInfo>): void;
|
|
21
|
+
export declare function getCompanyInfo(): CompanyInfo;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Company footer info for receipts — platform/brand block printed under
|
|
3
|
+
* the receipt footer ("Powered by" section).
|
|
4
|
+
*
|
|
5
|
+
* Defaults match docs/receipt-template.md §4. Host apps override at boot
|
|
6
|
+
* from env (desktop: VITE_COMPANY_*, mobile: EXPO_PUBLIC_COMPANY_*) via
|
|
7
|
+
* setCompanyInfo; unset fields fall back to defaults. The backend reads
|
|
8
|
+
* COMPANY_* OS env with the same defaults.
|
|
9
|
+
*/
|
|
10
|
+
const DEFAULTS = {
|
|
11
|
+
name: "TeincFood",
|
|
12
|
+
brand: "TeincFood Business",
|
|
13
|
+
address: "Accra, Ghana",
|
|
14
|
+
website: "https://teincfood.com",
|
|
15
|
+
supportEmail: "support@teincfood.com",
|
|
16
|
+
phone: "+233 50 398 1913",
|
|
17
|
+
};
|
|
18
|
+
let override = {};
|
|
19
|
+
export function setCompanyInfo(partial) {
|
|
20
|
+
const clean = {};
|
|
21
|
+
for (const [k, v] of Object.entries(partial)) {
|
|
22
|
+
if (typeof v === "string" && v.length > 0) {
|
|
23
|
+
clean[k] = v;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
override = { ...override, ...clean };
|
|
27
|
+
}
|
|
28
|
+
export function getCompanyInfo() {
|
|
29
|
+
return { ...DEFAULTS, ...override };
|
|
30
|
+
}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Local receipt generation —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Backend source: lib/teinc_food_backend/orders/receipt.ex
|
|
7
|
-
* Keep this file in sync with backend when template changes.
|
|
2
|
+
* Local receipt generation — implements docs/receipt-template.md
|
|
3
|
+
* (single source of design; backend TeincFoodBackend.Orders.Receipt
|
|
4
|
+
* implements the same spec). Generates ESC/POS (80mm, 32 chars) and HTML
|
|
5
|
+
* (visual twin) from a SellerOrder snapshot. Works fully offline.
|
|
8
6
|
*/
|
|
9
7
|
import type { SellerOrder } from "../types/api/seller.api";
|
|
10
8
|
export declare function escposText(s: string | null | undefined): string;
|
|
9
|
+
/** Word-wrap sanitized text to width. Long words hard-split. Never drops content. */
|
|
10
|
+
export declare function wrapText(text: string, width: number): string[];
|
|
11
11
|
export declare function calloutNumber(order: SellerOrder): string;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Resolve cached logo raster (base64 `GS v 0` block) for an order: prefers
|
|
14
|
+
* `order.business.logo_escpos`, falls back to the synced `business:profile`
|
|
15
|
+
* reference. Null when none — fully offline, no network.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveLogoRaster(order: SellerOrder): Promise<string | null>;
|
|
18
|
+
export declare function generateEscpos(order: SellerOrder, logoRasterB64?: string | null): string;
|
|
13
19
|
export declare function generateHtmlAsync(order: SellerOrder, opts?: {
|
|
14
20
|
logoDataUri?: string | null;
|
|
15
21
|
useCache?: boolean;
|
package/dist/printer/receipt.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Local receipt generation —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Backend source: lib/teinc_food_backend/orders/receipt.ex
|
|
7
|
-
* Keep this file in sync with backend when template changes.
|
|
2
|
+
* Local receipt generation — implements docs/receipt-template.md
|
|
3
|
+
* (single source of design; backend TeincFoodBackend.Orders.Receipt
|
|
4
|
+
* implements the same spec). Generates ESC/POS (80mm, 32 chars) and HTML
|
|
5
|
+
* (visual twin) from a SellerOrder snapshot. Works fully offline.
|
|
8
6
|
*/
|
|
7
|
+
import { getCompanyInfo } from "./company";
|
|
9
8
|
import { openSyncDatabase } from "../db/connection";
|
|
10
9
|
import { getReferenceData } from "../reference/operations";
|
|
11
10
|
import { cacheRemoteImage, resolveImageSource } from "../image-cache/service";
|
|
@@ -17,7 +16,6 @@ const ESC_BOLD_ON = "\x1B\x45\x01";
|
|
|
17
16
|
const ESC_BOLD_OFF = "\x1B\x45\x00";
|
|
18
17
|
const GS_SIZE_NORMAL = "\x1D\x21\x00";
|
|
19
18
|
const GS_SIZE_DOUBLE_W = "\x1D\x21\x11";
|
|
20
|
-
const GS_SIZE_DOUBLE_WH = "\x1D\x21\x33";
|
|
21
19
|
const GS_BAR_HEIGHT = "\x1D\x68\x3C";
|
|
22
20
|
const GS_BAR_WIDTH = "\x1D\x77\x02";
|
|
23
21
|
const LF = "\x0A";
|
|
@@ -60,6 +58,60 @@ function padR(text, width) {
|
|
|
60
58
|
return text.slice(0, width);
|
|
61
59
|
return text.padEnd(width, " ");
|
|
62
60
|
}
|
|
61
|
+
function padL(text, width) {
|
|
62
|
+
const s = String(text);
|
|
63
|
+
if (s.length >= width)
|
|
64
|
+
return s.slice(0, width);
|
|
65
|
+
return s.padStart(width, " ");
|
|
66
|
+
}
|
|
67
|
+
/** Word-wrap sanitized text to width. Long words hard-split. Never drops content. */
|
|
68
|
+
export function wrapText(text, width) {
|
|
69
|
+
const words = [];
|
|
70
|
+
for (const word of text.split(" ").filter(Boolean)) {
|
|
71
|
+
if (word.length <= width)
|
|
72
|
+
words.push(word);
|
|
73
|
+
else
|
|
74
|
+
for (let i = 0; i < word.length; i += width)
|
|
75
|
+
words.push(word.slice(i, i + width));
|
|
76
|
+
}
|
|
77
|
+
const lines = [];
|
|
78
|
+
let cur = "";
|
|
79
|
+
for (const word of words) {
|
|
80
|
+
if (!cur)
|
|
81
|
+
cur = word;
|
|
82
|
+
else if (cur.length + 1 + word.length <= width)
|
|
83
|
+
cur += " " + word;
|
|
84
|
+
else {
|
|
85
|
+
lines.push(cur);
|
|
86
|
+
cur = word;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (cur)
|
|
90
|
+
lines.push(cur);
|
|
91
|
+
return lines;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Business-name fit ladder (centered, never truncated):
|
|
95
|
+
* ≤16 chars → 2x, 17–64 → 1x bold (≤2 lines), longer → 1x (≤3 lines,
|
|
96
|
+
* keeps wrapping beyond that).
|
|
97
|
+
*/
|
|
98
|
+
function nameBlockEscpos(name) {
|
|
99
|
+
const text = escposText(name);
|
|
100
|
+
if (text.length <= 16)
|
|
101
|
+
return [GS_SIZE_DOUBLE_W, text, LF, GS_SIZE_NORMAL];
|
|
102
|
+
if (text.length <= 64) {
|
|
103
|
+
return [ESC_BOLD_ON, ...wrapText(text, 32).flatMap((l) => [escposText(l), LF]), ESC_BOLD_OFF];
|
|
104
|
+
}
|
|
105
|
+
return wrapText(text, 32).flatMap((l) => [escposText(l), LF]);
|
|
106
|
+
}
|
|
107
|
+
function nameSizeClass(name) {
|
|
108
|
+
const len = (name || "").length;
|
|
109
|
+
if (len <= 16)
|
|
110
|
+
return "name-2x";
|
|
111
|
+
if (len <= 64)
|
|
112
|
+
return "name-1x-bold";
|
|
113
|
+
return "name-1x";
|
|
114
|
+
}
|
|
63
115
|
function currencySymbol(currency) {
|
|
64
116
|
switch (currency) {
|
|
65
117
|
case "GHS": return "₵";
|
|
@@ -112,13 +164,16 @@ function itemName(item) {
|
|
|
112
164
|
return item.menu_item?.name || "(deleted item)";
|
|
113
165
|
}
|
|
114
166
|
function addonName(addon) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return a.name;
|
|
167
|
+
if (addon.addon?.name)
|
|
168
|
+
return addon.addon.name;
|
|
169
|
+
if (addon.name)
|
|
170
|
+
return addon.name;
|
|
120
171
|
return "Add-on";
|
|
121
172
|
}
|
|
173
|
+
function variantName(item) {
|
|
174
|
+
const n = item.variant?.name;
|
|
175
|
+
return n ? n : null;
|
|
176
|
+
}
|
|
122
177
|
function orderTypeText(order) {
|
|
123
178
|
const t = order.order_type;
|
|
124
179
|
if (t === "takeout")
|
|
@@ -194,6 +249,54 @@ async function fetchAsDataUri(url) {
|
|
|
194
249
|
return null;
|
|
195
250
|
}
|
|
196
251
|
}
|
|
252
|
+
/** Decode base64 raster bytes (from `business:profile` reference) to a byte string. */
|
|
253
|
+
function binaryFromBase64(b64) {
|
|
254
|
+
const clean = b64.replace(/\s/g, "");
|
|
255
|
+
if (typeof atob === "function")
|
|
256
|
+
return atob(clean);
|
|
257
|
+
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
258
|
+
let out = "";
|
|
259
|
+
let buf = 0;
|
|
260
|
+
let bits = 0;
|
|
261
|
+
for (const ch of clean) {
|
|
262
|
+
if (ch === "=")
|
|
263
|
+
break;
|
|
264
|
+
const v = chars.indexOf(ch);
|
|
265
|
+
if (v < 0)
|
|
266
|
+
continue;
|
|
267
|
+
buf = (buf << 6) | v;
|
|
268
|
+
bits += 6;
|
|
269
|
+
if (bits >= 8) {
|
|
270
|
+
bits -= 8;
|
|
271
|
+
out += String.fromCharCode((buf >> bits) & 0xff);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (!out)
|
|
275
|
+
throw new Error("empty raster");
|
|
276
|
+
return out;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Resolve cached logo raster (base64 `GS v 0` block) for an order: prefers
|
|
280
|
+
* `order.business.logo_escpos`, falls back to the synced `business:profile`
|
|
281
|
+
* reference. Null when none — fully offline, no network.
|
|
282
|
+
*/
|
|
283
|
+
export async function resolveLogoRaster(order) {
|
|
284
|
+
const direct = order.business?.logo_escpos;
|
|
285
|
+
if (typeof direct === "string" && direct.length > 0)
|
|
286
|
+
return direct;
|
|
287
|
+
try {
|
|
288
|
+
const bId = order.business_id;
|
|
289
|
+
if (!bId)
|
|
290
|
+
return null;
|
|
291
|
+
const db = await openSyncDatabase();
|
|
292
|
+
const ref = await getReferenceData(db, bId, "business:profile");
|
|
293
|
+
const raster = ref?.payload?.data?.logo_escpos;
|
|
294
|
+
return typeof raster === "string" && raster.length > 0 ? raster : null;
|
|
295
|
+
}
|
|
296
|
+
catch {
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
197
300
|
// ── ESC/POS ────────────────────────────────────────────────────────────
|
|
198
301
|
function doubleLineEscpos() { return "═".repeat(LINE_WIDTH) + LF; }
|
|
199
302
|
function singleLineEscpos() { return "─".repeat(LINE_WIDTH); }
|
|
@@ -208,7 +311,7 @@ function customerLineEscpos(order) {
|
|
|
208
311
|
}
|
|
209
312
|
function orderTypeEscpos(order) { return orderTypeText(order); }
|
|
210
313
|
function paymentLineEscpos(order) { return paymentLineText(order); }
|
|
211
|
-
export function generateEscpos(order) {
|
|
314
|
+
export function generateEscpos(order, logoRasterB64) {
|
|
212
315
|
const business = order.business;
|
|
213
316
|
const items = order.items || [];
|
|
214
317
|
const taxLines = (order.order_tax_lines ?? order.tax_lines ?? []);
|
|
@@ -219,15 +322,19 @@ export function generateEscpos(order) {
|
|
|
219
322
|
// (control codes and barcode data use raw push).
|
|
220
323
|
const pushT = (s) => { if (s != null)
|
|
221
324
|
parts.push(escposText(s)); };
|
|
222
|
-
// Header —
|
|
325
|
+
// Header — implements docs/receipt-template.md §1
|
|
223
326
|
// NOTE: no logo in ESC/POS text mode — a logo URL cannot be rendered without
|
|
224
327
|
// a raster pipeline (GS v 0). HTML receipts embed the logo instead.
|
|
225
328
|
push(ESC_INIT);
|
|
329
|
+
if (logoRasterB64) {
|
|
330
|
+
try {
|
|
331
|
+
push(binaryFromBase64(logoRasterB64));
|
|
332
|
+
}
|
|
333
|
+
catch { /* logo is decorative — never fail the receipt */ }
|
|
334
|
+
}
|
|
226
335
|
push(ESC_ALIGN_CENTER);
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
push(LF);
|
|
230
|
-
push(GS_SIZE_NORMAL);
|
|
336
|
+
for (const part of nameBlockEscpos(business?.name || "Teinc Food"))
|
|
337
|
+
push(part);
|
|
231
338
|
const addr = businessAddress(business);
|
|
232
339
|
if (addr)
|
|
233
340
|
pushT(addr + LF);
|
|
@@ -239,7 +346,8 @@ export function generateEscpos(order) {
|
|
|
239
346
|
// Order info
|
|
240
347
|
push(ESC_ALIGN_LEFT);
|
|
241
348
|
pushT(`Order: ${order.order_number}${LF}`);
|
|
242
|
-
// callout_box_escpos
|
|
349
|
+
// callout_box_escpos — symmetric blank lines, no border rules around it
|
|
350
|
+
push(LF);
|
|
243
351
|
push(ESC_ALIGN_CENTER);
|
|
244
352
|
push(GS_SIZE_DOUBLE_W);
|
|
245
353
|
pushT(`Callout: ${calloutNumber(order)}${LF}`);
|
|
@@ -259,43 +367,61 @@ export function generateEscpos(order) {
|
|
|
259
367
|
const data = order.order_number || "";
|
|
260
368
|
push(String.fromCharCode(0x1d, 0x6b, 0x49, data.length) + data);
|
|
261
369
|
push(LF);
|
|
262
|
-
// Items
|
|
370
|
+
// Items — template §2: name 17 | qty 3 (right) | price 10 (right) = 32
|
|
263
371
|
push(ESC_ALIGN_LEFT);
|
|
264
|
-
push(`${padR("Item",
|
|
372
|
+
push(`${padR("Item", 17)} ${padL("Qty", 3)} ${padL("Price", 10)}`);
|
|
265
373
|
push(LF);
|
|
266
374
|
pushT(singleLineEscpos());
|
|
267
375
|
push(LF);
|
|
268
376
|
for (const item of items) {
|
|
269
377
|
const qty = item.quantity || 1;
|
|
270
|
-
const price = formatMoney((item.unit_price ?? 0) * qty, order);
|
|
271
|
-
|
|
378
|
+
const price = escposText(formatMoney((item.unit_price ?? 0) * qty, order));
|
|
379
|
+
const nameLines = wrapText(escposText(itemName(item)), 17);
|
|
380
|
+
const first = nameLines[0] ?? "(deleted item)";
|
|
381
|
+
const rest = nameLines.slice(1, 2);
|
|
382
|
+
pushT(`${padR(first, 17)} ${padL(qty, 3)} ${padL(price, 10)}${LF}`);
|
|
383
|
+
for (const cont of rest)
|
|
384
|
+
pushT(`${padR(cont, 17)}${LF}`);
|
|
385
|
+
const vName = variantName(item);
|
|
386
|
+
if (vName) {
|
|
387
|
+
for (const vl of wrapText(escposText(`Size: ${vName}`), 30))
|
|
388
|
+
pushT(` ${vl}${LF}`);
|
|
389
|
+
}
|
|
272
390
|
const addons = item.order_item_addons ?? item.addons ?? [];
|
|
273
391
|
for (const addon of addons) {
|
|
274
|
-
const aName = addonName(addon);
|
|
275
392
|
const aPriceMinor = addon.price_minor ?? addon.price ?? 0;
|
|
276
|
-
const addonPrice = formatMoney(aPriceMinor, order);
|
|
277
|
-
|
|
393
|
+
const addonPrice = escposText(formatMoney(aPriceMinor, order));
|
|
394
|
+
const aLines = wrapText(escposText(addonName(addon)), 17);
|
|
395
|
+
if (!aLines.length)
|
|
396
|
+
continue;
|
|
397
|
+
pushT(` + ${padR(aLines[0], 17)} ${padL(addonPrice, 10)}${LF}`);
|
|
398
|
+
for (const aCont of aLines.slice(1, 2))
|
|
399
|
+
pushT(` ${padR(aCont, 17)}${LF}`);
|
|
278
400
|
}
|
|
279
401
|
}
|
|
280
402
|
pushT(singleLineEscpos());
|
|
281
403
|
push(LF);
|
|
282
|
-
// Subtotal section —
|
|
283
|
-
pushT(`${padR("Subtotal:", 20)} ${formatMoney(order.subtotal_minor, order)}${LF}`);
|
|
404
|
+
// Subtotal section — template §3: label 20 + amount 11 (right)
|
|
405
|
+
pushT(`${padR("Subtotal:", 20)} ${padL(escposText(formatMoney(order.subtotal_minor, order)), 11)}${LF}`);
|
|
284
406
|
if (order.delivery_fee_minor && order.delivery_fee_minor > 0) {
|
|
285
|
-
pushT(`${padR("Delivery Fee:", 20)} ${formatMoney(order.delivery_fee_minor, order)}${LF}`);
|
|
407
|
+
pushT(`${padR("Delivery Fee:", 20)} ${padL(escposText(formatMoney(order.delivery_fee_minor, order)), 11)}${LF}`);
|
|
286
408
|
}
|
|
287
409
|
for (const tax of taxLines) {
|
|
288
410
|
const rateStr = tax.rate_basis_points ? `(${Math.floor(tax.rate_basis_points / 100)}%)` : "";
|
|
289
411
|
const label = `${tax.name || ""} ${rateStr}`.trim().slice(0, 19);
|
|
290
|
-
pushT(`${padR(label, 20)} ${formatMoney(tax.tax_amount_minor, order)}${LF}`);
|
|
412
|
+
pushT(`${padR(label, 20)} ${padL(escposText(formatMoney(tax.tax_amount_minor, order)), 11)}${LF}`);
|
|
291
413
|
}
|
|
292
414
|
if (order.discount_minor && order.discount_minor > 0) {
|
|
293
|
-
pushT(`${padR("Discount:", 20)}
|
|
415
|
+
pushT(`${padR("Discount:", 20)} ${padL("-" + escposText(formatMoney(order.discount_minor, order)), 11)}${LF}`);
|
|
294
416
|
}
|
|
417
|
+
push(LF);
|
|
295
418
|
push(ESC_BOLD_ON);
|
|
296
|
-
pushT(`${padR("TOTAL:", 20)} ${formatMoney(order.total_minor, order)}${LF}`);
|
|
419
|
+
pushT(`${padR("TOTAL:", 20)} ${padL(escposText(formatMoney(order.total_minor, order)), 11)}${LF}`);
|
|
297
420
|
push(ESC_BOLD_OFF);
|
|
298
421
|
push(LF);
|
|
422
|
+
// Footer — template §4 company block (centered, never truncated)
|
|
423
|
+
const company = getCompanyInfo();
|
|
424
|
+
const contactLine = `${company.address} | ${company.phone}`;
|
|
299
425
|
push(ESC_ALIGN_CENTER);
|
|
300
426
|
pushT(paymentLineEscpos(order));
|
|
301
427
|
push(LF);
|
|
@@ -303,6 +429,12 @@ export function generateEscpos(order) {
|
|
|
303
429
|
pushT(doubleLineEscpos());
|
|
304
430
|
push("Thank you for your order!" + LF);
|
|
305
431
|
push("Come back soon!" + LF);
|
|
432
|
+
push(LF);
|
|
433
|
+
pushT(company.brand + LF);
|
|
434
|
+
pushT(contactLine + LF);
|
|
435
|
+
pushT(company.supportEmail + LF);
|
|
436
|
+
pushT(company.website + LF);
|
|
437
|
+
pushT(`Powered by ${company.name}` + LF);
|
|
306
438
|
push(ESC_FEED_3);
|
|
307
439
|
push(GS_CUT_FULL);
|
|
308
440
|
return parts.filter((p) => p != null).join("");
|
|
@@ -363,6 +495,7 @@ export function generateHtml(order, logoDataUri) {
|
|
|
363
495
|
const logoSrc = logoDataUri || business?.logo_url || "";
|
|
364
496
|
const hasLogo = !!logoSrc;
|
|
365
497
|
const businessName = escHtml(business?.name || "Teinc Food");
|
|
498
|
+
const company = getCompanyInfo();
|
|
366
499
|
const addr = businessAddress(business);
|
|
367
500
|
const bPhone = business?.phone;
|
|
368
501
|
const itemRows = items.map((item) => {
|
|
@@ -370,13 +503,17 @@ export function generateHtml(order, logoDataUri) {
|
|
|
370
503
|
// unit_price is already minor? backend format_money expects minor
|
|
371
504
|
const price = formatMoney((item.unit_price ?? 0) * qty, order);
|
|
372
505
|
const main = `<tr><td class="item-name">${escHtml(itemName(item))}</td><td class="item-qty">${qty}</td><td class="item-price">${price}</td></tr>`;
|
|
373
|
-
const
|
|
506
|
+
const vName = variantName(item);
|
|
507
|
+
const variantRow = vName
|
|
508
|
+
? `<tr class="variant-row"><td class="item-name" colspan="2">Size: ${escHtml(vName)}</td><td class="item-price"></td></tr>`
|
|
509
|
+
: "";
|
|
510
|
+
const addons = item.order_item_addons ?? item.addons ?? [];
|
|
374
511
|
const addonRows = addons.map((addon) => {
|
|
375
512
|
const aName = escHtml(addonName(addon));
|
|
376
513
|
const aPriceMinor = addon.price_minor ?? addon.price ?? 0;
|
|
377
514
|
return `<tr class="addon-row"><td class="item-name">+ ${aName}</td><td class="item-qty"></td><td class="addon-price">${formatMoney(aPriceMinor, order)}</td></tr>`;
|
|
378
515
|
}).join("\n");
|
|
379
|
-
return [main, addonRows].filter(Boolean).join("\n");
|
|
516
|
+
return [main, variantRow, addonRows].filter(Boolean).join("\n");
|
|
380
517
|
}).join("\n");
|
|
381
518
|
const taxRowsHtml = taxLines.map((tax) => {
|
|
382
519
|
const rateStr = tax.rate_basis_points ? `(${Math.floor(tax.rate_basis_points / 100)}%)` : "";
|
|
@@ -389,23 +526,28 @@ export function generateHtml(order, logoDataUri) {
|
|
|
389
526
|
<style>
|
|
390
527
|
body{font-family:monospace;max-width:320px;margin:0 auto;padding:16px;background:#fff;color:#111;}
|
|
391
528
|
.header{text-align:center;border-top:2px solid #333;border-bottom:2px solid #333;padding:8px 0;margin-bottom:12px;}
|
|
392
|
-
.header .logo{max-width:
|
|
393
|
-
.header h2{margin:4px 0 0;
|
|
529
|
+
.header .logo{max-width:200px;max-height:64px;margin:4px auto;display:block;object-fit:contain;}
|
|
530
|
+
.header h2{margin:4px 0 0;}
|
|
531
|
+
.header h2.name-2x{font-size:28px;font-weight:bold;}
|
|
532
|
+
.header h2.name-1x-bold{font-size:16px;font-weight:bold;}
|
|
533
|
+
.header h2.name-1x{font-size:14px;}
|
|
394
534
|
.header .address{font-size:11px;color:#555;margin:2px 0;}
|
|
395
|
-
.callout{
|
|
535
|
+
.callout{text-align:center;margin:16px 0;}
|
|
396
536
|
.callout .number{font-size:36px;font-weight:bold;letter-spacing:4px;margin:0;}
|
|
397
537
|
.callout .label{font-size:10px;color:#555;margin:0;}
|
|
398
538
|
.order-info{font-size:12px;margin:8px 0;}
|
|
399
|
-
table{width:100%;font-size:12px;border-collapse:collapse;}
|
|
400
|
-
td{padding:2px 0;vertical-align:top;}
|
|
401
|
-
.item-name{width:
|
|
402
|
-
.item-qty{width:
|
|
403
|
-
.item-price{width:
|
|
539
|
+
table{width:100%;font-size:12px;border-collapse:collapse;table-layout:fixed;}
|
|
540
|
+
td{padding:2px 0;vertical-align:top;overflow-wrap:anywhere;}
|
|
541
|
+
.item-name{width:17ch;}
|
|
542
|
+
.item-qty{width:3ch;text-align:right;}
|
|
543
|
+
.item-price{width:10ch;text-align:right;}
|
|
404
544
|
.addon-row td{font-size:11px;color:#666;padding-left:12px;}
|
|
405
545
|
.addon-row td.addon-price{text-align:right;}
|
|
546
|
+
.variant-row td{font-size:11px;color:#444;padding-left:8px;}
|
|
406
547
|
.totals{margin-top:8px;}
|
|
407
548
|
.totals td.label{text-align:left;width:70%;}
|
|
408
549
|
.totals td.amount{text-align:right;width:30%;}
|
|
550
|
+
.total-row td{padding-top:12px;}
|
|
409
551
|
.total-row{font-weight:bold;font-size:15px;border-top:2px solid #333;border-bottom:2px solid #333;padding:4px 0;}
|
|
410
552
|
.footer{text-align:center;margin-top:16px;padding-top:8px;font-size:12px;color:#555;}
|
|
411
553
|
@media print{body{max-width:80mm;padding:0;}}
|
|
@@ -413,7 +555,7 @@ export function generateHtml(order, logoDataUri) {
|
|
|
413
555
|
<body>
|
|
414
556
|
<div class="header">
|
|
415
557
|
${hasLogo ? `<img class="logo" src="${escHtml(logoSrc)}" alt="${businessName}" />` : ""}
|
|
416
|
-
<h2>${businessName}</h2>
|
|
558
|
+
<h2 class="${nameSizeClass(business?.name)}">${businessName}</h2>
|
|
417
559
|
<div class="address">${escHtml(addr || "")}</div>
|
|
418
560
|
${bPhone ? `<div class="address">Tel: ${escHtml(bPhone)}</div>` : ""}
|
|
419
561
|
</div>
|
|
@@ -443,6 +585,7 @@ export function generateHtml(order, logoDataUri) {
|
|
|
443
585
|
</div>
|
|
444
586
|
<div class="footer">
|
|
445
587
|
Thank you for your order!<br>Come back soon!
|
|
588
|
+
<br><br>${escHtml(company.brand)}<br>${escHtml(company.address)} | ${escHtml(company.phone)}<br>${escHtml(company.supportEmail)}<br>${escHtml(company.website)}<br>Powered by ${escHtml(company.name)}
|
|
446
589
|
</div>
|
|
447
590
|
</body></html>`;
|
|
448
591
|
}
|
|
@@ -8,8 +8,11 @@ import type { SellerOrder } from "../types/api/seller.api";
|
|
|
8
8
|
declare function fetchReceipt(orderId: string, format?: "html" | "escpos"): Promise<string>;
|
|
9
9
|
/**
|
|
10
10
|
* Generate receipt locally without network — used for offline queued DD-RRR-CCC orders.
|
|
11
|
+
* Pass a base64 logo raster (see resolveLogoRaster) to include the thermal header logo.
|
|
11
12
|
*/
|
|
12
|
-
export declare function generateLocalReceipt(order: SellerOrder, format?: "html" | "escpos", logoDataUri?: string | null): string;
|
|
13
|
+
export declare function generateLocalReceipt(order: SellerOrder, format?: "html" | "escpos", logoDataUri?: string | null, logoRasterB64?: string | null): string;
|
|
14
|
+
/** Async variant: resolves the cached logo raster before generating. */
|
|
15
|
+
export declare function generateLocalReceiptAsync(order: SellerOrder, format?: "html" | "escpos", logoDataUri?: string | null): Promise<string>;
|
|
13
16
|
/**
|
|
14
17
|
* Print an order — tries TCP ESC/POS if a default printer is configured, otherwise
|
|
15
18
|
* generates HTML and uses the PrintFileAdapter (expo-print / Tauri print).
|
|
@@ -23,6 +26,7 @@ export declare function sendToTcpPrinter(ip: string, port: number, text: string)
|
|
|
23
26
|
export declare const printerService: {
|
|
24
27
|
fetchReceipt: typeof fetchReceipt;
|
|
25
28
|
generateLocalReceipt: typeof generateLocalReceipt;
|
|
29
|
+
generateLocalReceiptAsync: typeof generateLocalReceiptAsync;
|
|
26
30
|
printOrderReceipt: typeof printOrderReceipt;
|
|
27
31
|
sendToTcpPrinter: typeof sendToTcpPrinter;
|
|
28
32
|
generateEscpos: typeof generateEscpos;
|
package/dist/printer/service.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { getHttpClient } from "../adapters/http";
|
|
7
7
|
import { getTcpAdapter, getPrintFileAdapter } from "../adapters/print";
|
|
8
8
|
import { getPrinterState } from "./store";
|
|
9
|
-
import { generateEscpos, generateHtml } from "./receipt";
|
|
9
|
+
import { generateEscpos, generateHtml, resolveLogoRaster } from "./receipt";
|
|
10
10
|
import { API_BASE_URL } from "../utils/constants";
|
|
11
11
|
async function fetchReceipt(orderId, format = "html") {
|
|
12
12
|
const http = getHttpClient();
|
|
@@ -32,9 +32,18 @@ async function fetchReceipt(orderId, format = "html") {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Generate receipt locally without network — used for offline queued DD-RRR-CCC orders.
|
|
35
|
+
* Pass a base64 logo raster (see resolveLogoRaster) to include the thermal header logo.
|
|
35
36
|
*/
|
|
36
|
-
export function generateLocalReceipt(order, format = "escpos", logoDataUri) {
|
|
37
|
-
return format === "escpos"
|
|
37
|
+
export function generateLocalReceipt(order, format = "escpos", logoDataUri, logoRasterB64) {
|
|
38
|
+
return format === "escpos"
|
|
39
|
+
? generateEscpos(order, logoRasterB64 ?? null)
|
|
40
|
+
: generateHtml(order, logoDataUri);
|
|
41
|
+
}
|
|
42
|
+
/** Async variant: resolves the cached logo raster before generating. */
|
|
43
|
+
export async function generateLocalReceiptAsync(order, format = "escpos", logoDataUri) {
|
|
44
|
+
if (format !== "escpos")
|
|
45
|
+
return generateHtml(order, logoDataUri);
|
|
46
|
+
return generateEscpos(order, await resolveLogoRaster(order));
|
|
38
47
|
}
|
|
39
48
|
/**
|
|
40
49
|
* Print an order — tries TCP ESC/POS if a default printer is configured, otherwise
|
|
@@ -64,7 +73,7 @@ export async function printOrderReceipt(order, opts) {
|
|
|
64
73
|
}
|
|
65
74
|
}
|
|
66
75
|
if (!escpos)
|
|
67
|
-
escpos =
|
|
76
|
+
escpos = generateEscpos(order, await resolveLogoRaster(order));
|
|
68
77
|
const tcp = getTcpAdapter();
|
|
69
78
|
if (!tcp)
|
|
70
79
|
throw new Error("TCP adapter not configured");
|
|
@@ -112,6 +121,7 @@ export async function sendToTcpPrinter(ip, port, text) {
|
|
|
112
121
|
export const printerService = {
|
|
113
122
|
fetchReceipt,
|
|
114
123
|
generateLocalReceipt,
|
|
124
|
+
generateLocalReceiptAsync,
|
|
115
125
|
printOrderReceipt,
|
|
116
126
|
sendToTcpPrinter,
|
|
117
127
|
generateEscpos,
|
|
@@ -20,6 +20,12 @@ export interface OrderMenuItem {
|
|
|
20
20
|
export interface OrderItemAddon {
|
|
21
21
|
id: string;
|
|
22
22
|
price: number;
|
|
23
|
+
/** Minor-unit price (backend order_item_addons carry price_minor). */
|
|
24
|
+
price_minor?: number;
|
|
25
|
+
name?: string;
|
|
26
|
+
addon?: {
|
|
27
|
+
name?: string;
|
|
28
|
+
} | null;
|
|
23
29
|
}
|
|
24
30
|
export interface OrderItem {
|
|
25
31
|
id: string;
|
|
@@ -28,11 +34,20 @@ export interface OrderItem {
|
|
|
28
34
|
unit_price: number;
|
|
29
35
|
subtotal: number;
|
|
30
36
|
addons?: OrderItemAddon[];
|
|
37
|
+
/** Backend order_items preload :variant (absolute size, has name). */
|
|
38
|
+
variant?: {
|
|
39
|
+
id?: string;
|
|
40
|
+
name?: string;
|
|
41
|
+
} | null;
|
|
42
|
+
/** Backend shape for addon lines. */
|
|
43
|
+
order_item_addons?: OrderItemAddon[];
|
|
31
44
|
}
|
|
32
45
|
export interface OrderBusiness {
|
|
33
46
|
id: string;
|
|
34
47
|
name: string;
|
|
35
48
|
phone?: string;
|
|
49
|
+
/** Base64 `GS v 0` raster block for the thermal header (synced via business:profile). */
|
|
50
|
+
logo_escpos?: string | null;
|
|
36
51
|
latitude?: number;
|
|
37
52
|
longitude?: number;
|
|
38
53
|
estimated_delivery_time?: number;
|
package/package.json
CHANGED