mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-11 13:28:19 +00:00
* Add export per icon * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Add documentations * Format code --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
55 lines
1.4 KiB
TypeScript
55 lines
1.4 KiB
TypeScript
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];
|
|
|
|
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;
|
|
toBeRemovedInVersion?: string;
|
|
};
|
|
|
|
export type IconDeprecationReason = 'icon.renamed' | '';
|
|
|
|
export type IconMetadataBase = {
|
|
toBeRemovedInVersion?: string;
|
|
categories: string[];
|
|
aliases?: AliasDeprecation[];
|
|
tags: string[];
|
|
deprecationReason?: IconDeprecationReason;
|
|
deprecated?: boolean;
|
|
};
|
|
|
|
export type IconMetadataWithDeprecation = IconMetadataBase & {
|
|
deprecated: true;
|
|
deprecationReason?: IconDeprecationReason;
|
|
};
|
|
|
|
export type IconMetadata = IconMetadataBase | IconMetadataWithDeprecation;
|