@ng-icons/core 31.4.0 → 32.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,55 +0,0 @@
1
- import { OnDestroy } from '@angular/core';
2
- import type { IconName } from '../../components/icon/icon-name';
3
- import * as i0 from "@angular/core";
4
- export type IconType = IconName | (string & {});
5
- export declare class NgIcon implements OnDestroy {
6
- /** Access the global icon config */
7
- private readonly config;
8
- /** Access the icons */
9
- private readonly icons;
10
- /** Access the icon loader if defined */
11
- private readonly loader;
12
- /** Access the icon cache if defined */
13
- private readonly cache;
14
- /** Access the pre-processor */
15
- private readonly preProcessor;
16
- /** Access the post-processor */
17
- private readonly postProcessor;
18
- /** Access the injector */
19
- private readonly injector;
20
- /** Access the renderer */
21
- private readonly renderer;
22
- /** Determine the platform we are rendering on */
23
- private readonly platform;
24
- /** Access the element ref */
25
- private readonly elementRef;
26
- /** A unique id for this instance */
27
- private readonly uniqueId;
28
- /** Access the logger */
29
- private readonly logger;
30
- /** Define the name of the icon to display */
31
- readonly name: import("@angular/core").InputSignal<IconType | undefined>;
32
- /** Define the svg of the icon to display */
33
- readonly svg: import("@angular/core").InputSignal<string | undefined>;
34
- /** Define the size of the icon */
35
- readonly size: import("@angular/core").InputSignalWithTransform<string | undefined, string>;
36
- /** Define the stroke-width of the icon */
37
- readonly strokeWidth: import("@angular/core").InputSignal<string | number | undefined>;
38
- /** Define the color of the icon */
39
- readonly color: import("@angular/core").InputSignal<string | undefined>;
40
- /** Store the inserted SVG */
41
- private svgElement?;
42
- constructor();
43
- ngOnDestroy(): void;
44
- private updateIcon;
45
- private setSvg;
46
- private replaceIds;
47
- /**
48
- * Request the icon from the loader.
49
- * @param name The name of the icon to load.
50
- * @returns The SVG content for a given icon name.
51
- */
52
- private requestIconFromLoader;
53
- static ɵfac: i0.ɵɵFactoryDeclaration<NgIcon, never>;
54
- static ɵcmp: i0.ɵɵComponentDeclaration<NgIcon, "ng-icon", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "svg": { "alias": "svg"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "strokeWidth": { "alias": "strokeWidth"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
55
- }
@@ -1,7 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class NgIconStack {
3
- /** The size of the child icons */
4
- readonly size: import("@angular/core").InputSignal<string>;
5
- static ɵfac: i0.ɵɵFactoryDeclaration<NgIconStack, never>;
6
- static ɵcmp: i0.ɵɵComponentDeclaration<NgIconStack, "ng-icon-stack", never, { "size": { "alias": "size"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
7
- }
@@ -1,17 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import { NgIcon } from './components/icon/icon.component';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "./components/icon/icon.component";
5
- export declare class NgIconsModule {
6
- constructor(icons: Record<string, string>);
7
- /**
8
- * Define the icons that will be included in the application. This allows unused icons to
9
- * be tree-shaken away to reduce bundle size
10
- * @param icons The object containing the required icons
11
- */
12
- static withIcons(icons: Record<string, string>): ModuleWithProviders<NgIconsModule>;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<NgIconsModule, never>;
14
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgIconsModule, never, [typeof i1.NgIcon], [typeof i1.NgIcon]>;
15
- static ɵinj: i0.ɵɵInjectorDeclaration<NgIconsModule>;
16
- }
17
- export declare const NG_ICON_DIRECTIVES: readonly [typeof NgIcon];
@@ -1,12 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { ContentSecurityPolicyFeature } from './features';
3
- export type NgIconPreProcessor = (icon: string) => string;
4
- export type NgIconPostProcessor = (element: HTMLElement | SVGElement) => void;
5
- export declare const NgIconPreProcessorToken: InjectionToken<NgIconPreProcessor>;
6
- export declare const NgIconPostProcessorToken: InjectionToken<NgIconPostProcessor>;
7
- export declare function injectNgIconPreProcessor(): NgIconPreProcessor;
8
- export declare function injectNgIconPostProcessor(): NgIconPostProcessor;
9
- /**
10
- * Process icons in a way that is compliant with the content security policy
11
- */
12
- export declare function withContentSecurityPolicy(): ContentSecurityPolicyFeature;
@@ -1,22 +0,0 @@
1
- import { Provider } from '@angular/core';
2
- export type ContentSecurityPolicyFeature = NgIconFeature<NgIconFeatureKind.ContentSecurityPolicyFeature>;
3
- export type ExceptionLoggerFeature = NgIconFeature<NgIconFeatureKind.ExceptionLoggerFeature>;
4
- export type NgIconFeatures = ContentSecurityPolicyFeature | ExceptionLoggerFeature;
5
- /**
6
- * The list of features as an enum to uniquely type each feature.
7
- */
8
- export declare const enum NgIconFeatureKind {
9
- ContentSecurityPolicyFeature = 0,
10
- ExceptionLoggerFeature = 1
11
- }
12
- /**
13
- * Helper type to represent a feature.
14
- */
15
- export interface NgIconFeature<FeatureKind extends NgIconFeatureKind> {
16
- ɵkind: FeatureKind;
17
- ɵproviders: Provider[];
18
- }
19
- /**
20
- * Helper function to create an object that represents a feature.
21
- */
22
- export declare function createFeature<FeatureKind extends NgIconFeatureKind>(kind: FeatureKind, providers: Provider[]): NgIconFeature<FeatureKind>;
@@ -1,30 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { ExceptionLoggerFeature } from './features';
3
- interface Logger {
4
- log(message: string): void;
5
- warn(message: string): void;
6
- error(message: string): void;
7
- }
8
- export declare const LoggerToken: InjectionToken<Logger>;
9
- /**
10
- * The default logger implementation that logs to the console
11
- */
12
- export declare class DefaultLogger implements Logger {
13
- log(message: string): void;
14
- warn(message: string): void;
15
- error(message: string): void;
16
- }
17
- /**
18
- * A logger implementation that throws an error on warnings and errors
19
- */
20
- export declare class ExceptionLogger implements Logger {
21
- log(message: string): void;
22
- warn(message: string): void;
23
- error(message: string): void;
24
- }
25
- export declare function injectLogger(): Logger;
26
- /**
27
- * Throw exceptions on warnings and errors
28
- */
29
- export declare function withExceptionLogger(): ExceptionLoggerFeature;
30
- export {};
@@ -1,27 +0,0 @@
1
- import { InjectionToken, Provider } from '@angular/core';
2
- export interface NgGlyphConfig {
3
- /** Define the default size of glyph */
4
- size: string | number;
5
- /** Define the optical size of the glyph */
6
- opticalSize?: number;
7
- /** Define the default color of glyph */
8
- color?: string;
9
- /** Define the default weight of glyph */
10
- weight?: number;
11
- /** Define the default grade of glyph */
12
- grade?: number;
13
- /** Define the default fill of glyph */
14
- fill?: boolean;
15
- }
16
- export declare const NgGlyphConfigToken: InjectionToken<Required<NgGlyphConfig>>;
17
- /**
18
- * Provide the configuration for the glyph
19
- * @param config The configuration to use
20
- */
21
- export declare function provideNgGlyphsConfig(config: Partial<NgGlyphConfig>): Provider;
22
- /**
23
- * Inject the configuration for the glyphs
24
- * @returns The configuration to use
25
- * @internal
26
- */
27
- export declare function injectNgGlyphsConfig(): Required<NgGlyphConfig>;
@@ -1,12 +0,0 @@
1
- import { InjectionToken, ValueProvider } from '@angular/core';
2
- export declare const NgGlyphsToken: InjectionToken<NgGlyphs>;
3
- export declare function provideNgGlyphs(...glyphsets: NgGlyphset[]): ValueProvider[];
4
- export declare function injectNgGlyphs(): NgGlyphs;
5
- export interface NgGlyphset {
6
- name: string;
7
- baseClass: string;
8
- }
9
- export interface NgGlyphs {
10
- defaultGlyphset: string;
11
- glyphsets: NgGlyphset[];
12
- }
@@ -1,22 +0,0 @@
1
- import { InjectionToken, Provider } from '@angular/core';
2
- import { NgIconFeatures } from './features/features';
3
- export interface NgIconConfig {
4
- /** Define the default size of icons */
5
- size?: string;
6
- /** Define the default color of icons */
7
- color?: string;
8
- /** Define the default stroke width of icons */
9
- strokeWidth?: string | number;
10
- }
11
- export declare const NgIconConfigToken: InjectionToken<NgIconConfig>;
12
- /**
13
- * Provide the configuration for the icons
14
- * @param config The configuration to use
15
- */
16
- export declare function provideNgIconsConfig(config: Partial<NgIconConfig>, ...features: NgIconFeatures[]): Provider[];
17
- /**
18
- * Inject the configuration for the icons
19
- * @returns The configuration to use
20
- * @internal
21
- */
22
- export declare function injectNgIconConfig(): NgIconConfig;
@@ -1,41 +0,0 @@
1
- import { InjectionToken, Provider } from '@angular/core';
2
- import type { Observable } from 'rxjs';
3
- export type NgIconLoader = (name: string) => Promise<string> | Observable<string> | string;
4
- export declare const NgIconLoaderToken: InjectionToken<NgIconLoader>;
5
- /**
6
- * The list of features as an enum to uniquely type each feature.
7
- */
8
- declare const enum NgIconLoaderFeatureKind {
9
- CachingFeature = 0
10
- }
11
- interface NgIconLoaderFeature<FeatureKind extends NgIconLoaderFeatureKind> {
12
- kind: FeatureKind;
13
- providers: Provider[];
14
- }
15
- type CachingFeature = NgIconLoaderFeature<NgIconLoaderFeatureKind.CachingFeature>;
16
- type NgIconLoaderFeatures = CachingFeature;
17
- export type NgIconLoaderCache = Map<string, string | Promise<string>>;
18
- export declare const NgIconCacheToken: InjectionToken<NgIconLoaderCache>;
19
- /**
20
- * Add caching to the loader. This will prevent the loader from being called multiple times for the same icon name.
21
- */
22
- export declare function withCaching(): CachingFeature;
23
- /**
24
- * Provide a function that will return the SVG content for a given icon name.
25
- * @param loader The function that will return the SVG content for a given icon name.
26
- * @param features The list of features to apply to the loader.
27
- * @returns The SVG content for a given icon name.
28
- */
29
- export declare function provideNgIconLoader(loader: NgIconLoader, ...features: NgIconLoaderFeatures[]): (Provider[][] | {
30
- provide: InjectionToken<NgIconLoader>;
31
- useValue: NgIconLoader;
32
- })[];
33
- /**
34
- * Inject the function that will return the SVG content for a given icon name.
35
- */
36
- export declare function injectNgIconLoader(): NgIconLoader | null;
37
- /**
38
- * Inject the cache that will store the SVG content for a given icon name.
39
- */
40
- export declare function injectNgIconLoaderCache(): NgIconLoaderCache | null;
41
- export {};
@@ -1,13 +0,0 @@
1
- import { InjectionToken, Provider } from '@angular/core';
2
- /**
3
- * Define the icons to use
4
- * @param icons The icons to provide
5
- */
6
- export declare function provideIcons(icons: Record<string, string>): Provider[];
7
- export declare const NgIconsToken: InjectionToken<Record<string, string>[]>;
8
- /**
9
- * Inject the icons to use
10
- * @returns The icons to use
11
- * @internal
12
- */
13
- export declare function injectNgIcons(): Record<string, string>[];
@@ -1,6 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- /**
3
- * A loader may return a promise, an observable or a string. This function will coerce the result into a promise.
4
- * @returns
5
- */
6
- export declare function coerceLoaderResult(result: Promise<string> | Observable<string> | string): Promise<string>;
@@ -1 +0,0 @@
1
- export declare function coerceCssPixelValue(value: string): string;
@@ -1,4 +0,0 @@
1
- /**
2
- * Hyphenated to lowerCamelCase
3
- */
4
- export declare function toPropertyName(str: string): string;