@bimdos/icon
Version:
跨框架图标库,支持 React、Vue、Angular、AngularJS、小程序等多种使用方式
52 lines (41 loc) • 995 B
TypeScript
/**
* Bimdos Icon Library - TypeScript 类型定义
*/
export interface IconData {
name: string;
path: string;
svg: string;
}
export interface SvgOptions {
size?: number | string;
color?: string;
className?: string;
}
/**
* 获取图标数据
*/
export function getIcon(name: string): IconData | null;
/**
* 获取所有图标名称
*/
export function getIconNames(): string[];
/**
* 检查图标是否存在
*/
export function hasIcon(name: string): boolean;
/**
* 生成 SVG 字符串
*/
export function generateSvg(name: string, options?: SvgOptions): string;
/**
* 所有图标数据
*/
export const icons: IconData[];
/**
* 图标名称类型
*/
export type IconName = 'up' | 'right' | 'left' | 'down';
/**
* 可用的图标名称常量
*/
export const ICON_NAMES: readonly IconName[];