1 | import { IRawStyle, IFontFace } from '@uifabric/merge-styles';
|
2 | export interface IIconSubset {
|
3 | fontFace?: IFontFace;
|
4 | icons: {
|
5 | [key: string]: string | JSX.Element;
|
6 | };
|
7 | style?: IRawStyle;
|
8 | }
|
9 | export interface IIconSubsetRecord extends IIconSubset {
|
10 | isRegistered?: boolean;
|
11 | className?: string;
|
12 | }
|
13 | export interface IIconRecord {
|
14 | code: string | undefined;
|
15 | subset: IIconSubsetRecord;
|
16 | }
|
17 | export interface IIconOptions {
|
18 | /**
|
19 | * By default, registering the same set of icons will generate a console warning per duplicate icon
|
20 | * registered, because this scenario can create unexpected consequences.
|
21 | *
|
22 | * Some scenarios include:
|
23 | *
|
24 | * Icon set was previously registered using a different base url.
|
25 | * Icon set was previously registered but a different version was provided.
|
26 | * Icons in a previous registered set overlap with a new set.
|
27 | *
|
28 | * To simply ignore previously registered icons, you can specify to disable warnings. This means
|
29 | * that if an icon which was previous registered is registered again, it will be silently ignored.
|
30 | * However, consider whether the problems listed above will cause issues.
|
31 | **/
|
32 | disableWarnings: boolean;
|
33 | /**
|
34 | * @deprecated
|
35 | * Use 'disableWarnings' instead.
|
36 | */
|
37 | warnOnMissingIcons?: boolean;
|
38 | }
|
39 | export interface IIconRecords {
|
40 | __options: IIconOptions;
|
41 | __remapped: {
|
42 | [key: string]: string;
|
43 | };
|
44 | [key: string]: IIconRecord | {};
|
45 | }
|
46 | /**
|
47 | * Registers a given subset of icons.
|
48 | *
|
49 | * @param iconSubset - the icon subset definition.
|
50 | */
|
51 | export declare function registerIcons(iconSubset: IIconSubset, options?: Partial<IIconOptions>): void;
|
52 | /**
|
53 | * Unregisters icons by name.
|
54 | *
|
55 | * @param iconNames - List of icons to unregister.
|
56 | */
|
57 | export declare function unregisterIcons(iconNames: string[]): void;
|
58 | /**
|
59 | * Remaps one icon name to another.
|
60 | */
|
61 | export declare function registerIconAlias(iconName: string, mappedToName: string): void;
|
62 | /**
|
63 | * Gets an icon definition. If an icon is requested but the subset has yet to be registered,
|
64 | * it will get registered immediately.
|
65 | *
|
66 | * @public
|
67 | * @param name - Name of icon.
|
68 | */
|
69 | export declare function getIcon(name?: string): IIconRecord | undefined;
|
70 | /**
|
71 | * Sets the icon options.
|
72 | *
|
73 | * @public
|
74 | */
|
75 | export declare function setIconOptions(options: Partial<IIconOptions>): void;
|