@iconify/tools 4.0.0-beta.9 → 4.0.0
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/lib/colors/attribs.d.cts +27 -0
- package/lib/colors/attribs.d.mts +27 -0
- package/lib/colors/attribs.d.ts +1 -1
- package/lib/colors/detect.d.cts +16 -0
- package/lib/colors/detect.d.mts +16 -0
- package/lib/colors/parse.d.cts +60 -0
- package/lib/colors/parse.d.mts +60 -0
- package/lib/colors/parse.d.ts +1 -1
- package/lib/colors/validate.d.cts +20 -0
- package/lib/colors/validate.d.mts +20 -0
- package/lib/css/parse.d.cts +6 -0
- package/lib/css/parse.d.mts +6 -0
- package/lib/css/parser/error.d.cts +13 -0
- package/lib/css/parser/error.d.mts +13 -0
- package/lib/css/parser/error.d.ts +1 -1
- package/lib/css/parser/export.d.cts +8 -0
- package/lib/css/parser/export.d.mts +8 -0
- package/lib/css/parser/strings.d.cts +16 -0
- package/lib/css/parser/strings.d.mts +16 -0
- package/lib/css/parser/text.d.cts +20 -0
- package/lib/css/parser/text.d.mts +20 -0
- package/lib/css/parser/tokens.d.cts +9 -0
- package/lib/css/parser/tokens.d.mts +9 -0
- package/lib/css/parser/tree.d.cts +8 -0
- package/lib/css/parser/tree.d.mts +8 -0
- package/lib/css/parser/types.d.cts +52 -0
- package/lib/css/parser/types.d.mts +52 -0
- package/lib/css/parser/types.d.ts +1 -1
- package/lib/download/api/cache.d.cts +20 -0
- package/lib/download/api/cache.d.mts +20 -0
- package/lib/download/api/config.d.cts +18 -0
- package/lib/download/api/config.d.mts +18 -0
- package/lib/download/api/download.d.cts +8 -0
- package/lib/download/api/download.d.mts +8 -0
- package/lib/download/api/index.d.cts +8 -0
- package/lib/download/api/index.d.mts +8 -0
- package/lib/download/api/queue.d.cts +32 -0
- package/lib/download/api/queue.d.mts +32 -0
- package/lib/download/api/queue.d.ts +1 -1
- package/lib/download/api/types.d.cts +17 -0
- package/lib/download/api/types.d.mts +17 -0
- package/lib/download/api/types.d.ts +1 -1
- package/lib/download/git/branch.d.cts +8 -0
- package/lib/download/git/branch.d.mts +8 -0
- package/lib/download/git/hash.d.cts +8 -0
- package/lib/download/git/hash.d.mts +8 -0
- package/lib/download/git/index.d.cts +29 -0
- package/lib/download/git/index.d.mts +29 -0
- package/lib/download/git/index.d.ts +1 -1
- package/lib/download/git/reset.d.cts +6 -0
- package/lib/download/git/reset.d.mts +6 -0
- package/lib/download/github/hash.d.cts +8 -0
- package/lib/download/github/hash.d.mts +8 -0
- package/lib/download/github/index.d.cts +31 -0
- package/lib/download/github/index.d.mts +31 -0
- package/lib/download/github/index.d.ts +1 -1
- package/lib/download/github/types.d.cts +11 -0
- package/lib/download/github/types.d.mts +11 -0
- package/lib/download/github/types.d.ts +1 -1
- package/lib/download/gitlab/hash.d.cts +8 -0
- package/lib/download/gitlab/hash.d.mts +8 -0
- package/lib/download/gitlab/index.d.cts +31 -0
- package/lib/download/gitlab/index.d.mts +31 -0
- package/lib/download/gitlab/index.d.ts +1 -1
- package/lib/download/gitlab/types.d.cts +15 -0
- package/lib/download/gitlab/types.d.mts +15 -0
- package/lib/download/gitlab/types.d.ts +1 -1
- package/lib/download/helpers/untar.d.cts +6 -0
- package/lib/download/helpers/untar.d.mts +6 -0
- package/lib/download/helpers/unzip.d.cts +6 -0
- package/lib/download/helpers/unzip.d.mts +6 -0
- package/lib/download/index.d.cts +48 -0
- package/lib/download/index.d.mts +48 -0
- package/lib/download/index.d.ts +1 -1
- package/lib/download/npm/index.d.cts +30 -0
- package/lib/download/npm/index.d.mts +30 -0
- package/lib/download/npm/index.d.ts +1 -1
- package/lib/download/npm/types.d.cts +9 -0
- package/lib/download/npm/types.d.mts +9 -0
- package/lib/download/npm/types.d.ts +1 -1
- package/lib/download/npm/version.d.cts +16 -0
- package/lib/download/npm/version.d.mts +16 -0
- package/lib/download/npm/version.d.ts +1 -1
- package/lib/download/types/modified.d.cts +6 -0
- package/lib/download/types/modified.d.mts +6 -0
- package/lib/download/types/modified.d.ts +1 -1
- package/lib/download/types/sources.d.cts +12 -0
- package/lib/download/types/sources.d.mts +12 -0
- package/lib/download/types/sources.d.ts +1 -1
- package/lib/export/directory.d.cts +26 -0
- package/lib/export/directory.d.mts +26 -0
- package/lib/export/directory.d.ts +1 -1
- package/lib/export/helpers/custom-files.d.cts +12 -0
- package/lib/export/helpers/custom-files.d.mts +12 -0
- package/lib/export/helpers/custom-files.d.ts +1 -1
- package/lib/export/helpers/prepare.d.cts +19 -0
- package/lib/export/helpers/prepare.d.mts +19 -0
- package/lib/export/helpers/prepare.d.ts +1 -1
- package/lib/export/helpers/types-version.d.cts +6 -0
- package/lib/export/helpers/types-version.d.mts +6 -0
- package/lib/export/icon-package.d.cts +26 -0
- package/lib/export/icon-package.d.mts +26 -0
- package/lib/export/icon-package.d.ts +1 -3
- package/lib/export/json-package.d.cts +25 -0
- package/lib/export/json-package.d.mts +25 -0
- package/lib/export/json-package.d.ts +1 -1
- package/lib/icon-set/index.cjs +22 -0
- package/lib/icon-set/index.d.cts +162 -0
- package/lib/icon-set/index.d.mts +162 -0
- package/lib/icon-set/index.mjs +22 -0
- package/lib/icon-set/match.d.cts +15 -0
- package/lib/icon-set/match.d.mts +15 -0
- package/lib/icon-set/merge.d.cts +14 -0
- package/lib/icon-set/merge.d.mts +14 -0
- package/lib/icon-set/modified.d.cts +16 -0
- package/lib/icon-set/modified.d.mts +16 -0
- package/lib/icon-set/props.d.cts +13 -0
- package/lib/icon-set/props.d.mts +13 -0
- package/lib/icon-set/tags.d.cts +23 -0
- package/lib/icon-set/tags.d.mts +23 -0
- package/lib/icon-set/types.d.cts +75 -0
- package/lib/icon-set/types.d.mts +75 -0
- package/lib/icon-set/types.d.ts +1 -1
- package/lib/import/directory.d.cts +52 -0
- package/lib/import/directory.d.mts +52 -0
- package/lib/import/directory.d.ts +1 -1
- package/lib/import/figma/index.d.cts +20 -0
- package/lib/import/figma/index.d.mts +20 -0
- package/lib/import/figma/nodes.d.cts +18 -0
- package/lib/import/figma/nodes.d.mts +18 -0
- package/lib/import/figma/query.d.cts +42 -0
- package/lib/import/figma/query.d.mts +42 -0
- package/lib/import/figma/query.d.ts +1 -1
- package/lib/import/figma/types/api.d.cts +53 -0
- package/lib/import/figma/types/api.d.mts +53 -0
- package/lib/import/figma/types/api.d.ts +1 -1
- package/lib/import/figma/types/nodes.d.cts +44 -0
- package/lib/import/figma/types/nodes.d.mts +44 -0
- package/lib/import/figma/types/nodes.d.ts +1 -1
- package/lib/import/figma/types/options.d.cts +59 -0
- package/lib/import/figma/types/options.d.mts +59 -0
- package/lib/import/figma/types/options.d.ts +1 -1
- package/lib/import/figma/types/result.d.cts +44 -0
- package/lib/import/figma/types/result.d.mts +44 -0
- package/lib/import/figma/types/result.d.ts +1 -1
- package/lib/index.cjs +7 -5
- package/lib/index.d.cts +78 -0
- package/lib/index.d.mts +78 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.mjs +6 -5
- package/lib/misc/bump-version.d.cts +6 -0
- package/lib/misc/bump-version.d.mts +6 -0
- package/lib/misc/cheerio.d.cts +9 -0
- package/lib/misc/cheerio.d.mts +9 -0
- package/lib/misc/cheerio.d.ts +1 -1
- package/lib/misc/compare-dirs.d.cts +11 -0
- package/lib/misc/compare-dirs.d.mts +11 -0
- package/lib/misc/compare-dirs.d.ts +1 -1
- package/lib/misc/exec.d.cts +12 -0
- package/lib/misc/exec.d.mts +12 -0
- package/lib/misc/exec.d.ts +1 -1
- package/lib/misc/keyword.d.cts +6 -0
- package/lib/misc/keyword.d.mts +6 -0
- package/lib/misc/scan.d.cts +33 -0
- package/lib/misc/scan.d.mts +33 -0
- package/lib/misc/scan.d.ts +1 -1
- package/lib/misc/write-json.d.cts +6 -0
- package/lib/misc/write-json.d.mts +6 -0
- package/lib/optimise/figma.d.cts +11 -0
- package/lib/optimise/figma.d.mts +11 -0
- package/lib/optimise/flags.d.cts +11 -0
- package/lib/optimise/flags.d.mts +11 -0
- package/lib/optimise/global-style.d.cts +11 -0
- package/lib/optimise/global-style.d.mts +11 -0
- package/lib/optimise/mask.d.cts +24 -0
- package/lib/optimise/mask.d.mts +24 -0
- package/lib/optimise/origin.d.cts +11 -0
- package/lib/optimise/origin.d.mts +11 -0
- package/lib/optimise/scale.d.cts +11 -0
- package/lib/optimise/scale.d.mts +11 -0
- package/lib/optimise/svgo.d.cts +37 -0
- package/lib/optimise/svgo.d.mts +37 -0
- package/lib/svg/analyse/error.d.cts +10 -0
- package/lib/svg/analyse/error.d.mts +10 -0
- package/lib/svg/analyse/types.d.cts +92 -0
- package/lib/svg/analyse/types.d.mts +92 -0
- package/lib/svg/analyse/types.d.ts +1 -1
- package/lib/svg/analyse.d.cts +15 -0
- package/lib/svg/analyse.d.mts +15 -0
- package/lib/svg/cleanup/attribs.d.cts +11 -0
- package/lib/svg/cleanup/attribs.d.mts +11 -0
- package/lib/svg/cleanup/bad-tags.d.cts +17 -0
- package/lib/svg/cleanup/bad-tags.d.mts +17 -0
- package/lib/svg/cleanup/bad-tags.d.ts +1 -1
- package/lib/svg/cleanup/inline-style.d.cts +11 -0
- package/lib/svg/cleanup/inline-style.d.mts +11 -0
- package/lib/svg/cleanup/root-style.d.cts +17 -0
- package/lib/svg/cleanup/root-style.d.mts +17 -0
- package/lib/svg/cleanup/root-svg.d.cts +11 -0
- package/lib/svg/cleanup/root-svg.d.mts +11 -0
- package/lib/svg/cleanup/svgo-style.d.cts +11 -0
- package/lib/svg/cleanup/svgo-style.d.mts +11 -0
- package/lib/svg/cleanup.d.cts +16 -0
- package/lib/svg/cleanup.d.mts +16 -0
- package/lib/svg/cleanup.d.ts +1 -1
- package/lib/svg/data/attributes.d.cts +77 -0
- package/lib/svg/data/attributes.d.mts +77 -0
- package/lib/svg/data/tags.d.cts +95 -0
- package/lib/svg/data/tags.d.mts +95 -0
- package/lib/svg/index.cjs +17 -0
- package/lib/svg/index.d.cts +52 -0
- package/lib/svg/index.d.mts +52 -0
- package/lib/svg/index.d.ts +5 -1
- package/lib/svg/index.mjs +18 -1
- package/lib/svg/parse-style.d.cts +58 -0
- package/lib/svg/parse-style.d.mts +58 -0
- package/lib/svg/parse-style.d.ts +1 -1
- package/lib/svg/parse.d.cts +30 -0
- package/lib/svg/parse.d.mts +30 -0
- package/lib/svg/parse.d.ts +1 -1
- package/package.json +14 -17
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default parameters
|
|
3
|
+
*/
|
|
4
|
+
declare const defaultQueueParams: ConcurrentQueriesCommonParams<unknown>;
|
|
5
|
+
/**
|
|
6
|
+
* Callback to get query
|
|
7
|
+
*/
|
|
8
|
+
type GetConcurrentQueryCallback<T> = (index: number) => Promise<T>;
|
|
9
|
+
/**
|
|
10
|
+
* Parameters
|
|
11
|
+
*/
|
|
12
|
+
interface ConcurrentQueriesCommonParams<T> {
|
|
13
|
+
limit?: number;
|
|
14
|
+
retries?: number;
|
|
15
|
+
onError?: (index: number, error: unknown, params: ConcurrentQueriesParams<T>) => void | Promise<void>;
|
|
16
|
+
onSuccess?: (index: number, params: ConcurrentQueriesParams<T>, result: T) => void;
|
|
17
|
+
onStart?: (index: number, params: ConcurrentQueriesParams<T>) => void;
|
|
18
|
+
}
|
|
19
|
+
interface ConcurrentQueriesParamsWithCount<T> extends ConcurrentQueriesCommonParams<T> {
|
|
20
|
+
total: number;
|
|
21
|
+
callback: (index: number) => Promise<T>;
|
|
22
|
+
}
|
|
23
|
+
interface ConcurrentQueriesParamsWithPromises<T> extends ConcurrentQueriesCommonParams<T> {
|
|
24
|
+
promises: Promise<T>[];
|
|
25
|
+
}
|
|
26
|
+
type ConcurrentQueriesParams<T> = ConcurrentQueriesParamsWithCount<T> | ConcurrentQueriesParamsWithPromises<T>;
|
|
27
|
+
/**
|
|
28
|
+
* Runs concurrent async operations
|
|
29
|
+
*/
|
|
30
|
+
declare function runConcurrentQueries<T>(params: ConcurrentQueriesParams<T>): Promise<T[]>;
|
|
31
|
+
|
|
32
|
+
export { type ConcurrentQueriesCommonParams, type ConcurrentQueriesParams, type ConcurrentQueriesParamsWithCount, type ConcurrentQueriesParamsWithPromises, type GetConcurrentQueryCallback, defaultQueueParams, runConcurrentQueries };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default parameters
|
|
3
|
+
*/
|
|
4
|
+
declare const defaultQueueParams: ConcurrentQueriesCommonParams<unknown>;
|
|
5
|
+
/**
|
|
6
|
+
* Callback to get query
|
|
7
|
+
*/
|
|
8
|
+
type GetConcurrentQueryCallback<T> = (index: number) => Promise<T>;
|
|
9
|
+
/**
|
|
10
|
+
* Parameters
|
|
11
|
+
*/
|
|
12
|
+
interface ConcurrentQueriesCommonParams<T> {
|
|
13
|
+
limit?: number;
|
|
14
|
+
retries?: number;
|
|
15
|
+
onError?: (index: number, error: unknown, params: ConcurrentQueriesParams<T>) => void | Promise<void>;
|
|
16
|
+
onSuccess?: (index: number, params: ConcurrentQueriesParams<T>, result: T) => void;
|
|
17
|
+
onStart?: (index: number, params: ConcurrentQueriesParams<T>) => void;
|
|
18
|
+
}
|
|
19
|
+
interface ConcurrentQueriesParamsWithCount<T> extends ConcurrentQueriesCommonParams<T> {
|
|
20
|
+
total: number;
|
|
21
|
+
callback: (index: number) => Promise<T>;
|
|
22
|
+
}
|
|
23
|
+
interface ConcurrentQueriesParamsWithPromises<T> extends ConcurrentQueriesCommonParams<T> {
|
|
24
|
+
promises: Promise<T>[];
|
|
25
|
+
}
|
|
26
|
+
type ConcurrentQueriesParams<T> = ConcurrentQueriesParamsWithCount<T> | ConcurrentQueriesParamsWithPromises<T>;
|
|
27
|
+
/**
|
|
28
|
+
* Runs concurrent async operations
|
|
29
|
+
*/
|
|
30
|
+
declare function runConcurrentQueries<T>(params: ConcurrentQueriesParams<T>): Promise<T[]>;
|
|
31
|
+
|
|
32
|
+
export { type ConcurrentQueriesCommonParams, type ConcurrentQueriesParams, type ConcurrentQueriesParamsWithCount, type ConcurrentQueriesParamsWithPromises, type GetConcurrentQueryCallback, defaultQueueParams, runConcurrentQueries };
|
|
@@ -29,4 +29,4 @@ type ConcurrentQueriesParams<T> = ConcurrentQueriesParamsWithCount<T> | Concurre
|
|
|
29
29
|
*/
|
|
30
30
|
declare function runConcurrentQueries<T>(params: ConcurrentQueriesParams<T>): Promise<T[]>;
|
|
31
31
|
|
|
32
|
-
export { ConcurrentQueriesCommonParams, ConcurrentQueriesParams, ConcurrentQueriesParamsWithCount, ConcurrentQueriesParamsWithPromises, GetConcurrentQueryCallback, defaultQueueParams, runConcurrentQueries };
|
|
32
|
+
export { type ConcurrentQueriesCommonParams, type ConcurrentQueriesParams, type ConcurrentQueriesParamsWithCount, type ConcurrentQueriesParamsWithPromises, type GetConcurrentQueryCallback, defaultQueueParams, runConcurrentQueries };
|
|
@@ -0,0 +1,17 @@
|
|
|
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 type { APICacheOptions, APIQueryParams };
|
|
@@ -0,0 +1,17 @@
|
|
|
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 type { APICacheOptions, APIQueryParams };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ExportTargetOptions } from '../../export/helpers/prepare.cjs';
|
|
2
|
+
import { DocumentNotModified } from '../types/modified.cjs';
|
|
3
|
+
import { DownloadSourceMixin } from '../types/sources.cjs';
|
|
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 { type DownloadGitRepoOptions, type DownloadGitRepoResult, downloadGitRepo };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ExportTargetOptions } from '../../export/helpers/prepare.mjs';
|
|
2
|
+
import { DocumentNotModified } from '../types/modified.mjs';
|
|
3
|
+
import { DownloadSourceMixin } from '../types/sources.mjs';
|
|
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 { type DownloadGitRepoOptions, type DownloadGitRepoResult, downloadGitRepo };
|
|
@@ -26,4 +26,4 @@ interface DownloadGitRepoResult extends DownloadSourceMixin<'git'> {
|
|
|
26
26
|
declare function downloadGitRepo<T extends IfModifiedSinceOption & DownloadGitRepoOptions>(options: T): Promise<DownloadGitRepoResult | DocumentNotModified>;
|
|
27
27
|
declare function downloadGitRepo(options: DownloadGitRepoOptions): Promise<DownloadGitRepoResult>;
|
|
28
28
|
|
|
29
|
-
export { DownloadGitRepoOptions, DownloadGitRepoResult, downloadGitRepo };
|
|
29
|
+
export { type DownloadGitRepoOptions, type DownloadGitRepoResult, downloadGitRepo };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ExportTargetOptions } from '../../export/helpers/prepare.cjs';
|
|
2
|
+
import { DocumentNotModified } from '../types/modified.cjs';
|
|
3
|
+
import { GitHubAPIOptions } from './types.cjs';
|
|
4
|
+
import { DownloadSourceMixin } from '../types/sources.cjs';
|
|
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 { type DownloadGitHubRepoOptions, type DownloadGitHubRepoResult, downloadGitHubRepo };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ExportTargetOptions } from '../../export/helpers/prepare.mjs';
|
|
2
|
+
import { DocumentNotModified } from '../types/modified.mjs';
|
|
3
|
+
import { GitHubAPIOptions } from './types.mjs';
|
|
4
|
+
import { DownloadSourceMixin } from '../types/sources.mjs';
|
|
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 { type DownloadGitHubRepoOptions, type DownloadGitHubRepoResult, downloadGitHubRepo };
|
|
@@ -28,4 +28,4 @@ interface DownloadGitHubRepoResult extends DownloadSourceMixin<'github'> {
|
|
|
28
28
|
declare function downloadGitHubRepo<T extends IfModifiedSinceOption & DownloadGitHubRepoOptions>(options: T): Promise<DownloadGitHubRepoResult | DocumentNotModified>;
|
|
29
29
|
declare function downloadGitHubRepo(options: DownloadGitHubRepoOptions): Promise<DownloadGitHubRepoResult>;
|
|
30
30
|
|
|
31
|
-
export { DownloadGitHubRepoOptions, DownloadGitHubRepoResult, downloadGitHubRepo };
|
|
31
|
+
export { type DownloadGitHubRepoOptions, type DownloadGitHubRepoResult, downloadGitHubRepo };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ExportTargetOptions } from '../../export/helpers/prepare.cjs';
|
|
2
|
+
import { DocumentNotModified } from '../types/modified.cjs';
|
|
3
|
+
import { GitLabAPIOptions } from './types.cjs';
|
|
4
|
+
import { DownloadSourceMixin } from '../types/sources.cjs';
|
|
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 { type DownloadGitLabRepoOptions, type DownloadGitLabRepoResult, downloadGitLabRepo };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ExportTargetOptions } from '../../export/helpers/prepare.mjs';
|
|
2
|
+
import { DocumentNotModified } from '../types/modified.mjs';
|
|
3
|
+
import { GitLabAPIOptions } from './types.mjs';
|
|
4
|
+
import { DownloadSourceMixin } from '../types/sources.mjs';
|
|
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 { type DownloadGitLabRepoOptions, type DownloadGitLabRepoResult, downloadGitLabRepo };
|
|
@@ -28,4 +28,4 @@ interface DownloadGitLabRepoResult extends DownloadSourceMixin<'gitlab'> {
|
|
|
28
28
|
declare function downloadGitLabRepo<T extends IfModifiedSinceOption & DownloadGitLabRepoOptions>(options: T): Promise<DownloadGitLabRepoResult | DocumentNotModified>;
|
|
29
29
|
declare function downloadGitLabRepo(options: DownloadGitLabRepoOptions): Promise<DownloadGitLabRepoResult>;
|
|
30
30
|
|
|
31
|
-
export { DownloadGitLabRepoOptions, DownloadGitLabRepoResult, downloadGitLabRepo };
|
|
31
|
+
export { type DownloadGitLabRepoOptions, type DownloadGitLabRepoResult, downloadGitLabRepo };
|
|
@@ -0,0 +1,15 @@
|
|
|
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 { type GitLabAPIOptions, defaultGitLabBaseURI };
|
|
@@ -0,0 +1,15 @@
|
|
|
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 { type GitLabAPIOptions, defaultGitLabBaseURI };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DownloadGitHubRepoOptions, DownloadGitHubRepoResult } from './github/index.cjs';
|
|
2
|
+
import { DownloadGitRepoOptions, DownloadGitRepoResult } from './git/index.cjs';
|
|
3
|
+
import { DownloadNPMPackageOptions, DownloadNPMPackageResult } from './npm/index.cjs';
|
|
4
|
+
import { DocumentNotModified } from './types/modified.cjs';
|
|
5
|
+
import { DownloadSourceType, DownloadSourceMixin } from './types/sources.cjs';
|
|
6
|
+
import { DownloadGitLabRepoOptions, DownloadGitLabRepoResult } from './gitlab/index.cjs';
|
|
7
|
+
import '../export/helpers/prepare.cjs';
|
|
8
|
+
import './github/types.cjs';
|
|
9
|
+
import './gitlab/types.cjs';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Options and result combinations
|
|
13
|
+
*/
|
|
14
|
+
interface DownloadGitRepo {
|
|
15
|
+
options: DownloadGitRepoOptions & DownloadSourceMixin<'git'>;
|
|
16
|
+
result: DownloadGitRepoResult;
|
|
17
|
+
}
|
|
18
|
+
interface DownloadGitHubRepo {
|
|
19
|
+
options: DownloadGitHubRepoOptions & DownloadSourceMixin<'github'>;
|
|
20
|
+
result: DownloadGitHubRepoResult;
|
|
21
|
+
}
|
|
22
|
+
interface DownloadGitLabRepo {
|
|
23
|
+
options: DownloadGitLabRepoOptions & DownloadSourceMixin<'gitlab'>;
|
|
24
|
+
result: DownloadGitLabRepoResult;
|
|
25
|
+
}
|
|
26
|
+
interface DownloadNPMPackage {
|
|
27
|
+
options: DownloadNPMPackageOptions & DownloadSourceMixin<'npm'>;
|
|
28
|
+
result: DownloadNPMPackageResult;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Combinations based on type
|
|
32
|
+
*/
|
|
33
|
+
type DownloadParamsMixin<T extends DownloadSourceType> = T extends 'git' ? DownloadGitRepo : T extends 'github' ? DownloadGitHubRepo : T extends 'gitlab' ? DownloadGitLabRepo : T extends 'npm' ? DownloadNPMPackage : never;
|
|
34
|
+
/**
|
|
35
|
+
* Combinations
|
|
36
|
+
*/
|
|
37
|
+
type DownloadParams = DownloadGitRepo | DownloadGitHubRepo | DownloadGitLabRepo | DownloadNPMPackage;
|
|
38
|
+
/**
|
|
39
|
+
* Pick options or result from combinations
|
|
40
|
+
*/
|
|
41
|
+
type DownloadOptions<T extends DownloadSourceType> = DownloadParamsMixin<T>['options'];
|
|
42
|
+
type DownloadResult<T extends DownloadSourceType> = Promise<DocumentNotModified | DownloadParamsMixin<T>['result']>;
|
|
43
|
+
declare function downloadPackage<T extends 'git'>(options: DownloadOptions<T>): DownloadResult<T>;
|
|
44
|
+
declare function downloadPackage<T extends 'github'>(options: DownloadOptions<T>): DownloadResult<T>;
|
|
45
|
+
declare function downloadPackage<T extends 'gitlab'>(options: DownloadOptions<T>): DownloadResult<T>;
|
|
46
|
+
declare function downloadPackage<T extends 'npm'>(options: DownloadOptions<T>): DownloadResult<T>;
|
|
47
|
+
|
|
48
|
+
export { type DownloadParams, type DownloadParamsMixin, downloadPackage };
|