@vuu-ui/vuu-data-types 0.8.72 → 0.8.74

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.
Files changed (2) hide show
  1. package/index.d.ts +22 -6
  2. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import type {
4
4
  ClientToServerEditRpc,
5
5
  ClientToServerMenuRPC,
6
6
  ClientToServerViewportRpcCall,
7
+ NoAction,
7
8
  OpenDialogAction,
8
9
  VuuAggregation,
9
10
  VuuColumnDataType,
@@ -334,6 +335,8 @@ export interface SubscribeProps {
334
335
  export type SubscribeCallback = (message: DataSourceCallbackMessage) => void;
335
336
  export type OptimizeStrategy = "none" | "throttle" | "debounce";
336
337
 
338
+ export type DataSourceEventHandler = (viewportId: string) => void;
339
+
337
340
  export type DataSourceEvents = {
338
341
  config: (
339
342
  config: DataSourceConfig | undefined,
@@ -343,8 +346,10 @@ export type DataSourceEvents = {
343
346
  optimize: (optimize: OptimizeStrategy) => void;
344
347
  range: (range: VuuRange) => void;
345
348
  resize: (size: number) => void;
346
- "subscription-open": (subscription: DataSourceSubscribedMessage) => void;
347
- "subscription-closed": () => void;
349
+ subscribed: (subscription: DataSourceSubscribedMessage) => void;
350
+ unsubscribed: DataSourceEventHandler;
351
+ disabled: DataSourceEventHandler;
352
+ enabled: DataSourceEventHandler;
348
353
  };
349
354
 
350
355
  /**
@@ -369,7 +374,9 @@ export type RpcResponse =
369
374
  | VuuUIMessageInRPCEditResponse
370
375
  | ViewportRpcResponse;
371
376
 
372
- export type RpcResponseHandler = (response: RpcResponse) => boolean;
377
+ export type RpcResponseHandler = (
378
+ response: Omit<RpcResponse, "requestId">
379
+ ) => boolean;
373
380
 
374
381
  export type RowSearchPredicate = (row: DataSourceRow) => boolean;
375
382
 
@@ -446,12 +453,14 @@ export interface DataSource
446
453
  * the subscription to active status. Fresh data will be dispatched to client. The enable call optionally
447
454
  * accepts the same subscribe callback as subscribe. This allows a completely new instance of a component to
448
455
  * assume ownership of a subscription and receive all messages.
456
+ * Should emit an enabled event
449
457
  */
450
458
  enable?: (callback?: SubscribeCallback) => void;
451
459
  /**
452
460
  * Disables this subscription. A datasource will send no further messages until re-enabled. Example usage
453
461
  * might be for a component displayed within a set of Tabs. If user switches to another tab, the dataSource
454
462
  * of the component that is no longer visible can be disabled until it is made visible again.
463
+ * Should emit a disabled event
455
464
  */
456
465
  disable?: () => void;
457
466
  filter: DataSourceFilter;
@@ -476,7 +485,7 @@ export interface DataSource
476
485
  menu?: VuuMenu;
477
486
  menuRpcCall: (
478
487
  rpcRequest: Omit<ClientToServerMenuRPC, "vpId"> | ClientToServerEditRpc
479
- ) => Promise<RpcResponse | undefined>;
488
+ ) => Promise<Omit<RpcResponse, "requestId"> | undefined>;
480
489
  rpcCall?: <T extends RpcResponse = RpcResponse>(
481
490
  message: Omit<ClientToServerViewportRpcCall, "vpId">
482
491
  ) => Promise<T | undefined>;
@@ -518,7 +527,10 @@ export interface OpenDialogActionWithSchema extends OpenDialogAction {
518
527
  tableSchema?: TableSchema;
519
528
  }
520
529
 
521
- export declare type MenuRpcAction = OpenDialogActionWithSchema | NoAction;
530
+ export declare type MenuRpcAction =
531
+ | OpenDialogActionWithSchema
532
+ | NoAction
533
+ | ShowToastAction;
522
534
 
523
535
  export type ConnectionStatus =
524
536
  | "connecting"
@@ -607,7 +619,11 @@ export interface VuuUIMessageInTableMeta {
607
619
  type: "TABLE_META_RESP";
608
620
  }
609
621
  export interface ViewportRpcResponse {
610
- action: ServerToClientViewportRpcResponse["action"];
622
+ action: ServerToClientViewportRpcResponse["action"] & {
623
+ // for SessionTable editing, we inject the schema after receiving server message
624
+ // and before forwarding to UI
625
+ tableSchema?: TableSchema;
626
+ };
611
627
  requestId: string;
612
628
  rpcName?: string;
613
629
  type: "VIEW_PORT_RPC_RESPONSE";
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@vuu-ui/vuu-data-types",
3
- "version": "0.8.72",
3
+ "version": "0.8.74",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
6
6
  "devDependencies": {
7
- "@vuu-ui/vuu-filter-types": "0.8.72",
8
- "@vuu-ui/vuu-protocol-types": "0.8.72"
7
+ "@vuu-ui/vuu-filter-types": "0.8.74",
8
+ "@vuu-ui/vuu-protocol-types": "0.8.74"
9
9
  },
10
10
  "dependencies": {},
11
11
  "peerDependencies": {},