chore: enforce erasable TypeScript syntax
This commit is contained in:
@@ -7,13 +7,14 @@ import type { TUI } from "@earendil-works/pi-tui";
|
||||
export class CountdownTimer {
|
||||
private intervalId: ReturnType<typeof setInterval> | undefined;
|
||||
private remainingSeconds: number;
|
||||
private tui: TUI | undefined;
|
||||
private onTick: (seconds: number) => void;
|
||||
private onExpire: () => void;
|
||||
|
||||
constructor(
|
||||
timeoutMs: number,
|
||||
private tui: TUI | undefined,
|
||||
private onTick: (seconds: number) => void,
|
||||
private onExpire: () => void,
|
||||
) {
|
||||
constructor(timeoutMs: number, tui: TUI | undefined, onTick: (seconds: number) => void, onExpire: () => void) {
|
||||
this.tui = tui;
|
||||
this.onTick = onTick;
|
||||
this.onExpire = onExpire;
|
||||
this.remainingSeconds = Math.ceil(timeoutMs / 1000);
|
||||
this.onTick(this.remainingSeconds);
|
||||
|
||||
|
||||
@@ -32,11 +32,13 @@ function formatTokens(count: number): string {
|
||||
*/
|
||||
export class FooterComponent implements Component {
|
||||
private autoCompactEnabled = true;
|
||||
private session: AgentSession;
|
||||
private footerData: ReadonlyFooterDataProvider;
|
||||
|
||||
constructor(
|
||||
private session: AgentSession,
|
||||
private footerData: ReadonlyFooterDataProvider,
|
||||
) {}
|
||||
constructor(session: AgentSession, footerData: ReadonlyFooterDataProvider) {
|
||||
this.session = session;
|
||||
this.footerData = footerData;
|
||||
}
|
||||
|
||||
setSession(session: AgentSession): void {
|
||||
this.session = session;
|
||||
|
||||
@@ -15,6 +15,7 @@ export class LoginDialogComponent extends Container implements Focusable {
|
||||
private abortController = new AbortController();
|
||||
private inputResolver?: (value: string) => void;
|
||||
private inputRejecter?: (error: Error) => void;
|
||||
private onComplete: (success: boolean, message?: string) => void;
|
||||
|
||||
// Focusable implementation - propagate to input for IME cursor positioning
|
||||
private _focused = false;
|
||||
@@ -29,12 +30,13 @@ export class LoginDialogComponent extends Container implements Focusable {
|
||||
constructor(
|
||||
tui: TUI,
|
||||
providerId: string,
|
||||
private onComplete: (success: boolean, message?: string) => void,
|
||||
onComplete: (success: boolean, message?: string) => void,
|
||||
providerNameOverride?: string,
|
||||
titleOverride?: string,
|
||||
) {
|
||||
super();
|
||||
this.tui = tui;
|
||||
this.onComplete = onComplete;
|
||||
|
||||
const providerInfo = getOAuthProviders().find((p) => p.id === providerId);
|
||||
const providerName = providerNameOverride || providerInfo?.name || providerId;
|
||||
|
||||
@@ -1056,7 +1056,11 @@ class TreeList implements Component {
|
||||
|
||||
/** Component that displays the current search query */
|
||||
class SearchLine implements Component {
|
||||
constructor(private treeList: TreeList) {}
|
||||
private treeList: TreeList;
|
||||
|
||||
constructor(treeList: TreeList) {
|
||||
this.treeList = treeList;
|
||||
}
|
||||
|
||||
invalidate(): void {}
|
||||
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user