@manuth/woltlab-compiler
Version:
A compiler for generating WoltLab-Package `.tar` Archives and other WoltLab-Package Components
45 lines • 1.28 kB
JavaScript
import { XMLEditor } from "../../Serialization/XMLEditor.js";
import { InstructionSet } from "./InstructionSet.js";
/**
* Represents a collection of instructions for updating a package.
*/
export class UpdateInstructionSet extends InstructionSet {
/**
* Initializes a new instance of the {@link UpdateInstructionSet `UpdateInstructionSet`} class.
*
* @param extensionPackage
* The package of the update-instruction.
*
* @param fromVersion
* The minimum version of the update-instruction.
*/
constructor(extensionPackage, fromVersion) {
super(extensionPackage);
this.FromVersion = fromVersion;
}
/**
* Gets or sets the version to update the package from.
*/
get FromVersion() {
return this.fromVersion;
}
/**
* @inheritdoc
*/
set FromVersion(value) {
this.fromVersion = value;
}
/**
* @inheritdoc
*
* @returns
* An element representing this instruction.
*/
Serialize() {
let editor = new XMLEditor(super.Serialize());
editor.SetAttribute("type", "update");
editor.SetAttribute("fromversion", this.FromVersion);
return editor.Element;
}
}
//# sourceMappingURL=UpdateInstructionSet.js.map