woltlab-compiler
Version:
A compiler for WoltLab-Package Archives and WoltLab-Package Components
106 lines • 2.85 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("util");
const Localization_1 = require("../Globalization/Localization");
const Person_1 = require("./Person");
/**
* Represents a component.
*/
class Component {
/**
* Initializes a new instance of the `Component` class.
*/
constructor(options) {
/**
* The human-readable name of the component.
*/
this.displayName = new Localization_1.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_1.Localization();
/**
* The license of the component.
*/
this.license = null;
this.Name = options.Name;
this.DisplayName.Data = options.DisplayName;
this.Version = options.Version;
if (!util_1.isNullOrUndefined(options.Author)) {
this.author = new Person_1.Person(options.Author);
}
if (!util_1.isNullOrUndefined(options.CreationDate)) {
this.CreationDate = options.CreationDate;
}
if (!util_1.isNullOrUndefined(options.Description)) {
this.Description.Data = options.Description;
}
if (!util_1.isNullOrUndefined(options.License)) {
this.License = options.License;
}
}
/**
* Gets or sets the name of the package.
*/
get Name() {
return this.name;
}
set Name(value) {
this.name = value;
}
/**
* 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;
}
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;
}
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;
}
set License(value) {
this.license = value;
}
}
exports.Component = Component;
//# sourceMappingURL=Component.js.map