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:
@@ -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[];
|
||||
|
||||
Reference in New Issue
Block a user