@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.
- package/README.md +1 -1
- package/lib/export/json-package.cjs +1 -0
- package/lib/export/json-package.mjs +1 -0
- package/lib/import/directory.cjs +26 -18
- package/lib/import/directory.mjs +26 -18
- package/lib/misc/keyword.cjs +1 -1
- package/lib/misc/keyword.mjs +1 -1
- 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
package/lib/icon-set/types.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { ExtendedIconifyIcon, ExtendedIconifyAlias, IconifyOptional, IconifyIcon } from '@iconify/types';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Category item
|
|
5
|
-
*/
|
|
6
|
-
interface IconCategory {
|
|
7
|
-
title: string;
|
|
8
|
-
count: number;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Get common properties: IconifyOptional + APIIconAttributes
|
|
12
|
-
*/
|
|
13
|
-
type CommonProps<A, B> = {
|
|
14
|
-
[K in keyof A & keyof B]?: A[K] extends B[K] ? A[K] : never;
|
|
15
|
-
};
|
|
16
|
-
type CommonIconProps = CommonProps<ExtendedIconifyIcon, ExtendedIconifyAlias>;
|
|
17
|
-
/**
|
|
18
|
-
* Exclude IconifyOptional from CommonIconProps
|
|
19
|
-
*/
|
|
20
|
-
type ExtraIconProps = Omit<CommonIconProps, keyof IconifyOptional>;
|
|
21
|
-
/**
|
|
22
|
-
* Partials
|
|
23
|
-
*/
|
|
24
|
-
interface IconWithChars {
|
|
25
|
-
chars: Set<string>;
|
|
26
|
-
}
|
|
27
|
-
interface IconWithPropsData extends IconWithChars {
|
|
28
|
-
props: CommonIconProps;
|
|
29
|
-
}
|
|
30
|
-
interface IconWithCategories {
|
|
31
|
-
categories: Set<IconCategory>;
|
|
32
|
-
}
|
|
33
|
-
interface IconParentData {
|
|
34
|
-
parent: string;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Icon types
|
|
38
|
-
*/
|
|
39
|
-
interface IconSetIcon extends IconWithPropsData, IconWithCategories {
|
|
40
|
-
type: 'icon';
|
|
41
|
-
body: string;
|
|
42
|
-
}
|
|
43
|
-
interface IconSetIconAlias extends IconWithChars, IconParentData {
|
|
44
|
-
type: 'alias';
|
|
45
|
-
}
|
|
46
|
-
interface IconSetIconVariation extends IconWithPropsData, IconParentData {
|
|
47
|
-
type: 'variation';
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* All icon types
|
|
51
|
-
*/
|
|
52
|
-
type IconSetIconEntry = IconSetIcon | IconSetIconAlias | IconSetIconVariation;
|
|
53
|
-
type IconSetIconType = IconSetIconEntry['type'];
|
|
54
|
-
/**
|
|
55
|
-
* Full icon with extra stuff
|
|
56
|
-
*/
|
|
57
|
-
interface ResolvedIconifyIcon extends IconifyIcon, ExtraIconProps {
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Result for checking theme: list of names for each theme
|
|
61
|
-
*/
|
|
62
|
-
interface CheckThemeResult {
|
|
63
|
-
valid: Record<string, string[]>;
|
|
64
|
-
invalid: string[];
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Callback for forEach functions
|
|
68
|
-
*
|
|
69
|
-
* Return false to stop loop
|
|
70
|
-
*/
|
|
71
|
-
type IconSetForEachCallbackResult = void | false;
|
|
72
|
-
type IconSetAsyncForEachCallback = (name: string, type: IconSetIconEntry['type']) => Promise<IconSetForEachCallbackResult> | IconSetForEachCallbackResult;
|
|
73
|
-
type IconSetSyncForEachCallback = (name: string, type: IconSetIconEntry['type']) => IconSetForEachCallbackResult;
|
|
74
|
-
|
|
75
|
-
export { CheckThemeResult, CommonIconProps, ExtraIconProps, IconCategory, IconParentData, IconSetAsyncForEachCallback, IconSetIcon, IconSetIconAlias, IconSetIconEntry, IconSetIconType, IconSetIconVariation, IconSetSyncForEachCallback, IconWithCategories, IconWithChars, IconWithPropsData, ResolvedIconifyIcon };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { IconSet } from '../icon-set/index.js';
|
|
2
|
-
import { CleanupSVGOptions } from '../svg/cleanup.js';
|
|
3
|
-
import '@iconify/types';
|
|
4
|
-
import '@iconify/utils/lib/customisations/defaults';
|
|
5
|
-
import '../icon-set/types.js';
|
|
6
|
-
import '../svg/index.js';
|
|
7
|
-
import '@iconify/utils/lib/icon-set/tree';
|
|
8
|
-
import '../svg/cleanup/bad-tags.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Entry for file
|
|
12
|
-
*/
|
|
13
|
-
interface ImportDirectoryFileEntry {
|
|
14
|
-
path: string;
|
|
15
|
-
subdir: string;
|
|
16
|
-
file: string;
|
|
17
|
-
ext: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Callback to get keyword for icon based on file name
|
|
21
|
-
*
|
|
22
|
-
* Returns:
|
|
23
|
-
* - string for new keyword
|
|
24
|
-
* - undefined to skip icon
|
|
25
|
-
*
|
|
26
|
-
* Callback can be asynchronous
|
|
27
|
-
*/
|
|
28
|
-
type ImportDirectoryKeywordCallbackResult = string | undefined;
|
|
29
|
-
type Callback<T> = (file: ImportDirectoryFileEntry, defaultKeyword: string, iconSet: IconSet) => T;
|
|
30
|
-
type AsyncCallback<T> = Callback<T | Promise<T>>;
|
|
31
|
-
type ImportDirectoryKeywordCallback = AsyncCallback<ImportDirectoryKeywordCallbackResult>;
|
|
32
|
-
type ImportDirectoryKeywordSyncCallback = Callback<ImportDirectoryKeywordCallbackResult>;
|
|
33
|
-
/**
|
|
34
|
-
* Options
|
|
35
|
-
*/
|
|
36
|
-
interface ImportDirectoryOptions<K> extends CleanupSVGOptions {
|
|
37
|
-
prefix?: string;
|
|
38
|
-
includeSubDirs?: boolean;
|
|
39
|
-
keyword?: K;
|
|
40
|
-
ignoreImportErrors?: boolean;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Import all icons from directory
|
|
44
|
-
*/
|
|
45
|
-
declare function importDirectory(path: string, options?: ImportDirectoryOptions<ImportDirectoryKeywordCallback>): Promise<IconSet>;
|
|
46
|
-
/**
|
|
47
|
-
* Import all icons from directory synchronously
|
|
48
|
-
*/
|
|
49
|
-
declare function importDirectorySync(path: string, options?: ImportDirectoryOptions<ImportDirectoryKeywordSyncCallback>): IconSet;
|
|
50
|
-
|
|
51
|
-
export { ImportDirectoryFileEntry, ImportDirectoryKeywordCallback, ImportDirectoryKeywordSyncCallback, importDirectory, importDirectorySync };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DocumentNotModified } from '../../download/types/modified.js';
|
|
2
|
-
import { FigmaIfModifiedSinceOption, FigmaImportOptions } from './types/options.js';
|
|
3
|
-
import { FigmaImportResult } from './types/result.js';
|
|
4
|
-
import '../../icon-set/index.js';
|
|
5
|
-
import '@iconify/types';
|
|
6
|
-
import '@iconify/utils/lib/customisations/defaults';
|
|
7
|
-
import '../../icon-set/types.js';
|
|
8
|
-
import '../../svg/index.js';
|
|
9
|
-
import '@iconify/utils/lib/icon-set/tree';
|
|
10
|
-
import './types/nodes.js';
|
|
11
|
-
import './types/api.js';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Import icon set from Figma
|
|
15
|
-
*/
|
|
16
|
-
declare function importFromFigma<T extends FigmaIfModifiedSinceOption & FigmaImportOptions>(options: T): Promise<FigmaImportResult | DocumentNotModified>;
|
|
17
|
-
declare function importFromFigma(options: FigmaImportOptions): Promise<FigmaImportResult>;
|
|
18
|
-
|
|
19
|
-
export { importFromFigma };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FigmaDocument } from './types/api.js';
|
|
2
|
-
import { FigmaGetIconNodesOptions } from './types/options.js';
|
|
3
|
-
import { FigmaNodesImportResult } from './types/result.js';
|
|
4
|
-
import '../../icon-set/index.js';
|
|
5
|
-
import '@iconify/types';
|
|
6
|
-
import '@iconify/utils/lib/customisations/defaults';
|
|
7
|
-
import '../../icon-set/types.js';
|
|
8
|
-
import '../../svg/index.js';
|
|
9
|
-
import '@iconify/utils/lib/icon-set/tree';
|
|
10
|
-
import './types/nodes.js';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Get node ids for icons
|
|
14
|
-
*/
|
|
15
|
-
declare function getFigmaIconNodes(document: FigmaDocument, options: FigmaGetIconNodesOptions): FigmaNodesImportResult;
|
|
16
|
-
|
|
17
|
-
export { getFigmaIconNodes };
|
|
@@ -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 };
|