@umbraco-cms/backoffice 1.0.0-next.ba26bec7 → 1.0.0-next.bc46b74e

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/workspace.d.ts CHANGED
@@ -1,6 +1,9 @@
1
+ import * as rxjs from 'rxjs';
1
2
  import { Observable } from 'rxjs';
2
3
  import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
3
4
  import { UmbWorkspaceContextInterface as UmbWorkspaceContextInterface$1 } from '@umbraco-cms/backoffice/workspace';
5
+ import { UmbEntityBase } from '@umbraco-cms/backoffice/models';
6
+ import { UmbVariantId } from '@umbraco-cms/backoffice/variant';
4
7
 
5
8
  interface UmbWorkspaceContextInterface<DataType = unknown> {
6
9
  host: UmbControllerHostElement;
@@ -21,6 +24,21 @@ interface UmbEntityWorkspaceContextInterface<EntityType = unknown> extends UmbWo
21
24
  save(): Promise<void>;
22
25
  }
23
26
 
27
+ declare abstract class UmbWorkspaceContext<T, EntityType extends UmbEntityBase> implements UmbEntityWorkspaceContextInterface<EntityType> {
28
+ #private;
29
+ host: UmbControllerHostElement;
30
+ repository: T;
31
+ isNew: rxjs.Observable<boolean | undefined>;
32
+ constructor(host: UmbControllerHostElement, repository: T);
33
+ getIsNew(): boolean | undefined;
34
+ setIsNew(isNew: boolean): void;
35
+ abstract getEntityId(): string | undefined;
36
+ abstract getEntityType(): string;
37
+ abstract getData(): EntityType | undefined;
38
+ abstract save(): Promise<void>;
39
+ abstract destroy(): void;
40
+ }
41
+
24
42
  interface UmbWorkspaceAction<WorkspaceType = unknown> {
25
43
  host: UmbControllerHostElement;
26
44
  workspaceContext?: WorkspaceType;
@@ -38,4 +56,30 @@ declare class UmbSaveWorkspaceAction extends UmbWorkspaceActionBase<UmbWorkspace
38
56
  execute(): Promise<void>;
39
57
  }
40
58
 
41
- export { UmbEntityWorkspaceContextInterface, UmbSaveWorkspaceAction, UmbWorkspaceAction, UmbWorkspaceActionBase, UmbWorkspaceContextInterface };
59
+ type ActiveVariant = {
60
+ index: number;
61
+ culture: string | null;
62
+ segment: string | null;
63
+ };
64
+ /**
65
+ * @export
66
+ * @class UmbWorkspaceSplitViewManager
67
+ * @description - Class managing the split view state for a workspace context.
68
+ */
69
+ declare class UmbWorkspaceSplitViewManager {
70
+ #private;
71
+ readonly activeVariantsInfo: rxjs.Observable<ActiveVariant[]>;
72
+ constructor(host: UmbControllerHostElement);
73
+ private _routeBase?;
74
+ getWorkspaceRoute(): string | undefined;
75
+ setWorkspaceRoute(route: string | undefined): void;
76
+ setActiveVariant(index: number, culture: string | null, segment: string | null): void;
77
+ getActiveVariants(): ActiveVariant[];
78
+ removeActiveVariant(index: number): void;
79
+ activeVariantByIndex(index: number): rxjs.Observable<ActiveVariant>;
80
+ switchVariant(index: number, variantId: UmbVariantId): boolean;
81
+ openSplitView(newVariant: UmbVariantId): boolean;
82
+ closeSplitView(index: number): boolean;
83
+ }
84
+
85
+ export { ActiveVariant, UmbEntityWorkspaceContextInterface, UmbSaveWorkspaceAction, UmbWorkspaceAction, UmbWorkspaceActionBase, UmbWorkspaceContext, UmbWorkspaceContextInterface, UmbWorkspaceSplitViewManager };