UNPKG

@salesforce/templates

Version:

Salesforce JS library for templates

61 lines (60 loc) 2.05 kB
import { CreateOutput, TemplateOptions } from '../utils/types'; type Changes = { created: string[]; conflicted: string[]; identical: string[]; forced: string[]; }; export declare function setCustomTemplatesRootPathOrGitRepo(pathOrRepoUri?: string, forceLoadingRemoteRepo?: boolean): Promise<string | undefined>; /** * Look up package version of @salesforce/templates package to supply a default API version */ export declare function getDefaultApiVersion(): string; declare abstract class NotYeoman { changes: Changes; private _sourceRoot; private _destinationRoot; constructor(); destinationPath(...dest: string[]): string; destinationRoot(rootPath?: string): string; sourceRoot(rootPath?: string): string; templatePath(...dest: string[]): string; render(source: string, destination: string, data?: Record<string, unknown>): Promise<void>; private register; } export declare abstract class BaseGenerator<TOptions extends TemplateOptions> extends NotYeoman { options: TOptions; /** * Set by sourceRootWithPartialPath called in generator */ builtInTemplatesRootPath?: string; protected outputdir: string; protected apiversion: string; private customTemplatesRootPath; /** * The constructor for the SfGenerator. * * @param options SfGenerator specific options. */ constructor(options: TOptions); /** * 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; run(opts?: { cwd?: string; customTemplatesRootPathOrGitRepo?: string; sourceRootPartial?: string; }): Promise<CreateOutput>; /** * Validate provided options */ abstract validateOptions(): void; /** * Generate the files */ abstract generate(): Promise<void>; } export {};