@manuth/generator-wsc-package
Version:
A Generator for WoltLab Suite Core Packages.
44 lines • 1.32 kB
JavaScript
import { printNode, ts } from "ts-morph";
import { InstructionFileMapping } from "./InstructionFileMapping.js";
/**
* Provides the functionality to generate bbcode instruction files.
*
* @template TSettings
* The type of the settings of the generator.
*
* @template TOptions
* The type of the options of the generator.
*
* @template TComponentOptions
* The type of the options of the component.
*/
export class FileInstructionMapping extends InstructionFileMapping {
/**
* Initializes a new instance of the {@link FileInstructionMapping `FileInstructionMapping<TSettings, TOptions, TComponentOptions>`} class.
*
* @param component
* The component to create an instruction-file for.
*/
constructor(component) {
super(component);
this.fileInstructionComponent = component;
}
/**
* @inheritdoc
*/
get Component() {
return this.fileInstructionComponent;
}
/**
* @inheritdoc
*/
get InstructionOptions() {
let options = super.InstructionOptions;
options.addPropertyAssignment({
name: "FileName",
initializer: printNode(ts.factory.createStringLiteral(this.Component.OutputFileName))
});
return options;
}
}
//# sourceMappingURL=FileInstructionMapping.js.map