icon.service.d.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * Use of this source code is governed by an MIT-style license that can be
  3. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  4. */
  5. import { Platform } from '@angular/cdk/platform';
  6. import { InjectionToken, OnDestroy, RendererFactory2 } from '@angular/core';
  7. import { DomSanitizer } from '@angular/platform-browser';
  8. import { Subject } from 'rxjs';
  9. import { IconDefinition, IconService } from '@ant-design/icons-angular';
  10. import { NzConfigService } from 'ng-zorro-antd/core/config';
  11. import * as i0 from "@angular/core";
  12. export interface NzIconfontOption {
  13. scriptUrl: string;
  14. }
  15. export declare const NZ_ICONS: InjectionToken<IconDefinition[]>;
  16. export declare const NZ_ICON_DEFAULT_TWOTONE_COLOR: InjectionToken<unknown>;
  17. export declare const DEFAULT_TWOTONE_COLOR = "#1890ff";
  18. /**
  19. * It should be a global singleton, otherwise registered icons could not be found.
  20. */
  21. export declare class NzIconService extends IconService implements OnDestroy {
  22. protected nzConfigService: NzConfigService;
  23. private platform;
  24. configUpdated$: Subject<void>;
  25. protected get _disableDynamicLoading(): boolean;
  26. private iconfontCache;
  27. private subscription;
  28. ngOnDestroy(): void;
  29. normalizeSvgElement(svg: SVGElement): void;
  30. fetchFromIconfont(opt: NzIconfontOption): void;
  31. createIconfontIcon(type: string): SVGElement;
  32. constructor(rendererFactory: RendererFactory2, sanitizer: DomSanitizer, nzConfigService: NzConfigService, platform: Platform);
  33. private onConfigChange;
  34. private configDefaultTheme;
  35. private configDefaultTwotoneColor;
  36. private getConfig;
  37. static ɵfac: i0.ɵɵFactoryDeclaration<NzIconService, never>;
  38. static ɵprov: i0.ɵɵInjectableDeclaration<NzIconService>;
  39. }
  40. export declare const NZ_ICONS_PATCH: InjectionToken<IconDefinition[]>;
  41. export declare class NzIconPatchService {
  42. private rootIconService;
  43. patched: boolean;
  44. private extraIcons;
  45. constructor(rootIconService: NzIconService);
  46. doPatch(): void;
  47. static ɵfac: i0.ɵɵFactoryDeclaration<NzIconPatchService, never>;
  48. static ɵprov: i0.ɵɵInjectableDeclaration<NzIconPatchService>;
  49. }