@aristid/leav-types 1.5.0-98bf7b08 → 1.5.0-d954f801

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.
@@ -8,15 +8,16 @@ import { type IRecord } from './record';
8
8
  import { type IValue } from './value';
9
9
  import { type IVersionProfile } from './versionProfile';
10
10
  import { type IPermission } from './permissions';
11
- import { type ITree } from './tree';
11
+ import { type ITreeDbEvent, type ITree } from './tree';
12
+ type OnlyObject<T> = T extends object ? T : never;
12
13
  /**
13
14
  * Maybe move all DBPayloadData types in @leav/utils type to allow event consumers outside core to use them
14
15
  * without having to redeclare them. For now before and after are any in @leav/utils
15
16
  */
16
17
  export interface IDbPayloadInternal<DBPayloadAction extends EventAction> extends IDbPayload {
17
18
  action: DBPayloadAction;
18
- before?: IDBPayloadData<DBPayloadAction>;
19
- after?: IDBPayloadData<DBPayloadAction>;
19
+ before?: OnlyObject<IDBPayloadData<DBPayloadAction>>;
20
+ after?: OnlyObject<IDBPayloadData<DBPayloadAction>>;
20
21
  }
21
22
  interface IDBPayloadDataMap {
22
23
  [EventAction.VALUE_SAVE]: IValue;
@@ -34,9 +35,9 @@ interface IDBPayloadDataMap {
34
35
  [EventAction.LIBRARY_DELETE]: ILibraryDbEvent;
35
36
  [EventAction.VERSION_PROFILE_SAVE]: IVersionProfile;
36
37
  [EventAction.VERSION_PROFILE_DELETE]: IVersionProfile;
37
- [EventAction.TREE_ADD_ELEMENT]: string;
38
- [EventAction.TREE_DELETE_ELEMENT]: string;
39
- [EventAction.TREE_MOVE_ELEMENT]: string;
38
+ [EventAction.TREE_ADD_ELEMENT]: ITreeDbEvent;
39
+ [EventAction.TREE_DELETE_ELEMENT]: ITreeDbEvent;
40
+ [EventAction.TREE_MOVE_ELEMENT]: ITreeDbEvent;
40
41
  [EventAction.TREE_SAVE]: ITree;
41
42
  [EventAction.TREE_DELETE]: ITree;
42
43
  [EventAction.PERMISSION_SAVE]: IPermission;
@@ -62,3 +62,8 @@ export interface ITreeEvent {
62
62
  };
63
63
  order: number;
64
64
  }
65
+ export interface ITreeDbEvent {
66
+ parentNode: {
67
+ id: string;
68
+ };
69
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aristid/leav-types",
3
- "version": "1.5.0-98bf7b08",
3
+ "version": "1.5.0-d954f801",
4
4
  "description": "Shared Leav types",
5
5
  "scripts": {
6
6
  "tscheck": "",