1 | import { MinecraftFolder, MinecraftLocation, Version as VersionJson } from "@xmcl/core";
|
2 | import { AbortableTask } from "@xmcl/task";
|
3 | import { InstallSideOption, LibraryOptions } from "./minecraft";
|
4 | import { SpawnJavaOptions } from "./utils";
|
5 | export interface PostProcessor {
|
6 | |
7 |
|
8 |
|
9 | jar: string;
|
10 | |
11 |
|
12 |
|
13 | classpath: string[];
|
14 | args: string[];
|
15 | outputs?: {
|
16 | [key: string]: string;
|
17 | };
|
18 | sides?: Array<"client" | "server">;
|
19 | }
|
20 | export interface InstallProfile {
|
21 | spec?: number;
|
22 | |
23 |
|
24 |
|
25 | profile: string;
|
26 | |
27 |
|
28 |
|
29 | version: string;
|
30 | |
31 |
|
32 |
|
33 | json: string;
|
34 | |
35 |
|
36 |
|
37 | path: string;
|
38 | |
39 |
|
40 |
|
41 | minecraft: string;
|
42 | |
43 |
|
44 |
|
45 |
|
46 |
|
47 | data?: {
|
48 | [key: string]: {
|
49 | client: string;
|
50 | server: string;
|
51 | };
|
52 | };
|
53 | |
54 |
|
55 |
|
56 | processors?: Array<PostProcessor>;
|
57 | |
58 |
|
59 |
|
60 | libraries: VersionJson.NormalLibrary[];
|
61 | |
62 |
|
63 |
|
64 | versionInfo?: VersionJson;
|
65 | }
|
66 | export interface InstallProfileOption extends LibraryOptions, InstallSideOption, SpawnJavaOptions {
|
67 | |
68 |
|
69 |
|
70 | java?: string;
|
71 | }
|
72 |
|
73 |
|
74 |
|
75 | export declare function resolveProcessors(side: "client" | "server", installProfile: InstallProfile, minecraft: MinecraftFolder): {
|
76 | args: string[];
|
77 | outputs: {
|
78 | [x: string]: string;
|
79 | } | undefined;
|
80 | |
81 |
|
82 |
|
83 | jar: string;
|
84 | |
85 |
|
86 |
|
87 | classpath: string[];
|
88 | sides?: ("client" | "server")[] | undefined;
|
89 | }[];
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 | export declare function postProcess(processors: PostProcessor[], minecraft: MinecraftFolder, javaOptions: SpawnJavaOptions): Promise<void>;
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 | export declare function installByProfile(installProfile: InstallProfile, minecraft: MinecraftLocation, options?: InstallProfileOption): Promise<void>;
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 | export declare function installByProfileTask(installProfile: InstallProfile, minecraft: MinecraftLocation, options?: InstallProfileOption): import("@xmcl/task").TaskRoutine<void>;
|
116 | export declare class PostProcessBadJarError extends Error {
|
117 | jarPath: string;
|
118 | causeBy: Error;
|
119 | constructor(jarPath: string, causeBy: Error);
|
120 | error: string;
|
121 | }
|
122 | export declare class PostProcessNoMainClassError extends Error {
|
123 | jarPath: string;
|
124 | constructor(jarPath: string);
|
125 | error: string;
|
126 | }
|
127 | export declare class PostProcessFailedError extends Error {
|
128 | jarPath: string;
|
129 | commands: string[];
|
130 | constructor(jarPath: string, commands: string[], message: string);
|
131 | error: string;
|
132 | }
|
133 | /**
|
134 | * Post process the post processors from `InstallProfile`.
|
135 | *
|
136 | * @param processors The processor info
|
137 | * @param minecraft The minecraft location
|
138 | * @param java The java executable path
|
139 | * @throws {@link PostProcessError}
|
140 | */
|
141 | export declare class PostProcessingTask extends AbortableTask<void> {
|
142 | private processors;
|
143 | private minecraft;
|
144 | private java;
|
145 | readonly name: string;
|
146 | private pointer;
|
147 | private activeProcess;
|
148 | constructor(processors: PostProcessor[], minecraft: MinecraftFolder, java: SpawnJavaOptions);
|
149 | protected findMainClass(lib: string): Promise<string>;
|
150 | protected isInvalid(outputs: Required<PostProcessor>["outputs"]): Promise<boolean>;
|
151 | protected postProcess(mc: MinecraftFolder, proc: PostProcessor, javaOptions: SpawnJavaOptions): Promise<void>;
|
152 | protected process(): Promise<void>;
|
153 | protected abort(isCancelled: boolean): Promise<void>;
|
154 | protected isAbortedError(e: any): boolean;
|
155 | }
|
156 | //# sourceMappingURL=profile.d.ts.map |
\ | No newline at end of file |