@umbraco-cms/backoffice 1.0.0-next.d924405b → 1.0.0-next.f8d940fc

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/context-api.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { UmbControllerHostInterface, UmbControllerInterface } from './controller';
1
+ import { UmbControllerHostElement, UmbControllerInterface } from './controller';
2
+ import { UmbWorkspaceContextInterface } from './workspace';
3
+ import { BaseEntity } from './models';
2
4
 
3
5
  declare class UmbContextToken<T = unknown> {
4
6
  protected alias: string;
@@ -90,9 +92,9 @@ declare class UmbContextConsumer<HostType extends EventTarget = EventTarget, T =
90
92
  destroy(): void;
91
93
  }
92
94
 
93
- declare class UmbContextConsumerController<T = unknown> extends UmbContextConsumer<UmbControllerHostInterface, T> implements UmbControllerInterface {
95
+ declare class UmbContextConsumerController<T = unknown> extends UmbContextConsumer<UmbControllerHostElement, T> implements UmbControllerInterface {
94
96
  get unique(): undefined;
95
- constructor(host: UmbControllerHostInterface, contextAlias: string | UmbContextToken<T>, callback: UmbContextCallback<T>);
97
+ constructor(host: UmbControllerHostElement, contextAlias: string | UmbContextToken<T>, callback: UmbContextCallback<T>);
96
98
  destroy(): void;
97
99
  }
98
100
 
@@ -136,9 +138,9 @@ declare class UmbContextProvider<HostType extends EventTarget = EventTarget> {
136
138
  destroy(): void;
137
139
  }
138
140
 
139
- declare class UmbContextProviderController<T = unknown> extends UmbContextProvider<UmbControllerHostInterface> implements UmbControllerInterface {
141
+ declare class UmbContextProviderController<T = unknown> extends UmbContextProvider<UmbControllerHostElement> implements UmbControllerInterface {
140
142
  get unique(): string;
141
- constructor(host: UmbControllerHostInterface, contextAlias: string | UmbContextToken<T>, instance: T);
143
+ constructor(host: UmbControllerHostElement, contextAlias: string | UmbContextToken<T>, instance: T);
142
144
  destroy(): void;
143
145
  }
144
146
 
@@ -162,4 +164,72 @@ declare class UmbContextProvideEventImplementation extends Event implements UmbC
162
164
  }
163
165
  declare const isUmbContextProvideEventType: (event: Event) => event is UmbContextProvideEventImplementation;
164
166
 
165
- export { UmbContextCallback, UmbContextConsumer, UmbContextConsumerController, UmbContextDebugRequest, UmbContextProvideEvent, UmbContextProvideEventImplementation, UmbContextProvider, UmbContextProviderController, UmbContextRequestEvent, UmbContextRequestEventImplementation, UmbContextToken, isUmbContextProvideEventType, isUmbContextRequestEvent, umbContextProvideEventType, umbContextRequestEventType, umbDebugContextEventType };
167
+ interface UmbEntityWorkspaceContextInterface<EntityType = unknown> extends UmbWorkspaceContextInterface<EntityType> {
168
+ getEntityKey(): string | undefined;
169
+ getEntityType(): string;
170
+ save(): Promise<void>;
171
+ }
172
+
173
+ declare const UMB_ENTITY_WORKSPACE_CONTEXT: UmbContextToken<UmbEntityWorkspaceContextInterface<BaseEntity>>;
174
+
175
+ /**
176
+ * Change the collection of Contexts into a simplified array of data
177
+ *
178
+ * @param contexts This is a map of the collected contexts from umb-debug
179
+ * @returns An array of simplified context data
180
+ */
181
+ declare function contextData(contexts: Map<any, any>): Array<DebugContextData>;
182
+ interface DebugContextData {
183
+ /**
184
+ * The alias of the context
185
+ *
186
+ * @type {string}
187
+ * @memberof DebugContextData
188
+ */
189
+ alias: string;
190
+ /**
191
+ * The type of the context such as object or string
192
+ *
193
+ * @type {("string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function")}
194
+ * @memberof DebugContextData
195
+ */
196
+ type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
197
+ /**
198
+ * Data about the context that includes method and property names
199
+ *
200
+ * @type {DebugContextItemData}
201
+ * @memberof DebugContextData
202
+ */
203
+ data: DebugContextItemData;
204
+ }
205
+ interface DebugContextItemData {
206
+ type: string;
207
+ methods?: Array<unknown>;
208
+ properties?: Array<DebugContextItemPropertyData>;
209
+ value?: unknown;
210
+ }
211
+ interface DebugContextItemPropertyData {
212
+ /**
213
+ * The name of the property
214
+ *
215
+ * @type {string}
216
+ * @memberof DebugContextItemPropertyData
217
+ */
218
+ key: string;
219
+ /**
220
+ * The type of the property's value such as string or number
221
+ *
222
+ * @type {("string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function")}
223
+ * @memberof DebugContextItemPropertyData
224
+ */
225
+ type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
226
+ /**
227
+ * Simple types such as string or number can have their value displayed stored inside the property
228
+ *
229
+ * @type {("string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function")}
230
+ * @memberof DebugContextItemPropertyData
231
+ */
232
+ value?: unknown;
233
+ }
234
+
235
+ export { DebugContextData, DebugContextItemData, DebugContextItemPropertyData, UMB_ENTITY_WORKSPACE_CONTEXT, UmbContextCallback, UmbContextConsumer, UmbContextConsumerController, UmbContextDebugRequest, UmbContextProvideEvent, UmbContextProvideEventImplementation, UmbContextProvider, UmbContextProviderController, UmbContextRequestEvent, UmbContextRequestEventImplementation, UmbContextToken, contextData, isUmbContextProvideEventType, isUmbContextRequestEvent, umbContextProvideEventType, umbContextRequestEventType, umbDebugContextEventType };
package/controller.d.ts CHANGED
@@ -7,7 +7,7 @@ interface UmbControllerInterface {
7
7
  destroy(): void;
8
8
  }
9
9
 
10
- declare class UmbControllerHostInterface extends HTMLElement {
10
+ declare class UmbControllerHostElement extends HTMLElement {
11
11
  hasController(controller: UmbControllerInterface): boolean;
12
12
  getControllers(filterMethod: (ctrl: UmbControllerInterface) => boolean): UmbControllerInterface[];
13
13
  addController(controller: UmbControllerInterface): void;
@@ -20,7 +20,7 @@ declare class UmbControllerHostInterface extends HTMLElement {
20
20
  * @param {Object} superClass - superclass to be extended.
21
21
  * @mixin
22
22
  */
23
- declare const UmbControllerHostMixin: <T extends HTMLElementConstructor<HTMLElement>>(superClass: T) => HTMLElementConstructor<UmbControllerHostInterface> & T;
23
+ declare const UmbControllerHostMixin: <T extends HTMLElementConstructor>(superClass: T) => HTMLElementConstructor<UmbControllerHostElement> & T;
24
24
  declare global {
25
25
  interface HTMLElement {
26
26
  connectedCallback(): void;
@@ -29,13 +29,13 @@ declare global {
29
29
  }
30
30
 
31
31
  declare abstract class UmbController implements UmbControllerInterface {
32
- protected host?: UmbControllerHostInterface;
32
+ protected host?: UmbControllerHostElement;
33
33
  private _alias?;
34
34
  get unique(): string | undefined;
35
- constructor(host: UmbControllerHostInterface, alias?: string);
35
+ constructor(host: UmbControllerHostElement, alias?: string);
36
36
  abstract hostConnected(): void;
37
37
  abstract hostDisconnected(): void;
38
38
  destroy(): void;
39
39
  }
40
40
 
41
- export { UmbController, UmbControllerHostInterface, UmbControllerHostMixin, UmbControllerInterface };
41
+ export { UmbController, UmbControllerHostElement, UmbControllerHostMixin, UmbControllerInterface };