@cloudcamp/aws-runtime
Version:
CloudCamp - Launch faster by building scalable infrastructure in few lines of code.
87 lines (86 loc) • 2.07 kB
TypeScript
/**
* (experimental) Language codes supported by CDK.
*
* @experimental
*/
export declare enum LanguageCode {
/**
* @experimental
*/
TYPESCRIPT = "typescript",
/**
* @experimental
*/
JAVASCRIPT = "javascript",
/**
* @experimental
*/
PYTHON = "python",
/**
* @experimental
*/
CSHARP = "csharp",
/**
* @experimental
*/
JAVA = "java"
}
interface IGenerator {
makeDirHome(dirname: string): void;
writeFileHome(filename: string, data: string): void;
}
/**
* Abstract Language class, serves as a template for subclasses
* which implement a specific language.
*/
export declare abstract class Language {
code: LanguageCode;
/**
* A list of valid language codes.
*/
static LANGUAGE_CODES: LanguageCode[];
/**
* Is a language code valid?
*/
static isValidCode(code: string): boolean;
/**
* Get the language code by file extension.
*/
static languageCodeForExtension(ext: string): LanguageCode;
/**
* Get the extension for a language code.
*/
static extensionForLanguageCode(code: LanguageCode): string;
static nameForLanguageCode(code: LanguageCode): string;
/**
* @param code The code of the language
*/
constructor(code: LanguageCode);
/**
* Generate files for a new app
*/
abstract generateFiles(generator: IGenerator): Promise<void>;
/**
* The command CDK uses to synthesize.
*
* Note: This command is run in the project directory.
*/
abstract get cdkAppCommand(): string;
/**
* Command to install dependencies
*
* Note: This command is run in the project directory.
*/
abstract get installCommands(): string[];
/**
* Command to build the CDK code
*
* Note: This command is run in the project directory.
*/
abstract get buildCommands(): string[];
/**
* Instantiate new Language based on code.
*/
static make(code: LanguageCode): Language;
}
export {};