UNPKG

@iconsets/svg-morpheus-ts

Version:

ESM TypeScript library enabling SVG icons to morph from one to the other. It implements Material Design's Delightful Details transitions. Refactored with modern TypeScript + Vite + pnpm stack. Supports both Chinese and English documentation.

65 lines 3.58 kB
import { CurveData, NormalizedStyle, RawStyle, Transform } from './types'; export declare function styleNormCalc(styleNormFrom: NormalizedStyle, styleNormTo: NormalizedStyle, progress: number, lite: boolean): NormalizedStyle; export declare function styleNormToString(styleNorm: NormalizedStyle): RawStyle; export declare function styleToNorm(styleFrom: RawStyle, styleTo: RawStyle, lite: boolean, doc: SVGSVGElement): [NormalizedStyle, NormalizedStyle]; export declare function transCalc(transFrom: Transform, transTo: Transform, progress: number): Transform; export declare function trans2string(trans: Transform): string; export declare function curveCalc(curveFrom: CurveData, curveTo: CurveData, progress: number): CurveData; export declare function clone<T>(obj: T): T; /** * 动态合并多个 SVG 为类似 iconset.svg 的格式,并返回 Blob URL。 * 与异步版本的相比,当前函数不支持 svgMap 参数中的键值只能为 svg 源码。 * @param svgMap - 对象,key 为 g 标签的 id,value 为 svg 代码 * @param svgAttributes - 可选,生成的 SVG 根元素的属性集合 * @returns 生成的 Blob URL */ export declare function bundleSvgsSync(svgMap: Record<string, string>, svgAttributes?: Record<string, string | number>): string; /** * 动态合并多个 SVG 为类似 iconset.svg 的格式,并返回 Blob URL * @param svgMap - 对象,key 为 g 标签的 id,value 为 svg 路径或 svg 代码 * @param svgAttributes - 可选,生成的 SVG 根元素的属性集合 * @returns 生成的 Blob URL */ export declare function bundleSvgs(svgMap: Record<string, string>, svgAttributes?: Record<string, string | number>): Promise<string>; /** * 动态合并多个 SVG 为类似 iconset.svg 的格式,并返回 SVG 字符串(用于需要直接操作 SVG 内容的场景) * @param svgMap - 对象,key 为 g 标签的 id,value 为 svg 路径或 svg 代码 * @param svgAttributes - 可选,生成的 SVG 根元素的属性集合 * @returns Promise<string> 合并后的 SVG 字符串 */ export declare function bundleSvgsString(svgMap: Record<string, string>, svgAttributes?: Record<string, string | number>): Promise<string>; /** * 动态合并多个 SVG 为类似 iconset.svg 的格式,并返回 SVG 字符串(用于需要直接操作 SVG 内容的场景)。 * 与异步版本的相比,当前函数不支持 svgMap 参数中的键值只能为 svg 源码。 * @param svgMap - 对象,key 为 g 标签的 id,value 为 svg 路径或 svg 代码 * @param svgAttributes - 可选,生成的 SVG 根元素的属性集合 * @returns Promise<string> 合并后的 SVG 字符串 */ export declare function bundleSvgsStringSync(svgMap: Record<string, string>, svgAttributes?: Record<string, string | number>): string; /** * 提取 SVG 的 ViewBox 信息 * @param svgContent - SVG 字符串 * @returns ViewBox 信息 */ export declare function extractViewBoxInfo(svgContent: string): { values: [number, number, number, number]; original: string; } | null; /** * 提取 SVG 的 defs 信息 * @param svgContent - SVG 字符串 * @returns defs 信息 */ export declare function extractDefsInfo(svgContent: string): { gradients: Record<string, string>; patterns: Record<string, string>; others: Record<string, string>; raw: string | undefined; }; /** * 提取 SVG 根元素的属性 * @param svgContent - SVG 字符串 * @returns 属性对象 */ export declare function extractSvgRootAttributes(svgContent: string): Record<string, string>; //# sourceMappingURL=helpers.d.ts.map