@typespec/compiler
Version:
TypeSpec compiler and standard library
27 lines • 1.28 kB
TypeScript
import type { InitTemplate } from "./init-template.js";
import type { ScaffoldingConfig } from "./scaffold.js";
export type FileTemplatingContext = Omit<InitTemplate, "libraries"> & ScaffoldingConfig & {
/** Name of the folder */
folderName: string;
casing: CasingUtils;
/**
* NormalizeVersion function replaces `-` with `_`.
*/
normalizeVersion: () => (text: string, render: any) => string;
/**
* toLowerCase function for template replacement
*/
toLowerCase: () => (text: string, render: any) => string;
/**
* Normalize package name for languages other than C#. It replaces `.` with `-` and toLowerCase
*/
normalizePackageName: () => (text: string, render: any) => string;
};
export interface CasingUtils {
readonly camelCase: () => (text: string, render: (...args: any) => string) => string;
readonly pascalCase: () => (text: string, render: (...args: any) => string) => string;
readonly kebabCase: () => (text: string, render: (...args: any) => string) => string;
}
export declare function createFileTemplatingContext(config: ScaffoldingConfig): FileTemplatingContext;
export declare function render(content: string, context: FileTemplatingContext): string;
//# sourceMappingURL=file-templating.d.ts.map