UNPKG

1.52 kBTypeScriptView Raw
1import { UpdatedObject } from "@xmcl/net";
2import { ForgeInstaller } from "./index";
3export declare namespace ForgeWebPage {
4 interface Download {
5 md5: string;
6 sha1: string;
7 path: string;
8 }
9 /**
10 * Query the webpage content from files.minecraftforge.net.
11 *
12 * You can put the last query result to the fallback option. It will check if your old result is up-to-date.
13 * It will request a new page only when the fallback option is outdated.
14 *
15 * @param option The option can control querying minecraft version, and page caching.
16 */
17 function getWebPage(option?: {
18 mcversion?: string;
19 fallback?: ForgeWebPage;
20 }): Promise<ForgeWebPage>;
21 interface Version extends ForgeInstaller.VersionMeta {
22 mcversion: string;
23 version: string;
24 date: string;
25 changelog: ForgeWebPage.Download;
26 installer: ForgeWebPage.Download;
27 mdk?: ForgeWebPage.Download;
28 universal: ForgeWebPage.Download;
29 type: "buggy" | "recommended" | "common" | "latest";
30 }
31 namespace Version {
32 function to(webPageVersion: ForgeWebPage.Version): ForgeInstaller.VersionMeta;
33 }
34}
35declare module "./index" {
36 namespace VersionMeta {
37 function from(webPageVersion: ForgeWebPage.Version): ForgeInstaller.VersionMeta;
38 }
39}
40export interface ForgeWebPage extends UpdatedObject {
41 versions: ForgeWebPage.Version[];
42 mcversion: string;
43}