UNPKG

2.54 kBTypeScriptView Raw
1export interface CliInitOptions {
2 readonly type?: string;
3 readonly language?: string;
4 readonly canUseNetwork?: boolean;
5 readonly generateOnly?: boolean;
6 readonly workDir?: string;
7 readonly stackName?: string;
8 readonly migrate?: boolean;
9 /**
10 * Override the built-in CDK version
11 */
12 readonly libVersion?: string;
13}
14/**
15 * Initialize a CDK package in the current directory
16 */
17export declare function cliInit(options: CliInitOptions): Promise<void>;
18export declare class InitTemplate {
19 private readonly basePath;
20 readonly name: string;
21 readonly languages: string[];
22 static fromName(templatesDir: string, name: string): Promise<InitTemplate>;
23 readonly description: string;
24 readonly aliases: Set<string>;
25 constructor(basePath: string, name: string, languages: string[], initInfo: any);
26 /**
27 * @param name the name that is being checked
28 * @returns ``true`` if ``name`` is the name of this template or an alias of it.
29 */
30 hasName(name: string): boolean;
31 /**
32 * Creates a new instance of this ``InitTemplate`` for a given language to a specified folder.
33 *
34 * @param language the language to instantiate this template with
35 * @param targetDirectory the directory where the template is to be instantiated into
36 */
37 install(language: string, targetDirectory: string, stackName?: string, libVersion?: string): Promise<void>;
38 private installFiles;
39 private installProcessed;
40 /**
41 * Adds context variables to `cdk.json` in the generated project directory to
42 * enable future behavior for new projects.
43 */
44 private applyFutureFlags;
45 addMigrateContext(projectDir: string): Promise<void>;
46}
47export declare function expandPlaceholders(template: string, language: string, project: ProjectInfo): string;
48interface ProjectInfo {
49 /** The value used for %name% */
50 readonly name: string;
51 readonly stackName?: string;
52 readonly versions: Versions;
53}
54export declare function availableInitTemplates(): Promise<InitTemplate[]>;
55export declare function availableInitLanguages(): Promise<string[]>;
56export declare function printAvailableTemplates(language?: string): Promise<void>;
57interface Versions {
58 ['aws-cdk']: string;
59 ['aws-cdk-lib']: string;
60 constructs: string;
61}
62/**
63 * Return the currently recommended flags for `aws-cdk-lib`.
64 *
65 * These have been built into the CLI at build time.
66 */
67export declare function currentlyRecommendedAwsCdkLibFlags(): Promise<any>;
68export {};