@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.
Files changed (88) 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/license.txt +1 -1
  5. package/package.json +17 -17
  6. package/lib/colors/attribs.d.ts +0 -27
  7. package/lib/colors/detect.d.ts +0 -15
  8. package/lib/colors/parse.d.ts +0 -67
  9. package/lib/colors/validate.d.ts +0 -26
  10. package/lib/css/parse.d.ts +0 -6
  11. package/lib/css/parser/error.d.ts +0 -13
  12. package/lib/css/parser/export.d.ts +0 -8
  13. package/lib/css/parser/strings.d.ts +0 -16
  14. package/lib/css/parser/text.d.ts +0 -20
  15. package/lib/css/parser/tokens.d.ts +0 -9
  16. package/lib/css/parser/tree.d.ts +0 -8
  17. package/lib/css/parser/types.d.ts +0 -52
  18. package/lib/download/api/cache.d.ts +0 -20
  19. package/lib/download/api/download.d.ts +0 -8
  20. package/lib/download/api/index.d.ts +0 -8
  21. package/lib/download/api/types.d.ts +0 -17
  22. package/lib/download/git/branch.d.ts +0 -8
  23. package/lib/download/git/hash.d.ts +0 -8
  24. package/lib/download/git/index.d.ts +0 -29
  25. package/lib/download/git/reset.d.ts +0 -6
  26. package/lib/download/github/hash.d.ts +0 -8
  27. package/lib/download/github/index.d.ts +0 -31
  28. package/lib/download/github/types.d.ts +0 -11
  29. package/lib/download/gitlab/hash.d.ts +0 -8
  30. package/lib/download/gitlab/index.d.ts +0 -31
  31. package/lib/download/gitlab/types.d.ts +0 -15
  32. package/lib/download/helpers/untar.d.ts +0 -6
  33. package/lib/download/helpers/unzip.d.ts +0 -6
  34. package/lib/download/index.d.ts +0 -48
  35. package/lib/download/npm/index.d.ts +0 -30
  36. package/lib/download/npm/types.d.ts +0 -9
  37. package/lib/download/npm/version.d.ts +0 -16
  38. package/lib/download/types/modified.d.ts +0 -6
  39. package/lib/download/types/sources.d.ts +0 -12
  40. package/lib/export/directory.d.ts +0 -25
  41. package/lib/export/helpers/custom-files.d.ts +0 -12
  42. package/lib/export/helpers/prepare.d.ts +0 -19
  43. package/lib/export/helpers/types-version.d.ts +0 -6
  44. package/lib/export/icon-package.d.ts +0 -25
  45. package/lib/export/json-package.d.ts +0 -23
  46. package/lib/icon-set/index.d.ts +0 -161
  47. package/lib/icon-set/match.d.ts +0 -14
  48. package/lib/icon-set/merge.d.ts +0 -13
  49. package/lib/icon-set/modified.d.ts +0 -15
  50. package/lib/icon-set/props.d.ts +0 -13
  51. package/lib/icon-set/tags.d.ts +0 -22
  52. package/lib/icon-set/types.d.ts +0 -75
  53. package/lib/import/directory.d.ts +0 -51
  54. package/lib/import/figma/index.d.ts +0 -19
  55. package/lib/import/figma/nodes.d.ts +0 -17
  56. package/lib/import/figma/query.d.ts +0 -28
  57. package/lib/import/figma/types/api.d.ts +0 -53
  58. package/lib/import/figma/types/nodes.d.ts +0 -43
  59. package/lib/import/figma/types/options.d.ts +0 -58
  60. package/lib/import/figma/types/result.d.ts +0 -43
  61. package/lib/index.d.ts +0 -72
  62. package/lib/misc/bump-version.d.ts +0 -6
  63. package/lib/misc/cheerio.d.ts +0 -7
  64. package/lib/misc/compare-dirs.d.ts +0 -11
  65. package/lib/misc/exec.d.ts +0 -12
  66. package/lib/misc/keyword.d.ts +0 -6
  67. package/lib/misc/scan.d.ts +0 -33
  68. package/lib/misc/write-json.d.ts +0 -6
  69. package/lib/optimise/flags.d.ts +0 -10
  70. package/lib/optimise/global-style.d.ts +0 -10
  71. package/lib/optimise/origin.d.ts +0 -10
  72. package/lib/optimise/scale.d.ts +0 -10
  73. package/lib/optimise/svgo.d.ts +0 -36
  74. package/lib/svg/analyse/error.d.ts +0 -8
  75. package/lib/svg/analyse/types.d.ts +0 -89
  76. package/lib/svg/analyse.d.ts +0 -13
  77. package/lib/svg/cleanup/attribs.d.ts +0 -10
  78. package/lib/svg/cleanup/bad-tags.d.ts +0 -16
  79. package/lib/svg/cleanup/inline-style.d.ts +0 -10
  80. package/lib/svg/cleanup/root-style.d.ts +0 -16
  81. package/lib/svg/cleanup/root-svg.d.ts +0 -10
  82. package/lib/svg/cleanup/svgo-style.d.ts +0 -10
  83. package/lib/svg/cleanup.d.ts +0 -15
  84. package/lib/svg/data/attributes.d.ts +0 -77
  85. package/lib/svg/data/tags.d.ts +0 -95
  86. package/lib/svg/index.d.ts +0 -47
  87. package/lib/svg/parse-style.d.ts +0 -63
  88. package/lib/svg/parse.d.ts +0 -36
package/README.md CHANGED
@@ -93,4 +93,4 @@ If you need to import or parse icons synchronously, such as in config file of pa
93
93
 
94
94
  Library is released with MIT license.
95
95
 
96
- © 2021 Vjacheslav Trushkin
96
+ © 2021-PRESENT Vjacheslav Trushkin
@@ -58,6 +58,7 @@ async function exportJSONPackage(iconSet, options) {
58
58
  const packageJSONExports = {
59
59
  "./*": "./*",
60
60
  ".": {
61
+ types: "./index.d.ts",
61
62
  require: "./index.js",
62
63
  import: "./index.mjs"
63
64
  }
@@ -56,6 +56,7 @@ async function exportJSONPackage(iconSet, options) {
56
56
  const packageJSONExports = {
57
57
  "./*": "./*",
58
58
  ".": {
59
+ types: "./index.d.ts",
59
60
  require: "./index.js",
60
61
  import: "./index.mjs"
61
62
  }
package/license.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Vjacheslav Trushkin
3
+ Copyright (c) 2021-PRESENT Vjacheslav Trushkin
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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.2",
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.5",
19
+ "@iconify/utils": "^2.1.7",
20
20
  "@types/cheerio": "^0.22.31",
21
- "@types/tar": "^6.1.4",
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.0",
25
+ "pathe": "^1.1.1",
26
26
  "svgo": "^3.0.2",
27
- "tar": "^6.1.13"
27
+ "tar": "^6.1.15"
28
28
  },
29
29
  "devDependencies": {
30
- "@types/jest": "^29.5.0",
31
- "@types/node": "^18.15.11",
32
- "@typescript-eslint/eslint-plugin": "^5.58.0",
33
- "@typescript-eslint/parser": "^5.58.0",
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.38.0",
36
- "eslint-config-prettier": "^8.8.0",
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": "^4.6.0",
40
- "jest": "^29.5.0",
41
- "prettier": "^2.8.7",
42
- "rimraf": "^5.0.0",
43
- "ts-jest": "^29.1.0",
44
- "typescript": "^5.0.4",
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": {
@@ -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 };
@@ -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 };
@@ -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 };
@@ -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 };
@@ -1,6 +0,0 @@
1
- /**
2
- * Parse inline style
3
- */
4
- declare function parseInlineStyle(style: string): Record<string, string> | null;
5
-
6
- export { parseInlineStyle };
@@ -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,8 +0,0 @@
1
- import { CSSTreeToken } from './types.js';
2
-
3
- /**
4
- * Convert tokens tree to string
5
- */
6
- declare function tokensToString(tree: CSSTreeToken[]): string;
7
-
8
- export { tokensToString };
@@ -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 };
@@ -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 };
@@ -1,9 +0,0 @@
1
- import { StyleParseError } from './error.js';
2
- import { CSSToken } from './types.js';
3
-
4
- /**
5
- * Get tokens
6
- */
7
- declare function getTokens(css: string): CSSToken[] | StyleParseError;
8
-
9
- export { getTokens };
@@ -1,8 +0,0 @@
1
- import { CSSToken, CSSTreeToken } from './types.js';
2
-
3
- /**
4
- * Convert tokens list to tree
5
- */
6
- declare function tokensTree(tokens: CSSToken[]): CSSTreeToken[];
7
-
8
- export { tokensTree };
@@ -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,8 +0,0 @@
1
- import { APIQueryParams } from './types.js';
2
-
3
- /**
4
- * Download file
5
- */
6
- declare function downloadFile(query: APIQueryParams, target: string): Promise<void>;
7
-
8
- export { downloadFile };
@@ -1,8 +0,0 @@
1
- import { APIQueryParams, APICacheOptions } from './types.js';
2
-
3
- /**
4
- * Send API query
5
- */
6
- declare function sendAPIQuery(query: APIQueryParams, cache?: APICacheOptions): Promise<number | string>;
7
-
8
- export { sendAPIQuery };
@@ -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,8 +0,0 @@
1
- import { ExportTargetOptions } from '../../export/helpers/prepare.js';
2
-
3
- /**
4
- * Get current branch from cloned git repo
5
- */
6
- declare function getGitRepoBranch(options: ExportTargetOptions, checkout?: string): Promise<string>;
7
-
8
- export { getGitRepoBranch };
@@ -1,8 +0,0 @@
1
- import { ExportTargetOptions } from '../../export/helpers/prepare.js';
2
-
3
- /**
4
- * Get latest hash from cloned git repo
5
- */
6
- declare function getGitRepoHash(options: ExportTargetOptions): Promise<string>;
7
-
8
- export { getGitRepoHash };
@@ -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,6 +0,0 @@
1
- /**
2
- * Reset Git repo contents
3
- */
4
- declare function resetGitRepoContents(target: string): Promise<void>;
5
-
6
- export { resetGitRepoContents };
@@ -1,8 +0,0 @@
1
- import { GitHubAPIOptions } from './types.js';
2
-
3
- /**
4
- * Get latest hash from GitHub using API
5
- */
6
- declare function getGitHubRepoHash(options: GitHubAPIOptions): Promise<string>;
7
-
8
- export { getGitHubRepoHash };
@@ -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,11 +0,0 @@
1
- /**
2
- * API options
3
- */
4
- interface GitHubAPIOptions {
5
- token: string;
6
- user: string;
7
- repo: string;
8
- branch: string;
9
- }
10
-
11
- export { GitHubAPIOptions };
@@ -1,8 +0,0 @@
1
- import { GitLabAPIOptions } from './types.js';
2
-
3
- /**
4
- * Get latest hash from GitHub using API
5
- */
6
- declare function getGitLabRepoHash(options: GitLabAPIOptions): Promise<string>;
7
-
8
- export { getGitLabRepoHash };
@@ -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 };
@@ -1,6 +0,0 @@
1
- /**
2
- * Unpack .tgz archive
3
- */
4
- declare function untar(file: string, path: string): Promise<void>;
5
-
6
- export { untar };
@@ -1,6 +0,0 @@
1
- /**
2
- * Unzip archive
3
- */
4
- declare function unzip(source: string, path: string): Promise<void>;
5
-
6
- export { unzip };