@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
package/README.md
CHANGED
package/license.txt
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "Collection of functions for cleaning up and parsing SVG for Iconify project",
|
|
5
5
|
"author": "Vjacheslav Trushkin",
|
|
6
|
-
"version": "3.0.
|
|
6
|
+
"version": "3.0.3",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"bugs": "https://github.com/iconify/tools/issues",
|
|
9
9
|
"homepage": "https://github.com/iconify/tools",
|
|
@@ -16,32 +16,32 @@
|
|
|
16
16
|
"types": "./lib/index.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@iconify/types": "^2.0.0",
|
|
19
|
-
"@iconify/utils": "^2.1.
|
|
19
|
+
"@iconify/utils": "^2.1.7",
|
|
20
20
|
"@types/cheerio": "^0.22.31",
|
|
21
|
-
"@types/tar": "^6.1.
|
|
21
|
+
"@types/tar": "^6.1.5",
|
|
22
22
|
"cheerio": "^1.0.0-rc.12",
|
|
23
23
|
"extract-zip": "^2.0.1",
|
|
24
24
|
"local-pkg": "^0.4.3",
|
|
25
|
-
"pathe": "^1.1.
|
|
25
|
+
"pathe": "^1.1.1",
|
|
26
26
|
"svgo": "^3.0.2",
|
|
27
|
-
"tar": "^6.1.
|
|
27
|
+
"tar": "^6.1.15"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@types/jest": "^29.5.
|
|
31
|
-
"@types/node": "^18.
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
33
|
-
"@typescript-eslint/parser": "^5.
|
|
30
|
+
"@types/jest": "^29.5.3",
|
|
31
|
+
"@types/node": "^18.17.3",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
33
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
34
34
|
"cross-env": "^7.0.3",
|
|
35
|
-
"eslint": "^8.
|
|
36
|
-
"eslint-config-prettier": "^8.
|
|
35
|
+
"eslint": "^8.46.0",
|
|
36
|
+
"eslint-config-prettier": "^8.10.0",
|
|
37
37
|
"eslint-plugin-jasmine": "^4.1.3",
|
|
38
38
|
"eslint-plugin-prettier": "^4.2.1",
|
|
39
|
-
"jasmine": "^
|
|
40
|
-
"jest": "^29.
|
|
41
|
-
"prettier": "^2.8.
|
|
42
|
-
"rimraf": "^5.0.
|
|
43
|
-
"ts-jest": "^29.1.
|
|
44
|
-
"typescript": "^5.
|
|
39
|
+
"jasmine": "^5.1.0",
|
|
40
|
+
"jest": "^29.6.2",
|
|
41
|
+
"prettier": "^2.8.8",
|
|
42
|
+
"rimraf": "^5.0.1",
|
|
43
|
+
"ts-jest": "^29.1.1",
|
|
44
|
+
"typescript": "^5.1.6",
|
|
45
45
|
"unbuild": "^1.2.1"
|
|
46
46
|
},
|
|
47
47
|
"exports": {
|
package/lib/colors/attribs.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Color } from '@iconify/utils/lib/colors/types';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Color attributes
|
|
5
|
-
*/
|
|
6
|
-
type CommonColorAttributes = 'color';
|
|
7
|
-
declare const commonColorAttributes: CommonColorAttributes[];
|
|
8
|
-
type ShapeColorAttributes = 'fill' | 'stroke';
|
|
9
|
-
declare const shapeColorAttributes: ShapeColorAttributes[];
|
|
10
|
-
type SpecialColorAttributes = 'stop-color' | 'flood-color';
|
|
11
|
-
declare const specialColorAttributes: SpecialColorAttributes[];
|
|
12
|
-
type ColorAttributes = CommonColorAttributes | ShapeColorAttributes | SpecialColorAttributes;
|
|
13
|
-
/**
|
|
14
|
-
* Default values
|
|
15
|
-
*/
|
|
16
|
-
declare const defaultBlackColor: Color;
|
|
17
|
-
declare const defaultColorValues: Record<ColorAttributes, Color>;
|
|
18
|
-
/**
|
|
19
|
-
* Ignore default color for some tags:
|
|
20
|
-
* - If value is true, allow default color
|
|
21
|
-
* - If value is attribute name, allow default color if attribute is set
|
|
22
|
-
*
|
|
23
|
-
* Parent elements are not checked for these tags!
|
|
24
|
-
*/
|
|
25
|
-
declare const allowDefaultColorValue: Partial<Record<ColorAttributes, string | true>>;
|
|
26
|
-
|
|
27
|
-
export { ColorAttributes, CommonColorAttributes, ShapeColorAttributes, SpecialColorAttributes, allowDefaultColorValue, commonColorAttributes, defaultBlackColor, defaultColorValues, shapeColorAttributes, specialColorAttributes };
|
package/lib/colors/detect.d.ts
DELETED
|
@@ -1,15 +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
|
-
* Detect palette
|
|
10
|
-
*
|
|
11
|
-
* Returns null if icon set has mixed colors
|
|
12
|
-
*/
|
|
13
|
-
declare function detectIconSetPalette(iconSet: IconSet): boolean | null;
|
|
14
|
-
|
|
15
|
-
export { detectIconSetPalette };
|
package/lib/colors/parse.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Color } from '@iconify/utils/lib/colors/types';
|
|
2
|
-
import { SVG } from '../svg/index.js';
|
|
3
|
-
import { ColorAttributes } from './attribs.js';
|
|
4
|
-
import { ElementsTreeItem, AnalyseSVGStructureResult, ExtendedTagElement, AnalyseSVGStructureOptions } from '../svg/analyse/types.js';
|
|
5
|
-
import '@iconify/types';
|
|
6
|
-
import '@iconify/utils/lib/customisations/defaults';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Result
|
|
10
|
-
*/
|
|
11
|
-
interface FindColorsResult {
|
|
12
|
-
colors: (Color | string)[];
|
|
13
|
-
hasUnsetColor: boolean;
|
|
14
|
-
hasGlobalStyle: boolean;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Callback to call for each found color
|
|
18
|
-
*
|
|
19
|
-
* Callback should return:
|
|
20
|
-
* - new color value to change color
|
|
21
|
-
* - first parameter to keep old value
|
|
22
|
-
* - 'unset' to delete old value
|
|
23
|
-
* - 'remove' to remove shape or rule
|
|
24
|
-
*/
|
|
25
|
-
type ParseColorsCallbackResult = Color | string | 'remove' | 'unset';
|
|
26
|
-
type ParseColorsCallback<T> = (attr: ColorAttributes, colorString: string, parsedColor: Color | null, tagName?: string, item?: ExtendedTagElementWithColors) => T;
|
|
27
|
-
/**
|
|
28
|
-
* Callback for default color
|
|
29
|
-
*/
|
|
30
|
-
type ParseColorOptionsDefaultColorCallback = (prop: string, item: ExtendedTagElementWithColors, treeItem: ElementsTreeItem, iconData: AnalyseSVGStructureResult) => Color;
|
|
31
|
-
/**
|
|
32
|
-
* Options
|
|
33
|
-
*/
|
|
34
|
-
interface Options<T> extends AnalyseSVGStructureOptions {
|
|
35
|
-
callback?: T;
|
|
36
|
-
defaultColor?: Color | string | ParseColorOptionsDefaultColorCallback;
|
|
37
|
-
}
|
|
38
|
-
type ParseColorsOptions = Options<ParseColorsCallback<ParseColorsCallbackResult | Promise<ParseColorsCallbackResult>>>;
|
|
39
|
-
type ParseColorsSyncOptions = Options<ParseColorsCallback<ParseColorsCallbackResult>>;
|
|
40
|
-
/**
|
|
41
|
-
* Extend properties for element
|
|
42
|
-
*/
|
|
43
|
-
type ItemColors = Partial<Record<ColorAttributes, Color | string>>;
|
|
44
|
-
interface ExtendedTagElementWithColors extends ExtendedTagElement {
|
|
45
|
-
_colors?: ItemColors;
|
|
46
|
-
_removed?: boolean;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Find colors in icon
|
|
50
|
-
*
|
|
51
|
-
* Clean up icon before running this function to convert style to attributes using
|
|
52
|
-
* cleanupInlineStyle() or cleanupSVG(), otherwise results might be inaccurate
|
|
53
|
-
*/
|
|
54
|
-
declare function parseColors(svg: SVG, options?: ParseColorsOptions): Promise<FindColorsResult>;
|
|
55
|
-
/**
|
|
56
|
-
* Find colors in icon, synchronous version
|
|
57
|
-
*
|
|
58
|
-
* Clean up icon before running this function to convert style to attributes using
|
|
59
|
-
* cleanupInlineStyle() or cleanupSVG(), otherwise results might be inaccurate
|
|
60
|
-
*/
|
|
61
|
-
declare function parseColorsSync(svg: SVG, options?: ParseColorsSyncOptions): FindColorsResult;
|
|
62
|
-
/**
|
|
63
|
-
* Check if color is empty, such as 'none' or 'transparent'
|
|
64
|
-
*/
|
|
65
|
-
declare function isEmptyColor(color: Color): boolean;
|
|
66
|
-
|
|
67
|
-
export { ExtendedTagElementWithColors, FindColorsResult, ParseColorOptionsDefaultColorCallback, ParseColorsOptions, ParseColorsSyncOptions, isEmptyColor, parseColors, parseColorsSync };
|
package/lib/colors/validate.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { SVG } from '../svg/index.js';
|
|
2
|
-
import { ParseColorsOptions, FindColorsResult, ParseColorsSyncOptions } from './parse.js';
|
|
3
|
-
import '@iconify/types';
|
|
4
|
-
import '@iconify/utils/lib/customisations/defaults';
|
|
5
|
-
import '@iconify/utils/lib/colors/types';
|
|
6
|
-
import './attribs.js';
|
|
7
|
-
import '../svg/analyse/types.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Validate colors in icon
|
|
11
|
-
*
|
|
12
|
-
* If icon is monotone,
|
|
13
|
-
*
|
|
14
|
-
* Throws exception on error
|
|
15
|
-
*/
|
|
16
|
-
declare function validateColors(svg: SVG, expectMonotone: boolean, options?: ParseColorsOptions): Promise<FindColorsResult>;
|
|
17
|
-
/**
|
|
18
|
-
* Validate colors in icon, synchronous version
|
|
19
|
-
*
|
|
20
|
-
* If icon is monotone,
|
|
21
|
-
*
|
|
22
|
-
* Throws exception on error
|
|
23
|
-
*/
|
|
24
|
-
declare function validateColorsSync(svg: SVG, expectMonotone: boolean, options?: ParseColorsSyncOptions): FindColorsResult;
|
|
25
|
-
|
|
26
|
-
export { validateColors, validateColorsSync };
|
package/lib/css/parse.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface StyleParseError {
|
|
2
|
-
type: 'style-parse-error';
|
|
3
|
-
message: string;
|
|
4
|
-
code: string;
|
|
5
|
-
index?: number;
|
|
6
|
-
fullMessage: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Create error message
|
|
10
|
-
*/
|
|
11
|
-
declare function styleParseError(message: string, code: string, index?: number): StyleParseError;
|
|
12
|
-
|
|
13
|
-
export { StyleParseError, styleParseError };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { StyleParseError } from './error.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Find end of quoted string
|
|
5
|
-
*
|
|
6
|
-
* Returns index of character after quote
|
|
7
|
-
*/
|
|
8
|
-
declare function findEndOfQuotedString(code: string, quote: string, start: number): number | null;
|
|
9
|
-
/**
|
|
10
|
-
* Find end of url
|
|
11
|
-
*
|
|
12
|
-
* Returns index of character after end of URL
|
|
13
|
-
*/
|
|
14
|
-
declare function findEndOfURL(code: string, start: number): number | StyleParseError;
|
|
15
|
-
|
|
16
|
-
export { findEndOfQuotedString, findEndOfURL };
|
package/lib/css/parser/text.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { TextToken, CSSRuleToken, CSSTokenWithSelector } from './types.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Merge text tokens to string
|
|
5
|
-
*/
|
|
6
|
-
declare function mergeTextTokens(tokens: TextToken[]): string;
|
|
7
|
-
/**
|
|
8
|
-
* Get list of selectors from list of words
|
|
9
|
-
*/
|
|
10
|
-
declare function getSelectors(tokens: TextToken[]): string[];
|
|
11
|
-
/**
|
|
12
|
-
* Convert text token to rule
|
|
13
|
-
*/
|
|
14
|
-
declare function textTokensToRule(tokens: TextToken[]): CSSRuleToken | null;
|
|
15
|
-
/**
|
|
16
|
-
* Create at-rule or selector token from text tokens
|
|
17
|
-
*/
|
|
18
|
-
declare function textTokensToSelector(tokens: TextToken[]): CSSTokenWithSelector | null;
|
|
19
|
-
|
|
20
|
-
export { getSelectors, mergeTextTokens, textTokensToRule, textTokensToSelector };
|
package/lib/css/parser/tree.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Text tokens, to be split combined into correct tokens later
|
|
3
|
-
*/
|
|
4
|
-
interface TextToken {
|
|
5
|
-
type: 'chunk' | 'url' | 'quoted-string';
|
|
6
|
-
index: number;
|
|
7
|
-
text: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Values
|
|
11
|
-
*/
|
|
12
|
-
type CSSATValue = string | string[];
|
|
13
|
-
/**
|
|
14
|
-
* Tokens
|
|
15
|
-
*/
|
|
16
|
-
interface CSSRuleToken {
|
|
17
|
-
type: 'rule';
|
|
18
|
-
index: number;
|
|
19
|
-
prop: string;
|
|
20
|
-
value: string;
|
|
21
|
-
important?: boolean;
|
|
22
|
-
}
|
|
23
|
-
interface CSSSelectorToken {
|
|
24
|
-
type: 'selector';
|
|
25
|
-
index: number;
|
|
26
|
-
code: string;
|
|
27
|
-
selectors: string[];
|
|
28
|
-
}
|
|
29
|
-
interface CSSAtRuleToken {
|
|
30
|
-
type: 'at-rule';
|
|
31
|
-
index: number;
|
|
32
|
-
rule: string;
|
|
33
|
-
value: string;
|
|
34
|
-
}
|
|
35
|
-
interface CSSCloseToken {
|
|
36
|
-
type: 'close';
|
|
37
|
-
index: number;
|
|
38
|
-
}
|
|
39
|
-
type CSSTokenWithSelector = CSSSelectorToken | CSSAtRuleToken;
|
|
40
|
-
type CSSToken = CSSRuleToken | CSSSelectorToken | CSSAtRuleToken | CSSCloseToken;
|
|
41
|
-
/**
|
|
42
|
-
* Tree tokens
|
|
43
|
-
*/
|
|
44
|
-
interface CSSSelectorTreeToken extends CSSSelectorToken {
|
|
45
|
-
children: CSSTreeToken[];
|
|
46
|
-
}
|
|
47
|
-
interface CSSAtRuleTreeToken extends CSSAtRuleToken {
|
|
48
|
-
children: CSSTreeToken[];
|
|
49
|
-
}
|
|
50
|
-
type CSSTreeToken = CSSRuleToken | CSSSelectorTreeToken | CSSAtRuleTreeToken;
|
|
51
|
-
|
|
52
|
-
export { CSSATValue, CSSAtRuleToken, CSSAtRuleTreeToken, CSSCloseToken, CSSRuleToken, CSSSelectorToken, CSSSelectorTreeToken, CSSToken, CSSTokenWithSelector, CSSTreeToken, TextToken };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { APIQueryParams, APICacheOptions } from './types.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Unique key
|
|
5
|
-
*/
|
|
6
|
-
declare function apiCacheKey(query: APIQueryParams): string;
|
|
7
|
-
/**
|
|
8
|
-
* Store cache
|
|
9
|
-
*/
|
|
10
|
-
declare function storeAPICache(options: APICacheOptions, key: string, data: string): Promise<void>;
|
|
11
|
-
/**
|
|
12
|
-
* Get item from cache
|
|
13
|
-
*/
|
|
14
|
-
declare function getAPICache(dir: string, key: string): Promise<string | null>;
|
|
15
|
-
/**
|
|
16
|
-
* Clear cache
|
|
17
|
-
*/
|
|
18
|
-
declare function clearAPICache(dir: string): Promise<void>;
|
|
19
|
-
|
|
20
|
-
export { apiCacheKey, clearAPICache, getAPICache, storeAPICache };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API Cache
|
|
3
|
-
*/
|
|
4
|
-
interface APICacheOptions {
|
|
5
|
-
dir: string;
|
|
6
|
-
ttl: number;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Params
|
|
10
|
-
*/
|
|
11
|
-
interface APIQueryParams {
|
|
12
|
-
uri: string;
|
|
13
|
-
params?: URLSearchParams;
|
|
14
|
-
headers?: Record<string, string>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { APICacheOptions, APIQueryParams };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ExportTargetOptions } from '../../export/helpers/prepare.js';
|
|
2
|
-
import { DocumentNotModified } from '../types/modified.js';
|
|
3
|
-
import { DownloadSourceMixin } from '../types/sources.js';
|
|
4
|
-
|
|
5
|
-
interface IfModifiedSinceOption {
|
|
6
|
-
ifModifiedSince: string | true | DownloadGitRepoResult;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Options for downloadGitRepo()
|
|
10
|
-
*/
|
|
11
|
-
interface DownloadGitRepoOptions extends ExportTargetOptions, Partial<IfModifiedSinceOption> {
|
|
12
|
-
remote: string;
|
|
13
|
-
branch: string;
|
|
14
|
-
log?: boolean;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Result
|
|
18
|
-
*/
|
|
19
|
-
interface DownloadGitRepoResult extends DownloadSourceMixin<'git'> {
|
|
20
|
-
contentsDir: string;
|
|
21
|
-
hash: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Download Git repo
|
|
25
|
-
*/
|
|
26
|
-
declare function downloadGitRepo<T extends IfModifiedSinceOption & DownloadGitRepoOptions>(options: T): Promise<DownloadGitRepoResult | DocumentNotModified>;
|
|
27
|
-
declare function downloadGitRepo(options: DownloadGitRepoOptions): Promise<DownloadGitRepoResult>;
|
|
28
|
-
|
|
29
|
-
export { DownloadGitRepoOptions, DownloadGitRepoResult, downloadGitRepo };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ExportTargetOptions } from '../../export/helpers/prepare.js';
|
|
2
|
-
import { DocumentNotModified } from '../types/modified.js';
|
|
3
|
-
import { GitHubAPIOptions } from './types.js';
|
|
4
|
-
import { DownloadSourceMixin } from '../types/sources.js';
|
|
5
|
-
|
|
6
|
-
interface IfModifiedSinceOption {
|
|
7
|
-
ifModifiedSince: string | DownloadGitHubRepoResult;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Options for downloadGitHubRepo()
|
|
11
|
-
*/
|
|
12
|
-
interface DownloadGitHubRepoOptions extends ExportTargetOptions, GitHubAPIOptions, Partial<IfModifiedSinceOption> {
|
|
13
|
-
cleanupOldFiles?: boolean;
|
|
14
|
-
cleanupOldDirectories?: boolean;
|
|
15
|
-
log?: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Result
|
|
19
|
-
*/
|
|
20
|
-
interface DownloadGitHubRepoResult extends DownloadSourceMixin<'github'> {
|
|
21
|
-
rootDir: string;
|
|
22
|
-
contentsDir: string;
|
|
23
|
-
hash: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Download GitHub repo using API
|
|
27
|
-
*/
|
|
28
|
-
declare function downloadGitHubRepo<T extends IfModifiedSinceOption & DownloadGitHubRepoOptions>(options: T): Promise<DownloadGitHubRepoResult | DocumentNotModified>;
|
|
29
|
-
declare function downloadGitHubRepo(options: DownloadGitHubRepoOptions): Promise<DownloadGitHubRepoResult>;
|
|
30
|
-
|
|
31
|
-
export { DownloadGitHubRepoOptions, DownloadGitHubRepoResult, downloadGitHubRepo };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ExportTargetOptions } from '../../export/helpers/prepare.js';
|
|
2
|
-
import { DocumentNotModified } from '../types/modified.js';
|
|
3
|
-
import { GitLabAPIOptions } from './types.js';
|
|
4
|
-
import { DownloadSourceMixin } from '../types/sources.js';
|
|
5
|
-
|
|
6
|
-
interface IfModifiedSinceOption {
|
|
7
|
-
ifModifiedSince: string | DownloadGitLabRepoResult;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Options for downloadGitLabRepo()
|
|
11
|
-
*/
|
|
12
|
-
interface DownloadGitLabRepoOptions extends ExportTargetOptions, GitLabAPIOptions, Partial<IfModifiedSinceOption> {
|
|
13
|
-
cleanupOldFiles?: boolean;
|
|
14
|
-
cleanupOldDirectories?: boolean;
|
|
15
|
-
log?: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Result
|
|
19
|
-
*/
|
|
20
|
-
interface DownloadGitLabRepoResult extends DownloadSourceMixin<'gitlab'> {
|
|
21
|
-
rootDir: string;
|
|
22
|
-
contentsDir: string;
|
|
23
|
-
hash: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Download GitLab repo using API
|
|
27
|
-
*/
|
|
28
|
-
declare function downloadGitLabRepo<T extends IfModifiedSinceOption & DownloadGitLabRepoOptions>(options: T): Promise<DownloadGitLabRepoResult | DocumentNotModified>;
|
|
29
|
-
declare function downloadGitLabRepo(options: DownloadGitLabRepoOptions): Promise<DownloadGitLabRepoResult>;
|
|
30
|
-
|
|
31
|
-
export { DownloadGitLabRepoOptions, DownloadGitLabRepoResult, downloadGitLabRepo };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API options
|
|
3
|
-
*/
|
|
4
|
-
interface GitLabAPIOptions {
|
|
5
|
-
uri?: string;
|
|
6
|
-
token: string;
|
|
7
|
-
project: string;
|
|
8
|
-
branch: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Default base URI for GitLab API
|
|
12
|
-
*/
|
|
13
|
-
declare const defaultGitLabBaseURI = "https://gitlab.com/api/v4/projects";
|
|
14
|
-
|
|
15
|
-
export { GitLabAPIOptions, defaultGitLabBaseURI };
|