/** * Winget 包管理器相关类型定义 */ export declare namespace Winget { interface Package { PackageIdentifier: string; PackageVersion: string; InstallerType: string; InstallModes: string[]; InstallerSwitches: InstallerSwitches; ExpectedReturnCodes: ExpectedReturnCode[]; UpgradeBehavior: string; Protocols: string[]; FileExtensions: string[]; AppsAndFeaturesEntries: AppsAndFeaturesEntry[]; Installers: Installer[]; ManifestType: string; ManifestVersion: string; } interface Installer { Architecture: string; Scope?: string; InstallerUrl: string; InstallerSha256: string; InstallerLocale?: string; InstallerType?: string; } interface InstallerSwitches2 { Custom: string; } interface AppsAndFeaturesEntry { UpgradeCode: string; InstallerType: string; } interface ExpectedReturnCode { InstallerReturnCode: number; ReturnResponse: string; } interface InstallerSwitches { Log: string; } } export interface GithubContent { name: string; path: string; sha: string; size: number; url: string; html_url: string; git_url: string; download_url?: string | null; type: string; _links: Links; } export interface Links { self: string; git: string; html: string; } /** * 从 Winget 仓库下载软件 * 1. 获取软件最新版本信息 * 2. 解析安装包配置 * 3. 下载并重命名安装包 * @param param0 下载配置 * @param param0.name 软件名称 * @param param0.id Winget ID * @param param0.dir 下载目录 * @param param0.filter 安装包筛选函数 */ export declare function downloadFromWinget({ name, id, dir, filter }: WingetDownloadInfo): Promise; export type WingetItem = { filename: string; version: string; ext: string; architecture: string; }; export type WingetDownloadInfo = { name: string; id: string; dir: string; filter: (item: Winget.Installer, index: number, arr: Winget.Installer[]) => boolean; };