ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
123 lines (113 loc) • 5.1 kB
TypeScript
import * as i0 from '@angular/core';
import { InjectionToken, OnChanges, AfterContentChecked, Renderer2, SimpleChanges, ModuleWithProviders, EnvironmentProviders, Provider } from '@angular/core';
import { IconService, IconDefinition, IconDirective, ThemeType } from '@ant-design/icons-angular';
import { Subject } from 'rxjs';
import { NzConfigService } from 'ng-zorro-antd/core/config';
interface NzIconfontOption {
scriptUrl: string;
}
declare const NZ_ICONS: InjectionToken<IconDefinition[]>;
declare const NZ_ICON_DEFAULT_TWOTONE_COLOR: InjectionToken<unknown>;
declare const DEFAULT_TWOTONE_COLOR = "#1890ff";
/**
* It should be a global singleton, otherwise registered icons could not be found.
*/
declare class NzIconService extends IconService {
protected nzConfigService: NzConfigService;
private platform;
configUpdated$: Subject<void>;
protected get _disableDynamicLoading(): boolean;
private iconfontCache;
normalizeSvgElement(svg: SVGElement): void;
fetchFromIconfont(opt: NzIconfontOption): void;
createIconfontIcon(type: string): SVGElement;
constructor();
private onConfigChange;
private configDefaultTheme;
private configDefaultTwotoneColor;
private getConfig;
static ɵfac: i0.ɵɵFactoryDeclaration<NzIconService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<NzIconService>;
}
declare const NZ_ICONS_PATCH: InjectionToken<IconDefinition[]>;
declare class NzIconPatchService {
private rootIconService;
patched: boolean;
private extraIcons;
constructor(rootIconService: NzIconService);
doPatch(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NzIconPatchService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<NzIconPatchService>;
}
declare class NzIconDirective extends IconDirective implements OnChanges, AfterContentChecked {
readonly iconService: NzIconService;
private readonly ngZone;
private readonly changeDetectorRef;
readonly renderer: Renderer2;
private destroyRef;
private pendingTasks;
private isBrowser;
cacheClassName: string | null;
set nzSpin(value: boolean);
nzRotate: number;
set nzType(value: string);
set nzTheme(value: ThemeType);
set nzTwotoneColor(value: string);
set nzIconfont(value: string);
hostClass?: string;
private readonly el;
private iconfont?;
private spin;
constructor(iconService: NzIconService);
ngOnChanges(changes: SimpleChanges): void;
/**
* If custom content is provided, try to normalize SVG elements.
*/
ngAfterContentChecked(): void;
/**
* Replacement of `changeIcon` for more modifications.
*/
private changeIcon2;
private handleSpin;
private handleRotate;
private setClassName;
private setSVGData;
static ɵfac: i0.ɵɵFactoryDeclaration<NzIconDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<NzIconDirective, "nz-icon,[nz-icon]", ["nzIcon"], { "nzSpin": { "alias": "nzSpin"; "required": false; }; "nzRotate": { "alias": "nzRotate"; "required": false; }; "nzType": { "alias": "nzType"; "required": false; }; "nzTheme": { "alias": "nzTheme"; "required": false; }; "nzTwotoneColor": { "alias": "nzTwotoneColor"; "required": false; }; "nzIconfont": { "alias": "nzIconfont"; "required": false; }; }, {}, never, never, true, never>;
static ngAcceptInputType_nzSpin: unknown;
static ngAcceptInputType_nzRotate: unknown;
}
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
declare class NzIconModule {
static forRoot(icons: IconDefinition[]): ModuleWithProviders<NzIconModule>;
static forChild(icons: IconDefinition[]): ModuleWithProviders<NzIconModule>;
static ɵfac: i0.ɵɵFactoryDeclaration<NzIconModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<NzIconModule, never, [typeof NzIconDirective], [typeof NzIconDirective]>;
static ɵinj: i0.ɵɵInjectorDeclaration<NzIconModule>;
}
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
declare const NZ_ICONS_USED_BY_ZORRO: IconDefinition[];
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* Provide icon definitions for NzIcon in root
*
* @param icons Icon definitions
*/
declare const provideNzIcons: (icons: IconDefinition[]) => EnvironmentProviders;
/**
* Provide icon definitions for NzIcon in feature module or standalone component
*
* @param icons Icon definitions
*/
declare const provideNzIconsPatch: (icons: IconDefinition[]) => Provider[];
export { DEFAULT_TWOTONE_COLOR, NZ_ICONS, NZ_ICONS_PATCH, NZ_ICONS_USED_BY_ZORRO, NZ_ICON_DEFAULT_TWOTONE_COLOR, NzIconDirective, NzIconModule, NzIconPatchService, NzIconService, provideNzIcons, provideNzIconsPatch };
export type { NzIconfontOption };