@vuu-ui/vuu-data-types 0.8.87 → 0.8.89

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 +26 -30
  2. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -14,14 +14,14 @@ import type {
14
14
  VuuRowDataItemType,
15
15
  VuuSort,
16
16
  VuuTable,
17
- VuuRpcRequest
17
+ VuuRpcRequest,
18
18
  } from "@vuu-ui/vuu-protocol-types";
19
19
  import type { DataSourceConfigChanges, IEventEmitter } from "@vuu-ui/vuu-utils";
20
20
  import type {
21
21
  DataSourceFilter,
22
22
  MenuRpcResponse,
23
23
  Selection,
24
- TableSchema
24
+ TableSchema,
25
25
  } from "@vuu-ui/vuu-data-types";
26
26
  import type {
27
27
  VuuTableListRequest,
@@ -29,7 +29,7 @@ import type {
29
29
  LinkDescriptorWithLabel,
30
30
  VuuRpcViewportResponse,
31
31
  TypeAheadMethod,
32
- VuuRange
32
+ VuuRange,
33
33
  } from "@vuu-ui/vuu-protocol-types";
34
34
 
35
35
  export interface DataSourceFilter extends VuuFilter {
@@ -59,7 +59,7 @@ export type DataSourceRow = [
59
59
  ChildCount,
60
60
  RowKey,
61
61
  IsSelected,
62
- ...VuuRowDataItemType[]
62
+ ...VuuRowDataItemType[],
63
63
  ];
64
64
 
65
65
  export type DataSourceRowObject = {
@@ -189,10 +189,6 @@ export interface DataSourceVisualLinksMessage
189
189
  links: VuuLinkDescriptor[];
190
190
  }
191
191
 
192
- export type VuuFeatureInvocationMessage =
193
- | DataSourceVisualLinkCreatedMessage
194
- | DataSourceVisualLinkRemovedMessage;
195
-
196
192
  export type VuuFeatureMessage =
197
193
  | DataSourceMenusMessage
198
194
  | DataSourceVisualLinksMessage;
@@ -246,7 +242,7 @@ export type ConfigChangeHandler = (msg: ConfigChangeMessage) => void;
246
242
  */
247
243
  export type MenuBuilder<L = string, O = unknown> = (
248
244
  location: L,
249
- options: O
245
+ options: O,
250
246
  ) => ContextMenuItemDescriptor[];
251
247
 
252
248
  /**
@@ -258,7 +254,7 @@ export type MenuBuilder<L = string, O = unknown> = (
258
254
  * ActionHandlers to be chained.
259
255
  */
260
256
  export type MenuActionHandler = (
261
- reason: MenuActionClosePopup
257
+ reason: MenuActionClosePopup,
262
258
  ) => boolean | undefined;
263
259
 
264
260
  export interface ContextMenuContextType {
@@ -328,21 +324,28 @@ export type SubscribeCallback = (message: DataSourceCallbackMessage) => void;
328
324
  export type OptimizeStrategy = "none" | "throttle" | "debounce";
329
325
 
330
326
  export type DataSourceEventHandler = (viewportId: string) => void;
327
+ export type RowSelectionEventHandler = (
328
+ selection: Selection,
329
+ selectedRowCount: number,
330
+ ) => void;
331
331
 
332
332
  export type DataSourceEvents = {
333
333
  config: (
334
334
  config: DataSourceConfig | undefined,
335
335
  confirmed?: boolean,
336
- configChanges?: DataSourceConfigChanges
336
+ configChanges?: DataSourceConfigChanges,
337
337
  ) => void;
338
338
  optimize: (optimize: OptimizeStrategy) => void;
339
339
  range: (range: VuuRange) => void;
340
340
  resize: (size: number) => void;
341
- "row-selection": (selection: Selection, selectedRowCount: number) => void;
341
+ "row-selection": RowSelectionEventHandler;
342
342
  subscribed: (subscription: DataSourceSubscribedMessage) => void;
343
343
  unsubscribed: DataSourceEventHandler;
344
344
  disabled: DataSourceEventHandler;
345
345
  enabled: DataSourceEventHandler;
346
+ "title-changed": (id: string, title: string) => void;
347
+ "visual-link-created": (message: DataSourceVisualLinkCreatedMessage) => void;
348
+ "visual-link-removed": () => void;
346
349
  };
347
350
 
348
351
  /**
@@ -352,13 +355,13 @@ export type DataSourceEvents = {
352
355
  export type DataSourceEditHandler = (
353
356
  rowKey: string,
354
357
  columnName: string,
355
- value: VuuRowDataItemType
358
+ value: VuuRowDataItemType,
356
359
  ) => Promise<true | string>;
357
360
 
358
361
  export type DataSourceDeleteHandler = (key: string) => Promise<true | string>;
359
362
  export type DataSourceInsertHandler = (
360
363
  key: string,
361
- data: VuuDataRowDto
364
+ data: VuuDataRowDto,
362
365
  ) => Promise<true | string>;
363
366
 
364
367
  export type RpcResponse =
@@ -368,7 +371,7 @@ export type RpcResponse =
368
371
  | ViewportRpcResponse;
369
372
 
370
373
  export type RpcResponseHandler = (
371
- response: Omit<VuuRpcResponse, "vpId">
374
+ response: Omit<VuuRpcResponse, "vpId">,
372
375
  ) => boolean;
373
376
 
374
377
  export type RowSearchPredicate = (row: DataSourceRow) => boolean;
@@ -390,7 +393,7 @@ export type SuggestionProvider = () => SuggestionFetcher;
390
393
  export interface TypeaheadSuggestionProvider {
391
394
  getTypeaheadSuggestions: (
392
395
  columnName: string,
393
- pattern?: string
396
+ pattern?: string,
394
397
  ) => Promise<string[]>;
395
398
  }
396
399
 
@@ -413,7 +416,7 @@ export interface DataSource
413
416
  * @returns true if config has been applied (will not be if existig config is same)
414
417
  */
415
418
  applyConfig: (
416
- config: DataSourceConfig
419
+ config: DataSourceConfig,
417
420
  ) => DataSourceConfigChanges | undefined;
418
421
  closeTreeNode: (key: string, cascade?: boolean) => void;
419
422
  columns: string[];
@@ -478,16 +481,16 @@ export interface DataSource
478
481
  menu?: VuuMenu;
479
482
  /** @deprecated, use remoteProcedureCall instead */
480
483
  menuRpcCall: (
481
- rpcRequest: Omit<VuuRpcRequest, "vpId">
484
+ rpcRequest: Omit<VuuRpcRequest, "vpId">,
482
485
  ) => Promise<VuuRpcMenuResponse>;
483
486
  /* @deprecated, use remoteProcedureCall instead */
484
487
  rpcCall?: <T extends VuuRpcResponse = VuuRpcResponse>(
485
- rpcRequest: Omit<VuuRpcRequest, "vpId">
488
+ rpcRequest: Omit<VuuRpcRequest, "vpId">,
486
489
  ) => Promise<T>;
487
490
  openTreeNode: (key: string) => void;
488
491
  range: VuuRange;
489
492
  remoteProcedureCall: <T extends VuuRpcResponse = VuuRpcResponse>(
490
- message: VuuRpcRequest
493
+ message: VuuRpcRequest,
491
494
  ) => Promise<T>;
492
495
  select: SelectionChangeHandler;
493
496
  readonly selectedRowsCount: number;
@@ -496,7 +499,7 @@ export interface DataSource
496
499
  sort: VuuSort;
497
500
  subscribe: (
498
501
  props: SubscribeProps,
499
- callback: SubscribeCallback
502
+ callback: SubscribeCallback,
500
503
  ) => Promise<void>;
501
504
  table?: VuuTable;
502
505
  readonly tableSchema?: TableSchema;
@@ -505,14 +508,14 @@ export interface DataSource
505
508
  * Users can edit titles on components. If so, and this is a table component, we will display this title in
506
509
  * the context menu rather than the underlying table name (which may not be unique within the layout)
507
510
  */
508
- title?: string;
511
+ title: string;
509
512
  unsubscribe: () => void;
510
513
  viewport?: string;
511
514
  visualLink?: LinkDescriptorWithLabel;
512
515
  }
513
516
 
514
517
  export interface MenuRpcResponse<
515
- TAction extends MenuRpcAction = MenuRpcAction
518
+ TAction extends MenuRpcAction = MenuRpcAction,
516
519
  > {
517
520
  action: TAction;
518
521
  error?: string;
@@ -709,12 +712,6 @@ export interface VuuUIMessageOutCloseTreeNode extends ViewportMessageOut {
709
712
  key: string;
710
713
  type: "closeTreeNode";
711
714
  }
712
- export interface VuuUIMessageOutCreateLink extends ViewportMessageOut {
713
- childColumnName: string;
714
- parentColumnName: string;
715
- parentClientVpId: string;
716
- type: "createLink";
717
- }
718
715
  export interface VuuUIMessageOutRemoveLink extends ViewportMessageOut {
719
716
  type: "removeLink";
720
717
  }
@@ -766,7 +763,6 @@ export type VuuUIMessageOutViewport =
766
763
  | VuuUIMessageOutCloseTreeNode
767
764
  | VuuUIMessageOutColumns
768
765
  | VuuUIMessageOutConfig
769
- | VuuUIMessageOutCreateLink
770
766
  | VuuUIMessageOutDisable
771
767
  | VuuUIMessageOutEnable
772
768
  | VuuUIMessageOutOpenTreeNode
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@vuu-ui/vuu-data-types",
3
- "version": "0.8.87",
3
+ "version": "0.8.89",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
6
6
  "devDependencies": {
7
- "@vuu-ui/vuu-filter-types": "0.8.87",
8
- "@vuu-ui/vuu-protocol-types": "0.8.87"
7
+ "@vuu-ui/vuu-filter-types": "0.8.89",
8
+ "@vuu-ui/vuu-protocol-types": "0.8.89"
9
9
  },
10
10
  "dependencies": {},
11
11
  "peerDependencies": {},