@tossplace/pos-plugin-sdk 0.0.20 → 0.0.21

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
@@ -1601,6 +1601,29 @@ export declare interface PluginTableGroup {
1601
1601
  tableIds: number[];
1602
1602
  }
1603
1603
 
1604
+ declare class PluginUnicast implements PluginUnicastTypes {
1605
+ private pluginName;
1606
+ private readonly sendBuffer;
1607
+ private readonly sendEventBuffer;
1608
+ private readonly listenHandlers;
1609
+ constructor();
1610
+ send: <T = any>(message: T, to: string) => void;
1611
+ listen: <T = any>(event: UnicastEvent, callback: (message: T, from: string) => void) => (() => void);
1612
+ private sendToWebview;
1613
+ private flushSendBuffer;
1614
+ private flushSendEventBuffer;
1615
+ }
1616
+
1617
+ export declare const pluginUnicast: PluginUnicast;
1618
+
1619
+ /**
1620
+ * @publicApi
1621
+ */
1622
+ export declare type PluginUnicastTypes = {
1623
+ send<T = any>(message: T, to: string): void;
1624
+ listen<T = any>(event: 'message', callback: (message: T, from: string) => void): () => void;
1625
+ };
1626
+
1604
1627
  /**
1605
1628
  * @publicApi
1606
1629
  */
@@ -1648,6 +1671,7 @@ export declare type PosPluginSdk = {
1648
1671
  powerSaver: PowerSaverTypes;
1649
1672
  sound: SoundTypes;
1650
1673
  kdsOrder: KdsOrder;
1674
+ pluginUnicast: PluginUnicastTypes;
1651
1675
  };
1652
1676
 
1653
1677
  /**
@@ -1853,6 +1877,8 @@ declare class UiImpl implements Ui {
1853
1877
  openInputModal(data: Omit<PopupElement<'input'>, 'type'>): Promise<PopupActionResponse<'input'>>;
1854
1878
  }
1855
1879
 
1880
+ declare type UnicastEvent = 'message';
1881
+
1856
1882
  declare type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
1857
1883
 
1858
1884
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tossplace/pos-plugin-sdk",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "description": "포스 플러그인 sdk",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
package/types/index.d.ts CHANGED
@@ -1594,6 +1594,29 @@ export declare interface PluginTableGroup {
1594
1594
  tableIds: number[];
1595
1595
  }
1596
1596
 
1597
+ declare class PluginUnicast implements PluginUnicastTypes {
1598
+ private pluginName;
1599
+ private readonly sendBuffer;
1600
+ private readonly sendEventBuffer;
1601
+ private readonly listenHandlers;
1602
+ constructor();
1603
+ send: <T = any>(message: T, to: string) => void;
1604
+ listen: <T = any>(event: UnicastEvent, callback: (message: T, from: string) => void) => (() => void);
1605
+ private sendToWebview;
1606
+ private flushSendBuffer;
1607
+ private flushSendEventBuffer;
1608
+ }
1609
+
1610
+ export declare const pluginUnicast: PluginUnicast;
1611
+
1612
+ /**
1613
+ * @publicApi
1614
+ */
1615
+ export declare type PluginUnicastTypes = {
1616
+ send<T = any>(message: T, to: string): void;
1617
+ listen<T = any>(event: 'message', callback: (message: T, from: string) => void): () => void;
1618
+ };
1619
+
1597
1620
  /**
1598
1621
  * @publicApi
1599
1622
  */
@@ -1641,6 +1664,7 @@ export declare type PosPluginSdk = {
1641
1664
  powerSaver: PowerSaverTypes;
1642
1665
  sound: SoundTypes;
1643
1666
  kdsOrder: KdsOrder;
1667
+ pluginUnicast: PluginUnicastTypes;
1644
1668
  };
1645
1669
 
1646
1670
  /**
@@ -1846,6 +1870,8 @@ declare class UiImpl implements Ui {
1846
1870
  openInputModal(data: Omit<PopupElement<'input'>, 'type'>): Promise<PopupActionResponse<'input'>>;
1847
1871
  }
1848
1872
 
1873
+ declare type UnicastEvent = 'message';
1874
+
1849
1875
  declare type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
1850
1876
 
1851
1877
  /**