@ngaox/icons
Version:
Inline SVG icons from (src | files | your favorite icons library | ...)!
42 lines (41 loc) • 1.65 kB
TypeScript
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { ILazyIcon, INgaoxIcon } from './models';
import * as i0 from "@angular/core";
export declare class IconsService {
private http;
private document;
private fallbackIcon;
private icons;
private lazyIcons;
constructor(http: HttpClient, document: Document, fallbackIcon?: string, icons?: INgaoxIcon[]);
private textToSvgElement;
/**
* Get the fallback icon specified in the import of the `IconsModule.forRoot`
* Used in the `ngaox-icon` component when the icon is not found
* @see {@link https://ngaox-lab.web.app/docs/icons#fallback-icon}
*/
getFallbackIcon(): string;
/**
* get an already registered/added icon
*
* @see {@link IconsService.add}
*/
get(name: string): Observable<SVGElement | undefined>;
/**
* Add an SVG icon to the NgaoxIcons registry
*
* @param name the name of the Icon in the registry (used in `ngaox-icon` component and {@link IconsService.get})
* @param value the SVG content or {@link ILazyIcon} for lazy loaded icons
* @param override (default to true) whether or not replacing existing `svg` if `name` already exists
*
*/
add(name: string, value: string | ILazyIcon): Observable<SVGElement | undefined>;
addAll(icons: INgaoxIcon[]): void;
/**
* remove a registered icon
*/
remove(name: string): void;
static ɵfac: i0.ɵɵFactoryDeclaration<IconsService, [null, null, { optional: true; }, { optional: true; }]>;
static ɵprov: i0.ɵɵInjectableDeclaration<IconsService>;
}