2025-06-18 15:47:24 +02:00
|
|
|
import { type INode } from 'svgson';
|
|
|
|
|
|
|
|
|
|
export type SVGProps = Record<string, string | number>;
|
|
|
|
|
|
|
|
|
|
export type IconNode = [tag: string, attrs: SVGProps][];
|
|
|
|
|
|
|
|
|
|
export type IconNodeWithChildren = [tag: string, attrs: SVGProps, children: IconNode];
|
|
|
|
|
|
2026-03-13 10:18:53 +01:00
|
|
|
export type IconData = {
|
|
|
|
|
name: string;
|
|
|
|
|
node: IconNode;
|
|
|
|
|
aliases?: string[];
|
|
|
|
|
} & ({ size: number } | { width: number; height: number });
|
|
|
|
|
|
|
|
|
|
export interface ExportTemplate {
|
2025-06-18 15:47:24 +02:00
|
|
|
componentName: string;
|
|
|
|
|
iconName: string;
|
|
|
|
|
children: IconNode;
|
|
|
|
|
getSvg: () => Promise<string>;
|
2026-03-13 10:18:53 +01:00
|
|
|
deprecated: boolean;
|
|
|
|
|
deprecationReason: string;
|
|
|
|
|
iconData: IconData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type TemplateFunction = (params: ExportTemplate) => Promise<string>;
|
2025-06-18 15:47:24 +02:00
|
|
|
|
|
|
|
|
export type Path = string;
|
|
|
|
|
|
|
|
|
|
export type AliasDeprecationReason = 'alias.typo' | 'alias.name' | 'alias.duplicate';
|
|
|
|
|
|
|
|
|
|
export type AliasDeprecation = {
|
|
|
|
|
name: string;
|
|
|
|
|
deprecated: true;
|
|
|
|
|
deprecationReason: AliasDeprecationReason;
|
2026-07-02 12:34:23 +02:00
|
|
|
toBeRemovedInVersion?: string;
|
2025-06-18 15:47:24 +02:00
|
|
|
};
|
|
|
|
|
|
2025-11-27 10:56:32 +01:00
|
|
|
export type IconDeprecationReason = 'icon.renamed' | '';
|
2025-06-18 15:47:24 +02:00
|
|
|
|
|
|
|
|
export type IconMetadataBase = {
|
|
|
|
|
toBeRemovedInVersion?: string;
|
2025-07-04 17:27:07 +02:00
|
|
|
categories: string[];
|
2026-07-09 14:53:06 +02:00
|
|
|
aliases?: AliasDeprecation[];
|
2025-07-04 17:27:07 +02:00
|
|
|
tags: string[];
|
2025-06-18 15:47:24 +02:00
|
|
|
deprecationReason?: IconDeprecationReason;
|
|
|
|
|
deprecated?: boolean;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type IconMetadataWithDeprecation = IconMetadataBase & {
|
|
|
|
|
deprecated: true;
|
|
|
|
|
deprecationReason?: IconDeprecationReason;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type IconMetadata = IconMetadataBase | IconMetadataWithDeprecation;
|