@vuu-ui/vuu-data-types 0.8.84 → 0.8.86
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/index.d.ts +32 -28
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { Filter } from "@vuu-ui/vuu-filter-types";
|
|
2
2
|
import type { MenuActionClosePopup } from "@vuu-ui/vuu-popups";
|
|
3
3
|
import type {
|
|
4
|
-
ClientToServerEditRpc,
|
|
5
|
-
ClientToServerMenuRPC,
|
|
6
|
-
ClientToServerViewportRpcCall,
|
|
7
4
|
NoAction,
|
|
8
5
|
OpenDialogAction,
|
|
9
6
|
VuuAggregation,
|
|
@@ -17,21 +14,22 @@ import type {
|
|
|
17
14
|
VuuRowDataItemType,
|
|
18
15
|
VuuSort,
|
|
19
16
|
VuuTable,
|
|
17
|
+
VuuRpcRequest
|
|
20
18
|
} from "@vuu-ui/vuu-protocol-types";
|
|
21
19
|
import type { DataSourceConfigChanges, IEventEmitter } from "@vuu-ui/vuu-utils";
|
|
22
20
|
import type {
|
|
23
21
|
DataSourceFilter,
|
|
24
22
|
MenuRpcResponse,
|
|
25
23
|
Selection,
|
|
26
|
-
TableSchema
|
|
24
|
+
TableSchema
|
|
27
25
|
} from "@vuu-ui/vuu-data-types";
|
|
28
26
|
import type {
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
VuuTableListRequest,
|
|
28
|
+
VuuTableMetaRequest,
|
|
31
29
|
LinkDescriptorWithLabel,
|
|
32
|
-
|
|
30
|
+
VuuRpcViewportResponse,
|
|
33
31
|
TypeAheadMethod,
|
|
34
|
-
VuuRange
|
|
32
|
+
VuuRange
|
|
35
33
|
} from "@vuu-ui/vuu-protocol-types";
|
|
36
34
|
|
|
37
35
|
export interface DataSourceFilter extends VuuFilter {
|
|
@@ -61,7 +59,7 @@ export type DataSourceRow = [
|
|
|
61
59
|
ChildCount,
|
|
62
60
|
RowKey,
|
|
63
61
|
IsSelected,
|
|
64
|
-
...VuuRowDataItemType[]
|
|
62
|
+
...VuuRowDataItemType[]
|
|
65
63
|
];
|
|
66
64
|
|
|
67
65
|
export type DataSourceRowObject = {
|
|
@@ -248,7 +246,7 @@ export type ConfigChangeHandler = (msg: ConfigChangeMessage) => void;
|
|
|
248
246
|
*/
|
|
249
247
|
export type MenuBuilder<L = string, O = unknown> = (
|
|
250
248
|
location: L,
|
|
251
|
-
options: O
|
|
249
|
+
options: O
|
|
252
250
|
) => ContextMenuItemDescriptor[];
|
|
253
251
|
|
|
254
252
|
/**
|
|
@@ -260,7 +258,7 @@ export type MenuBuilder<L = string, O = unknown> = (
|
|
|
260
258
|
* ActionHandlers to be chained.
|
|
261
259
|
*/
|
|
262
260
|
export type MenuActionHandler = (
|
|
263
|
-
reason: MenuActionClosePopup
|
|
261
|
+
reason: MenuActionClosePopup
|
|
264
262
|
) => boolean | undefined;
|
|
265
263
|
|
|
266
264
|
export interface ContextMenuContextType {
|
|
@@ -335,7 +333,7 @@ export type DataSourceEvents = {
|
|
|
335
333
|
config: (
|
|
336
334
|
config: DataSourceConfig | undefined,
|
|
337
335
|
confirmed?: boolean,
|
|
338
|
-
configChanges?: DataSourceConfigChanges
|
|
336
|
+
configChanges?: DataSourceConfigChanges
|
|
339
337
|
) => void;
|
|
340
338
|
optimize: (optimize: OptimizeStrategy) => void;
|
|
341
339
|
range: (range: VuuRange) => void;
|
|
@@ -352,15 +350,15 @@ export type DataSourceEvents = {
|
|
|
352
350
|
* return Promise<errorMessage> indicates failure
|
|
353
351
|
*/
|
|
354
352
|
export type DataSourceEditHandler = (
|
|
355
|
-
|
|
353
|
+
rowKey: string,
|
|
356
354
|
columnName: string,
|
|
357
|
-
value: VuuRowDataItemType
|
|
355
|
+
value: VuuRowDataItemType
|
|
358
356
|
) => Promise<true | string>;
|
|
359
357
|
|
|
360
358
|
export type DataSourceDeleteHandler = (key: string) => Promise<true | string>;
|
|
361
359
|
export type DataSourceInsertHandler = (
|
|
362
360
|
key: string,
|
|
363
|
-
data: VuuDataRowDto
|
|
361
|
+
data: VuuDataRowDto
|
|
364
362
|
) => Promise<true | string>;
|
|
365
363
|
|
|
366
364
|
export type RpcResponse =
|
|
@@ -370,7 +368,7 @@ export type RpcResponse =
|
|
|
370
368
|
| ViewportRpcResponse;
|
|
371
369
|
|
|
372
370
|
export type RpcResponseHandler = (
|
|
373
|
-
response: Omit<
|
|
371
|
+
response: Omit<VuuRpcResponse, "vpId">
|
|
374
372
|
) => boolean;
|
|
375
373
|
|
|
376
374
|
export type RowSearchPredicate = (row: DataSourceRow) => boolean;
|
|
@@ -392,7 +390,7 @@ export type SuggestionProvider = () => SuggestionFetcher;
|
|
|
392
390
|
export interface TypeaheadSuggestionProvider {
|
|
393
391
|
getTypeaheadSuggestions: (
|
|
394
392
|
columnName: string,
|
|
395
|
-
pattern?: string
|
|
393
|
+
pattern?: string
|
|
396
394
|
) => Promise<string[]>;
|
|
397
395
|
}
|
|
398
396
|
|
|
@@ -415,7 +413,7 @@ export interface DataSource
|
|
|
415
413
|
* @returns true if config has been applied (will not be if existig config is same)
|
|
416
414
|
*/
|
|
417
415
|
applyConfig: (
|
|
418
|
-
config: DataSourceConfig
|
|
416
|
+
config: DataSourceConfig
|
|
419
417
|
) => DataSourceConfigChanges | undefined;
|
|
420
418
|
closeTreeNode: (key: string, cascade?: boolean) => void;
|
|
421
419
|
columns: string[];
|
|
@@ -478,21 +476,27 @@ export interface DataSource
|
|
|
478
476
|
insertRow?: DataSourceInsertHandler;
|
|
479
477
|
links?: LinkDescriptorWithLabel[];
|
|
480
478
|
menu?: VuuMenu;
|
|
479
|
+
/** @deprecated, use remoteProcedureCall instead */
|
|
481
480
|
menuRpcCall: (
|
|
482
|
-
rpcRequest: Omit<
|
|
483
|
-
) => Promise<
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
481
|
+
rpcRequest: Omit<VuuRpcRequest, "vpId">
|
|
482
|
+
) => Promise<VuuRpcMenuResponse>;
|
|
483
|
+
/* @deprecated, use remoteProcedureCall instead */
|
|
484
|
+
rpcCall?: <T extends VuuRpcResponse = VuuRpcResponse>(
|
|
485
|
+
rpcRequest: Omit<VuuRpcRequest, "vpId">
|
|
486
|
+
) => Promise<T>;
|
|
487
487
|
openTreeNode: (key: string) => void;
|
|
488
488
|
range: VuuRange;
|
|
489
|
+
remoteProcedureCall: <T extends VuuRpcResponse = VuuRpcResponse>(
|
|
490
|
+
message: VuuRpcRequest
|
|
491
|
+
) => Promise<T>;
|
|
489
492
|
select: SelectionChangeHandler;
|
|
490
493
|
readonly selectedRowsCount: number;
|
|
494
|
+
sendBroadcastMessage?: (message: DataSourceBroadcastMessage) => void;
|
|
491
495
|
readonly size: number;
|
|
492
496
|
sort: VuuSort;
|
|
493
497
|
subscribe: (
|
|
494
498
|
props: SubscribeProps,
|
|
495
|
-
callback: SubscribeCallback
|
|
499
|
+
callback: SubscribeCallback
|
|
496
500
|
) => Promise<void>;
|
|
497
501
|
table?: VuuTable;
|
|
498
502
|
readonly tableSchema?: TableSchema;
|
|
@@ -508,7 +512,7 @@ export interface DataSource
|
|
|
508
512
|
}
|
|
509
513
|
|
|
510
514
|
export interface MenuRpcResponse<
|
|
511
|
-
TAction extends MenuRpcAction = MenuRpcAction
|
|
515
|
+
TAction extends MenuRpcAction = MenuRpcAction
|
|
512
516
|
> {
|
|
513
517
|
action: TAction;
|
|
514
518
|
error?: string;
|
|
@@ -609,7 +613,7 @@ export interface VuuUIMessageInTableMeta {
|
|
|
609
613
|
type: "TABLE_META_RESP";
|
|
610
614
|
}
|
|
611
615
|
export interface ViewportRpcResponse {
|
|
612
|
-
action:
|
|
616
|
+
action: VuuRpcViewportResponse["action"] & {
|
|
613
617
|
// for SessionTable editing, we inject the schema after receiving server message
|
|
614
618
|
// and before forwarding to UI
|
|
615
619
|
tableSchema?: TableSchema;
|
|
@@ -789,5 +793,5 @@ export type VuuUIMessageOut =
|
|
|
789
793
|
| VuuUIMessageOutSubscribe
|
|
790
794
|
| VuuUIMessageOutUnsubscribe
|
|
791
795
|
| VuuUIMessageOutViewport
|
|
792
|
-
| WithRequestId<
|
|
793
|
-
| WithRequestId<
|
|
796
|
+
| WithRequestId<VuuTableListRequest>
|
|
797
|
+
| WithRequestId<VuuTableMetaRequest>;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuu-ui/vuu-data-types",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.86",
|
|
4
4
|
"author": "heswell",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@vuu-ui/vuu-filter-types": "0.8.
|
|
8
|
-
"@vuu-ui/vuu-protocol-types": "0.8.
|
|
7
|
+
"@vuu-ui/vuu-filter-types": "0.8.86",
|
|
8
|
+
"@vuu-ui/vuu-protocol-types": "0.8.86"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {},
|
|
11
11
|
"peerDependencies": {},
|