12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import {
- library_default_default
- } from "./chunk.LZ6V34JJ.js";
- import {
- library_system_default
- } from "./chunk.73PEGQ4K.js";
- // src/components/icon/library.ts
- var registry = [library_default_default, library_system_default];
- var watchedIcons = [];
- function watchIcon(icon) {
- watchedIcons.push(icon);
- }
- function unwatchIcon(icon) {
- watchedIcons = watchedIcons.filter((el) => el !== icon);
- }
- function getIconLibrary(name) {
- return registry.filter((lib) => lib.name === name)[0];
- }
- function registerIconLibrary(name, options) {
- unregisterIconLibrary(name);
- registry.push({
- name,
- resolver: options.resolver,
- mutator: options.mutator
- });
- watchedIcons.map((icon) => {
- if (icon.library === name) {
- icon.redraw();
- }
- });
- }
- function unregisterIconLibrary(name) {
- registry = registry.filter((lib) => lib.name !== name);
- }
- export {
- watchIcon,
- unwatchIcon,
- getIconLibrary,
- registerIconLibrary,
- unregisterIconLibrary
- };
|