@tossplace/pos-plugin-sdk 0.0.20 → 0.0.22
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/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/sdk.d.ts +27 -5
- package/package.json +1 -1
- package/types/index.d.ts +27 -5
package/dist/sdk.d.ts
CHANGED
|
@@ -1223,7 +1223,7 @@ declare interface PluginKdsOrderItem {
|
|
|
1223
1223
|
updatedAt: string;
|
|
1224
1224
|
}
|
|
1225
1225
|
|
|
1226
|
-
declare type PluginKdsOrderItemState = 'OPENED' | 'COMPLETED' | 'CANCELLED';
|
|
1226
|
+
declare type PluginKdsOrderItemState = 'REQUESTED' | 'OPENED' | 'COMPLETED' | 'CANCELLED';
|
|
1227
1227
|
|
|
1228
1228
|
declare type PluginKdsOrderRequestType = 'ADDED' | 'NEW' | 'CHANGED' | 'CANCELLED' | 'MERGED';
|
|
1229
1229
|
|
|
@@ -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
|
/**
|
|
@@ -1777,10 +1801,6 @@ export declare interface Table {
|
|
|
1777
1801
|
getTable: (tableId: number) => Promise<PluginTable>;
|
|
1778
1802
|
on(event: 'clear' | 'add' | 'delete' | 'update', callback: (id: PluginTable['id']) => void): void;
|
|
1779
1803
|
on(event: 'move', callback: (before: PluginTable['id'], after: PluginTable['id']) => void): void;
|
|
1780
|
-
clearTable: ({ table, order }: {
|
|
1781
|
-
table: PluginTable;
|
|
1782
|
-
order?: PluginOrder;
|
|
1783
|
-
}) => Promise<void>;
|
|
1784
1804
|
}
|
|
1785
1805
|
|
|
1786
1806
|
/**
|
|
@@ -1853,6 +1873,8 @@ declare class UiImpl implements Ui {
|
|
|
1853
1873
|
openInputModal(data: Omit<PopupElement<'input'>, 'type'>): Promise<PopupActionResponse<'input'>>;
|
|
1854
1874
|
}
|
|
1855
1875
|
|
|
1876
|
+
declare type UnicastEvent = 'message';
|
|
1877
|
+
|
|
1856
1878
|
declare type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
|
|
1857
1879
|
|
|
1858
1880
|
/**
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1223,7 +1223,7 @@ declare interface PluginKdsOrderItem {
|
|
|
1223
1223
|
updatedAt: string;
|
|
1224
1224
|
}
|
|
1225
1225
|
|
|
1226
|
-
declare type PluginKdsOrderItemState = 'OPENED' | 'COMPLETED' | 'CANCELLED';
|
|
1226
|
+
declare type PluginKdsOrderItemState = 'REQUESTED' | 'OPENED' | 'COMPLETED' | 'CANCELLED';
|
|
1227
1227
|
|
|
1228
1228
|
declare type PluginKdsOrderRequestType = 'ADDED' | 'NEW' | 'CHANGED' | 'CANCELLED' | 'MERGED';
|
|
1229
1229
|
|
|
@@ -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
|
/**
|
|
@@ -1770,10 +1794,6 @@ export declare interface Table {
|
|
|
1770
1794
|
getTable: (tableId: number) => Promise<PluginTable>;
|
|
1771
1795
|
on(event: 'clear' | 'add' | 'delete' | 'update', callback: (id: PluginTable['id']) => void): void;
|
|
1772
1796
|
on(event: 'move', callback: (before: PluginTable['id'], after: PluginTable['id']) => void): void;
|
|
1773
|
-
clearTable: ({ table, order }: {
|
|
1774
|
-
table: PluginTable;
|
|
1775
|
-
order?: PluginOrder;
|
|
1776
|
-
}) => Promise<void>;
|
|
1777
1797
|
}
|
|
1778
1798
|
|
|
1779
1799
|
/**
|
|
@@ -1846,6 +1866,8 @@ declare class UiImpl implements Ui {
|
|
|
1846
1866
|
openInputModal(data: Omit<PopupElement<'input'>, 'type'>): Promise<PopupActionResponse<'input'>>;
|
|
1847
1867
|
}
|
|
1848
1868
|
|
|
1869
|
+
declare type UnicastEvent = 'message';
|
|
1870
|
+
|
|
1849
1871
|
declare type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
|
|
1850
1872
|
|
|
1851
1873
|
/**
|