@tossplace/pos-plugin-sdk 0.0.16 → 0.0.17

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/sdk.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { WebView } from '@tossplace-nexus/pos-webview';
2
-
3
1
  declare type AllPaymentCreateDto = PluginCardDto | PluginCashDto | PluginExternalDto;
4
2
 
5
3
  declare const AvailableLanguageCodes: {
@@ -75,14 +73,9 @@ export declare interface Catalog {
75
73
  getCatalog: (catalogId: number) => Promise<PluginCatalogItem>;
76
74
  getCatalogs: () => Promise<PluginCatalogItem[]>;
77
75
  on(event: 'update' | 'add' | 'delete', callback: CatalogEventCallback): void;
78
- /**
79
- * @deprecated 다음 버전에서 제거 예정입니다
80
- */
81
- on(event: 'sold-out' | 'on-sale', callback: CatalogEventCallback): void;
82
- on(event: 'sold-out' | 'on-sale' | 'update' | 'add' | 'delete', callback: CatalogEventCallback): void;
83
76
  }
84
77
 
85
- declare type CatalogEventCallback = (catalog: PluginCatalogItem) => void;
78
+ declare type CatalogEventCallback = (id: PluginCatalogItem['id']) => void;
86
79
 
87
80
  /**
88
81
  * @publicApi
@@ -95,7 +88,7 @@ export declare type CatalogItemOptionChoiceState = 'ON_SALE' | 'SOLD_OUT';
95
88
  export declare interface CategoryTypes {
96
89
  getCategories: () => Promise<PluginCatalogCategory[]>;
97
90
  getCategory: (categoryId: number) => Promise<PluginCatalogCategory>;
98
- on: (event: 'update' | 'add' | 'delete', callback: (category: PluginCatalogCategory) => void) => void;
91
+ on: (event: 'update' | 'add' | 'delete', callback: (category: PluginCatalogCategory['id']) => void) => void;
99
92
  }
100
93
 
101
94
  /**
@@ -112,6 +105,12 @@ declare type CheckBoxInput = Omit<BaseInput, 'placeholder'> & {
112
105
  values: InputValue[];
113
106
  };
114
107
 
108
+ /**
109
+ * @publicApi
110
+ * @param length
111
+ */
112
+ export declare function createCallbackId(length?: number): string;
113
+
115
114
  /**
116
115
  * @publicApi
117
116
  */
@@ -151,7 +150,7 @@ export declare interface DeliveryCatalogOption {
151
150
  /**
152
151
  * @publicApi
153
152
  */
154
- export declare type DeliveryConnectionStatusErrorCode = 'NOT_RUNNING' | 'NOT_LOGGED_IN' | 'UNKNOWN' | 'BAEMIN_NOT_SELECTED_PROGRAM';
153
+ export declare type DeliveryConnectionStatusErrorCode = 'NOT_RUNNING' | 'NOT_LOGGED_IN' | 'UNKNOWN' | 'BAEMIN_NOT_SELECTED_PROGRAM' | string;
155
154
 
156
155
  /**
157
156
  * @publicApi
@@ -245,6 +244,7 @@ declare type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
245
244
  * @publicApi
246
245
  */
247
246
  export declare interface DraftOrder {
247
+ on(event: 'update', callback: (draftOrder: PluginDraftOrder) => void): void;
248
248
  clear(): Promise<void>;
249
249
  get(): Promise<PluginDraftOrder>;
250
250
  addLineItem(lineItem: PluginDraftOrderItemDto): Promise<PluginDraftOrder>;
@@ -258,101 +258,33 @@ export declare interface DraftOrder {
258
258
  startPayment(): Promise<void>;
259
259
  }
260
260
 
261
- declare type Element_2 = BarcodeElements | InputElements;
262
-
263
- declare class ErrorImpl {
264
- private readonly webview;
265
- constructor(webview: WebView);
266
- addErrorListener(handler: (error: Error) => void): void;
267
- }
268
-
269
261
  /**
270
262
  * @publicApi
271
263
  */
272
- declare type FFIAbiType = '__stdcall';
264
+ export declare const draftOrder: DraftOrderImpl;
273
265
 
274
- /**
275
- * @publicApi
276
- */
277
- declare interface FFIApi extends FFIFunction {
278
- name: string;
279
- }
280
-
281
- /**
282
- * @internal
283
- * @publicApi
284
- */
285
- declare interface FFIDownloadInfo {
286
- win32: {
287
- filePath: string;
288
- downloadUrl: string;
289
- };
290
- win64: {
291
- filePath: string;
292
- downloadUrl: string;
293
- };
294
- }
295
-
296
- /**
297
- * @publicApi
298
- */
299
- declare interface FFIFunction {
300
- params?: FFIFunctionParam[];
301
- return: FFIFunctionReturn;
302
- options?: FFIFunctionOptions;
303
- returnData?: any;
304
- }
305
-
306
- /**
307
- * @publicApi
308
- */
309
- declare interface FFIFunctionOptions {
310
- /**
311
- * Application Binary Interface
312
- * - 응용 프로그램 바이너리 인터페이스: 컴파일된 프로그램 모듈들이 바이너리 수준에서 상호작용하는 방식을 정의하는 인터페이스
313
- */
314
- abi?: FFIAbiType;
266
+ declare class DraftOrderImpl implements DraftOrder {
267
+ constructor();
268
+ on(event: 'update', callback: (draftOrder: PluginDraftOrder) => void): void;
269
+ deleteDiscount(indexOfDiscount: number): Promise<PluginDraftOrder>;
270
+ updateItemOptionChoice(itemKey: string, choices: PluginCatalogItemOptionChoice[]): Promise<PluginDraftOrder>;
271
+ updateItemMemo(itemKey: string, memo: string): Promise<PluginDraftOrder>;
272
+ updateIgnorePrint(ignorePrint: boolean): Promise<PluginDraftOrder>;
273
+ deleteItemDiscount(itemKey: string, indexOfDiscount: number): Promise<PluginDraftOrder>;
274
+ clear(): Promise<void>;
275
+ get(): Promise<PluginDraftOrder>;
276
+ addLineItem(lineItem: PluginDraftOrderItemDto): Promise<PluginDraftOrder>;
277
+ deleteLineItem(key: string): Promise<PluginDraftOrder>;
278
+ startPayment(): Promise<void>;
279
+ updateItemQuantity(itemKey: string, quantity: number): Promise<PluginDraftOrder>;
315
280
  }
316
281
 
317
- /**
318
- * @publicApi
319
- */
320
- declare type FFIFunctionParam = {
321
- type: 'str';
322
- } | {
323
- type: 'int';
324
- } | {
325
- type: 'bool';
326
- } | {
327
- type: 'wchar *';
328
- } | {
329
- type: 'callback';
330
- };
331
-
332
- /**
333
- * @publicApi
334
- */
335
- declare type FFIFunctionReturn = 'void' | 'str' | 'int' | 'bool' | 'wchar *' | 'void *';
282
+ declare type Element_2 = BarcodeElements | InputElements;
336
283
 
337
- /**
338
- * @publicApi
339
- */
340
- export declare interface FFITypes {
341
- download: (downloadInfo: FFIDownloadInfo) => Promise<{
342
- platform: keyof FFIDownloadInfo;
343
- }>;
344
- load: (filePath: string, apis: FFIApi[]) => Promise<void>;
345
- unload: (filePath: string) => Promise<void>;
346
- invoke: (filePath: string, apiName: string, params?: any[]) => Promise<any>;
347
- registerCallback: (filePath: string, signature: FFIFunction, callback: (...args: any[]) => any) => Promise<{
348
- ffiCallbackId: string;
349
- }>;
350
- unregisterCallback: (filePath: string, callbackId: string) => Promise<void>;
351
- addCallbackErrorHandler: (filePath: string, handler: (error: Error) => void) => void;
284
+ declare class ErrorImpl {
285
+ addErrorListener(handler: (error: Error) => void): void;
352
286
  }
353
287
 
354
- declare function getValues<T extends Record<string, number | string | string[] | boolean | undefined>>(): Promise<T>;
355
-
356
288
  declare type HereOrder = Order_2 & {
357
289
  type: 'HERE';
358
290
  memo: {
@@ -367,23 +299,28 @@ declare type HereOrder = Order_2 & {
367
299
  */
368
300
  export declare type HttpMethod = 'GET' | 'POST' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'PUT' | 'PATCH';
369
301
 
302
+ declare interface HttpOption {
303
+ timeoutMs?: number;
304
+ }
305
+
370
306
  declare interface HttpRequest {
371
307
  method: HttpMethod;
372
308
  payload?: string;
373
309
  headers: [string, string][];
310
+ timeoutMs?: number;
374
311
  }
375
312
 
376
313
  /**
377
314
  * @publicApi
378
315
  */
379
316
  export declare interface HttpTypes {
380
- get: (url: string, headers?: [string, string][]) => Promise<PluginHttpResponse>;
381
- post: (url: string, payload: any, headers?: [string, string][]) => Promise<PluginHttpResponse>;
382
- delete: (url: string, headers?: [string, string][]) => Promise<PluginHttpResponse>;
383
- head: (url: string, headers?: [string, string][]) => Promise<PluginHttpResponse>;
384
- options: (url: string, headers?: [string, string][]) => Promise<PluginHttpResponse>;
385
- put: (url: string, payload: any, headers?: [string, string][]) => Promise<PluginHttpResponse>;
386
- patch: (url: string, payload: any, headers?: [string, string][]) => Promise<PluginHttpResponse>;
317
+ get: (url: string, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
318
+ post: (url: string, payload: any, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
319
+ delete: (url: string, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
320
+ head: (url: string, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
321
+ options: (url: string, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
322
+ put: (url: string, payload: any, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
323
+ patch: (url: string, payload: any, headers?: [string, string][], options?: HttpOption) => Promise<PluginHttpResponse>;
387
324
  }
388
325
 
389
326
  declare type InputElements = {
@@ -430,12 +367,7 @@ declare type Languages = Record<PluginLanguageCode, string>;
430
367
  export declare interface MenuOption {
431
368
  getOptions: () => Promise<PluginCatalogItemOption[]>;
432
369
  getOption: (optionId: number) => Promise<PluginCatalogItemOption>;
433
- /**
434
- * @deprecated 다음 버전에서 제거 예정입니다
435
- */
436
- on(event: 'sold-out' | 'on-sale', callback: (option: PluginCatalogItemOption) => void): void;
437
- on(event: 'update' | 'add' | 'delete', callback: (option: PluginCatalogItemOption) => void): void;
438
- on(event: 'sold-out' | 'on-sale' | 'update' | 'add' | 'delete', callback: (option: PluginCatalogItemOption) => void): void;
370
+ on(event: 'update' | 'add' | 'delete', callback: (id: PluginCatalogItemOption['id']) => void): void;
439
371
  }
440
372
 
441
373
  /**
@@ -453,28 +385,6 @@ export declare interface Merchant {
453
385
  getMerchant: () => Promise<TossMerchant>;
454
386
  }
455
387
 
456
- /**
457
- * @publicApi
458
- */
459
- export declare interface Navigation {
460
- navigate(page: 'plugin-tab', packageName?: string): void;
461
- navigate(page: 'business-type-setting'): void;
462
- /**
463
- * 포스에서 페이지를 이동합니다.
464
- * @param page business-type-setting 업종유형 변경, plugin-tab 플러그인 탭 이동
465
- * @param packageName 이동할 탭의 이름, 없는 경우 첫번째 플러그인 탭으로 이동합니다
466
- */
467
- navigate(page: 'business-type-setting' | 'plugin-tab', packageName?: string): void;
468
- }
469
-
470
- /**
471
- * @publicApi
472
- */
473
- export declare class NavigationImpl implements Navigation {
474
- navigate(page: 'plugin-tab', packageName?: string): void;
475
- navigate(page: 'business-type-setting'): void;
476
- }
477
-
478
388
  /**
479
389
  * @publicApi
480
390
  * @return number
@@ -513,10 +423,7 @@ export declare interface Order {
513
423
  size?: number;
514
424
  orderStates?: PluginOrderState[];
515
425
  }) => Promise<PluginOrder[]>;
516
- /**
517
- * @deprecated
518
- */
519
- on(event: 'cancel', callback: (order: PluginOrder) => void): void;
426
+ on(event: 'add' | 'accept' | 'decline' | 'expire' | 'complete' | 'update', callback: (order: PluginOrder['id']) => void): void;
520
427
  cancel: (id: string) => Promise<void>;
521
428
  add: (order: PluginOrderDto) => Promise<PluginOrder>;
522
429
  /**
@@ -568,7 +475,7 @@ declare type Order_2 = {
568
475
  customerChargedPrice: number;
569
476
  };
570
477
 
571
- declare type OrderItemType = 'ITEM' | 'DELIVERY_FEE' | 'PREPAID_CARD' | 'MULTI_USE_TICKET';
478
+ declare type OrderItemType = 'ITEM' | 'DELIVERY_FEE' | 'PREPAID_CARD' | 'MULTI_USE_TICKET' | 'COMBO' | 'GIFT_CARD';
572
479
 
573
480
  /**
574
481
  * @publicApi
@@ -598,7 +505,7 @@ export declare interface Payment {
598
505
  getPayment: (paymentId: PluginPayment['id']) => Promise<PluginPayment>;
599
506
  }
600
507
 
601
- declare type PaymentCallback = (payment: PluginPayment) => void;
508
+ declare type PaymentCallback = (paymentId: PluginPayment['id'], orderId: PluginOrder['id']) => void;
602
509
 
603
510
  /**
604
511
  * @publicApi
@@ -660,7 +567,6 @@ export declare const plugin: PluginImpl;
660
567
  * @publicApi
661
568
  */
662
569
  declare interface Plugin_2 {
663
- on(event: 'close', callback: () => Promise<void>): void;
664
570
  getPluginInfo(): Promise<{
665
571
  name: string;
666
572
  version: string;
@@ -901,10 +807,14 @@ export declare interface PluginCatalogItemOption {
901
807
  title: string;
902
808
  titleI18n?: PluginLanguagePack;
903
809
  isRequired: boolean;
810
+ /**
811
+ * 토스 포스에서 최소 수량은 선택 불가능하며 필수선택 여부에 따라 0 또는 1로 내려옴
812
+ * 0 - 필수아님
813
+ * 1 - 필수
814
+ */
904
815
  minChoices: number;
905
816
  /**
906
817
  * 최대로 선택가능한 선택 수
907
- * -1인 경우 무제한 선택이 가능합니다.
908
818
  */
909
819
  maxChoices: number;
910
820
  choices: PluginCatalogItemOptionChoice[];
@@ -1021,15 +931,21 @@ export declare interface PluginDeliveryDiscount extends PluginDiscount {
1021
931
  * @publicApi
1022
932
  * @description order를 만들기 위한 dto
1023
933
  */
1024
- export declare type PluginDeliveryOrderDto = Omit<PluginOrderDto, 'lineItems' | 'discounts'> & {
934
+ export declare type PluginDeliveryOrderDtoV2 = Omit<PluginOrderDto, 'lineItems' | 'discounts'> & {
1025
935
  cancelled: boolean;
1026
936
  delivery: PluginDelivery<'DELIVERY' | 'PICKUP' | 'HERE'>;
1027
937
  discounts: Array<PluginDeliveryDiscount>;
1028
- lineItems: Array<Omit<PluginOrderItem, 'id' | 'orderId' | 'item' | 'optionChoices' | 'discounts'> & {
938
+ lineItems: Array<Omit<PluginOrderItem, 'id' | 'orderId' | 'item' | 'optionChoices' | 'discounts' | 'chargePrice'> & {
1029
939
  item: {
1030
940
  title: string;
1031
941
  type: 'ITEM' | 'DELIVERY_FEE';
1032
942
  };
943
+ /**
944
+ * @description 옵션,할인을 제외한 메뉴 1개의 단일 가격
945
+ */
946
+ itemPrice: {
947
+ value: number;
948
+ };
1033
949
  optionChoices: Array<{
1034
950
  title: string;
1035
951
  priceValue: number;
@@ -1037,6 +953,9 @@ export declare type PluginDeliveryOrderDto = Omit<PluginOrderDto, 'lineItems' |
1037
953
  }>;
1038
954
  discounts?: Array<PluginDeliveryDiscount>;
1039
955
  }>;
956
+ metadata?: {
957
+ bmpc?: boolean;
958
+ };
1040
959
  };
1041
960
 
1042
961
  /**
@@ -1203,12 +1122,8 @@ export declare type PluginHttpResponse = {
1203
1122
  };
1204
1123
 
1205
1124
  declare class PluginImpl implements Plugin_2 {
1206
- private readonly webview;
1207
- private plugin;
1208
- private pluginCallbacks;
1209
- constructor(webview: WebView);
1125
+ constructor();
1210
1126
  private initializePlugin;
1211
- on(event: 'close', callback: () => Promise<void>): void;
1212
1127
  getPluginInfo(): Promise<{
1213
1128
  name: string;
1214
1129
  version: string;
@@ -1231,26 +1146,6 @@ export declare interface PluginLanguagePack {
1231
1146
  languages: Partial<Languages>;
1232
1147
  }
1233
1148
 
1234
- /**
1235
- * @publicApi
1236
- */
1237
- export declare interface PluginMessenger {
1238
- broadcast<T = any>(message: T): void;
1239
- on<T = any>(event: 'message', callback: (message: T) => void): void;
1240
- }
1241
-
1242
- /**
1243
- * @publicApi
1244
- */
1245
- export declare const pluginMessenger: PluginMessengerImpl;
1246
-
1247
- declare class PluginMessengerImpl implements PluginMessenger {
1248
- private readonly webview;
1249
- constructor(webview: WebView);
1250
- broadcast<T = any>(message: T): void;
1251
- on<T = any>(event: 'message', callback: (message: T) => void): void;
1252
- }
1253
-
1254
1149
  /**
1255
1150
  * @publicApi
1256
1151
  * @description pluginOrder orderDto를 서버에 저장 후 가공해서 내려 준 값
@@ -1276,6 +1171,11 @@ export declare interface PluginOrder {
1276
1171
  paymentPrice: PluginOrderPaymentPrice;
1277
1172
  requestedInfo?: PluginOrderRequestInfo;
1278
1173
  source: string;
1174
+ channel: {
1175
+ source: string;
1176
+ /** @memo 생성할 때 source를 넣고 groups를 따로 명시하지 않으면, groups는 source로부터 유도되어 채워집니다 */
1177
+ groups: PluginOrderGroup[];
1178
+ };
1279
1179
  /** 해당 주문의 테이블 인원 수 */
1280
1180
  numGuests?: number;
1281
1181
  memo?: string;
@@ -1332,8 +1232,16 @@ export declare type PluginOrderDto = {
1332
1232
  discounts: PluginDiscount[];
1333
1233
  tableId?: number;
1334
1234
  lineItems: PluginOrderItemDto[];
1235
+ channel?: {
1236
+ /**
1237
+ * 주문의 타입을 지정합니다 아무것도 지정되지 않을 경우 POS로 간주됩니다.
1238
+ */
1239
+ groups: PluginOrderGroup[];
1240
+ };
1335
1241
  };
1336
1242
 
1243
+ declare type PluginOrderGroup = 'POS' | 'KIOSK' | 'DELIVERY' | 'TABLE_ORDER' | 'MOBILE_ORDER';
1244
+
1337
1245
  /**
1338
1246
  * @publicApi
1339
1247
  */
@@ -1348,7 +1256,7 @@ export declare interface PluginOrderItem {
1348
1256
  value: number;
1349
1257
  };
1350
1258
  /**
1351
- * @description 실제 고객이 결제하는 금액에 대한 정보입니다. (할인 적용 금액)
1259
+ * @description 실제 고객이 결제하는 금액에 대한 정보입니다. (할인 적용 금액 + 옵션합산금액)
1352
1260
  */
1353
1261
  chargePrice: {
1354
1262
  value: number;
@@ -1389,6 +1297,7 @@ declare interface PluginOrderItemItemOptionChoiceDto {
1389
1297
  }
1390
1298
 
1391
1299
  /**
1300
+ * @publicApi
1392
1301
  * 주문항목 옵션 선택
1393
1302
  */
1394
1303
  declare interface PluginOrderItemOptionChoice extends PluginCatalogItemOptionChoice {
@@ -1630,6 +1539,7 @@ export declare type PosPluginSdk = {
1630
1539
  catalog: Catalog;
1631
1540
  option: MenuOption;
1632
1541
  storage: StorageTypes;
1542
+ secureStore: SecureStore;
1633
1543
  cashReceipt: CashReceiptTypes;
1634
1544
  order: Order;
1635
1545
  payment: Payment;
@@ -1639,14 +1549,12 @@ export declare type PosPluginSdk = {
1639
1549
  merchant: Merchant;
1640
1550
  paymentMethod: PaymentMethodType;
1641
1551
  websocket: WebsocketTypes;
1642
- ffi: FFITypes;
1643
1552
  barcode: Barcode;
1644
1553
  plugin: Plugin_2;
1645
- pluginMessenger: PluginMessenger;
1646
1554
  setting: SettingTypes;
1647
1555
  draftOrder: DraftOrder;
1648
- navigation: Navigation;
1649
1556
  error: ErrorImpl;
1557
+ powerSaver: PowerSaverTypes;
1650
1558
  };
1651
1559
 
1652
1560
  /**
@@ -1670,6 +1578,24 @@ export declare class PosPluginSdkRateLimitError extends PosPluginSdkError {
1670
1578
  static isPosPluginSdkRateLimitError(error: unknown): error is PosPluginSdkRateLimitError;
1671
1579
  }
1672
1580
 
1581
+ /**
1582
+ * @publicApi
1583
+ */
1584
+ export declare type PowerSaverTypes = {
1585
+ /**
1586
+ * 절전모드 방지를 시작합니다.
1587
+ */
1588
+ startBlocking(): Promise<void>;
1589
+ /**
1590
+ * 절전모드 방지를 해제합니다.
1591
+ */
1592
+ stopBlocking(): Promise<void>;
1593
+ /**
1594
+ * 절전모드 방지가 활성화 상태인지 확인합니다.
1595
+ */
1596
+ isBlocked(): Promise<boolean>;
1597
+ };
1598
+
1673
1599
  /**
1674
1600
  * @publicApi
1675
1601
  * @return string values.id
@@ -1685,17 +1611,22 @@ declare type RadioInput = Omit<BaseInput, 'placeholder'> & {
1685
1611
 
1686
1612
  declare type Response_2 = BarcodeResponse | InputResponse;
1687
1613
 
1688
- declare function setInputs(inputs: Array<PluginInputs>): Promise<void>;
1689
-
1690
- declare const setting: {
1691
- setInputs: typeof setInputs;
1692
- getValues: typeof getValues;
1693
- };
1614
+ /**
1615
+ * @publicApi
1616
+ */
1617
+ export declare interface SecureStore {
1618
+ get: (key: string) => Promise<string | undefined>;
1619
+ set: (key: string, value: string) => Promise<void>;
1620
+ del: (key: string) => Promise<void>;
1621
+ }
1694
1622
 
1695
1623
  /**
1696
1624
  * @publicApi
1697
1625
  */
1698
- export declare type SettingTypes = typeof setting;
1626
+ export declare type SettingTypes = {
1627
+ setInputs: (inputs: Array<PluginInputs>) => Promise<void>;
1628
+ getValues: <T extends Record<string, number | string | string[] | boolean | undefined>>() => Promise<T>;
1629
+ };
1699
1630
 
1700
1631
  /**
1701
1632
  * @publicApi
@@ -1731,14 +1662,12 @@ export declare type StoreStatus = 'NEW' | 'ACCEPTED' | 'REJECTED' | 'PARTIALLY_C
1731
1662
  * @publicApi
1732
1663
  */
1733
1664
  export declare interface Table {
1734
- getTables: () => Promise<PluginTable[]>;
1665
+ getTables: () => Promise<(PluginTable & {
1666
+ order?: PluginOrder;
1667
+ })[]>;
1735
1668
  getTable: (tableId: number) => Promise<PluginTable>;
1736
- /**
1737
- * @deprecated 다음버전에서 제거 예정. order.on 사용 권장
1738
- */
1739
- on(event: 'order-update' | 'order-add', callback: (order: PluginOrder) => void): void;
1740
- on(event: 'clear' | 'add' | 'delete' | 'update', callback: (table: PluginTable) => void): void;
1741
- on(event: 'move', callback: (before: PluginTable, after: PluginTable) => void): void;
1669
+ on(event: 'clear' | 'add' | 'delete' | 'update', callback: (id: PluginTable['id']) => void): void;
1670
+ on(event: 'move', callback: (before: PluginTable['id'], after: PluginTable['id']) => void): void;
1742
1671
  clearTable: ({ table, order }: {
1743
1672
  table: PluginTable;
1744
1673
  order?: PluginOrder;
@@ -1837,18 +1766,18 @@ export declare class Websocket {
1837
1766
  followRedirects?: boolean | undefined;
1838
1767
  timeout?: number | undefined;
1839
1768
  } | undefined);
1840
- connect(): Promise<void>;
1841
- disconnect(): Promise<void>;
1842
- send(data: {
1769
+ connect: () => Promise<void>;
1770
+ disconnect: () => Promise<void>;
1771
+ send: (data: {
1843
1772
  data: string;
1844
1773
  option?: {
1845
- mask?: boolean;
1846
- };
1847
- }): void;
1848
- onMessage(callback: (message: string) => void): void;
1849
- onError(callback: (errorName?: string, errorMessage?: string) => void): void;
1850
- onClose(callback: (code: string) => void): void;
1851
- onOpen(callback: () => void): void;
1774
+ mask?: boolean | undefined;
1775
+ } | undefined;
1776
+ }) => void;
1777
+ onMessage: (callback: (message: string) => void) => void;
1778
+ onError: (callback: (errorName?: string, errorMessage?: string) => void) => void;
1779
+ onClose: (callback: (code: string) => void) => void;
1780
+ onOpen: (callback: () => void) => void;
1852
1781
  }
1853
1782
 
1854
1783
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tossplace/pos-plugin-sdk",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "포스 플러그인 sdk",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",