sync working code, and import type-doc

This commit is contained in:
2023-07-17 17:24:49 +08:00
parent 7ab7a7094a
commit 3e9ee59178
43 changed files with 1024 additions and 1553 deletions

22
lib/ui/icon.d.ts vendored
View File

@ -1,3 +1,25 @@
/**
* 创建矢量图标元素
* @param type 样式分类,可以是 ['`fa-light`', '`fa-regular`', '`fa-solid`'] 其中之一
* @param id 图标 id
* @param style 样式表对象
*/
export function createIcon(type: string, id: string, style?: { [key: string]: string }): SVGSVGElement
/**
* 修改矢量图标
* @param svg 矢量图标元素
* @param type 样式分类,见 { @link createIcon } 第一个参数
* @param id 图标 id见 { @link createIcon } 第二个参数
*/
export function changeIcon(svg: SVGSVGElement, type: string, id: string): SVGSVGElement
/**
* 解析容器元素内符合条件的子元素为矢量图标元素
* @param container 容器元素
* @example
* ```
* <svg data-id="user" data-type="fa-solid"></svg>
* ```
* - `data-id`: 见 { @link createIcon } 第二个参数
* - `data-type`: 见 { @link createIcon } 第一个参数
*/
export function resolveIcon(container: HTMLElement): HTMLElement