UNPKG

5.38 kBTypeScriptView Raw
1import { MinecraftLocation } from "@xmcl/core";
2import { Timestamped } from "./http/fetch";
3import { InstallOptions } from "./utils";
4export declare const YARN_MAVEN_URL = "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml";
5export declare const LOADER_MAVEN_URL = "https://maven.fabricmc.net/net/fabricmc/fabric-loader/maven-metadata.xml";
6/**
7 * Fabric Yarn version list
8 * @see https://github.com/FabricMC/yarn
9 */
10export interface FabricYarnVersionList extends Timestamped {
11 versions: FabricArtifactVersion[];
12}
13/**
14 * Fabric mod loader version list
15 * @see https://fabricmc.net/
16 */
17export interface FabricLoaderVersionList extends Timestamped {
18 versions: FabricArtifactVersion[];
19}
20export interface FabricArtifactVersion {
21 gameVersion?: string;
22 separator?: string;
23 build?: number;
24 maven: string;
25 version: string;
26 stable: boolean;
27}
28export interface FabricArtifacts {
29 mappings: FabricArtifactVersion[];
30 loader: FabricArtifactVersion[];
31}
32export interface FabricLoaderArtifact {
33 loader: FabricArtifactVersion;
34 intermediary: FabricArtifactVersion;
35 launcherMeta: {
36 version: number;
37 libraries: {
38 client: {
39 name: string;
40 url: string;
41 }[];
42 common: {
43 name: string;
44 url: string;
45 }[];
46 server: {
47 name: string;
48 url: string;
49 }[];
50 };
51 mainClass: {
52 client: string;
53 server: string;
54 };
55 };
56}
57export declare const DEFAULT_FABRIC_API = "https://meta.fabricmc.net/v2";
58/**
59 * Get all the artifacts provided by fabric
60 * @param remote The fabric API host
61 * @beta
62 */
63export declare function getFabricArtifacts(remote?: string): Promise<FabricArtifacts>;
64/**
65 * Get fabric-yarn artifact list
66 * @param remote The fabric API host
67 * @beta
68 */
69export declare function getYarnArtifactList(remote?: string): Promise<FabricArtifactVersion[]>;
70/**
71 * Get fabric-yarn artifact list by Minecraft version
72 * @param minecraft The Minecraft version
73 * @param remote The fabric API host
74 * @beta
75 */
76export declare function getYarnArtifactListFor(minecraft: string, remote?: string): Promise<FabricArtifactVersion[]>;
77/**
78 * Get fabric-loader artifact list
79 * @param remote The fabric API host
80 * @beta
81 */
82export declare function getLoaderArtifactList(remote?: string): Promise<FabricArtifactVersion[]>;
83/**
84 * Get fabric-loader artifact list by Minecraft version
85 * @param minecraft The minecraft version
86 * @param remote The fabric API host
87 * @beta
88 */
89export declare function getLoaderArtifactListFor(minecraft: string, remote?: string): Promise<FabricLoaderArtifact[]>;
90/**
91 * Get fabric-loader artifact list by Minecraft version
92 * @param minecraft The minecraft version
93 * @param loader The yarn-loader version
94 * @param remote The fabric API host
95 * @beta
96 */
97export declare function getFabricLoaderArtifact(minecraft: string, loader: string, remote?: string): Promise<FabricLoaderArtifact>;
98/**
99 * Get or refresh the yarn version list.
100 * @beta
101 */
102export declare function getYarnVersionListFromXML(option?: {
103 /**
104 * If this presents, it will send request with the original list timestamp.
105 *
106 * If the server believes there is no modification after the original one,
107 * it will directly return the orignal one.
108 */
109 original?: FabricYarnVersionList;
110 /**
111 * remote maven xml url of this request
112 */
113 remote?: string;
114}): Promise<FabricYarnVersionList>;
115/**
116 * Get or refresh the fabric mod loader version list.
117 * @beta
118 */
119export declare function getLoaderVersionListFromXML(option: {
120 /**
121 * If this presents, it will send request with the original list timestamp.
122 *
123 * If the server believes there is no modification after the original one,
124 * it will directly return the orignal one.
125 */
126 original?: FabricLoaderVersionList;
127 /**
128 * remote maven xml url of this request
129 */
130 remote?: string;
131}): Promise<FabricLoaderVersionList>;
132/**
133 * Install the fabric to the client. Notice that this will only install the json.
134 * You need to call `Installer.installDependencies` to get a full client.
135 * @param yarnVersion The yarn version
136 * @param loaderVersion The fabric loader version
137 * @param minecraft The minecraft location
138 * @returns The installed version id
139 */
140export declare function installFabricYarnAndLoader(yarnVersion: string, loaderVersion: string, minecraft: MinecraftLocation, options?: InstallOptions): Promise<string>;
141export interface FabricInstallOptions extends InstallOptions {
142 side?: "client" | "server";
143 yarnVersion?: string | FabricArtifactVersion;
144}
145/**
146 * Generate fabric version json to the disk according to yarn and loader
147 * @param side Client or server
148 * @param yarnVersion The yarn version string or artifact
149 * @param loader The loader artifact
150 * @param minecraft The Minecraft Location
151 * @param options The options
152 * @beta
153 */
154export declare function installFabric(loader: FabricLoaderArtifact, minecraft: MinecraftLocation, options?: FabricInstallOptions): Promise<string>;
155//# sourceMappingURL=fabric.d.ts.map
\No newline at end of file