@manuth/woltlab-compiler
Version:
A compiler for generating WoltLab-Package `.tar` Archives and other WoltLab-Package Components
108 lines • 2.7 kB
JavaScript
import { Localization } from "../Globalization/Localization.js";
import { Person } from "./Person.js";
/**
* Represents a component.
*/
export class Component {
/**
* Initializes a new instance of the {@link Component `Component`} class.
*
* @param options
* The options of the component.
*/
constructor(options) {
/**
* The human-readable name of the component.
*/
this.displayName = new Localization();
/**
* The author of the component.
*/
this.author = null;
/**
* The creation-date of the component.
*/
this.creationDate = new Date();
/**
* The description of the component.
*/
this.description = new Localization();
/**
* The license of the component.
*/
this.license = null;
this.DisplayName.Load(options.DisplayName);
this.Version = options.Version;
if ((options.Author !== null) &&
(options.Author !== undefined)) {
this.author = new Person(options.Author);
}
if ((options.CreationDate !== null) &&
(options.CreationDate !== undefined)) {
this.CreationDate = options.CreationDate;
}
if ((options.Description !== null) &&
(options.Description !== undefined)) {
this.Description.Load(options.Description);
}
if ((options.License !== null) &&
(options.License !== undefined)) {
this.License = options.License;
}
}
/**
* Gets the human-readable name of the component.
*/
get DisplayName() {
return this.displayName;
}
/**
* Gets or sets the version of the component.
*/
get Version() {
return this.version;
}
/**
* @inheritdoc
*/
set Version(value) {
this.version = value;
}
/**
* Gets or sets the author of the component.
*/
get Author() {
return this.author;
}
/**
* Gets or sets the creation-date of the component.
*/
get CreationDate() {
return this.creationDate;
}
/**
* @inheritdoc
*/
set CreationDate(value) {
this.creationDate = value;
}
/**
* Gets the description of the component.
*/
get Description() {
return this.description;
}
/**
* Gets or sets the license of the component.
*/
get License() {
return this.license;
}
/**
* @inheritdoc
*/
set License(value) {
this.license = value;
}
}
//# sourceMappingURL=Component.js.map