import { BooleanInput } from '@angular/cdk/coercion'; import * as i0 from '@angular/core'; import { OnDestroy, InjectionToken, OnChanges, ElementRef, SimpleChanges } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { DomSanitizer, SafeHtml, SafeResourceUrl } from '@angular/platform-browser'; import { Observable } from 'rxjs'; import * as i1 from '@angular/common'; declare class NxDefaultIcons { 'chevron-down'?: string; 'chevron-up'?: string; 'chevron-right'?: string; 'exclamation-triangle'?: string; 'check-circle'?: string; 'check'?: string; 'chevron-right-small'?: string; 'chevron-left'?: string; 'close'?: string; 'trash-o'?: string; 'password-show-o'?: string; 'password-hide-o'?: string; 'info-circle'?: string; 'exclamation-circle'?: string; 'exclamation-circle-warning'?: string; 'arrow-first'?: string; 'arrow-left'?: string; 'arrow-right'?: string; 'arrow-last'?: string; 'star'?: string; 'star-o'?: string; 'chevron-left-small'?: string; 'chevron-up-small'?: string; 'chevron-down-small'?: string; 'play'?: string; 'plus'?: string; 'minus'?: string; 'ellipsis-h'?: string; 'calendar'?: string; 'relation'?: string; 'clock-o'?: string; } declare const DEFAULT_ICONS: { [k: string]: string; }; declare class NxSvgIcon { protected readonly _httpClient: HttpClient | null; protected readonly _sanitizer: DomSanitizer; protected readonly _document: Document; svgElement: SVGElement | undefined; constructor(_httpClient: HttpClient | null, _sanitizer: DomSanitizer, _document: Document); /** Returns the content. */ getContent(): Observable; protected _svgElementFromString(str: string): SVGElement; } declare class NxSvgIconLiteral extends NxSvgIcon { constructor(data: SafeHtml, _httpClient: HttpClient | null, _sanitizer: DomSanitizer, _document: Document); } declare class NxSvgIconFromUrl extends NxSvgIcon { url: string; protected _httpClient: HttpClient; private _pendingRequest?; constructor(safeUrl: SafeResourceUrl, _httpClient: HttpClient | null, _sanitizer: DomSanitizer, _document: Document); /** Returns the content. If the SVG is not already loaded it fetches the SVG from icons' URL */ getContent(): Observable; private _loadSvgIcon; /** * Returns an Observable which produces the string contents of the given URL. Results may be * cached, so future calls with the same URL may not cause another HTTP request. */ private _fetchUrl; } declare class NxFontIcon { readonly alias: string; readonly font: NxIconFontDefinition; constructor(alias: string, font: NxIconFontDefinition); getClasses(): { alias: string; font: NxIconFontDefinition; }; } declare function throwNxIconNotFoundError(iconName: string): void; declare class NxIconFontDefinition { readonly hostClass: string; readonly prefix: string; constructor(hostClass: string, prefix?: string); } declare const NX_ICON_INITIALIZER: InjectionToken<((registry: NxIconRegistry) => void)[]>; declare class NxIconRegistry implements OnDestroy { private readonly _httpClient; private readonly _sanitizer; private readonly _document; private readonly _icons; private readonly _fonts; private initializers; private _defaultFont?; constructor(_httpClient: HttpClient | null, _sanitizer: DomSanitizer, _document: Document); /** * Registers an icon using an HTML string. */ addSvgIconLiteral(iconName: string, literal: SafeHtml): void; /** * Registers an icon by URL. */ addSvgIcon(iconName: string, safeUrl: SafeResourceUrl): void; /** * Only necessary to override an existing svg icon in the registry * with a font class. Useful to override the essential library icons. * To register an icon font in general use `registerFont` and * `setDefaultFontClass`. * * Example: you want to override the essential svg icon of the library `chevron-down` * with an icon from your icon font called 'arrow-down'. You would first register your * icon font: * `iconRegistry.registerFont('my-icons');` * `iconRegistry.setDefaultFontClass('my-icons');` * and then override the chevron-down icon in the registry: * `iconRegistry.addFontIcon('chevron-down', 'arrow-down');` */ addFontIcon(iconName: string, alias?: string, fontName?: string): void; /** Returns the icon from the registry or undefined if not found. */ getIcon(iconName: string): NxSvgIcon | NxFontIcon | undefined; ngOnDestroy(): void; /** * Register an icon font which can be used by the font input on the icon component. * @param name Custom name identifier. * @param hostClass The hostClass is the general class like `fa` and an optional prefix can be given. * @param prefix The prefix is helpful if your class name for the icon would be prefixed, * e.g. my-icons--heart but you still want to only use the name * <nx-icon name="heart" font="my-icons"></nx-icon>. */ registerFont(name: string, hostClass?: string, prefix?: string): void; /** * Sets the font as the default font that is used when the font input * is omitted. */ setDefaultFont(name: string): void; /** * Returns the registered CSS class name. */ getDefaultFont(): NxIconFontDefinition | undefined; /** * Returns the registered font by name. */ getFont(fontName: string): NxIconFontDefinition; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** Clones an SVGElement while preserving type information. */ declare function cloneSvg(svg: SVGElement): SVGElement; /** Types of icon sizes */ type IconSize = 'auto' | 's' | 'm' | 'l' | 'xl'; declare class NxIconComponent implements OnChanges { /** @docs-private */ readonly el: ElementRef; private readonly _iconRegistry; /** Keeps track of the elements and attributes that we've prefixed with the current path. */ private _elementsWithExternalReferences?; private _previousFontClasses; /** Sets the name for specifying the icon.*/ set name(name: string); get name(): string; private _name; /** Whether the icon has an outline. */ set outline(value: BooleanInput); get outline(): boolean; private _outline; /** Whether the icon is filled. */ set fill(value: BooleanInput); get fill(): boolean; private _fill; /** Specifies the size of the icon. */ set size(value: IconSize); get size(): IconSize; private _size; /** Sets the font name that should be used. */ font: string; constructor( /** @docs-private */ el: ElementRef, _iconRegistry: NxIconRegistry); ngOnChanges(changes: SimpleChanges): void; private renderIcon; private _setSvgElement; private _clearSvgElement; private _updateFontIconClassesFromOverride; private _updateFontIconClasses; private _setFontIconClasses; private _removePreviousFontClasses; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } type NxStatusIconType = 'success' | 'info' | 'error' | 'warning'; type NxStatusIconSize = 'auto' | 's' | 'm' | 'l' | 'xl'; declare class NxStatusIconComponent { /** Sets status type */ type: NxStatusIconType; /** Specifies the size of the icon. */ set size(value: NxStatusIconSize); get size(): NxStatusIconSize; private _size; private statusList; /** @docs-private */ get icon(): any; /** @docs-private */ get typeClass(): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NxIconModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { DEFAULT_ICONS, NX_ICON_INITIALIZER, NxDefaultIcons, NxFontIcon, NxIconComponent, NxIconFontDefinition, NxIconModule, NxIconRegistry, NxStatusIconComponent, NxSvgIcon, NxSvgIconFromUrl, NxSvgIconLiteral, cloneSvg, throwNxIconNotFoundError }; export type { IconSize, NxStatusIconSize, NxStatusIconType };