diff --git a/packages/@aws-cdk/tmp-toolkit-helpers/src/api/io/io-host.ts b/packages/@aws-cdk/tmp-toolkit-helpers/src/api/io/io-host.ts index 9ee4dc92a..a5692f58c 100644 --- a/packages/@aws-cdk/tmp-toolkit-helpers/src/api/io/io-host.ts +++ b/packages/@aws-cdk/tmp-toolkit-helpers/src/api/io/io-host.ts @@ -5,7 +5,7 @@ export interface IIoHost { * Notifies the host of a message. * The caller waits until the notification completes. */ - notify(msg: IoMessage): Promise; + notify(msg: IoMessage): Promise; /** * Notifies the host of a message that requires a response. diff --git a/packages/@aws-cdk/tmp-toolkit-helpers/src/api/io/private/io-helper.ts b/packages/@aws-cdk/tmp-toolkit-helpers/src/api/io/private/io-helper.ts index 54d67d608..2a1da3fe3 100644 --- a/packages/@aws-cdk/tmp-toolkit-helpers/src/api/io/private/io-helper.ts +++ b/packages/@aws-cdk/tmp-toolkit-helpers/src/api/io/private/io-helper.ts @@ -13,7 +13,7 @@ export type ActionLessRequest = Omit, 'action'>; * Wraps a client provided IoHost and provides additional features & services to toolkit internal classes. */ export interface IoHelper extends IIoHost { - notify(msg: ActionLessMessage): Promise; + notify(msg: ActionLessMessage): Promise; requestResponse(msg: ActionLessRequest): Promise; } diff --git a/packages/@aws-cdk/toolkit-lib/test/_helpers/test-io-host.ts b/packages/@aws-cdk/toolkit-lib/test/_helpers/test-io-host.ts index f7641e7eb..1c938e0a1 100644 --- a/packages/@aws-cdk/toolkit-lib/test/_helpers/test-io-host.ts +++ b/packages/@aws-cdk/toolkit-lib/test/_helpers/test-io-host.ts @@ -18,7 +18,7 @@ export class TestIoHost implements IIoHost { this.requestSpy = jest.fn(); } - public async notify(msg: IoMessage): Promise { + public async notify(msg: IoMessage): Promise { if (isMessageRelevantForLevel(msg, this.level)) { this.notifySpy(msg); } diff --git a/packages/aws-cdk/lib/cli/activity-printer/base.ts b/packages/aws-cdk/lib/cli/activity-printer/base.ts index 2b67dde2b..3e1534a7a 100644 --- a/packages/aws-cdk/lib/cli/activity-printer/base.ts +++ b/packages/aws-cdk/lib/cli/activity-printer/base.ts @@ -5,7 +5,7 @@ import { IoMessage } from '../../toolkit/cli-io-host'; import { maxResourceTypeLength, stackEventHasErrorMessage } from '../../util'; export interface IActivityPrinter { - notify(msg: IoMessage): void; + notify(msg: IoMessage): void; } export interface ActivityPrinterProps { @@ -51,10 +51,10 @@ export abstract class ActivityPrinterBase implements IActivityPrinter { /** * Receive a stack activity message */ - public notify(msg: IoMessage): void { + public notify(msg: IoMessage): void { switch (msg.code) { case 'CDK_TOOLKIT_I5501': - this.start(msg.data); + this.start(msg.data as { stack: CloudFormationStackArtifact }); break; case 'CDK_TOOLKIT_I5502': this.activity(msg.data as StackActivity); diff --git a/packages/aws-cdk/lib/toolkit/cli-io-host.ts b/packages/aws-cdk/lib/toolkit/cli-io-host.ts index 1bcd59402..1852bf43a 100644 --- a/packages/aws-cdk/lib/toolkit/cli-io-host.ts +++ b/packages/aws-cdk/lib/toolkit/cli-io-host.ts @@ -127,7 +127,7 @@ export class CliIoHost implements IIoHost { // Corked Logging private corkedCounter = 0; - private readonly corkedLoggingBuffer: IoMessage[] = []; + private readonly corkedLoggingBuffer: IoMessage[] = []; private constructor(props: CliIoHostProps = {}) { this.currentAction = props.currentAction ?? 'none'; @@ -220,7 +220,7 @@ export class CliIoHost implements IIoHost { * Notifies the host of a message. * The caller waits until the notification completes. */ - public async notify(msg: IoMessage): Promise { + public async notify(msg: IoMessage): Promise { if (this._internalIoHost) { return this._internalIoHost.notify(msg); } @@ -250,7 +250,7 @@ export class CliIoHost implements IIoHost { /** * Detect stack activity messages so they can be send to the printer. */ - private isStackActivity(msg: IoMessage) { + private isStackActivity(msg: IoMessage) { return [ 'CDK_TOOLKIT_I5501', 'CDK_TOOLKIT_I5502', @@ -376,7 +376,7 @@ export class CliIoHost implements IIoHost { /** * Formats a message for console output with optional color support */ - private formatMessage(msg: IoMessage): string { + private formatMessage(msg: IoMessage): string { // apply provided style or a default style if we're in TTY mode let message_text = this.isTTY ? styleMap[msg.level](msg.message) diff --git a/packages/aws-cdk/test/_helpers/test-io-host.ts b/packages/aws-cdk/test/_helpers/test-io-host.ts index 1d173c4e8..2a544252c 100644 --- a/packages/aws-cdk/test/_helpers/test-io-host.ts +++ b/packages/aws-cdk/test/_helpers/test-io-host.ts @@ -15,7 +15,7 @@ export class TestIoHost implements IIoHost { this.requestSpy = jest.fn(); } - public async notify(msg: IoMessage): Promise { + public async notify(msg: IoMessage): Promise { if (isMessageRelevantForLevel(msg, this.level)) { this.notifySpy(msg); }