@iconify/tools 2.0.17 → 2.1.0-beta.2
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/lib/colors/parse.d.ts +2 -2
- package/lib/colors/validate.d.ts +2 -2
- package/lib/download/git/branch.cjs +2 -3
- package/lib/download/git/branch.mjs +2 -3
- package/lib/download/git/hash.cjs +1 -0
- package/lib/download/git/hash.mjs +1 -0
- package/lib/download/git/index.cjs +4 -2
- package/lib/download/git/index.mjs +4 -2
- package/lib/download/git/reset.cjs +4 -2
- package/lib/download/git/reset.mjs +4 -2
- package/lib/download/index.cjs +4 -2
- package/lib/download/index.mjs +4 -2
- package/lib/download/npm/index.cjs +1 -0
- package/lib/download/npm/index.mjs +1 -0
- package/lib/download/npm/version.cjs +1 -0
- package/lib/download/npm/version.mjs +1 -0
- package/lib/export/directory.d.ts +3 -2
- package/lib/export/icon-package.d.ts +3 -2
- package/lib/export/json-package.cjs +2 -2
- package/lib/export/json-package.d.ts +3 -2
- package/lib/export/json-package.mjs +2 -2
- package/lib/icon-set/index.cjs +100 -106
- package/lib/icon-set/index.d.ts +23 -5
- package/lib/icon-set/index.mjs +101 -107
- package/lib/icon-set/match.cjs +5 -5
- package/lib/icon-set/match.d.ts +4 -3
- package/lib/icon-set/match.mjs +2 -2
- package/lib/icon-set/merge.cjs +10 -3
- package/lib/icon-set/merge.d.ts +3 -2
- package/lib/icon-set/merge.mjs +10 -3
- package/lib/icon-set/modified.cjs +27 -0
- package/lib/icon-set/modified.d.ts +15 -0
- package/lib/icon-set/modified.mjs +23 -0
- package/lib/icon-set/props.cjs +8 -18
- package/lib/icon-set/props.d.ts +5 -6
- package/lib/icon-set/props.mjs +9 -18
- package/lib/icon-set/types.d.ts +1 -1
- package/lib/import/directory.cjs +4 -3
- package/lib/import/directory.d.ts +3 -2
- package/lib/import/directory.mjs +4 -3
- package/lib/import/figma/index.cjs +4 -3
- package/lib/import/figma/index.d.ts +3 -2
- package/lib/import/figma/index.mjs +4 -3
- package/lib/import/figma/nodes.d.ts +3 -2
- package/lib/import/figma/query.d.ts +3 -2
- package/lib/import/figma/types/nodes.d.ts +3 -2
- package/lib/import/figma/types/options.d.ts +3 -2
- package/lib/import/figma/types/result.d.ts +3 -2
- package/lib/index.cjs +5 -2
- package/lib/index.d.ts +4 -2
- package/lib/index.mjs +5 -2
- package/lib/misc/bump-version.cjs +2 -2
- package/lib/misc/bump-version.mjs +2 -2
- package/lib/misc/cheerio.cjs +2 -0
- package/lib/misc/cheerio.d.ts +7 -0
- package/lib/misc/cheerio.mjs +1 -0
- package/lib/misc/exec.cjs +7 -2
- package/lib/misc/exec.mjs +7 -2
- package/lib/optimise/flags.cjs +8 -8
- package/lib/optimise/flags.d.ts +2 -2
- package/lib/optimise/flags.mjs +8 -8
- package/lib/optimise/global-style.d.ts +2 -2
- package/lib/optimise/scale.cjs +3 -3
- package/lib/optimise/scale.d.ts +3 -3
- package/lib/optimise/scale.mjs +3 -3
- package/lib/optimise/svgo.cjs +1 -1
- package/lib/optimise/svgo.d.ts +3 -3
- package/lib/optimise/svgo.mjs +1 -1
- package/lib/svg/analyse.d.ts +2 -2
- package/lib/svg/cleanup/attribs.d.ts +2 -2
- package/lib/svg/cleanup/bad-tags.d.ts +2 -2
- package/lib/svg/cleanup/inline-style.d.ts +2 -2
- package/lib/svg/cleanup/root-svg.d.ts +2 -2
- package/lib/svg/cleanup/svgo-style.cjs +1 -1
- package/lib/svg/cleanup/svgo-style.d.ts +2 -2
- package/lib/svg/cleanup/svgo-style.mjs +1 -1
- package/lib/svg/cleanup.d.ts +2 -2
- package/lib/svg/index.cjs +9 -9
- package/lib/svg/index.d.ts +4 -4
- package/lib/svg/index.mjs +10 -10
- package/lib/svg/parse-style.d.ts +3 -2
- package/lib/svg/parse.d.ts +4 -8
- package/lib/types-f0980297.d.ts +258 -0
- package/package.json +10 -3
package/lib/icon-set/index.cjs
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const defaults = require('@iconify/utils/lib/icon/defaults');
|
|
6
6
|
const build = require('@iconify/utils/lib/svg/build');
|
|
7
|
-
const
|
|
7
|
+
const defaults$1 = require('@iconify/utils/lib/customisations/defaults');
|
|
8
8
|
const minify = require('@iconify/utils/lib/icon-set/minify');
|
|
9
9
|
const convertInfo = require('@iconify/utils/lib/icon-set/convert-info');
|
|
10
10
|
const iconSet_props = require('./props.cjs');
|
|
11
11
|
const svg_index = require('../svg/index.cjs');
|
|
12
|
+
const utils = require('@iconify/utils');
|
|
13
|
+
require('@iconify/utils/lib/misc/objects');
|
|
12
14
|
require('cheerio');
|
|
13
|
-
require('@iconify/utils');
|
|
14
15
|
|
|
15
|
-
const maxIteration = 6;
|
|
16
16
|
const themeKeys = ["prefixes", "suffixes"];
|
|
17
17
|
function sortThemeKeys(keys) {
|
|
18
18
|
return keys.sort((a, b) => a.length === b.length ? a.localeCompare(b) : b.length - a.length);
|
|
@@ -23,7 +23,7 @@ class IconSet {
|
|
|
23
23
|
}
|
|
24
24
|
load(data) {
|
|
25
25
|
this.prefix = data.prefix;
|
|
26
|
-
const defaultProps = iconSet_props.filterProps(data, true);
|
|
26
|
+
const defaultProps = iconSet_props.filterProps(data, defaults.defaultIconDimensions, true);
|
|
27
27
|
this.entries = /* @__PURE__ */ Object.create(null);
|
|
28
28
|
const entries = this.entries;
|
|
29
29
|
for (const name in data.icons) {
|
|
@@ -34,7 +34,7 @@ class IconSet {
|
|
|
34
34
|
props: iconSet_props.filterProps({
|
|
35
35
|
...defaultProps,
|
|
36
36
|
...item
|
|
37
|
-
}, true),
|
|
37
|
+
}, iconSet_props.defaultCommonProps, true),
|
|
38
38
|
chars: /* @__PURE__ */ new Set(),
|
|
39
39
|
categories: /* @__PURE__ */ new Set()
|
|
40
40
|
};
|
|
@@ -42,9 +42,12 @@ class IconSet {
|
|
|
42
42
|
}
|
|
43
43
|
if (data.aliases) {
|
|
44
44
|
for (const name in data.aliases) {
|
|
45
|
+
if (entries[name]) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
45
48
|
const item = data.aliases[name];
|
|
46
49
|
const parent = item.parent;
|
|
47
|
-
const props = iconSet_props.filterProps(item, false);
|
|
50
|
+
const props = iconSet_props.filterProps(item, iconSet_props.defaultCommonProps, false);
|
|
48
51
|
const chars = /* @__PURE__ */ new Set();
|
|
49
52
|
if (Object.keys(props).length) {
|
|
50
53
|
const entry = {
|
|
@@ -121,6 +124,10 @@ class IconSet {
|
|
|
121
124
|
}
|
|
122
125
|
}
|
|
123
126
|
});
|
|
127
|
+
this.lastModified = data.lastModified || 0;
|
|
128
|
+
}
|
|
129
|
+
updateLastModified(value) {
|
|
130
|
+
this.lastModified = value || Math.floor(Date.now() / 1e3);
|
|
124
131
|
}
|
|
125
132
|
list(types = ["icon", "variation"]) {
|
|
126
133
|
return Object.keys(this.entries).filter((name) => {
|
|
@@ -144,60 +151,53 @@ class IconSet {
|
|
|
144
151
|
}
|
|
145
152
|
}
|
|
146
153
|
}
|
|
147
|
-
|
|
154
|
+
getTree(names) {
|
|
148
155
|
const entries = this.entries;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
156
|
+
const resolved = /* @__PURE__ */ Object.create(null);
|
|
157
|
+
function resolve(name) {
|
|
158
|
+
const item = entries[name];
|
|
159
|
+
if (!item) {
|
|
160
|
+
return resolved[name] = null;
|
|
152
161
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
case "alias":
|
|
163
|
-
return getIcon(item.parent, iteration + 1);
|
|
164
|
-
case "variation": {
|
|
165
|
-
const parent = getIcon(item.parent, iteration + 1);
|
|
166
|
-
if (!parent) {
|
|
167
|
-
return null;
|
|
168
|
-
}
|
|
169
|
-
for (const key in item.props) {
|
|
170
|
-
const attr = key;
|
|
171
|
-
const value = item.props[attr];
|
|
172
|
-
if (value) {
|
|
173
|
-
if (parent[attr] === void 0) {
|
|
174
|
-
parent[attr] = value;
|
|
175
|
-
} else {
|
|
176
|
-
switch (attr) {
|
|
177
|
-
case "rotate":
|
|
178
|
-
parent[attr] = (parent[attr] + value) % 4;
|
|
179
|
-
break;
|
|
180
|
-
case "hFlip":
|
|
181
|
-
case "vFlip":
|
|
182
|
-
parent[attr] = !parent[attr];
|
|
183
|
-
break;
|
|
184
|
-
default:
|
|
185
|
-
parent[attr] = value;
|
|
186
|
-
break;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
return parent;
|
|
162
|
+
if (item.type === "icon") {
|
|
163
|
+
return resolved[name] = [];
|
|
164
|
+
}
|
|
165
|
+
if (resolved[name] === void 0) {
|
|
166
|
+
resolved[name] = null;
|
|
167
|
+
const parent = item.parent;
|
|
168
|
+
const value = parent && resolve(parent);
|
|
169
|
+
if (value) {
|
|
170
|
+
resolved[name] = [parent].concat(value);
|
|
192
171
|
}
|
|
193
|
-
default:
|
|
194
|
-
return null;
|
|
195
172
|
}
|
|
173
|
+
return resolved[name];
|
|
196
174
|
}
|
|
197
|
-
|
|
198
|
-
return
|
|
175
|
+
(names || Object.keys(entries)).forEach(resolve);
|
|
176
|
+
return resolved;
|
|
199
177
|
}
|
|
200
|
-
|
|
178
|
+
resolve(name, full = false) {
|
|
179
|
+
const entries = this.entries;
|
|
180
|
+
const item = entries[name];
|
|
181
|
+
const tree = item && (item.type === "icon" ? [] : this.getTree([name])[name]);
|
|
182
|
+
if (!tree) {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
let result = {};
|
|
186
|
+
function parse(name2) {
|
|
187
|
+
const item2 = entries[name2];
|
|
188
|
+
if (item2.type === "alias") {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
result = utils.mergeIconData(item2.props, result);
|
|
192
|
+
if (item2.type === "icon") {
|
|
193
|
+
result.body = item2.body;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
parse(name);
|
|
197
|
+
tree.forEach(parse);
|
|
198
|
+
return result && full ? { ...defaults.defaultIconProps, ...result } : result;
|
|
199
|
+
}
|
|
200
|
+
toString(name, customisations = {
|
|
201
201
|
width: "auto",
|
|
202
202
|
height: "auto"
|
|
203
203
|
}) {
|
|
@@ -206,8 +206,8 @@ class IconSet {
|
|
|
206
206
|
return null;
|
|
207
207
|
}
|
|
208
208
|
const result = build.iconToSVG(item, {
|
|
209
|
-
...
|
|
210
|
-
...
|
|
209
|
+
...defaults$1.defaultIconCustomisations,
|
|
210
|
+
...customisations
|
|
211
211
|
});
|
|
212
212
|
const attributes = Object.keys(result.attributes).map((key) => ` ${key}="${result.attributes[key]}"`).join("");
|
|
213
213
|
return `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"${attributes}>${result.body}</svg>`;
|
|
@@ -219,6 +219,7 @@ class IconSet {
|
|
|
219
219
|
export(validate = true) {
|
|
220
220
|
const icons = /* @__PURE__ */ Object.create(null);
|
|
221
221
|
const aliases = /* @__PURE__ */ Object.create(null);
|
|
222
|
+
const tree = validate ? this.getTree() : /* @__PURE__ */ Object.create(null);
|
|
222
223
|
const names = Object.keys(this.entries);
|
|
223
224
|
names.sort((a, b) => a.localeCompare(b));
|
|
224
225
|
names.forEach((name) => {
|
|
@@ -234,7 +235,7 @@ class IconSet {
|
|
|
234
235
|
}
|
|
235
236
|
case "alias":
|
|
236
237
|
case "variation": {
|
|
237
|
-
if (validate && !
|
|
238
|
+
if (validate && !tree[name]) {
|
|
238
239
|
break;
|
|
239
240
|
}
|
|
240
241
|
const props = item.type === "variation" ? item.props : {};
|
|
@@ -258,6 +259,9 @@ class IconSet {
|
|
|
258
259
|
if (info) {
|
|
259
260
|
result.info = info;
|
|
260
261
|
}
|
|
262
|
+
if (this.lastModified) {
|
|
263
|
+
result.lastModified = this.lastModified;
|
|
264
|
+
}
|
|
261
265
|
result.icons = icons;
|
|
262
266
|
if (Object.keys(aliases).length) {
|
|
263
267
|
result.aliases = aliases;
|
|
@@ -341,7 +345,7 @@ class IconSet {
|
|
|
341
345
|
return true;
|
|
342
346
|
}).length;
|
|
343
347
|
}
|
|
344
|
-
|
|
348
|
+
findCategory(title, add) {
|
|
345
349
|
const categoryItem = Array.from(this.categories).find((item) => item.title === title);
|
|
346
350
|
if (categoryItem) {
|
|
347
351
|
return categoryItem;
|
|
@@ -357,7 +361,7 @@ class IconSet {
|
|
|
357
361
|
return null;
|
|
358
362
|
}
|
|
359
363
|
listCategory(category) {
|
|
360
|
-
const categoryItem = typeof category === "string" ? this.
|
|
364
|
+
const categoryItem = typeof category === "string" ? this.findCategory(category, false) : category;
|
|
361
365
|
if (!categoryItem) {
|
|
362
366
|
return null;
|
|
363
367
|
}
|
|
@@ -380,51 +384,45 @@ class IconSet {
|
|
|
380
384
|
}
|
|
381
385
|
remove(name, removeDependencies = true) {
|
|
382
386
|
const entries = this.entries;
|
|
383
|
-
const names = /* @__PURE__ */ new Set();
|
|
384
387
|
if (typeof removeDependencies === "string") {
|
|
385
|
-
|
|
388
|
+
const item2 = entries[removeDependencies];
|
|
389
|
+
if (name === removeDependencies || item2?.type !== "icon") {
|
|
386
390
|
return 0;
|
|
387
391
|
}
|
|
388
|
-
names.add(removeDependencies);
|
|
389
392
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}
|
|
394
|
-
names.add(name2);
|
|
395
|
-
if (removeDependencies === true || !iteration && typeof removeDependencies === "string") {
|
|
396
|
-
for (const key in entries) {
|
|
397
|
-
const item = entries[key];
|
|
398
|
-
switch (item.type) {
|
|
399
|
-
case "icon":
|
|
400
|
-
break;
|
|
401
|
-
case "alias":
|
|
402
|
-
case "variation":
|
|
403
|
-
if (item.parent === name2) {
|
|
404
|
-
if (removeDependencies === true) {
|
|
405
|
-
if (!del(key, iteration + 1)) {
|
|
406
|
-
return false;
|
|
407
|
-
}
|
|
408
|
-
break;
|
|
409
|
-
}
|
|
410
|
-
item.parent = removeDependencies;
|
|
411
|
-
}
|
|
412
|
-
break;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
return true;
|
|
393
|
+
const item = entries[name];
|
|
394
|
+
if (!item) {
|
|
395
|
+
return 0;
|
|
417
396
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
397
|
+
this.updateLastModified();
|
|
398
|
+
if (typeof removeDependencies === "string") {
|
|
399
|
+
for (const key in entries) {
|
|
400
|
+
const item2 = entries[key];
|
|
401
|
+
if (item2.type !== "icon" && item2.parent === name) {
|
|
402
|
+
item2.parent = removeDependencies;
|
|
403
|
+
}
|
|
421
404
|
}
|
|
422
|
-
|
|
423
|
-
|
|
405
|
+
return 0;
|
|
406
|
+
}
|
|
407
|
+
delete entries[name];
|
|
408
|
+
let count = 1;
|
|
409
|
+
function remove(parent) {
|
|
410
|
+
const list = Object.keys(entries).filter((name2) => {
|
|
411
|
+
const item2 = entries[name2];
|
|
412
|
+
return item2.type !== "icon" && item2.parent === parent;
|
|
424
413
|
});
|
|
425
|
-
|
|
414
|
+
list.forEach((name2) => {
|
|
415
|
+
if (entries[name2]) {
|
|
416
|
+
delete entries[name2];
|
|
417
|
+
count++;
|
|
418
|
+
remove(name2);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
if (removeDependencies === true) {
|
|
423
|
+
remove(name);
|
|
426
424
|
}
|
|
427
|
-
return
|
|
425
|
+
return count;
|
|
428
426
|
}
|
|
429
427
|
rename(oldName, newName) {
|
|
430
428
|
const entries = this.entries;
|
|
@@ -451,6 +449,7 @@ class IconSet {
|
|
|
451
449
|
break;
|
|
452
450
|
}
|
|
453
451
|
}
|
|
452
|
+
this.updateLastModified();
|
|
454
453
|
return true;
|
|
455
454
|
}
|
|
456
455
|
setItem(name, item) {
|
|
@@ -463,13 +462,14 @@ class IconSet {
|
|
|
463
462
|
}
|
|
464
463
|
}
|
|
465
464
|
this.entries[name] = item;
|
|
465
|
+
this.updateLastModified();
|
|
466
466
|
return true;
|
|
467
467
|
}
|
|
468
468
|
setIcon(name, icon) {
|
|
469
469
|
return this.setItem(name, {
|
|
470
470
|
type: "icon",
|
|
471
471
|
body: icon.body,
|
|
472
|
-
props: iconSet_props.filterProps(icon, true),
|
|
472
|
+
props: iconSet_props.filterProps(icon, iconSet_props.defaultCommonProps, true),
|
|
473
473
|
chars: /* @__PURE__ */ new Set(),
|
|
474
474
|
categories: /* @__PURE__ */ new Set()
|
|
475
475
|
});
|
|
@@ -490,18 +490,12 @@ class IconSet {
|
|
|
490
490
|
});
|
|
491
491
|
}
|
|
492
492
|
fromSVG(name, svg) {
|
|
493
|
-
const props = svg.viewBox;
|
|
493
|
+
const props = { ...svg.viewBox };
|
|
494
494
|
const body = svg.getBody();
|
|
495
495
|
const item = this.entries[name];
|
|
496
496
|
switch (item?.type) {
|
|
497
497
|
case "icon":
|
|
498
498
|
case "variation": {
|
|
499
|
-
for (const key in iconSet_props.extraDefaultProps) {
|
|
500
|
-
const prop = key;
|
|
501
|
-
if (item.props[prop]) {
|
|
502
|
-
props[prop] = item.props[prop];
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
499
|
return this.setItem(name, {
|
|
506
500
|
type: "icon",
|
|
507
501
|
body,
|
|
@@ -529,7 +523,7 @@ class IconSet {
|
|
|
529
523
|
}
|
|
530
524
|
toggleCategory(iconName, category, add) {
|
|
531
525
|
const item = this.entries[iconName];
|
|
532
|
-
const categoryItem = this.
|
|
526
|
+
const categoryItem = this.findCategory(category, add);
|
|
533
527
|
if (!item || !categoryItem) {
|
|
534
528
|
return false;
|
|
535
529
|
}
|
package/lib/icon-set/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { IconifyInfo, IconifyJSON } from '
|
|
2
|
-
import { IconifyIconCustomisations } from '@iconify/utils/lib/customisations';
|
|
1
|
+
import { a as IconifyInfo, b as IconifyJSON } from '../types-f0980297.js';
|
|
2
|
+
import { IconifyIconCustomisations } from '@iconify/utils/lib/customisations/defaults';
|
|
3
3
|
import { IconSetIconEntry, IconCategory, IconSetIconType, IconSetAsyncForEachCallback, ResolvedIconifyIcon, CommonIconProps, CheckThemeResult } from './types.js';
|
|
4
4
|
import { SVG } from '../svg/index.js';
|
|
5
|
+
import { ParentIconsTree } from '@iconify/utils/lib/icon-set/tree';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Sort theme keys: long keys first
|
|
@@ -18,6 +19,7 @@ declare class IconSet {
|
|
|
18
19
|
* 'entries' and 'categories' properties, there are functions for that.
|
|
19
20
|
*/
|
|
20
21
|
prefix: string;
|
|
22
|
+
lastModified: number;
|
|
21
23
|
entries: Record<string, IconSetIconEntry>;
|
|
22
24
|
info: IconifyInfo | undefined;
|
|
23
25
|
categories: Set<IconCategory>;
|
|
@@ -31,6 +33,10 @@ declare class IconSet {
|
|
|
31
33
|
* Load icon set
|
|
32
34
|
*/
|
|
33
35
|
load(data: IconifyJSON): void;
|
|
36
|
+
/**
|
|
37
|
+
* Update last modification time
|
|
38
|
+
*/
|
|
39
|
+
updateLastModified(value?: number): void;
|
|
34
40
|
/**
|
|
35
41
|
* List icons
|
|
36
42
|
*/
|
|
@@ -42,6 +48,18 @@ declare class IconSet {
|
|
|
42
48
|
* Callback should return false to stop loop.
|
|
43
49
|
*/
|
|
44
50
|
forEach(callback: IconSetAsyncForEachCallback, types?: IconSetIconType[]): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Get parent icons tree
|
|
53
|
+
*
|
|
54
|
+
* Returns parent icons list for each icon, null if failed to resolve.
|
|
55
|
+
* In parent icons list, first element is a direct parent, last is icon. Does not include item.
|
|
56
|
+
*
|
|
57
|
+
* Examples:
|
|
58
|
+
* 'alias3': ['alias2', 'alias1', 'icon']
|
|
59
|
+
* 'icon': []
|
|
60
|
+
* 'bad-icon': null
|
|
61
|
+
*/
|
|
62
|
+
getTree(names?: string[]): ParentIconsTree;
|
|
45
63
|
/**
|
|
46
64
|
* Resolve icon
|
|
47
65
|
*/
|
|
@@ -51,7 +69,7 @@ declare class IconSet {
|
|
|
51
69
|
/**
|
|
52
70
|
* Generate HTML
|
|
53
71
|
*/
|
|
54
|
-
toString(name: string,
|
|
72
|
+
toString(name: string, customisations?: IconifyIconCustomisations): string | null;
|
|
55
73
|
/**
|
|
56
74
|
* Get SVG instance for icon
|
|
57
75
|
*/
|
|
@@ -75,7 +93,7 @@ declare class IconSet {
|
|
|
75
93
|
/**
|
|
76
94
|
* Find category by title
|
|
77
95
|
*/
|
|
78
|
-
|
|
96
|
+
findCategory(title: string, add: boolean): IconCategory | null;
|
|
79
97
|
/**
|
|
80
98
|
* Count icons in category, remove category if empty
|
|
81
99
|
*
|
|
@@ -89,7 +107,7 @@ declare class IconSet {
|
|
|
89
107
|
/**
|
|
90
108
|
* Remove icons. Returns number of removed icons
|
|
91
109
|
*
|
|
92
|
-
* If removeDependencies is a string, it represents new parent for all aliases of removed icon.
|
|
110
|
+
* If removeDependencies is a string, it represents new parent for all aliases of removed icon. New parent cannot be alias or variation.
|
|
93
111
|
*/
|
|
94
112
|
remove(name: string, removeDependencies?: boolean | string): number;
|
|
95
113
|
/**
|