@luoxiao123/angular-tabler-icons
Version:
Tabler Icons components library for your Angular applications
65 lines (59 loc) • 2.22 kB
TypeScript
import * as i0 from '@angular/core';
import { ModuleWithProviders, Provider } from '@angular/core';
/**
* A component that renders Tabler icons as SVG elements.
*
* This component takes an icon name as input and renders the corresponding SVG icon
* by injecting it into the DOM. It supports multiple icon sets through an options token
* and provides warnings when icons are not found.
*
* @example
* ```html
* <tabler-icon name="user"></tabler-icon>
* ```
*
* @remarks
* The component uses Angular's dependency injection to get ElementRef and options.
* Icons are rendered using innerHTML after being retrieved from the configured icon sets.
* Warning messages are logged to the console when icons are not found (unless warnings are ignored in options).
*/
declare class TablerIconComponent {
#private;
/**
* Icon name in kebab-case format.
* @example
* - "user"
* - "heart-filled"
* - "camera-off"
* - "brand-github"
* etc
*/
readonly name: i0.InputSignal<string>;
setNativeSvg: i0.EffectRef;
static ɵfac: i0.ɵɵFactoryDeclaration<TablerIconComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<TablerIconComponent, "i-tabler, tabler-icon", never, { "name": { "alias": "name"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
}
type Options = {
icons?: OptionIcons;
ignoreWarnings?: boolean;
};
type OptionIcons = Record<string, string>;
/**
* @deprecated
*
*/
declare class TablerIconsModule {
private options;
constructor();
/**
* Initialize module with given icons and options
* @param icons
* @returns Module with options
*/
static pick(icons: OptionIcons, options?: Options): ModuleWithProviders<TablerIconsModule>;
static ɵfac: i0.ɵɵFactoryDeclaration<TablerIconsModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<TablerIconsModule, never, [typeof TablerIconComponent], [typeof TablerIconComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<TablerIconsModule>;
}
declare function provideTablerIcons(icons: OptionIcons, options?: Options): Provider[];
export { TablerIconComponent, TablerIconsModule, provideTablerIcons };