@alyle/ui
Version:
Minimal Design, a set of components for Angular
71 lines (70 loc) • 2.2 kB
TypeScript
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { LyTheme2 } from '@alyle/ui';
import { SafeHtml, DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
import * as i0 from "@angular/core";
export interface FontClassOptions {
key: string;
/** Class name */
class?: string;
/** Frefix class */
prefix?: string;
}
export interface SvgIcon {
obs?: Observable<SVGElement>;
svg?: SVGElement;
}
export declare class LyIconService {
private http;
private _sanitizer;
private _document;
private theme;
private _defaultClass?;
private _defaultClassPrefix?;
private svgMap;
private _fontClasses;
/**
* Styles
* @docs-private
*/
readonly classes: import("@alyle/ui").LyClasses<{
svg: {
width: string;
height: string;
fill: string;
};
}>;
readonly defaultSvgIcon: string;
get defaultClass(): string;
get defaultClassPrefix(): string;
constructor(http: HttpClient, _sanitizer: DomSanitizer, _document: any, theme: LyTheme2);
setSvg(key: string, url: SafeResourceUrl): void;
addSvgIconLiteral(key: string, literal: SafeHtml): void;
/** String to SVG */
_textToSvg(str: string): SVGElement;
private _cacheSvgIcon;
getSvg(key: string): SvgIcon;
/**
* Set default className for `ly-icon`
* @param className class name
* @param prefix Class prefix,
* For example if you use FontAwesome your prefix would be `fa-`,
* then in the template it is no longer necessary to use the prefix
* Example: `<ly-icon fontIcon="alarm">`
*/
setDefaultClass(className?: string, prefix?: string): void;
/**
* Register new font class alias
* demo:
* For FontAwesome
* registerFontClass({
* key: 'fa',
* class: 'fa'
* prefix: 'fa-'
* })
*/
registerFontClass(opt: FontClassOptions): void;
getFontClass(key: string): FontClassOptions;
static ɵfac: i0.ɵɵFactoryDeclaration<LyIconService, [null, null, { optional: true; }, null]>;
static ɵprov: i0.ɵɵInjectableDeclaration<LyIconService>;
}