UNPKG

@manuth/generator-wsc-package

Version:

A Generator for WoltLab Suite Core Packages.

82 lines (81 loc) 3.03 kB
/// <reference types="yeoman-generator" /> import { GeneratorOptions, IFileMapping, Question } from "@manuth/extended-yo-generator"; import { IWoltLabComponentOptions } from "../Settings/IWoltLabComponentOptions.js"; import { IWoltLabSettings } from "../Settings/IWoltLabSettings.js"; import { WoltLabGenerator } from "../WoltLabGenerator.js"; import { WoltLabComponent } from "./WoltLabComponent.js"; /** * Provides a component for generating an instruction-file. * * @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 declare abstract class InstructionComponent<TSettings extends IWoltLabSettings, TOptions extends GeneratorOptions, TComponentOptions extends IWoltLabComponentOptions = IWoltLabComponentOptions> extends WoltLabComponent<TSettings, TOptions, TComponentOptions> { /** * Initializes a new instance of the {@link InstructionComponent `InstructionComponent<TSettings, TOptions, TComponentOptions>`} class. * * @param generator * The generator of the component. */ constructor(generator: WoltLabGenerator<TSettings, TOptions>); /** * Gets the name of the instruction-class. */ get ClassName(): string; /** * Gets the name of the instruction-variable to export. */ get VariableName(): string; /** * Gets the default name of the file to write the instruction to. */ get InstructionFileName(): string; /** * @inheritdoc */ get FileMappings(): Array<IFileMapping<TSettings, TOptions>>; /** * A question for asking for the component-path. */ protected get PathQuestion(): Question<TComponentOptions>; /** * Gets a file-mapping for creating the instruction-file. */ protected abstract get InstructionFileMapping(): IFileMapping<TSettings, TOptions>; /** * Gets the name of the instruction-class based on the options provided by the user. * * @param options * The options which have been provided by the user. * * @returns * The name of the instruction-class. */ protected abstract GetClassName(options: TComponentOptions): string; /** * Gets the name of the instruction-variable to export based on the options provided by the user. * * @param options * The options which have been provided by the user. * * @returns * The name of the instruction-variable to export. */ protected GetVariableName(options: TComponentOptions): string; /** * Gets the default name of the file to write the instruction to based on the options provided by the user. * * @param options * The options which have been provided by the user. * * @returns * The default name of the file to write the instruction to. */ protected GetInstructionFileName(options: TComponentOptions): string; }