aws-cdk 2.1026.0 → 2.1028.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,30 +1,75 @@
1
1
  import type { IoHelper } from '../../api-private';
2
2
  export interface CliInitOptions {
3
+ /**
4
+ * Template name to initialize
5
+ * @default undefined
6
+ */
3
7
  readonly type?: string;
8
+ /**
9
+ * Programming language for the project
10
+ * @default - Optional/auto-detected if template supports only one language, otherwise required
11
+ */
4
12
  readonly language?: string;
13
+ /**
14
+ * @default true
15
+ */
5
16
  readonly canUseNetwork?: boolean;
17
+ /**
18
+ * @default false
19
+ */
6
20
  readonly generateOnly?: boolean;
21
+ /**
22
+ * @default process.cwd()
23
+ */
7
24
  readonly workDir?: string;
25
+ /**
26
+ * @default undefined
27
+ */
8
28
  readonly stackName?: string;
29
+ /**
30
+ * @default undefined
31
+ */
9
32
  readonly migrate?: boolean;
10
33
  /**
11
34
  * Override the built-in CDK version
35
+ * @default undefined
12
36
  */
13
37
  readonly libVersion?: string;
38
+ /**
39
+ * Path to a local custom template directory
40
+ * @default undefined
41
+ */
42
+ readonly fromPath?: string;
43
+ /**
44
+ * Path to a specific template within a multi-template repository.
45
+ * This parameter requires --from-path to be specified.
46
+ * @default undefined
47
+ */
48
+ readonly templatePath?: string;
14
49
  readonly ioHelper: IoHelper;
15
50
  }
16
51
  /**
17
52
  * Initialize a CDK package in the current directory
18
53
  */
19
54
  export declare function cliInit(options: CliInitOptions): Promise<void>;
55
+ interface TemplateInitInfo {
56
+ readonly description: string;
57
+ readonly aliases?: string[];
58
+ }
59
+ declare enum TemplateType {
60
+ BUILT_IN = "builtin",
61
+ CUSTOM = "custom"
62
+ }
20
63
  export declare class InitTemplate {
21
64
  private readonly basePath;
22
65
  readonly name: string;
23
66
  readonly languages: string[];
24
67
  static fromName(templatesDir: string, name: string): Promise<InitTemplate>;
25
- readonly description: string;
68
+ static fromPath(templatePath: string): Promise<InitTemplate>;
69
+ readonly description?: string;
26
70
  readonly aliases: Set<string>;
27
- constructor(basePath: string, name: string, languages: string[], initInfo: any);
71
+ readonly templateType: TemplateType;
72
+ constructor(basePath: string, name: string, languages: string[], initInfo: TemplateInitInfo | null, templateType: TemplateType);
28
73
  /**
29
74
  * @param name - the name that is being checked
30
75
  * @returns ``true`` if ``name`` is the name of this template or an alias of it.
@@ -33,12 +78,20 @@ export declare class InitTemplate {
33
78
  /**
34
79
  * Creates a new instance of this ``InitTemplate`` for a given language to a specified folder.
35
80
  *
36
- * @param language - the language to instantiate this template with
81
+ * @param language - the language to instantiate this template with
37
82
  * @param targetDirectory - the directory where the template is to be instantiated into
83
+ * @param stackName - the name of the stack to create
84
+ * @default undefined
85
+ * @param libVersion - the version of the CDK library to use
86
+ * @default undefined
38
87
  */
39
88
  install(ioHelper: IoHelper, language: string, targetDirectory: string, stackName?: string, libVersion?: string): Promise<void>;
40
89
  private installFiles;
41
90
  private installProcessed;
91
+ /**
92
+ * Copy template files without processing placeholders (for custom templates)
93
+ */
94
+ private installFilesWithoutProcessing;
42
95
  /**
43
96
  * Adds context variables to `cdk.json` in the generated project directory to
44
97
  * enable future behavior for new projects.
@@ -55,6 +108,12 @@ interface ProjectInfo {
55
108
  }
56
109
  export declare function availableInitTemplates(): Promise<InitTemplate[]>;
57
110
  export declare function availableInitLanguages(): Promise<string[]>;
111
+ /**
112
+ * Print available templates to the user
113
+ * @param ioHelper - IO helper for user interaction
114
+ * @param language - Programming language filter
115
+ * @default undefined
116
+ */
58
117
  export declare function printAvailableTemplates(ioHelper: IoHelper, language?: string): Promise<void>;
59
118
  interface Versions {
60
119
  ['aws-cdk']: string;