@umbraco-cms/backoffice 1.0.0-next.48e903f7 → 1.0.0-next.54c4e01c

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/element.d.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  import { Observable } from 'rxjs';
2
- import { HTMLElementConstructor } from './models';
3
- import { UmbControllerHostInterface } from './controller';
4
- import { UmbContextToken, UmbContextProviderController, UmbContextCallback, UmbContextConsumerController } from './context-api';
5
- import { UmbObserverController } from './observable-api';
2
+ import { HTMLElementConstructor } from '@umbraco-cms/backoffice/models';
3
+ import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
4
+ import { UmbContextToken, UmbContextProviderController, UmbContextCallback, UmbContextConsumerController } from '@umbraco-cms/backoffice/context-api';
5
+ import { UmbObserverController } from '@umbraco-cms/backoffice/observable-api';
6
6
 
7
7
  interface ResolvedContexts {
8
8
  [key: string]: any;
9
9
  }
10
- declare class UmbElementMixinInterface extends UmbControllerHostInterface {
10
+ declare class UmbElementMixinInterface extends UmbControllerHostElement {
11
11
  observe<T>(source: Observable<T>, callback: (_value: T) => void, unique?: string): UmbObserverController<T>;
12
12
  provideContext<R = unknown>(alias: string | UmbContextToken<R>, instance: R): UmbContextProviderController<R>;
13
13
  consumeContext<R = unknown>(alias: string | UmbContextToken<R>, callback: UmbContextCallback<R>): UmbContextConsumerController<R>;
14
14
  consumeAllContexts(contextAliases: string[], callback: (_instances: ResolvedContexts) => void): void;
15
15
  }
16
- declare const UmbElementMixin: <T extends HTMLElementConstructor<HTMLElement>>(superClass: T) => HTMLElementConstructor<UmbElementMixinInterface> & T;
16
+ declare const UmbElementMixin: <T extends HTMLElementConstructor>(superClass: T) => HTMLElementConstructor<UmbElementMixinInterface> & T;
17
17
 
18
18
  export { UmbElementMixin, UmbElementMixinInterface };
@@ -1,15 +1,16 @@
1
- import { UmbControllerHostInterface } from './controller';
2
- import { UmbEntityActionBase as UmbEntityActionBase$1 } from './entity-action';
1
+ import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
2
+ import { UmbEntityActionBase as UmbEntityActionBase$1 } from '@umbraco-cms/backoffice/entity-action';
3
+ import { UmbDetailRepository, UmbItemRepository, UmbFolderRepository } from '@umbraco-cms/backoffice/repository';
3
4
 
4
5
  interface UmbAction<RepositoryType = unknown> {
5
- host: UmbControllerHostInterface;
6
+ host: UmbControllerHostElement;
6
7
  repository: RepositoryType;
7
8
  execute(): Promise<void>;
8
9
  }
9
10
  declare class UmbActionBase<RepositoryType> {
10
- host: UmbControllerHostInterface;
11
+ host: UmbControllerHostElement;
11
12
  repository?: RepositoryType;
12
- constructor(host: UmbControllerHostInterface, repositoryAlias: string);
13
+ constructor(host: UmbControllerHostElement, repositoryAlias: string);
13
14
  }
14
15
 
15
16
  interface UmbEntityAction<RepositoryType> extends UmbAction<RepositoryType> {
@@ -17,7 +18,8 @@ interface UmbEntityAction<RepositoryType> extends UmbAction<RepositoryType> {
17
18
  }
18
19
  declare class UmbEntityActionBase<RepositoryType> extends UmbActionBase<RepositoryType> {
19
20
  unique: string;
20
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, unique: string);
21
+ repositoryAlias: string;
22
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
21
23
  }
22
24
 
23
25
  interface UmbEntityBulkAction<RepositoryType = unknown> extends UmbAction<RepositoryType> {
@@ -26,47 +28,55 @@ interface UmbEntityBulkAction<RepositoryType = unknown> extends UmbAction<Reposi
26
28
  }
27
29
  declare class UmbEntityBulkActionBase<RepositoryType = unknown> extends UmbActionBase<RepositoryType> {
28
30
  selection: Array<string>;
29
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, selection: Array<string>);
31
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, selection: Array<string>);
30
32
  setSelection(selection: Array<string>): void;
31
33
  }
32
34
 
33
35
  declare class UmbCopyEntityAction<T extends {
34
36
  copy(): Promise<void>;
35
37
  }> extends UmbEntityActionBase$1<T> {
36
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, unique: string);
38
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
37
39
  execute(): Promise<void>;
38
40
  }
39
41
 
40
- declare class UmbDeleteEntityAction<T extends {
41
- delete(unique: string): Promise<void>;
42
- requestItems(uniques: Array<string>): any;
43
- }> extends UmbEntityActionBase$1<T> {
42
+ declare class UmbDeleteEntityAction<T extends UmbDetailRepository & UmbItemRepository<any>> extends UmbEntityActionBase$1<T> {
43
+ #private;
44
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
45
+ execute(): Promise<void>;
46
+ }
47
+
48
+ declare class UmbDeleteFolderEntityAction<T extends UmbFolderRepository> extends UmbEntityActionBase$1<T> {
49
+ #private;
50
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
51
+ execute(): Promise<void>;
52
+ }
53
+
54
+ declare class UmbFolderUpdateEntityAction<T extends UmbFolderRepository = UmbFolderRepository> extends UmbEntityActionBase$1<T> {
44
55
  #private;
45
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, unique: string);
56
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
46
57
  execute(): Promise<void>;
47
58
  }
48
59
 
49
60
  declare class UmbMoveEntityAction<T extends {
50
61
  move(): Promise<void>;
51
62
  }> extends UmbEntityActionBase$1<T> {
52
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, unique: string);
63
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
53
64
  execute(): Promise<void>;
54
65
  }
55
66
 
56
67
  declare class UmbSortChildrenOfEntityAction<T extends {
57
68
  sortChildrenOf(): Promise<void>;
58
69
  }> extends UmbEntityActionBase$1<T> {
59
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, unique: string);
70
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
60
71
  execute(): Promise<void>;
61
72
  }
62
73
 
63
- declare class UmbTrashEntityAction<T extends {
74
+ declare class UmbTrashEntityAction<T extends UmbItemRepository<any> & {
64
75
  trash(unique: Array<string>): Promise<void>;
65
- requestTreeItems(uniques: Array<string>): any;
66
76
  }> extends UmbEntityActionBase$1<T> {
67
77
  #private;
68
- constructor(host: UmbControllerHostInterface, repositoryAlias: string, unique: string);
78
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
69
79
  execute(): Promise<void>;
70
80
  }
71
81
 
72
- export { UmbAction, UmbActionBase, UmbCopyEntityAction, UmbDeleteEntityAction, UmbEntityAction, UmbEntityActionBase, UmbEntityBulkAction, UmbEntityBulkActionBase, UmbMoveEntityAction, UmbSortChildrenOfEntityAction, UmbTrashEntityAction };
82
+ export { UmbAction, UmbActionBase, UmbCopyEntityAction, UmbDeleteEntityAction, UmbDeleteFolderEntityAction, UmbEntityAction, UmbEntityActionBase, UmbEntityBulkAction, UmbEntityBulkActionBase, UmbFolderUpdateEntityAction, UmbMoveEntityAction, UmbSortChildrenOfEntityAction, UmbTrashEntityAction };
@@ -1,7 +1,7 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ManifestTypes, ManifestKind, ManifestTypeMap, ManifestBase, SpecificManifestTypeOrManifestBase, ManifestElement, ManifestElementWithElementName, ManifestClass } from './extensions-registry';
3
- import { UmbContextToken } from './context-api';
4
- import { UmbControllerHostInterface } from './controller';
2
+ import { ManifestTypes, ManifestKind, ManifestTypeMap, ManifestBase, SpecificManifestTypeOrManifestBase, ManifestElement, ManifestElementWithElementName, ManifestWithLoader, ManifestClass } from '@umbraco-cms/backoffice/extensions-registry';
3
+ import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
4
+ import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
5
5
 
6
6
  declare class UmbExtensionRegistry {
7
7
  private _extensions;
@@ -10,6 +10,7 @@ declare class UmbExtensionRegistry {
10
10
  readonly kinds: Observable<ManifestKind[]>;
11
11
  defineKind(kind: ManifestKind): void;
12
12
  register(manifest: ManifestTypes | ManifestKind): void;
13
+ registerMany(manifests: Array<ManifestTypes>): void;
13
14
  unregister(alias: string): void;
14
15
  isRegistered(alias: string): boolean;
15
16
  private _kindsOfType;
@@ -22,13 +23,13 @@ declare class UmbExtensionRegistry {
22
23
  }
23
24
  declare const UMB_EXTENSION_REGISTRY_TOKEN: UmbContextToken<UmbExtensionRegistry>;
24
25
 
25
- declare function createExtensionElement(manifest: ManifestElement): Promise<HTMLElement | undefined>;
26
+ declare function createExtensionElement<ElementType extends HTMLElement>(manifest: ManifestElement<ElementType>): Promise<ElementType | undefined>;
26
27
 
27
28
  declare function hasDefaultExport<ConstructorType>(object: unknown): object is {
28
29
  default: ConstructorType;
29
30
  };
30
31
 
31
- type UmbEntrypointOnInit = (host: UmbControllerHostInterface, extensionRegistry: UmbExtensionRegistry) => void;
32
+ type UmbEntrypointOnInit = (host: UmbControllerHostElement, extensionRegistry: UmbExtensionRegistry) => void;
32
33
  /**
33
34
  * Interface containing supported life-cycle functions for ESModule entrypoints
34
35
  */
@@ -43,19 +44,19 @@ declare function hasInitExport(obj: unknown): obj is Pick<UmbEntrypointModule, '
43
44
 
44
45
  declare function isManifestElementNameType(manifest: unknown): manifest is ManifestElementWithElementName;
45
46
 
46
- declare function isManifestElementableType(manifest: ManifestBase): manifest is ManifestElement;
47
+ declare function isManifestElementableType<ElementType extends HTMLElement = HTMLElement>(manifest: ManifestBase): manifest is ManifestElement;
47
48
 
48
- type ManifestLoaderType = ManifestElement & {
49
- loader: () => Promise<object | HTMLElement>;
50
- };
51
- type ManifestJSType = ManifestElement & {
49
+ type ManifestJSType<T> = ManifestWithLoader<T> & {
52
50
  js: string;
53
51
  };
54
- declare function loadExtension(manifest: ManifestElement): Promise<object | HTMLElement | null>;
52
+ declare function isManifestJSType<T>(manifest: ManifestBase | unknown): manifest is ManifestJSType<T>;
55
53
 
56
- declare function isManifestJSType(manifest: ManifestBase | unknown): manifest is ManifestJSType;
54
+ type ManifestLoaderType<T> = ManifestWithLoader<T> & {
55
+ loader: () => Promise<T>;
56
+ };
57
+ declare function isManifestLoaderType<T>(manifest: ManifestBase): manifest is ManifestLoaderType<T>;
57
58
 
58
- declare function isManifestLoaderType(manifest: ManifestBase): manifest is ManifestLoaderType;
59
+ declare function loadExtension<T = unknown>(manifest: ManifestWithLoader<T>): Promise<T | null>;
59
60
 
60
61
  declare function createExtensionElementOrFallback(manifest: any, fallbackElementName: string): Promise<HTMLElement | undefined>;
61
62