icon.directive.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { ElementRef, OnChanges, Renderer2, SimpleChanges } from '@angular/core';
  2. import { IconDefinition, ThemeType } from '../types';
  3. import { IconService } from './icon.service';
  4. import * as i0 from "@angular/core";
  5. interface RenderMeta {
  6. type: string | IconDefinition;
  7. theme?: ThemeType;
  8. twoToneColor?: string;
  9. }
  10. export declare class IconDirective implements OnChanges {
  11. protected _iconService: IconService;
  12. protected _elementRef: ElementRef;
  13. protected _renderer: Renderer2;
  14. type: string | IconDefinition;
  15. theme?: ThemeType;
  16. twoToneColor?: string;
  17. constructor(_iconService: IconService, _elementRef: ElementRef, _renderer: Renderer2);
  18. ngOnChanges(changes: SimpleChanges): void;
  19. /**
  20. * Render a new icon in the current element. Remove the icon when `type` is falsy.
  21. */
  22. protected _changeIcon(): Promise<SVGElement | null>;
  23. protected _getSelfRenderMeta(): RenderMeta;
  24. /**
  25. * Parse a icon to the standard form, an `IconDefinition` or a string like 'account-book-fill` (with a theme suffixed).
  26. * If namespace is specified, ignore theme because it meaningless for users' icons.
  27. *
  28. * @param type
  29. * @param theme
  30. */
  31. protected _parseIconType(type: string | IconDefinition, theme?: ThemeType): IconDefinition | string;
  32. protected _setSVGElement(svg: SVGElement): void;
  33. protected _clearSVGElement(): void;
  34. static ɵfac: i0.ɵɵFactoryDeclaration<IconDirective, never>;
  35. static ɵdir: i0.ɵɵDirectiveDeclaration<IconDirective, "[antIcon]", never, { "type": { "alias": "type"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "twoToneColor": { "alias": "twoToneColor"; "required": false; }; }, {}, never, never, false, never>;
  36. }
  37. export {};