Appearance
@loontail/minecraft-kit v0.8.14 / InstallProgressTracker
Type alias: InstallProgressTracker
ts
type InstallProgressTracker: {
onEvent: ProgressListener;
finish: void;
snapshot: ProgressSnapshot;
subscribe: () => void;
};Aggregator returned by createInstallProgressTracker. Wire onEvent into install.run / repair.run, and subscribe into your UI layer.
Example
ts
import { createInstallProgressTracker, type InstallProgressTracker } from "@loontail/minecraft-kit";
const tracker: InstallProgressTracker = createInstallProgressTracker(plan);
const unsubscribe = tracker.subscribe((s) => renderBar(s));
await kit.install.run(plan, { onEvent: tracker.onEvent });
tracker.finish();
unsubscribe();Type declaration
| Member | Type | Description |
|---|---|---|
onEvent | ProgressListener | Pass directly as the onEvent callback to install.run / repair.run. |
finish | void | Force-emit a final 100% snapshot and stop the throttle timer. |
snapshot | ProgressSnapshot | - |
subscribe | () => void | First push fires immediately with the initial snapshot. |