@iconify/tools 3.0.1 → 3.0.3

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.
Files changed (92) hide show
  1. package/README.md +1 -1
  2. package/lib/export/json-package.cjs +1 -0
  3. package/lib/export/json-package.mjs +1 -0
  4. package/lib/import/directory.cjs +26 -18
  5. package/lib/import/directory.mjs +26 -18
  6. package/lib/misc/keyword.cjs +1 -1
  7. package/lib/misc/keyword.mjs +1 -1
  8. package/license.txt +1 -1
  9. package/package.json +17 -17
  10. package/lib/colors/attribs.d.ts +0 -27
  11. package/lib/colors/detect.d.ts +0 -15
  12. package/lib/colors/parse.d.ts +0 -67
  13. package/lib/colors/validate.d.ts +0 -26
  14. package/lib/css/parse.d.ts +0 -6
  15. package/lib/css/parser/error.d.ts +0 -13
  16. package/lib/css/parser/export.d.ts +0 -8
  17. package/lib/css/parser/strings.d.ts +0 -16
  18. package/lib/css/parser/text.d.ts +0 -20
  19. package/lib/css/parser/tokens.d.ts +0 -9
  20. package/lib/css/parser/tree.d.ts +0 -8
  21. package/lib/css/parser/types.d.ts +0 -52
  22. package/lib/download/api/cache.d.ts +0 -20
  23. package/lib/download/api/download.d.ts +0 -8
  24. package/lib/download/api/index.d.ts +0 -8
  25. package/lib/download/api/types.d.ts +0 -17
  26. package/lib/download/git/branch.d.ts +0 -8
  27. package/lib/download/git/hash.d.ts +0 -8
  28. package/lib/download/git/index.d.ts +0 -29
  29. package/lib/download/git/reset.d.ts +0 -6
  30. package/lib/download/github/hash.d.ts +0 -8
  31. package/lib/download/github/index.d.ts +0 -31
  32. package/lib/download/github/types.d.ts +0 -11
  33. package/lib/download/gitlab/hash.d.ts +0 -8
  34. package/lib/download/gitlab/index.d.ts +0 -31
  35. package/lib/download/gitlab/types.d.ts +0 -15
  36. package/lib/download/helpers/untar.d.ts +0 -6
  37. package/lib/download/helpers/unzip.d.ts +0 -6
  38. package/lib/download/index.d.ts +0 -48
  39. package/lib/download/npm/index.d.ts +0 -30
  40. package/lib/download/npm/types.d.ts +0 -9
  41. package/lib/download/npm/version.d.ts +0 -16
  42. package/lib/download/types/modified.d.ts +0 -6
  43. package/lib/download/types/sources.d.ts +0 -12
  44. package/lib/export/directory.d.ts +0 -25
  45. package/lib/export/helpers/custom-files.d.ts +0 -12
  46. package/lib/export/helpers/prepare.d.ts +0 -19
  47. package/lib/export/helpers/types-version.d.ts +0 -6
  48. package/lib/export/icon-package.d.ts +0 -25
  49. package/lib/export/json-package.d.ts +0 -23
  50. package/lib/icon-set/index.d.ts +0 -161
  51. package/lib/icon-set/match.d.ts +0 -14
  52. package/lib/icon-set/merge.d.ts +0 -13
  53. package/lib/icon-set/modified.d.ts +0 -15
  54. package/lib/icon-set/props.d.ts +0 -13
  55. package/lib/icon-set/tags.d.ts +0 -22
  56. package/lib/icon-set/types.d.ts +0 -75
  57. package/lib/import/directory.d.ts +0 -51
  58. package/lib/import/figma/index.d.ts +0 -19
  59. package/lib/import/figma/nodes.d.ts +0 -17
  60. package/lib/import/figma/query.d.ts +0 -28
  61. package/lib/import/figma/types/api.d.ts +0 -53
  62. package/lib/import/figma/types/nodes.d.ts +0 -43
  63. package/lib/import/figma/types/options.d.ts +0 -58
  64. package/lib/import/figma/types/result.d.ts +0 -43
  65. package/lib/index.d.ts +0 -72
  66. package/lib/misc/bump-version.d.ts +0 -6
  67. package/lib/misc/cheerio.d.ts +0 -7
  68. package/lib/misc/compare-dirs.d.ts +0 -11
  69. package/lib/misc/exec.d.ts +0 -12
  70. package/lib/misc/keyword.d.ts +0 -6
  71. package/lib/misc/scan.d.ts +0 -33
  72. package/lib/misc/write-json.d.ts +0 -6
  73. package/lib/optimise/flags.d.ts +0 -10
  74. package/lib/optimise/global-style.d.ts +0 -10
  75. package/lib/optimise/origin.d.ts +0 -10
  76. package/lib/optimise/scale.d.ts +0 -10
  77. package/lib/optimise/svgo.d.ts +0 -36
  78. package/lib/svg/analyse/error.d.ts +0 -8
  79. package/lib/svg/analyse/types.d.ts +0 -89
  80. package/lib/svg/analyse.d.ts +0 -13
  81. package/lib/svg/cleanup/attribs.d.ts +0 -10
  82. package/lib/svg/cleanup/bad-tags.d.ts +0 -16
  83. package/lib/svg/cleanup/inline-style.d.ts +0 -10
  84. package/lib/svg/cleanup/root-style.d.ts +0 -16
  85. package/lib/svg/cleanup/root-svg.d.ts +0 -10
  86. package/lib/svg/cleanup/svgo-style.d.ts +0 -10
  87. package/lib/svg/cleanup.d.ts +0 -15
  88. package/lib/svg/data/attributes.d.ts +0 -77
  89. package/lib/svg/data/tags.d.ts +0 -95
  90. package/lib/svg/index.d.ts +0 -47
  91. package/lib/svg/parse-style.d.ts +0 -63
  92. package/lib/svg/parse.d.ts +0 -36
@@ -1,89 +0,0 @@
1
- /**
2
- * Options
3
- */
4
- interface AnalyseSVGStructureOptions {
5
- fixErrors?: boolean;
6
- }
7
- /**
8
- * Extended properties for element
9
- */
10
- /**
11
- * Link to element
12
- */
13
- interface LinkToElementWithID {
14
- id: string;
15
- usedAsMask: boolean;
16
- usedByIndex: number;
17
- }
18
- /**
19
- * How element is used by parent elements
20
- */
21
- interface ExtendedTagElementUses {
22
- _usedAsMask: boolean;
23
- _usedAsPaint: boolean;
24
- }
25
- /**
26
- * Definition: mask, clip path, symbol, etc...
27
- */
28
- interface ReusableElement {
29
- id: string;
30
- isMask: boolean;
31
- index: number;
32
- }
33
- /**
34
- * Element with id
35
- *
36
- * Similar to ReusableElement, but not necessary a definition - any element with id. Also contains list of child elements
37
- */
38
- interface ElementWithID {
39
- id: string;
40
- isMask: boolean;
41
- indexes: Set<number>;
42
- }
43
- /**
44
- * Parent and child elements. Unlike standard tree, this tree is for elements that inherit attributes from parent element
45
- */
46
- interface ExtendedTagElementRelations {
47
- _parentElement?: number;
48
- _childElements?: number[];
49
- }
50
- /**
51
- * Extended tag
52
- */
53
- interface ExtendedTagElement extends cheerio.TagElement, ExtendedTagElementUses, ExtendedTagElementRelations {
54
- _index: number;
55
- _id?: string;
56
- _belongsTo?: ElementWithID[];
57
- _reusableElement?: ReusableElement;
58
- _linksTo?: LinkToElementWithID[];
59
- }
60
- /**
61
- * Additional stuff for <svg>
62
- */
63
- interface ExtendedRootTagElement extends ExtendedTagElement {
64
- _parsed?: boolean;
65
- }
66
- /**
67
- * Tree
68
- */
69
- interface ElementsTreeItem {
70
- index: number;
71
- usedAsMask: boolean;
72
- parent?: ElementsTreeItem;
73
- children: ElementsTreeItem[];
74
- }
75
- /**
76
- * Elements map
77
- */
78
- type ElementsMap = Map<number, ExtendedTagElement>;
79
- /**
80
- * Result
81
- */
82
- interface AnalyseSVGStructureResult {
83
- elements: ElementsMap;
84
- ids: Record<string, number>;
85
- links: LinkToElementWithID[];
86
- tree: ElementsTreeItem;
87
- }
88
-
89
- export { AnalyseSVGStructureOptions, AnalyseSVGStructureResult, ElementWithID, ElementsMap, ElementsTreeItem, ExtendedRootTagElement, ExtendedTagElement, ExtendedTagElementUses, LinkToElementWithID };
@@ -1,13 +0,0 @@
1
- import { SVG } from './index.js';
2
- import { AnalyseSVGStructureOptions, AnalyseSVGStructureResult } from './analyse/types.js';
3
- import '@iconify/types';
4
- import '@iconify/utils/lib/customisations/defaults';
5
-
6
- /**
7
- * Find all IDs, links, which elements use palette, which items aren't used
8
- *
9
- * Before running this function run cleanup functions to change inline style to attributes and fix attributes
10
- */
11
- declare function analyseSVGStructure(svg: SVG, options?: AnalyseSVGStructureOptions): AnalyseSVGStructureResult;
12
-
13
- export { analyseSVGStructure };
@@ -1,10 +0,0 @@
1
- import { SVG } from '../index.js';
2
- import '@iconify/types';
3
- import '@iconify/utils/lib/customisations/defaults';
4
-
5
- /**
6
- * Remove useless attributes
7
- */
8
- declare function removeBadAttributes(svg: SVG): void;
9
-
10
- export { removeBadAttributes };
@@ -1,16 +0,0 @@
1
- import { SVG } from '../index.js';
2
- import '@iconify/types';
3
- import '@iconify/utils/lib/customisations/defaults';
4
-
5
- /**
6
- * Options
7
- */
8
- interface CheckBadTagsOptions {
9
- keepTitles?: boolean;
10
- }
11
- /**
12
- * Test for bag tags
13
- */
14
- declare function checkBadTags(svg: SVG, options?: CheckBadTagsOptions): void;
15
-
16
- export { CheckBadTagsOptions, checkBadTags };
@@ -1,10 +0,0 @@
1
- import { SVG } from '../index.js';
2
- import '@iconify/types';
3
- import '@iconify/utils/lib/customisations/defaults';
4
-
5
- /**
6
- * Expand inline style
7
- */
8
- declare function cleanupInlineStyle(svg: SVG): void;
9
-
10
- export { cleanupInlineStyle };
@@ -1,16 +0,0 @@
1
- import { SVG } from '../index.js';
2
- import '@iconify/types';
3
- import '@iconify/utils/lib/customisations/defaults';
4
-
5
- interface CleanupRootStyleResult {
6
- animations?: Set<string>;
7
- removedAtRules?: Set<string>;
8
- }
9
- /**
10
- * Clean up root style
11
- *
12
- * This function removes all at-rule tokens, such as `@font-face`, `@media`
13
- */
14
- declare function cleanupRootStyle(svg: SVG): CleanupRootStyleResult;
15
-
16
- export { cleanupRootStyle };
@@ -1,10 +0,0 @@
1
- import { SVG } from '../index.js';
2
- import '@iconify/types';
3
- import '@iconify/utils/lib/customisations/defaults';
4
-
5
- /**
6
- * Clean up SVG
7
- */
8
- declare function cleanupSVGRoot(svg: SVG): void;
9
-
10
- export { cleanupSVGRoot };
@@ -1,10 +0,0 @@
1
- import { SVG } from '../index.js';
2
- import '@iconify/types';
3
- import '@iconify/utils/lib/customisations/defaults';
4
-
5
- /**
6
- * Expand inline style
7
- */
8
- declare function convertStyleToAttrs(svg: SVG): void;
9
-
10
- export { convertStyleToAttrs };
@@ -1,15 +0,0 @@
1
- import { SVG } from './index.js';
2
- import { CheckBadTagsOptions } from './cleanup/bad-tags.js';
3
- import '@iconify/types';
4
- import '@iconify/utils/lib/customisations/defaults';
5
-
6
- /**
7
- * Options
8
- */
9
- type CleanupSVGOptions = CheckBadTagsOptions;
10
- /**
11
- * Clean up SVG before parsing/optimising it
12
- */
13
- declare function cleanupSVG(svg: SVG, options?: CleanupSVGOptions): void;
14
-
15
- export { CleanupSVGOptions, cleanupSVG };
@@ -1,77 +0,0 @@
1
- /**
2
- * This list is highly opinionated. It is designed to handle icons that can be safely embedded in HTML and linked as external source.
3
- * Icons cannot have anything that requires external resources, anything that renders inconsistently.
4
- */
5
- /***** Attributes that are not part of tag specific stuff *****/
6
- /**
7
- * Attributes that icons should not mess with or that are irrelevant. They should be removed
8
- */
9
- declare const badAttributes: Set<string>;
10
- /**
11
- * Attributes for SVG element that should be removed
12
- */
13
- declare const junkSVGAttributes: Set<string>;
14
- /**
15
- * Attributes and styles often added by bad software to wrong tags, such as Adobe Illustrator and Inkscape
16
- */
17
- declare const badSoftwareAttributes: Set<string>;
18
- declare const badAttributePrefixes: Set<string>;
19
- /**
20
- * Common attributes that can exist on any element
21
- */
22
- declare const commonAttributes: Set<string>;
23
- declare const stylingAttributes: Set<string>;
24
- /**
25
- * Attributes that exist only on child elements of <clipPath>
26
- */
27
- declare const insideClipPathAttributes: Set<string>;
28
- /***** Other attributes, added to tagSpecificAttributes variable below *****/
29
- /**
30
- * Presentational attributes
31
- */
32
- declare const fillPresentationalAttributes: Set<string>;
33
- declare const strokePresentationalAttributes: Set<string>;
34
- declare const urlPresentationalAttributes: Set<string>;
35
- declare const visibilityPresentationalAttributes: Set<string>;
36
- declare const commonColorPresentationalAttributes: Set<string>;
37
- declare const otherPresentationalAttributes: Set<string>;
38
- declare const presentationalAttributes: Set<string>;
39
- /**
40
- * Markers
41
- *
42
- * Presentational attributes
43
- */
44
- declare const markerAttributes: Set<string>;
45
- /**
46
- * Shapes
47
- *
48
- * Not presentational
49
- */
50
- declare const otherShapeAttributes: Set<string>;
51
- /**
52
- * Animations
53
- */
54
- declare const animationTimingAttributes: Set<string>;
55
- declare const animationValueAttributes: Set<string>;
56
- declare const otherAnimationAttributes: Set<string>;
57
- /**
58
- * Gradients
59
- */
60
- declare const commonGradientAttributes: Set<string>;
61
- /**
62
- * Filters
63
- */
64
- declare const commonFeAttributes: Set<string>;
65
- declare const feFuncAttributes: Set<string>;
66
- /**
67
- * Tag specific attributes
68
- */
69
- declare const tagSpecificAnimatedAttributes: Record<string, Set<string>>;
70
- declare const tagSpecificPresentationalAttributes: Record<string, Set<string>>;
71
- declare const tagSpecificNonPresentationalAttributes: Record<string, Set<string>>;
72
- /**
73
- * Styles to keep in tags
74
- */
75
- declare const tagSpecificInlineStyles: Record<string, Set<string>>;
76
-
77
- export { animationTimingAttributes, animationValueAttributes, badAttributePrefixes, badAttributes, badSoftwareAttributes, commonAttributes, commonColorPresentationalAttributes, commonFeAttributes, commonGradientAttributes, feFuncAttributes, fillPresentationalAttributes, insideClipPathAttributes, junkSVGAttributes, markerAttributes, otherAnimationAttributes, otherPresentationalAttributes, otherShapeAttributes, presentationalAttributes, strokePresentationalAttributes, stylingAttributes, tagSpecificAnimatedAttributes, tagSpecificInlineStyles, tagSpecificNonPresentationalAttributes, tagSpecificPresentationalAttributes, urlPresentationalAttributes, visibilityPresentationalAttributes };
@@ -1,95 +0,0 @@
1
- /**
2
- * This list is highly opinionated. It is designed to handle icons that can be safely embedded in HTML and linked as external source.
3
- * Icons cannot have anything that requires external resources, anything that renders inconsistently.
4
- */
5
- /**
6
- * Bad tags
7
- *
8
- * Parser should throw error if one of these tags is found
9
- *
10
- * List includes text tags because:
11
- * - it usuaully uses custom font, which makes things much more complex
12
- * - it renders differently on different operating systems and browsers
13
- *
14
- * View tag is not allowed because it requires targeting view by id from external source, making it unusable in embedded icons.
15
- */
16
- declare const badTags: Set<string>;
17
- /**
18
- * Deprecated or irrelevant tags
19
- *
20
- * Tags that are quietly removed
21
- */
22
- declare const unsupportedTags: Set<string>;
23
- /**
24
- * Style
25
- */
26
- declare const styleTag: Set<string>;
27
- /**
28
- * Definitions: reusable elements inside
29
- */
30
- declare const defsTag: Set<string>;
31
- /**
32
- * Masks: colors are ignored, elements must have id
33
- */
34
- declare const maskTags: Set<string>;
35
- /**
36
- * Symbol
37
- */
38
- declare const symbolTag: Set<string>;
39
- /**
40
- * SVG shapes
41
- */
42
- declare const shapeTags: Set<string>;
43
- /**
44
- * Use
45
- */
46
- declare const useTag: Set<string>;
47
- /**
48
- * Groups
49
- */
50
- declare const groupTag: Set<string>;
51
- /**
52
- * Marker, should be inside <defs>
53
- */
54
- declare const markerTag: Set<string>;
55
- /**
56
- * SVG animations
57
- */
58
- declare const animateTags: Set<string>;
59
- declare const animateMotionChildTags: Set<string>;
60
- /**
61
- * Gradients, should be inside <defs>
62
- */
63
- declare const gradientTags: Set<string>;
64
- /**
65
- * Gradient color, must be inside one of gradientTags
66
- */
67
- declare const gradientChildTags: Set<string>;
68
- /**
69
- * Pattern, should be inside <defs>
70
- */
71
- declare const patternTag: Set<string>;
72
- /**
73
- * Filters
74
- */
75
- declare const filterTag: Set<string>;
76
- declare const feLightningTags: Set<string>;
77
- declare const filterChildTags: Set<string>;
78
- declare const feComponentTransferChildTag: Set<string>;
79
- declare const feLightningChildTags: Set<string>;
80
- declare const feMergeChildTags: Set<string>;
81
- /***** Combination of tags *****/
82
- /**
83
- * Reusable elements that use colors
84
- *
85
- * Most are used via color attributes like `fill`
86
- * Some are used via custom attributes like `marker-start`
87
- * Filter is used via `filter`
88
- */
89
- declare const reusableElementsWithPalette: Set<string>;
90
- /**
91
- * All supported tags
92
- */
93
- declare const allValidTags: Set<string>;
94
-
95
- export { allValidTags, animateMotionChildTags, animateTags, badTags, defsTag, feComponentTransferChildTag, feLightningChildTags, feLightningTags, feMergeChildTags, filterChildTags, filterTag, gradientChildTags, gradientTags, groupTag, markerTag, maskTags, patternTag, reusableElementsWithPalette, shapeTags, styleTag, symbolTag, unsupportedTags, useTag };
@@ -1,47 +0,0 @@
1
- import { IconifyIcon } from '@iconify/types';
2
- export { IconifyIcon } from '@iconify/types';
3
- import { IconifyIconCustomisations } from '@iconify/utils/lib/customisations/defaults';
4
- export { IconifyIconCustomisations } from '@iconify/utils/lib/customisations/defaults';
5
-
6
- interface ViewBox {
7
- left: number;
8
- top: number;
9
- width: number;
10
- height: number;
11
- }
12
-
13
- /**
14
- * SVG class, used to manipulate icon content.
15
- */
16
- declare class SVG {
17
- $svg: cheerio.Root;
18
- viewBox: ViewBox;
19
- /**
20
- * Constructor
21
- */
22
- constructor(content: string);
23
- /**
24
- * Get SVG as string
25
- */
26
- toString(customisations?: IconifyIconCustomisations): string;
27
- /**
28
- * Get SVG as string without whitespaces
29
- */
30
- toMinifiedString(customisations?: IconifyIconCustomisations): string;
31
- /**
32
- * Get body
33
- */
34
- getBody(): string;
35
- /**
36
- * Get icon as IconifyIcon
37
- */
38
- getIcon(): IconifyIcon;
39
- /**
40
- * Load SVG
41
- *
42
- * @param {string} content
43
- */
44
- load(content: string): void;
45
- }
46
-
47
- export { SVG, ViewBox };
@@ -1,63 +0,0 @@
1
- import { SVG } from './index.js';
2
- import { CSSRuleToken, CSSToken, CSSAtRuleToken } from '../css/parser/types.js';
3
- import { ParseSVGCallbackItem } from './parse.js';
4
- import '@iconify/types';
5
- import '@iconify/utils/lib/customisations/defaults';
6
- import '../misc/cheerio.js';
7
-
8
- /**
9
- * Item in callback
10
- */
11
- interface ParseSVGStyleCallbackItemCommon {
12
- prop: string;
13
- value: string;
14
- }
15
- interface ParseSVGStyleCallbackItemInline extends ParseSVGStyleCallbackItemCommon {
16
- type: 'inline';
17
- item: ParseSVGCallbackItem;
18
- }
19
- interface ParseSVGStyleCallbackItemGlobal extends ParseSVGStyleCallbackItemCommon {
20
- type: 'global';
21
- token: CSSRuleToken;
22
- selectors: string[];
23
- selectorTokens: CSSToken[];
24
- prevTokens: (CSSToken | null)[];
25
- nextTokens: CSSToken[];
26
- }
27
- interface ParseSVGStyleCallbackItemGlobalAtRule extends ParseSVGStyleCallbackItemCommon {
28
- token: CSSAtRuleToken;
29
- childTokens: CSSToken[];
30
- prevTokens: (CSSToken | null)[];
31
- nextTokens: CSSToken[];
32
- }
33
- interface ParseSVGStyleCallbackItemGlobalGenericAtRule extends ParseSVGStyleCallbackItemGlobalAtRule {
34
- type: 'at-rule';
35
- }
36
- interface ParseSVGStyleCallbackItemGlobalKeyframesAtRule extends ParseSVGStyleCallbackItemGlobalAtRule {
37
- type: 'keyframes';
38
- from: Record<string, string>;
39
- }
40
- type ParseSVGStyleCallbackItem = ParseSVGStyleCallbackItemInline | ParseSVGStyleCallbackItemGlobal | ParseSVGStyleCallbackItemGlobalGenericAtRule | ParseSVGStyleCallbackItemGlobalKeyframesAtRule;
41
- /**
42
- * Result: undefined to remove item, string to change/keep item
43
- */
44
- type ParseSVGStyleCallbackResult = string | undefined;
45
- /**
46
- * Callback function
47
- */
48
- type ParseSVGStyleCallback = (item: ParseSVGStyleCallbackItem) => ParseSVGStyleCallbackResult | Promise<ParseSVGStyleCallbackResult>;
49
- type ParseSVGStyleCallbackSync = (item: ParseSVGStyleCallbackItem) => ParseSVGStyleCallbackResult;
50
- /**
51
- * Parse styles in SVG
52
- *
53
- * This function finds CSS in SVG, parses it, calls callback for each rule.
54
- * Callback should return new value (string) or undefined to remove rule.
55
- * Callback can be asynchronous.
56
- */
57
- declare function parseSVGStyle(svg: SVG, callback: ParseSVGStyleCallback): Promise<void>;
58
- /**
59
- * Synchronous version
60
- */
61
- declare function parseSVGStyleSync(svg: SVG, callback: ParseSVGStyleCallbackSync): void;
62
-
63
- export { ParseSVGStyleCallback, ParseSVGStyleCallbackItem, ParseSVGStyleCallbackResult, ParseSVGStyleCallbackSync, parseSVGStyle, parseSVGStyleSync };
@@ -1,36 +0,0 @@
1
- import { CheerioElement, WrappedCheerioElement } from '../misc/cheerio.js';
2
- import { SVG } from './index.js';
3
- import '@iconify/types';
4
- import '@iconify/utils/lib/customisations/defaults';
5
-
6
- /**
7
- * Item in callback
8
- */
9
- interface ParseSVGCallbackItem {
10
- tagName: string;
11
- element: CheerioElement;
12
- $element: WrappedCheerioElement;
13
- svg: SVG;
14
- parents: ParseSVGCallbackItem[];
15
- testChildren: boolean;
16
- removeNode: boolean;
17
- }
18
- /**
19
- * Callback function
20
- */
21
- type Callback<T> = (item: ParseSVGCallbackItem) => T;
22
- type ParseSVGCallback = Callback<void | Promise<void>>;
23
- type ParseSVGCallbackSync = Callback<void>;
24
- /**
25
- * Parse SVG
26
- *
27
- * This function finds all elements in SVG and calls callback for each element.
28
- * Callback can be asynchronous.
29
- */
30
- declare function parseSVG(svg: SVG, callback: ParseSVGCallback): Promise<void>;
31
- /**
32
- * Sync version
33
- */
34
- declare function parseSVGSync(svg: SVG, callback: ParseSVGCallbackSync): void;
35
-
36
- export { ParseSVGCallback, ParseSVGCallbackItem, ParseSVGCallbackSync, parseSVG, parseSVGSync };