@acrool/icon-symbols
Version:
Merge svg into svg symbols, and unpack svg symbols into individual svg
13 lines (12 loc) • 553 B
TypeScript
import { IFormatSvgContentRes } from '../../types';
/**
* 格式化 SVG 内容
* @param svgContent - 原始 SVG 内容
* @returns 包含格式化后的 viewBox、defs 和 content 的对象
* @description
* 1. 解析 SVG 内容并获取填充颜色、内容、定义和视口信息
* 2. 判断是否为多色图标
* 3. 格式化 SVG 内容,处理 fill 和 stroke 属性
* 4. 如果 fillNone 为 true 且 path 使用 stroke,则添加 fill="none" 属性
*/
export declare const formatSvgContent: (svgContent: string) => IFormatSvgContentRes;