Files
lucide/tools/build-icons/types.ts
KarsaandJakob Guddas a87bc9b15b fix(icons): deprecated swiss franc icons (#4799)
* fix(icons): deprecated swiss franc icons & refined icon deprecation reasons

* Update tools/build-icons/utils/deprecationReasonTemplate.ts

Co-authored-by: Jakob Guddas <github@jguddas.de>

* fix(icons): replace icon.obsolete => icon.use-case

---------

Co-authored-by: Jakob Guddas <github@jguddas.de>
2026-09-04 14:04:24 +02:00

51 lines
1.3 KiB
TypeScript

export type SVGProps = Record<string, string | number>;
export type IconNode = [tag: string, attrs: SVGProps][];
export type IconNodeWithChildren = [tag: string, attrs: SVGProps, children: IconNode];
export type IconData = {
name: string;
node: IconNode;
aliases?: string[];
} & ({ size: number } | { width: number; height: number });
export interface ExportTemplate {
componentName: string;
iconName: string;
children: IconNode;
getSvg: () => Promise<string>;
deprecated: boolean;
deprecationReason: string;
iconData: IconData;
}
export type TemplateFunction = (params: ExportTemplate) => Promise<string>;
export type Path = string;
export type AliasDeprecationReason = 'alias.typo' | 'alias.name' | 'alias.duplicate';
export type AliasDeprecation = {
name: string;
deprecated: true;
deprecationReason: AliasDeprecationReason;
};
export type IconDeprecationReason = 'icon.design' | 'icon.use-case' | '';
export type IconMetadataBase = {
categories: string[];
aliases?: AliasDeprecation[];
tags: string[];
deprecationReason?: IconDeprecationReason;
deprecated?: boolean;
};
export type IconMetadataWithDeprecation = IconMetadataBase & {
deprecated: true;
deprecationReason?: IconDeprecationReason;
};
export type IconMetadata = IconMetadataBase | IconMetadataWithDeprecation;