@vuu-ui/vuu-data-types 0.8.92 → 0.8.94

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 +56 -19
  2. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -15,6 +15,12 @@ import type {
15
15
  VuuSort,
16
16
  VuuTable,
17
17
  VuuRpcRequest,
18
+ VuuRpcServiceRequest,
19
+ VuuRpcMenuRequest,
20
+ VuuRpcViewportRequest,
21
+ VuuCreateVisualLink,
22
+ VuuRemoveVisualLink,
23
+ VuuTableList,
18
24
  } from "@vuu-ui/vuu-protocol-types";
19
25
  import type { DataSourceConfigChanges, IEventEmitter } from "@vuu-ui/vuu-utils";
20
26
  import type {
@@ -32,6 +38,7 @@ import type {
32
38
  VuuRange,
33
39
  } from "@vuu-ui/vuu-protocol-types";
34
40
  import { DataValueTypeDescriptor } from "@vuu-ui/vuu-table-types";
41
+ import { PostMessageToClientCallback } from "@vuu-ui/vuu-data-remote";
35
42
 
36
43
  export declare type DataValueValidationSuccessResult = {
37
44
  ok: true;
@@ -211,6 +218,9 @@ export interface DataSourceAggregateMessage
211
218
 
212
219
  export type DataUpdateMode = "batch" | "update" | "size-only";
213
220
 
221
+ export interface DataSourceClearMessage extends MessageWithClientViewportId {
222
+ type: "viewport-clear";
223
+ }
214
224
  export interface DataSourceDataMessage extends MessageWithClientViewportId {
215
225
  mode: DataUpdateMode;
216
226
  rows?: DataSourceRow[];
@@ -315,6 +325,7 @@ export type DataSourceCallbackMessage =
315
325
  | DataSourceConfigMessage
316
326
  | DataSourceColumnsMessage
317
327
  | DataSourceDataMessage
328
+ | DataSourceClearMessage
318
329
  | DataSourceDebounceRequest
319
330
  | DataSourceDisabledMessage
320
331
  | DataSourceEnabledMessage
@@ -526,6 +537,11 @@ export interface DataSource
526
537
  */
527
538
  applyConfig: (
528
539
  config: DataSourceConfig,
540
+ /**
541
+ * If new config is missing attributes and these attributes are present on
542
+ * existing config, shoule the existing attributes be preserved ?
543
+ */
544
+ preserveExistingConfigAttributes?: boolean,
529
545
  ) => DataSourceConfigChanges | undefined;
530
546
  closeTreeNode: (key: string, cascade?: boolean) => void;
531
547
  columns: string[];
@@ -543,7 +559,7 @@ export interface DataSource
543
559
  * If an suspend is requested and not resumed within 3 seconds, it will automatically be promoted to a disable.,
544
560
  */
545
561
  suspend?: () => void;
546
- resume?: () => void;
562
+ resume?: (callback?: SubscribeCallback) => void;
547
563
 
548
564
  deleteRow?: DataSourceDeleteHandler;
549
565
  /**
@@ -643,21 +659,6 @@ export declare type MenuRpcAction =
643
659
  | NoAction
644
660
  | ShowToastAction;
645
661
 
646
- export type ConnectionStatus =
647
- | "connecting"
648
- | "connection-open-awaiting-session"
649
- | "connected"
650
- | "disconnected"
651
- | "failed"
652
- | "reconnected";
653
-
654
- export interface ConnectionStatusMessage {
655
- type: "connection-status";
656
- reason?: string;
657
- retry?: boolean;
658
- status: ConnectionStatus;
659
- }
660
-
661
662
  export interface ConnectionQualityMetrics {
662
663
  type: "connection-metrics";
663
664
  messagesLength: number;
@@ -768,7 +769,7 @@ export type VuuUIMessageIn =
768
769
  export type WebSocketProtocol = string | string[] | undefined;
769
770
 
770
771
  export interface VuuUIMessageOutConnect {
771
- protocol: WebSocketProtocol;
772
+ protocol?: WebSocketProtocol;
772
773
  type: "connect";
773
774
  token: string;
774
775
  url: string;
@@ -777,6 +778,10 @@ export interface VuuUIMessageOutConnect {
777
778
  retryLimitStartup?: number;
778
779
  }
779
780
 
781
+ export interface VuuUIMessageOutDisconnect {
782
+ type: "disconnect";
783
+ }
784
+
780
785
  export interface VuuUIMessageOutSubscribe extends ServerProxySubscribeMessage {
781
786
  type: "subscribe";
782
787
  }
@@ -895,8 +900,40 @@ export type WithRequestId<T> = T & { requestId: string };
895
900
 
896
901
  export type VuuUIMessageOut =
897
902
  | VuuUIMessageOutConnect
903
+ | VuuUIMessageOutDisconnect
898
904
  | VuuUIMessageOutSubscribe
899
905
  | VuuUIMessageOutUnsubscribe
900
906
  | VuuUIMessageOutViewport
901
- | WithRequestId<VuuTableListRequest>
902
- | WithRequestId<VuuTableMetaRequest>;
907
+ | WithRequestId<VuuTableListRequest | VuuTableMetaRequest>;
908
+
909
+ export type ConnectOptions = {
910
+ url: string;
911
+ token: string;
912
+ username: string;
913
+ protocol?: WebSocketProtocol;
914
+ /** Max number of reconnect attempts in the event of unsuccessful websocket connection at startup */
915
+ retryLimitStartup?: number;
916
+ /** Max number of reconnect attempts in the event of a disconnected websocket connection */
917
+ retryLimitDisconnect?: number;
918
+ };
919
+
920
+ export interface ServerAPI {
921
+ destroy: (viewportId?: string) => void;
922
+ getTableSchema: (table: VuuTable) => Promise<TableSchema>;
923
+ getTableList: (module?: string) => Promise<VuuTableList>;
924
+ // TODO its not really unknown
925
+ rpcCall: <T = unknown>(
926
+ msg:
927
+ | VuuRpcServiceRequest
928
+ | VuuRpcMenuRequest
929
+ | VuuRpcViewportRequest
930
+ | VuuCreateVisualLink
931
+ | VuuRemoveVisualLink,
932
+ ) => Promise<T>;
933
+ send: (message: VuuUIMessageOut) => void;
934
+ subscribe: (
935
+ message: ServerProxySubscribeMessage,
936
+ callback: PostMessageToClientCallback,
937
+ ) => void;
938
+ unsubscribe: (viewport: string) => void;
939
+ }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@vuu-ui/vuu-data-types",
3
- "version": "0.8.92",
3
+ "version": "0.8.94",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
6
6
  "devDependencies": {
7
- "@vuu-ui/vuu-filter-types": "0.8.92",
8
- "@vuu-ui/vuu-protocol-types": "0.8.92"
7
+ "@vuu-ui/vuu-filter-types": "0.8.94",
8
+ "@vuu-ui/vuu-protocol-types": "0.8.94"
9
9
  },
10
10
  "dependencies": {},
11
11
  "peerDependencies": {},