@manuth/woltlab-compiler
Version:
A compiler for generating WoltLab-Package `.tar` Archives and other WoltLab-Package Components
45 lines • 1.32 kB
JavaScript
import path from "upath";
import { ThemeInstructionCompiler } from "../../../../Compilation/PackageSystem/Instructions/ThemeInstructionCompiler.js";
import { ThemeLoader } from "../../../../Customization/Presentation/Themes/ThemeLoader.js";
import { Instruction } from "../../Instruction.js";
const { join } = path;
/**
* The name of the {@link ThemeInstruction `ThemeInstruction`}-type.
*/
const STYLE_TYPENAME = "style";
/**
* Represents an instruction which provides a theme.
*/
export class ThemeInstruction extends Instruction {
/**
* Initializes a new instance of the {@link ThemeInstruction `ThemeInstruction`} class.
*
* @param options
* The options for the theme-instruction.
*/
constructor(options) {
super({
FileName: options.FileName || join(STYLE_TYPENAME, `${options.Theme.Name}.tar`)
});
this.themeLoader = new ThemeLoader(this, options.Theme);
}
/**
* @inheritdoc
*/
get Type() {
return STYLE_TYPENAME;
}
/**
* Gets the theme-loader provided by the instruction.
*/
get ThemeLoader() {
return this.themeLoader;
}
/**
* @inheritdoc
*/
get Compiler() {
return new ThemeInstructionCompiler(this);
}
}
//# sourceMappingURL=ThemeInstruction.js.map