@umbraco-cms/backoffice 1.0.0-next.2a93cc95 → 1.0.0-next.2d232d0c

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/store.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as rxjs from 'rxjs';
2
2
  import { Observable } from 'rxjs';
3
- import { UmbControllerHostInterface } from './controller';
4
- import { EntityTreeItemResponseModel } from './backend-api';
5
- import { UmbStoreBase as UmbStoreBase$1 } from './store';
3
+ import { UmbControllerHostElement } from './controller';
4
+ import { EntityTreeItemResponseModel, FileSystemTreeItemPresentationModel } from './backend-api';
5
+ import { UmbStoreBase as UmbStoreBase$1, UmbTreeStore as UmbTreeStore$1 } from './store';
6
6
 
7
7
  interface UmbDataStoreIdentifiers {
8
8
  key?: string;
@@ -11,24 +11,6 @@ interface UmbDataStoreIdentifiers {
11
11
  interface UmbDataStore {
12
12
  readonly storeAlias: string;
13
13
  }
14
- interface UmbTreeStore<T> extends UmbDataStore {
15
- getTreeRoot(): Observable<Array<T>>;
16
- getTreeItemChildren(key: string): Observable<Array<T>>;
17
- /**
18
- * @description - Trash data.
19
- * @param {string[]} keys
20
- * @return {*} {(Promise<void>)}
21
- * @memberof UmbTreeStore
22
- */
23
- trash(keys: string[]): Promise<void>;
24
- /**
25
- * @description - Move data.
26
- * @param {string[]} keys
27
- * @return {*} {(Promise<void>)}
28
- * @memberof UmbTreeStore
29
- */
30
- move(keys: string[], destination: string): Promise<void>;
31
- }
32
14
  interface UmbEntityDetailStore<T> extends UmbDataStore {
33
15
  /**
34
16
  * @description - Request scaffold data by entityType and . The data is added to the store and is returned as an Observable.
@@ -36,7 +18,7 @@ interface UmbEntityDetailStore<T> extends UmbDataStore {
36
18
  * @return {*} {T}
37
19
  * @memberof UmbEntityDetailStore
38
20
  */
39
- getScaffold: (entityType: string, parentKey: string | null) => T;
21
+ getScaffold: (entityType: string, parentId: string | null) => T;
40
22
  /**
41
23
  * @description - Request data by key. The data is added to the store and is returned as an Observable.
42
24
  * @param {string} key
@@ -57,57 +39,121 @@ interface UmbContentStore<T> extends UmbEntityDetailStore<T> {
57
39
  }
58
40
 
59
41
  declare class UmbStoreBase {
60
- protected _host: UmbControllerHostInterface;
42
+ protected _host: UmbControllerHostElement;
61
43
  readonly storeAlias: string;
62
- constructor(_host: UmbControllerHostInterface, storeAlias: string);
44
+ constructor(_host: UmbControllerHostElement, storeAlias: string);
63
45
  }
64
46
 
65
47
  /**
66
48
  * @export
67
- * @class UmbTreeStoreBase
49
+ * @class UmbEntityTreeStore
68
50
  * @extends {UmbStoreBase}
69
51
  * @description - General Tree Data Store
70
52
  */
71
- declare class UmbTreeStoreBase extends UmbStoreBase$1 {
53
+ declare class UmbEntityTreeStore extends UmbStoreBase$1 implements UmbTreeStore$1<EntityTreeItemResponseModel> {
72
54
  #private;
73
55
  /**
74
56
  * Appends items to the store
75
- * @param {Array<EntityTreeItemModel>} items
76
- * @memberof UmbTreeStoreBase
57
+ * @param {Array<EntityTreeItemResponseModel>} items
58
+ * @memberof UmbEntityTreeStore
77
59
  */
78
60
  appendItems(items: Array<EntityTreeItemResponseModel>): void;
79
61
  /**
80
62
  * Updates an item in the store
81
- * @param {string} key
82
- * @param {Partial<EntityTreeItemModel>} data
83
- * @memberof UmbTreeStoreBase
63
+ * @param {string} id
64
+ * @param {Partial<EntityTreeItemResponseModel>} data
65
+ * @memberof UmbEntityTreeStore
84
66
  */
85
- updateItem(key: string, data: Partial<EntityTreeItemResponseModel>): void;
67
+ updateItem(id: string, data: Partial<EntityTreeItemResponseModel>): void;
86
68
  /**
87
69
  * Removes an item from the store
88
- * @param {string} key
89
- * @memberof UmbTreeStoreBase
70
+ * @param {string} id
71
+ * @memberof UmbEntityTreeStore
90
72
  */
91
- removeItem(key: string): void;
73
+ removeItem(id: string): void;
92
74
  /**
93
75
  * An observable to observe the root items
94
- * @memberof UmbTreeStoreBase
76
+ * @memberof UmbEntityTreeStore
95
77
  */
96
78
  rootItems: rxjs.Observable<EntityTreeItemResponseModel[]>;
97
79
  /**
98
80
  * Returns an observable to observe the children of a given parent
99
- * @param {(string | null)} parentKey
81
+ * @param {(string | null)} parentId
100
82
  * @return {*}
101
- * @memberof UmbTreeStoreBase
83
+ * @memberof UmbEntityTreeStore
102
84
  */
103
- childrenOf(parentKey: string | null): rxjs.Observable<EntityTreeItemResponseModel[]>;
85
+ childrenOf(parentId: string | null): rxjs.Observable<EntityTreeItemResponseModel[]>;
104
86
  /**
105
- * Returns an observable to observe the items with the given keys
106
- * @param {Array<string>} keys
87
+ * Returns an observable to observe the items with the given ids
88
+ * @param {Array<string>} ids
107
89
  * @return {*}
108
- * @memberof UmbTreeStoreBase
90
+ * @memberof UmbEntityTreeStore
91
+ */
92
+ items(ids: Array<string>): rxjs.Observable<EntityTreeItemResponseModel[]>;
93
+ }
94
+
95
+ /**
96
+ * @export
97
+ * @class UmbFileSystemTreeStore
98
+ * @extends {UmbStoreBase}
99
+ * @description - General Tree Data Store
100
+ */
101
+ declare class UmbFileSystemTreeStore extends UmbStoreBase$1 implements UmbTreeStore$1<FileSystemTreeItemPresentationModel> {
102
+ #private;
103
+ /**
104
+ * Appends items to the store
105
+ * @param {Array<FileSystemTreeItemPresentationModel>} items
106
+ * @memberof UmbFileSystemTreeStore
109
107
  */
110
- items(keys: Array<string>): rxjs.Observable<EntityTreeItemResponseModel[]>;
108
+ appendItems(items: Array<FileSystemTreeItemPresentationModel>): void;
109
+ /**
110
+ * Updates an item in the store
111
+ * @param {string} path
112
+ * @param {Partial<FileSystemTreeItemPresentationModel>} data
113
+ * @memberof UmbFileSystemTreeStore
114
+ */
115
+ updateItem(path: string, data: Partial<FileSystemTreeItemPresentationModel>): void;
116
+ /**
117
+ * Removes an item from the store
118
+ * @param {string} path
119
+ * @memberof UmbFileSystemTreeStore
120
+ */
121
+ removeItem(path: string): void;
122
+ /**
123
+ * An observable to observe the root items
124
+ * @memberof UmbFileSystemTreeStore
125
+ */
126
+ rootItems: rxjs.Observable<FileSystemTreeItemPresentationModel[]>;
127
+ /**
128
+ * Returns an observable to observe the children of a given parent
129
+ * @param {(string | null)} parentPath
130
+ * @return {*}
131
+ * @memberof UmbFileSystemTreeStore
132
+ */
133
+ childrenOf(parentPath: string | null): rxjs.Observable<FileSystemTreeItemPresentationModel[]>;
134
+ /**
135
+ * Returns an observable to observe the items with the given ids
136
+ * @param {Array<string>} paths
137
+ * @return {*}
138
+ * @memberof UmbFileSystemTreeStore
139
+ */
140
+ items(paths: Array<string>): rxjs.Observable<FileSystemTreeItemPresentationModel[]>;
141
+ }
142
+
143
+ type TreeItemPresentationModel = {
144
+ name?: string;
145
+ type?: string;
146
+ icon?: string;
147
+ hasChildren?: boolean;
148
+ };
149
+
150
+ interface UmbTreeStore<T extends TreeItemPresentationModel = any> {
151
+ appendItems: (items: Array<T>) => void;
152
+ updateItem: (unique: string, item: Partial<T>) => void;
153
+ removeItem: (unique: string) => void;
154
+ rootItems: Observable<Array<T>>;
155
+ childrenOf: (parentUnique: string | null) => Observable<Array<T>>;
156
+ items: (uniques: Array<string>) => Observable<Array<T>>;
111
157
  }
112
158
 
113
- export { UmbContentStore, UmbDataStore, UmbDataStoreIdentifiers, UmbEntityDetailStore, UmbStoreBase, UmbTreeStore, UmbTreeStoreBase };
159
+ export { UmbContentStore, UmbDataStore, UmbDataStoreIdentifiers, UmbEntityDetailStore, UmbEntityTreeStore, UmbFileSystemTreeStore, UmbStoreBase, UmbTreeStore };
package/utils.d.ts CHANGED
@@ -11,4 +11,6 @@ declare function umbracoPath(path: string): string;
11
11
  declare function buildUdi(entityType: string, guid: string): string;
12
12
  declare function getKeyFromUdi(udi: string): string;
13
13
 
14
- export { buildUdi, getKeyFromUdi, getLookAndColorFromUserStatus, umbracoPath };
14
+ declare function generateGuid(): string;
15
+
16
+ export { buildUdi, generateGuid, getKeyFromUdi, getLookAndColorFromUserStatus, umbracoPath };