frontend-plugin-api: add icon method to IconsApi that returns an element, deprecate getIcon

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2026-02-11 22:38:55 +01:00
parent abd0a5ad52
commit c8960d0ec3
6 changed files with 86 additions and 65 deletions
+2 -1
View File
@@ -1447,8 +1447,9 @@ export type IconElement = JSX_2.Element | null;
// @public
export interface IconsApi {
// (undocumented)
// @deprecated (undocumented)
getIcon(key: string): IconComponent | undefined;
icon(key: string): IconElement | undefined;
// (undocumented)
listIconKeys(): string[];
}
@@ -15,7 +15,7 @@
*/
import { createApiRef } from '../system';
import { IconComponent } from '../../icons';
import { IconComponent, IconElement } from '../../icons';
/**
* API for accessing app icons.
@@ -23,6 +23,14 @@ import { IconComponent } from '../../icons';
* @public
*/
export interface IconsApi {
/**
* Look up an icon element by key.
*/
icon(key: string): IconElement | undefined;
/**
* @deprecated Use {@link IconsApi.icon} instead.
*/
getIcon(key: string): IconComponent | undefined;
listIconKeys(): string[];