chore: enforce erasable TypeScript syntax

This commit is contained in:
Mario Zechner
2026-05-19 23:15:39 +02:00
parent 48b6510c18
commit 06c6c324d7
17 changed files with 122 additions and 74 deletions

View File

@@ -147,14 +147,19 @@ function isExpandable(obj: unknown): obj is Expandable {
}
class ExpandableText extends Text implements Expandable {
private readonly getCollapsedText: () => string;
private readonly getExpandedText: () => string;
constructor(
private readonly getCollapsedText: () => string,
private readonly getExpandedText: () => string,
getCollapsedText: () => string,
getExpandedText: () => string,
expanded = false,
paddingX = 0,
paddingY = 0,
) {
super(expanded ? getExpandedText() : getCollapsedText(), paddingX, paddingY);
this.getCollapsedText = getCollapsedText;
this.getExpandedText = getExpandedText;
}
setExpanded(expanded: boolean): void {
@@ -334,6 +339,8 @@ export class InteractiveMode {
// Custom header from extension (undefined = use built-in header)
private customHeader: (Component & { dispose?(): void }) | undefined = undefined;
private options: InteractiveModeOptions;
// Convenience accessors
private get session(): AgentSession {
return this.runtimeHost.session;
@@ -348,11 +355,9 @@ export class InteractiveMode {
return this.session.settingsManager;
}
constructor(
runtimeHost: AgentSessionRuntime,
private options: InteractiveModeOptions = {},
) {
constructor(runtimeHost: AgentSessionRuntime, options: InteractiveModeOptions = {}) {
this.runtimeHost = runtimeHost;
this.options = options;
this.runtimeHost.setBeforeSessionInvalidate(() => {
this.resetExtensionUI();
});