@scarlab-icons/js 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -2
- package/dist/index.cjs +106 -58462
- package/dist/index.d.ts +19 -3
- package/dist/index.js +104 -58463
- package/package.json +17 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
declare function replace(params?: {}): void;
|
|
1
|
+
import { IconNode } from '@scarlab-icons/icons';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
type Attrs = Record<string, string | number | boolean | null | undefined>;
|
|
4
|
+
declare function toSvg(icon: IconNode, attrs?: Attrs): string;
|
|
5
|
+
|
|
6
|
+
interface ElementAttribute {
|
|
7
|
+
name: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
declare function getIcon(name: string, style?: string): IconNode | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Собирает <svg> по атрибутам элемента-заглушки (data-scarlab, data-style и остальные).
|
|
13
|
+
* Возвращает undefined, если data-scarlab нет или иконка не найдена.
|
|
14
|
+
*/
|
|
15
|
+
declare function attributesToSvg(attributes: Iterable<ElementAttribute>, params?: Attrs): string | undefined;
|
|
16
|
+
declare function replaceByAttribute(params?: Attrs, root?: ParentNode): void;
|
|
17
|
+
declare function replace(params?: Attrs, root?: ParentNode): void;
|
|
18
|
+
|
|
19
|
+
export { attributesToSvg, getIcon, replace, replaceByAttribute, toSvg };
|
|
20
|
+
export type { Attrs, ElementAttribute };
|