Skip to content

@loontail/minecraft-kit v0.8.14 / DownloadAction

Type alias: DownloadAction

ts
type DownloadAction: {
  category: DownloadCategory;
  expectedSha1: string;
  expectedSize: number;
  kind: typeof InstallActionKinds.DOWNLOAD_FILE;
  target: string;
  url: string | readonly string[];
};

A single download step.

url accepts either a single string or a readonly string[] of mirror URLs that the runner tries in order. Each URL gets a full retry budget; the next URL is only consulted when the previous one's retries are exhausted. Pass a single string for the common single-source case — the runner will treat it identically to a one-element array. For display, use the first array entry; progress events report the URL currently being fetched.

Example

ts
import { InstallActionKinds, type DownloadAction } from "@loontail/minecraft-kit";

const downloads = plan.actions.filter(
  (a): a is DownloadAction => a.kind === InstallActionKinds.DOWNLOAD_FILE,
);
const totalBytes = downloads.reduce((sum, a) => sum + (a.expectedSize ?? 0), 0);

Type declaration

MemberType
categoryDownloadCategory
expectedSha1string
expectedSizenumber
kindtypeof InstallActionKinds.DOWNLOAD_FILE
targetstring
urlstring | readonly string[]

Source

src/types/install.ts:146

MIT License