import { DownloadGitHubRepoOptions, DownloadGitHubRepoResult } from './github/index.js'; import { DownloadGitRepoOptions, DownloadGitRepoResult } from './git/index.js'; import { DownloadNPMPackageOptions, DownloadNPMPackageResult } from './npm/index.js'; import { DocumentNotModified } from './types/modified.js'; import { DownloadSourceType, DownloadSourceMixin } from './types/sources.js'; import { DownloadGitLabRepoOptions, DownloadGitLabRepoResult } from './gitlab/index.js'; import '../export/helpers/prepare.js'; import './github/types.js'; import './gitlab/types.js'; /** * Options and result combinations */ interface DownloadGitRepo { options: DownloadGitRepoOptions & DownloadSourceMixin<'git'>; result: DownloadGitRepoResult; } interface DownloadGitHubRepo { options: DownloadGitHubRepoOptions & DownloadSourceMixin<'github'>; result: DownloadGitHubRepoResult; } interface DownloadGitLabRepo { options: DownloadGitLabRepoOptions & DownloadSourceMixin<'gitlab'>; result: DownloadGitLabRepoResult; } interface DownloadNPMPackage { options: DownloadNPMPackageOptions & DownloadSourceMixin<'npm'>; result: DownloadNPMPackageResult; } /** * Combinations based on type */ type DownloadParamsMixin = T extends 'git' ? DownloadGitRepo : T extends 'github' ? DownloadGitHubRepo : T extends 'gitlab' ? DownloadGitLabRepo : T extends 'npm' ? DownloadNPMPackage : never; /** * Combinations */ type DownloadParams = DownloadGitRepo | DownloadGitHubRepo | DownloadGitLabRepo | DownloadNPMPackage; /** * Pick options or result from combinations */ type DownloadOptions = DownloadParamsMixin['options']; type DownloadResult = Promise['result']>; declare function downloadPackage(options: DownloadOptions): DownloadResult; declare function downloadPackage(options: DownloadOptions): DownloadResult; declare function downloadPackage(options: DownloadOptions): DownloadResult; declare function downloadPackage(options: DownloadOptions): DownloadResult; export { DownloadParams, DownloadParamsMixin, downloadPackage };