UNPKG

2.35 kBTypeScriptView Raw
1import { NbFontIconPackParams, NbIconPack, NbIconPackParams, NbIcons } from './icon-pack';
2import { NbFontIcon, NbIcon, NbSvgIcon } from './icon';
3import * as i0 from "@angular/core";
4export declare class NbIconDefinition {
5 name: string;
6 type: string;
7 pack: string;
8 icon: NbIcon;
9}
10/**
11 * This service allows to register multiple icon packs to use them later within `<nb-icon></nb-icon>` component.
12 */
13export declare class NbIconLibraries {
14 protected packs: Map<string, NbIconPack>;
15 protected defaultPack: NbIconPack;
16 /**
17 * Registers new Svg icon pack
18 * @param {string} name
19 * @param {NbIcon} icons
20 * @param {NbIconPackParams} params
21 */
22 registerSvgPack(name: string, icons: NbIcons, params?: NbIconPackParams): void;
23 /**
24 * Registers new font pack
25 * @param {string} name
26 * @param {NbIconPackParams} params
27 */
28 registerFontPack(name: string, params?: NbFontIconPackParams): void;
29 /**
30 * Returns pack by name
31 * @param {string} name
32 */
33 getPack(name: string): NbIconPack;
34 /**
35 * Sets pack as a default
36 * @param {string} name
37 */
38 setDefaultPack(name: string): void;
39 /**
40 * Returns Svg icon
41 * @param {string} name
42 * @param {string} pack
43 *
44 * @returns NbIconDefinition
45 */
46 getSvgIcon(name: string, pack?: string): NbIconDefinition | null;
47 /**
48 * Returns Font icon
49 * @param {string} name
50 * @param {string} pack
51 *
52 * @returns NbIconDefinition
53 */
54 getFontIcon(name: string, pack?: string): NbIconDefinition;
55 /**
56 * Returns an icon
57 * @param {string} name
58 * @param {string} pack
59 *
60 * @returns NbIconDefinition
61 */
62 getIcon(name: string, pack?: string): NbIconDefinition | null;
63 protected createSvgIcon(name: string, content: NbIcon | string, params: NbIconPackParams): NbSvgIcon;
64 protected createFontIcon(name: string, content: NbIcon | string, params: NbFontIconPackParams): NbFontIcon;
65 protected getPackOrThrow(name: string): NbIconPack;
66 protected getDefaultPackOrThrow(): NbIconPack;
67 protected getIconFromPack(name: string, pack: NbIconPack): NbIcon | string | null;
68 static ɵfac: i0.ɵɵFactoryDeclaration<NbIconLibraries, never>;
69 static ɵprov: i0.ɵɵInjectableDeclaration<NbIconLibraries>;
70}