From a873898422c3d4ffc80e33b1f5f5409de8120c4e Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sun, 13 Nov 2022 14:25:06 +0000 Subject: [PATCH] Fix TS --- packages/app-cli/app/gui/StatusBarWidget.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/app-cli/app/gui/StatusBarWidget.ts b/packages/app-cli/app/gui/StatusBarWidget.ts index b67b34286..15e6c7123 100644 --- a/packages/app-cli/app/gui/StatusBarWidget.ts +++ b/packages/app-cli/app/gui/StatusBarWidget.ts @@ -1,7 +1,7 @@ const BaseWidget = require('tkwidgets/BaseWidget.js'); const chalk = require('chalk'); const termutils = require('tkwidgets/framework/termutils.js'); -import stripAnsi from 'strip-ansi'; +const stripAnsi = require('strip-ansi'); const { handleAutocompletion } = require('../autocompletion.js'); export default class StatusBarWidget extends BaseWidget { @@ -22,7 +22,7 @@ export default class StatusBarWidget extends BaseWidget { return false; } - setItemAt(index, text) { + setItemAt(index: number, text: string) { this.items_[index] = stripAnsi(text).trim(); this.invalidate(); } @@ -86,7 +86,7 @@ export default class StatusBarWidget extends BaseWidget { // const textStyle = this.promptActive ? (s) => s : chalk.bgBlueBright.white; // const textStyle = (s) => s; - const textStyle = this.promptActive ? s => s : chalk.gray; + const textStyle = this.promptActive ? (s: any) => s : chalk.gray; this.term.drawHLine(this.absoluteInnerX, this.absoluteInnerY, this.innerWidth, textStyle(' ')); @@ -118,7 +118,7 @@ export default class StatusBarWidget extends BaseWidget { if ('cursorPosition' in this.promptState_) options.cursorPosition = this.promptState_.cursorPosition; if (isSecurePrompt) options.echoChar = true; - this.inputEventEmitter_ = this.term.inputField(options, (error, input) => { + this.inputEventEmitter_ = this.term.inputField(options, (error: any, input: any) => { let resolveResult = null; const resolveFn = this.promptState_.resolve;