Skip to content

Commit ebfb522

Browse files
cockscombrix0rrr
authored andcommittedNov 8, 2018
fix(aws-ecs): fix use of published NPM package with TypeScript (#1117)
The package previously published would not work with a TypeScript consumer, because the generated `.d.ts` file was missing an import statement due to a bug in the TypeScript compiler. Add an explicit type declaration to work around this issue until it is fixed and released upstream. Reference: microsoft/TypeScript#26969
1 parent b4d9155 commit ebfb522

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ export class FargateTaskDefinition extends TaskDefinition {
4646
/**
4747
* The configured network mode
4848
*/
49-
public readonly networkMode = NetworkMode.AwsVpc;
49+
public readonly networkMode: NetworkMode = NetworkMode.AwsVpc;
50+
// NOTE: Until the fix to https://github.com/Microsoft/TypeScript/issues/26969 gets released,
51+
// we need to explicitly write the type here, as type deduction for enums won't lead to
52+
// the import being generated in the .d.ts file.
5053

5154
constructor(parent: cdk.Construct, name: string, props: FargateTaskDefinitionProps = {}) {
5255
super(parent, name, {

0 commit comments

Comments
 (0)