UNPKG

@salesforce/templates

Version:

Salesforce JS library for templates

33 lines (32 loc) 1.36 kB
import * as Generator from 'yeoman-generator'; import { TemplateOptions } from '../utils/types'; /** * Base class for generators */ export declare abstract class SfdxGenerator<TOptions extends TemplateOptions> extends Generator<Generator.GeneratorOptions> { options: TOptions; /** * Set by sourceRootWithPartialPath called in generator */ builtInTemplatesRootPath?: string; protected outputdir: string; protected apiversion: string; /** * The constructor for the SFDXGenerator. * * @param args arguments to pass to the yeoman generator constructor. * @param options SFDXGenerator specific options. * @param features The yeoman GeneratorFeatures. Defaults to a customInstallTask of false in order to skip the automatic npm/yarn install. Override to true if you need to run the package manager install. */ constructor(args: string | string[], options: TOptions, features?: Generator.GeneratorFeatures); /** * Validate provided options */ abstract validateOptions(): void; /** * Set source root to built-in templates or custom templates root if available. * @param partialPath the relative path from the templates folder to templates root folder. */ sourceRootWithPartialPath(partialPath: string): void; templatePath(...paths: string[]): string; }