Skip to content

Commit

Permalink
fix(aws-ecs): fix use of published NPM package with TypeScript (#1117)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cockscomb authored and rix0rrr committed Nov 8, 2018
1 parent b4d9155 commit ebfb522
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ export class FargateTaskDefinition extends TaskDefinition {
/**
* The configured network mode
*/
public readonly networkMode = NetworkMode.AwsVpc;
public readonly networkMode: NetworkMode = NetworkMode.AwsVpc;
// NOTE: Until the fix to https://github.com/Microsoft/TypeScript/issues/26969 gets released,
// we need to explicitly write the type here, as type deduction for enums won't lead to
// the import being generated in the .d.ts file.

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

0 comments on commit ebfb522

Please sign in to comment.