import Generator from 'yeoman-generator'; import type { Prompts, AppWizard as AppWizardType } from '@sap-devx/yeoman-ui-types'; import type { ToolsLogger } from '@sap-ux/logger'; import type { GeneratorTypes } from '../types.js'; import type { GeneratorOpts } from '../utils/opts.js'; /** * Shared base class for all ADP generators. */ export default class SubGeneratorBase extends Generator { setPromptsCallback: (fn: any) => void; prompts: Prompts; /** * Instance of the logger. */ logger: ToolsLogger; /** * Instance of the app wizard. */ protected readonly appWizard: AppWizardType; /** * The type of generator. */ protected readonly type: GeneratorTypes; /** * Captures validation errors occurring during construction so they can be surfaced later. */ protected validationError: Error | undefined; /** * Stores a callback provided by Yeoman-UI when the instance is not * yet created. This ensures the callback is attached once the prompts are * available (e.g. after async i18n or system look-ups). */ private pendingPromptsCallback?; /** * Creates an instance of the generator. * * @param {string | string[]} args - The arguments passed to the generator. * @param {Generator.GeneratorOptions} opts - The options for the generator. * @param {GeneratorTypes} type - The type of generator. */ constructor(args: string | string[], opts: GeneratorOpts, type: GeneratorTypes); /** * Helper to create/update the prompts instance. Any pending Yeoman-UI * callback that arrived before prompts existed will automatically be * attached. * * @param {Prompts} prompts The newly created Prompts instance. */ protected _registerPrompts(prompts: Prompts): void; /** * Centralized error handler that ensures resources are cleaned up and a helpful * error prompt is shown to the user. * * @param {string} errorMessage - Human-readable error message. * @returns {Promise} A promise that resolves when the error is handled. */ protected handleRuntimeCrash(errorMessage: string): Promise; /** * Builds a Yeoman question that simply displays the error message and blocks the wizard. * * @param {string} errorMessage - Human-readable error message. * @returns {YUIQuestion} The Yeoman question that displays the error message. */ private _getErrorMessagePrompt; } //# sourceMappingURL=sub-gen-base.d.ts.map