@iconify/tools 3.0.2 → 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.
- package/README.md +1 -1
- package/lib/export/json-package.cjs +1 -0
- package/lib/export/json-package.mjs +1 -0
- package/license.txt +1 -1
- package/package.json +17 -17
- package/lib/colors/attribs.d.ts +0 -27
- package/lib/colors/detect.d.ts +0 -15
- package/lib/colors/parse.d.ts +0 -67
- package/lib/colors/validate.d.ts +0 -26
- package/lib/css/parse.d.ts +0 -6
- package/lib/css/parser/error.d.ts +0 -13
- package/lib/css/parser/export.d.ts +0 -8
- package/lib/css/parser/strings.d.ts +0 -16
- package/lib/css/parser/text.d.ts +0 -20
- package/lib/css/parser/tokens.d.ts +0 -9
- package/lib/css/parser/tree.d.ts +0 -8
- package/lib/css/parser/types.d.ts +0 -52
- package/lib/download/api/cache.d.ts +0 -20
- package/lib/download/api/download.d.ts +0 -8
- package/lib/download/api/index.d.ts +0 -8
- package/lib/download/api/types.d.ts +0 -17
- package/lib/download/git/branch.d.ts +0 -8
- package/lib/download/git/hash.d.ts +0 -8
- package/lib/download/git/index.d.ts +0 -29
- package/lib/download/git/reset.d.ts +0 -6
- package/lib/download/github/hash.d.ts +0 -8
- package/lib/download/github/index.d.ts +0 -31
- package/lib/download/github/types.d.ts +0 -11
- package/lib/download/gitlab/hash.d.ts +0 -8
- package/lib/download/gitlab/index.d.ts +0 -31
- package/lib/download/gitlab/types.d.ts +0 -15
- package/lib/download/helpers/untar.d.ts +0 -6
- package/lib/download/helpers/unzip.d.ts +0 -6
- package/lib/download/index.d.ts +0 -48
- package/lib/download/npm/index.d.ts +0 -30
- package/lib/download/npm/types.d.ts +0 -9
- package/lib/download/npm/version.d.ts +0 -16
- package/lib/download/types/modified.d.ts +0 -6
- package/lib/download/types/sources.d.ts +0 -12
- package/lib/export/directory.d.ts +0 -25
- package/lib/export/helpers/custom-files.d.ts +0 -12
- package/lib/export/helpers/prepare.d.ts +0 -19
- package/lib/export/helpers/types-version.d.ts +0 -6
- package/lib/export/icon-package.d.ts +0 -25
- package/lib/export/json-package.d.ts +0 -23
- package/lib/icon-set/index.d.ts +0 -161
- package/lib/icon-set/match.d.ts +0 -14
- package/lib/icon-set/merge.d.ts +0 -13
- package/lib/icon-set/modified.d.ts +0 -15
- package/lib/icon-set/props.d.ts +0 -13
- package/lib/icon-set/tags.d.ts +0 -22
- package/lib/icon-set/types.d.ts +0 -75
- package/lib/import/directory.d.ts +0 -51
- package/lib/import/figma/index.d.ts +0 -19
- package/lib/import/figma/nodes.d.ts +0 -17
- package/lib/import/figma/query.d.ts +0 -28
- package/lib/import/figma/types/api.d.ts +0 -53
- package/lib/import/figma/types/nodes.d.ts +0 -43
- package/lib/import/figma/types/options.d.ts +0 -58
- package/lib/import/figma/types/result.d.ts +0 -43
- package/lib/index.d.ts +0 -72
- package/lib/misc/bump-version.d.ts +0 -6
- package/lib/misc/cheerio.d.ts +0 -7
- package/lib/misc/compare-dirs.d.ts +0 -11
- package/lib/misc/exec.d.ts +0 -12
- package/lib/misc/keyword.d.ts +0 -6
- package/lib/misc/scan.d.ts +0 -33
- package/lib/misc/write-json.d.ts +0 -6
- package/lib/optimise/flags.d.ts +0 -10
- package/lib/optimise/global-style.d.ts +0 -10
- package/lib/optimise/origin.d.ts +0 -10
- package/lib/optimise/scale.d.ts +0 -10
- package/lib/optimise/svgo.d.ts +0 -36
- package/lib/svg/analyse/error.d.ts +0 -8
- package/lib/svg/analyse/types.d.ts +0 -89
- package/lib/svg/analyse.d.ts +0 -13
- package/lib/svg/cleanup/attribs.d.ts +0 -10
- package/lib/svg/cleanup/bad-tags.d.ts +0 -16
- package/lib/svg/cleanup/inline-style.d.ts +0 -10
- package/lib/svg/cleanup/root-style.d.ts +0 -16
- package/lib/svg/cleanup/root-svg.d.ts +0 -10
- package/lib/svg/cleanup/svgo-style.d.ts +0 -10
- package/lib/svg/cleanup.d.ts +0 -15
- package/lib/svg/data/attributes.d.ts +0 -77
- package/lib/svg/data/tags.d.ts +0 -95
- package/lib/svg/index.d.ts +0 -47
- package/lib/svg/parse-style.d.ts +0 -63
- package/lib/svg/parse.d.ts +0 -36
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { APICacheOptions } from '../../download/api/types.js';
|
|
2
|
-
import { DocumentNotModified } from '../../download/types/modified.js';
|
|
3
|
-
import { FigmaDocument } from './types/api.js';
|
|
4
|
-
import { FigmaIfModifiedSinceOption, FigmaFilesQueryOptions, FigmaImagesQueryOptions } from './types/options.js';
|
|
5
|
-
import { FigmaNodesImportResult } from './types/result.js';
|
|
6
|
-
import '../../icon-set/index.js';
|
|
7
|
-
import '@iconify/types';
|
|
8
|
-
import '@iconify/utils/lib/customisations/defaults';
|
|
9
|
-
import '../../icon-set/types.js';
|
|
10
|
-
import '../../svg/index.js';
|
|
11
|
-
import '@iconify/utils/lib/icon-set/tree';
|
|
12
|
-
import './types/nodes.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Get Figma files
|
|
16
|
-
*/
|
|
17
|
-
declare function figmaFilesQuery<T extends FigmaIfModifiedSinceOption & FigmaFilesQueryOptions>(options: T, cache?: APICacheOptions): Promise<FigmaDocument | DocumentNotModified>;
|
|
18
|
-
declare function figmaFilesQuery(options: FigmaFilesQueryOptions, cache?: APICacheOptions): Promise<FigmaDocument>;
|
|
19
|
-
/**
|
|
20
|
-
* Generate all images
|
|
21
|
-
*/
|
|
22
|
-
declare function figmaImagesQuery(options: FigmaImagesQueryOptions, nodes: FigmaNodesImportResult, cache?: APICacheOptions): Promise<FigmaNodesImportResult>;
|
|
23
|
-
/**
|
|
24
|
-
* Download all images
|
|
25
|
-
*/
|
|
26
|
-
declare function figmaDownloadImages(nodes: FigmaNodesImportResult, cache?: APICacheOptions): Promise<FigmaNodesImportResult>;
|
|
27
|
-
|
|
28
|
-
export { figmaDownloadImages, figmaFilesQuery, figmaImagesQuery };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Basic document structure
|
|
3
|
-
*/
|
|
4
|
-
interface FigmaBoundingBox {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
}
|
|
10
|
-
interface BaseFigmaNode {
|
|
11
|
-
id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
}
|
|
14
|
-
interface GenericFigmaNode extends BaseFigmaNode {
|
|
15
|
-
type: string;
|
|
16
|
-
children?: FigmaNode[];
|
|
17
|
-
}
|
|
18
|
-
interface IconFigmaNode extends BaseFigmaNode {
|
|
19
|
-
type: 'FRAME' | 'COMPONENT' | 'INSTANCE';
|
|
20
|
-
clipsContent?: boolean;
|
|
21
|
-
absoluteBoundingBox?: FigmaBoundingBox;
|
|
22
|
-
children: FigmaNode[];
|
|
23
|
-
}
|
|
24
|
-
interface FigmaDocumentNode extends BaseFigmaNode {
|
|
25
|
-
type: 'DOCUMENT';
|
|
26
|
-
children: FigmaNode[];
|
|
27
|
-
}
|
|
28
|
-
type FigmaNode = GenericFigmaNode | IconFigmaNode;
|
|
29
|
-
/**
|
|
30
|
-
* Document response from API
|
|
31
|
-
*/
|
|
32
|
-
interface FigmaDocument {
|
|
33
|
-
document: FigmaDocumentNode;
|
|
34
|
-
name: string;
|
|
35
|
-
version: string;
|
|
36
|
-
lastModified: string;
|
|
37
|
-
thumbnailUrl: string;
|
|
38
|
-
role: string;
|
|
39
|
-
editorType: 'figma' | 'figjam';
|
|
40
|
-
}
|
|
41
|
-
interface FigmaAPIError {
|
|
42
|
-
status: number;
|
|
43
|
-
err: string;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Result for retrieved icons
|
|
47
|
-
*/
|
|
48
|
-
interface FigmaAPIImagesResponse {
|
|
49
|
-
err?: string | null;
|
|
50
|
-
images: Record<string, string | null>;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { FigmaAPIError, FigmaAPIImagesResponse, FigmaDocument, FigmaDocumentNode, FigmaNode, IconFigmaNode };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { IconFigmaNode, FigmaDocument } from './api.js';
|
|
2
|
-
import { FigmaNodesImportResult, FigmaIconNode } from './result.js';
|
|
3
|
-
import '../../../icon-set/index.js';
|
|
4
|
-
import '@iconify/types';
|
|
5
|
-
import '@iconify/utils/lib/customisations/defaults';
|
|
6
|
-
import '../../../icon-set/types.js';
|
|
7
|
-
import '../../../svg/index.js';
|
|
8
|
-
import '@iconify/utils/lib/icon-set/tree';
|
|
9
|
-
|
|
10
|
-
type FigmaImportParentNodeType = 'CANVAS' | 'FRAME' | 'GROUP' | 'SECTION';
|
|
11
|
-
type FigmaImportIconNodeType = IconFigmaNode['type'];
|
|
12
|
-
/**
|
|
13
|
-
* Node information passed to callback
|
|
14
|
-
*/
|
|
15
|
-
interface FigmaParentNodeData {
|
|
16
|
-
id: string;
|
|
17
|
-
type: FigmaImportParentNodeType;
|
|
18
|
-
name: string;
|
|
19
|
-
}
|
|
20
|
-
interface FigmaImportNodeData {
|
|
21
|
-
id: string;
|
|
22
|
-
type: FigmaImportIconNodeType;
|
|
23
|
-
name: string;
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
parents: FigmaParentNodeData[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Callback to check if node needs to be checked for icons
|
|
30
|
-
*
|
|
31
|
-
* Used to speed up processing by eleminating pages, frames and groups that do not need processing
|
|
32
|
-
*/
|
|
33
|
-
type FigmaImportParentNodeFilter = (node: FigmaParentNodeData[], document: FigmaDocument) => boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Check if node is an icon.
|
|
36
|
-
*
|
|
37
|
-
* Returns icon name on success, null or undefined if not should be ignored.
|
|
38
|
-
* Function can also return FigmaIconNode object, where it can put extra properties that can be used later
|
|
39
|
-
*/
|
|
40
|
-
type FigmaIconNodeWithKeyword = Partial<FigmaIconNode> & Pick<FigmaIconNode, 'keyword'>;
|
|
41
|
-
type FigmaImportNodeFilter = (node: FigmaImportNodeData, nodes: FigmaNodesImportResult, document: FigmaDocument) => string | FigmaIconNodeWithKeyword | null | undefined;
|
|
42
|
-
|
|
43
|
-
export { FigmaImportIconNodeType, FigmaImportNodeData, FigmaImportNodeFilter, FigmaImportParentNodeFilter, FigmaImportParentNodeType, FigmaParentNodeData };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { IconSet } from '../../../icon-set/index.js';
|
|
2
|
-
import { FigmaImportParentNodeFilter, FigmaImportNodeFilter } from './nodes.js';
|
|
3
|
-
import { FigmaIconNode } from './result.js';
|
|
4
|
-
import '@iconify/types';
|
|
5
|
-
import '@iconify/utils/lib/customisations/defaults';
|
|
6
|
-
import '../../../icon-set/types.js';
|
|
7
|
-
import '../../../svg/index.js';
|
|
8
|
-
import '@iconify/utils/lib/icon-set/tree';
|
|
9
|
-
import './api.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Options for importing SVG
|
|
13
|
-
*/
|
|
14
|
-
interface FigmaImportSVGOptions {
|
|
15
|
-
includeID?: boolean;
|
|
16
|
-
simplifyStroke?: boolean;
|
|
17
|
-
useAbsoluteBounds?: boolean;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Options
|
|
21
|
-
*/
|
|
22
|
-
interface FigmaImportCommonOptions {
|
|
23
|
-
token: string;
|
|
24
|
-
file: string;
|
|
25
|
-
version?: string;
|
|
26
|
-
}
|
|
27
|
-
interface FigmaIfModifiedSinceOption {
|
|
28
|
-
ifModifiedSince: string | Date | true;
|
|
29
|
-
}
|
|
30
|
-
interface FigmaFilesQueryOptions extends FigmaImportCommonOptions, Partial<FigmaIfModifiedSinceOption> {
|
|
31
|
-
ids?: string[];
|
|
32
|
-
depth?: number;
|
|
33
|
-
}
|
|
34
|
-
interface FigmaImagesQueryOptions extends FigmaImportCommonOptions {
|
|
35
|
-
svgOptions?: FigmaImportSVGOptions;
|
|
36
|
-
}
|
|
37
|
-
interface FigmaGetIconNodesOptions {
|
|
38
|
-
pages?: string[];
|
|
39
|
-
filterParentNode?: FigmaImportParentNodeFilter;
|
|
40
|
-
iconNameForNode: FigmaImportNodeFilter;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Callback to call before or after importing icon
|
|
44
|
-
*/
|
|
45
|
-
type FigmaImportedIconCallback = (node: FigmaIconNode, iconSet: IconSet) => void | Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* Options for main import function
|
|
48
|
-
*/
|
|
49
|
-
interface FigmaImportOptions extends FigmaFilesQueryOptions, FigmaImagesQueryOptions, FigmaGetIconNodesOptions {
|
|
50
|
-
prefix: string;
|
|
51
|
-
cacheDir?: string;
|
|
52
|
-
cacheAPITTL?: number;
|
|
53
|
-
cacheSVGTTL?: number;
|
|
54
|
-
beforeImportingIcon?: FigmaImportedIconCallback;
|
|
55
|
-
afterImportingIcon?: FigmaImportedIconCallback;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export { FigmaFilesQueryOptions, FigmaGetIconNodesOptions, FigmaIfModifiedSinceOption, FigmaImagesQueryOptions, FigmaImportOptions, FigmaImportSVGOptions };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { IconSet } from '../../../icon-set/index.js';
|
|
2
|
-
import '@iconify/types';
|
|
3
|
-
import '@iconify/utils/lib/customisations/defaults';
|
|
4
|
-
import '../../../icon-set/types.js';
|
|
5
|
-
import '../../../svg/index.js';
|
|
6
|
-
import '@iconify/utils/lib/icon-set/tree';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Result for found icons
|
|
10
|
-
*/
|
|
11
|
-
interface FigmaIconNode {
|
|
12
|
-
id: string;
|
|
13
|
-
name: string;
|
|
14
|
-
keyword: string;
|
|
15
|
-
url?: string;
|
|
16
|
-
content?: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Nodes count
|
|
20
|
-
*/
|
|
21
|
-
interface FigmaNodesCount {
|
|
22
|
-
nodesCount: number;
|
|
23
|
-
generatedIconsCount: number;
|
|
24
|
-
downloadedIconsCount: number;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Import result for icons
|
|
28
|
-
*/
|
|
29
|
-
interface FigmaNodesImportResult extends Partial<FigmaNodesCount> {
|
|
30
|
-
icons: Record<string, FigmaIconNode>;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Import result
|
|
34
|
-
*/
|
|
35
|
-
interface FigmaImportResult extends FigmaNodesCount {
|
|
36
|
-
name: string;
|
|
37
|
-
version: string;
|
|
38
|
-
lastModified: string;
|
|
39
|
-
iconSet: IconSet;
|
|
40
|
-
missing: FigmaIconNode[];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { FigmaIconNode, FigmaImportResult, FigmaNodesCount, FigmaNodesImportResult };
|
package/lib/index.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
export { SVG } from './svg/index.js';
|
|
2
|
-
export { parseSVG, parseSVGSync } from './svg/parse.js';
|
|
3
|
-
export { parseSVGStyle, parseSVGStyleSync } from './svg/parse-style.js';
|
|
4
|
-
export { analyseSVGStructure } from './svg/analyse.js';
|
|
5
|
-
export { cleanupSVG } from './svg/cleanup.js';
|
|
6
|
-
export { removeBadAttributes } from './svg/cleanup/attribs.js';
|
|
7
|
-
export { checkBadTags } from './svg/cleanup/bad-tags.js';
|
|
8
|
-
export { cleanupRootStyle } from './svg/cleanup/root-style.js';
|
|
9
|
-
export { cleanupInlineStyle } from './svg/cleanup/inline-style.js';
|
|
10
|
-
export { cleanupSVGRoot } from './svg/cleanup/root-svg.js';
|
|
11
|
-
export { convertStyleToAttrs } from './svg/cleanup/svgo-style.js';
|
|
12
|
-
export { IconSet, blankIconSet } from './icon-set/index.js';
|
|
13
|
-
export { mergeIconSets } from './icon-set/merge.js';
|
|
14
|
-
export { addTagsToIconSet } from './icon-set/tags.js';
|
|
15
|
-
export { importFromFigma } from './import/figma/index.js';
|
|
16
|
-
export { importDirectory, importDirectorySync } from './import/directory.js';
|
|
17
|
-
export { downloadGitRepo } from './download/git/index.js';
|
|
18
|
-
export { getGitRepoHash } from './download/git/hash.js';
|
|
19
|
-
export { getGitRepoBranch } from './download/git/branch.js';
|
|
20
|
-
export { resetGitRepoContents } from './download/git/reset.js';
|
|
21
|
-
export { downloadGitHubRepo } from './download/github/index.js';
|
|
22
|
-
export { getGitHubRepoHash } from './download/github/hash.js';
|
|
23
|
-
export { downloadGitLabRepo } from './download/gitlab/index.js';
|
|
24
|
-
export { getGitLabRepoHash } from './download/gitlab/hash.js';
|
|
25
|
-
export { downloadNPMPackage } from './download/npm/index.js';
|
|
26
|
-
export { getNPMVersion, getPackageVersion } from './download/npm/version.js';
|
|
27
|
-
export { downloadPackage } from './download/index.js';
|
|
28
|
-
export { downloadFile } from './download/api/download.js';
|
|
29
|
-
export { isEmptyColor, parseColors, parseColorsSync } from './colors/parse.js';
|
|
30
|
-
export { validateColors, validateColorsSync } from './colors/validate.js';
|
|
31
|
-
export { detectIconSetPalette } from './colors/detect.js';
|
|
32
|
-
export { runSVGO } from './optimise/svgo.js';
|
|
33
|
-
export { deOptimisePaths } from './optimise/flags.js';
|
|
34
|
-
export { resetSVGOrigin } from './optimise/origin.js';
|
|
35
|
-
export { scaleSVG } from './optimise/scale.js';
|
|
36
|
-
export { cleanupGlobalStyle } from './optimise/global-style.js';
|
|
37
|
-
export { exportToDirectory } from './export/directory.js';
|
|
38
|
-
export { exportIconPackage } from './export/icon-package.js';
|
|
39
|
-
export { exportJSONPackage } from './export/json-package.js';
|
|
40
|
-
export { writeJSONFile } from './misc/write-json.js';
|
|
41
|
-
export { prepareDirectoryForExport } from './export/helpers/prepare.js';
|
|
42
|
-
export { scanDirectory, scanDirectorySync } from './misc/scan.js';
|
|
43
|
-
export { compareDirectories } from './misc/compare-dirs.js';
|
|
44
|
-
export { unzip } from './download/helpers/unzip.js';
|
|
45
|
-
export { untar } from './download/helpers/untar.js';
|
|
46
|
-
export { execAsync } from './misc/exec.js';
|
|
47
|
-
export { cleanupIconKeyword } from './misc/keyword.js';
|
|
48
|
-
export { bumpVersion } from './misc/bump-version.js';
|
|
49
|
-
export { sendAPIQuery } from './download/api/index.js';
|
|
50
|
-
import '@iconify/types';
|
|
51
|
-
import '@iconify/utils/lib/customisations/defaults';
|
|
52
|
-
import './misc/cheerio.js';
|
|
53
|
-
import './css/parser/types.js';
|
|
54
|
-
import './svg/analyse/types.js';
|
|
55
|
-
import './icon-set/types.js';
|
|
56
|
-
import '@iconify/utils/lib/icon-set/tree';
|
|
57
|
-
import './download/types/modified.js';
|
|
58
|
-
import './import/figma/types/options.js';
|
|
59
|
-
import './import/figma/types/nodes.js';
|
|
60
|
-
import './import/figma/types/api.js';
|
|
61
|
-
import './import/figma/types/result.js';
|
|
62
|
-
import './download/types/sources.js';
|
|
63
|
-
import './download/github/types.js';
|
|
64
|
-
import './download/gitlab/types.js';
|
|
65
|
-
import './download/npm/types.js';
|
|
66
|
-
import './download/api/types.js';
|
|
67
|
-
import '@iconify/utils/lib/colors/types';
|
|
68
|
-
import './colors/attribs.js';
|
|
69
|
-
import 'svgo';
|
|
70
|
-
import './export/helpers/custom-files.js';
|
|
71
|
-
import 'fs';
|
|
72
|
-
import 'child_process';
|
package/lib/misc/cheerio.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface CompareDirectoriesOptions {
|
|
2
|
-
ignoreNewLine?: boolean;
|
|
3
|
-
ignoreVersions?: boolean;
|
|
4
|
-
textExtensions?: string[];
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Compare directories. Returns true if files are identical, false if different
|
|
8
|
-
*/
|
|
9
|
-
declare function compareDirectories(dir1: string, dir2: string, options?: CompareDirectoriesOptions): Promise<boolean>;
|
|
10
|
-
|
|
11
|
-
export { CompareDirectoriesOptions, compareDirectories };
|
package/lib/misc/exec.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ExecOptions } from 'child_process';
|
|
2
|
-
|
|
3
|
-
interface ExecResult {
|
|
4
|
-
stdout: string;
|
|
5
|
-
stderr: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Exec as Promise
|
|
9
|
-
*/
|
|
10
|
-
declare function execAsync(cmd: string, options?: ExecOptions): Promise<ExecResult>;
|
|
11
|
-
|
|
12
|
-
export { ExecResult, execAsync };
|
package/lib/misc/keyword.d.ts
DELETED
package/lib/misc/scan.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Stats } from 'fs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Callback
|
|
5
|
-
*
|
|
6
|
-
* Extension starts with '.' (can be empty)
|
|
7
|
-
* File does not include extension
|
|
8
|
-
* Subdir ends with '/' (can be empty)
|
|
9
|
-
*
|
|
10
|
-
* Should return:
|
|
11
|
-
* - false, null or undefined to skip file
|
|
12
|
-
* - true to include file (subdir + file + extension)
|
|
13
|
-
* - string to include custom string (such as file without extension)
|
|
14
|
-
* - custom object to return custom object
|
|
15
|
-
*/
|
|
16
|
-
type ScanDirectoryCallbackFalseResult = boolean | null | undefined;
|
|
17
|
-
type ScanDirectoryCallbackStringResult = ScanDirectoryCallbackFalseResult | string;
|
|
18
|
-
type Callback<T> = (ext: string, file: string, subdir: string, path: string, stat: Stats) => T;
|
|
19
|
-
type AsyncCallback<T> = Callback<T | Promise<T>>;
|
|
20
|
-
type ScanDirectoryCallback = AsyncCallback<ScanDirectoryCallbackStringResult | unknown>;
|
|
21
|
-
type ScanDirectorySyncCallback = Callback<ScanDirectoryCallbackStringResult | unknown>;
|
|
22
|
-
/**
|
|
23
|
-
* Find all files in directory
|
|
24
|
-
*/
|
|
25
|
-
declare function scanDirectory(path: string, callback?: AsyncCallback<ScanDirectoryCallbackStringResult>, subdirs?: boolean): Promise<string[]>;
|
|
26
|
-
declare function scanDirectory<T>(path: string, callback: AsyncCallback<T | ScanDirectoryCallbackFalseResult>, subdirs?: boolean): Promise<T[]>;
|
|
27
|
-
/**
|
|
28
|
-
* Find all files in directory, synchronously
|
|
29
|
-
*/
|
|
30
|
-
declare function scanDirectorySync(path: string, callback?: Callback<ScanDirectoryCallbackStringResult>, subdirs?: boolean): string[];
|
|
31
|
-
declare function scanDirectorySync<T>(path: string, callback: Callback<T | ScanDirectoryCallbackFalseResult>, subdirs?: boolean): T[];
|
|
32
|
-
|
|
33
|
-
export { ScanDirectoryCallback, ScanDirectorySyncCallback, scanDirectory, scanDirectorySync };
|
package/lib/misc/write-json.d.ts
DELETED
package/lib/optimise/flags.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SVG } from '../svg/index.js';
|
|
2
|
-
import '@iconify/types';
|
|
3
|
-
import '@iconify/utils/lib/customisations/defaults';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* De-optimise paths. Compressed paths are still not supported by some software.
|
|
7
|
-
*/
|
|
8
|
-
declare function deOptimisePaths(svg: SVG): Promise<void>;
|
|
9
|
-
|
|
10
|
-
export { deOptimisePaths };
|
package/lib/optimise/origin.d.ts
DELETED
package/lib/optimise/scale.d.ts
DELETED
package/lib/optimise/svgo.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { PluginConfig } from 'svgo';
|
|
2
|
-
import { SVG } from '../svg/index.js';
|
|
3
|
-
import '@iconify/types';
|
|
4
|
-
import '@iconify/utils/lib/customisations/defaults';
|
|
5
|
-
|
|
6
|
-
interface CleanupIDsOption {
|
|
7
|
-
cleanupIDs?: string | ((id: string) => string) | false;
|
|
8
|
-
}
|
|
9
|
-
interface GetSVGOPluginOptions extends CleanupIDsOption {
|
|
10
|
-
animated?: boolean;
|
|
11
|
-
keepShapes?: boolean;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Get list of plugins
|
|
15
|
-
*/
|
|
16
|
-
declare function getSVGOPlugins(options: GetSVGOPluginOptions): PluginConfig[];
|
|
17
|
-
/**
|
|
18
|
-
* Options
|
|
19
|
-
*/
|
|
20
|
-
interface SVGOCommonOptions {
|
|
21
|
-
multipass?: boolean;
|
|
22
|
-
}
|
|
23
|
-
interface SVGOOptionsWithPlugin extends SVGOCommonOptions {
|
|
24
|
-
plugins: PluginConfig[];
|
|
25
|
-
}
|
|
26
|
-
interface SVGOptionsWithoutPlugin extends SVGOCommonOptions, CleanupIDsOption {
|
|
27
|
-
plugins?: undefined;
|
|
28
|
-
keepShapes?: boolean;
|
|
29
|
-
}
|
|
30
|
-
type SVGOOptions = SVGOOptionsWithPlugin | SVGOptionsWithoutPlugin;
|
|
31
|
-
/**
|
|
32
|
-
* Run SVGO on icon
|
|
33
|
-
*/
|
|
34
|
-
declare function runSVGO(svg: SVG, options?: SVGOOptions): void;
|
|
35
|
-
|
|
36
|
-
export { getSVGOPlugins, runSVGO };
|
|
@@ -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 };
|
package/lib/svg/analyse.d.ts
DELETED
|
@@ -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,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,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 };
|