36 lines
1.4 KiB
TypeScript
36 lines
1.4 KiB
TypeScript
import React from 'react';
|
||
|
||
/**
|
||
* 渲染一个 iconfont symbol 图标(依赖 Iconfont.init 注入的 SVG symbol 脚本)
|
||
* @param {Object} props
|
||
* @param {string} [props.className] 额外的 class 名
|
||
* @param {string} props.type 图标名,对应 svg symbol 的 id
|
||
* @param {Object} [props.style] 行内样式
|
||
* @param {number} [props.rotate] 旋转角度(deg)
|
||
* @param {boolean} [props.spin] 是否开启旋转动画
|
||
* @param {string} [props.twoToneColor] 双色图标的第二色
|
||
* @param {boolean} [props.compact] 是否紧凑模式(去除默认间距)
|
||
*/
|
||
declare function Iconfont({ className, type, style, rotate, spin, twoToneColor, compact, ...props }: {
|
||
className?: string;
|
||
type: string;
|
||
style?: any;
|
||
rotate?: number;
|
||
spin?: boolean;
|
||
twoToneColor?: string;
|
||
compact?: boolean;
|
||
}): React.JSX.Element;
|
||
declare namespace Iconfont {
|
||
export { createScriptUrlElements as init };
|
||
}
|
||
|
||
/**
|
||
* 依次注入 iconfont symbol 的 script 地址(单个 url 只会注入一次);
|
||
* 也是 Iconfont.init 挂载的实现,支持传入多个 url 按顺序加载(前一个 load/error 后再加载下一个)
|
||
* @param {string[]} [scriptUrls] iconfont symbol 脚本地址列表
|
||
* @param {number} [index] 内部递归用的当前下标
|
||
*/
|
||
declare function createScriptUrlElements(scriptUrls?: string[], index?: number): void;
|
||
|
||
export { Iconfont as default };
|