1
+ import type { UmbIconDefinition } from './types.js' ;
1
2
import { type UUIIconHost , UUIIconRegistry } from '@umbraco-cms/backoffice/external/uui' ;
2
3
3
- interface UmbIconDescriptor {
4
- name : string ;
5
- path : string ;
6
- }
7
-
8
4
/**
9
5
* @export
10
6
* @class UmbIconRegistry
@@ -17,10 +13,10 @@ export class UmbIconRegistry extends UUIIconRegistry {
17
13
this . #initResolve = resolve ;
18
14
} ) ;
19
15
20
- #icons: UmbIconDescriptor [ ] = [ ] ;
16
+ #icons: UmbIconDefinition [ ] = [ ] ;
21
17
#unhandledProviders: Map < string , UUIIconHost > = new Map ( ) ;
22
18
23
- setIcons ( icons : UmbIconDescriptor [ ] ) {
19
+ setIcons ( icons : UmbIconDefinition [ ] ) {
24
20
const oldIcons = this . #icons;
25
21
this . #icons = icons ;
26
22
if ( this . #initResolve) {
@@ -39,7 +35,7 @@ export class UmbIconRegistry extends UUIIconRegistry {
39
35
}
40
36
} ) ;
41
37
}
42
- appendIcons ( icons : UmbIconDescriptor [ ] ) {
38
+ appendIcons ( icons : UmbIconDefinition [ ] ) {
43
39
this . #icons = [ ...this . #icons, ...icons ] ;
44
40
}
45
41
/**
@@ -56,7 +52,7 @@ export class UmbIconRegistry extends UUIIconRegistry {
56
52
57
53
async #loadIcon( iconName : string , iconProvider : UUIIconHost ) : Promise < boolean > {
58
54
await this . #init;
59
- const iconManifest = this . #icons. find ( ( i : UmbIconDescriptor ) => i . name === iconName ) ;
55
+ const iconManifest = this . #icons. find ( ( i : UmbIconDefinition ) => i . name === iconName ) ;
60
56
// Icon not found, so lets add it to a list of unhandled requests.
61
57
if ( ! iconManifest ) {
62
58
this . #unhandledProviders. set ( iconName , iconProvider ) ;
0 commit comments