fix: add explicit any types to resolve implicit any diagnostics
This commit is contained in:
14
index.ts
14
index.ts
@@ -64,7 +64,7 @@ async function readPiCredential(authStorage: AuthStorage, provider: Provider): P
|
||||
async function forceRefreshPiCredential(authStorage: AuthStorage, provider: Provider): Promise<UsageCredential> {
|
||||
authStorage.reload();
|
||||
const raw = authStorage.get(provider);
|
||||
const oauthProvider = authStorage.getOAuthProviders().find(candidate => candidate.id === provider);
|
||||
const oauthProvider = authStorage.getOAuthProviders().find((candidate: any) => candidate.id === provider);
|
||||
if (raw?.type !== "oauth" || !oauthProvider) throw new Error("login expired");
|
||||
|
||||
// Refresh Provider OAuth Token
|
||||
@@ -211,7 +211,7 @@ export default function piStatusbarExtension(pi: ExtensionAPI) {
|
||||
if (lastProvider === provider) rerender(ctx);
|
||||
}
|
||||
|
||||
pi.on("session_start", async (_event, ctx) => {
|
||||
pi.on("session_start", async (_event: any, ctx: any) => {
|
||||
updateThinkingLevel();
|
||||
installFooter(ctx);
|
||||
await refresh(ctx, true);
|
||||
@@ -220,7 +220,7 @@ export default function piStatusbarExtension(pi: ExtensionAPI) {
|
||||
timer = setInterval(() => void refresh(latestCtx ?? ctx), REFRESH_MS);
|
||||
});
|
||||
|
||||
pi.on("session_shutdown", async (_event, ctx) => {
|
||||
pi.on("session_shutdown", async (_event: any, ctx: any) => {
|
||||
if (timer) clearInterval(timer);
|
||||
timer = undefined;
|
||||
inFlight?.abort();
|
||||
@@ -232,24 +232,24 @@ export default function piStatusbarExtension(pi: ExtensionAPI) {
|
||||
}
|
||||
});
|
||||
|
||||
pi.on("model_select", async (_event, ctx) => {
|
||||
pi.on("model_select", async (_event: any, ctx: any) => {
|
||||
updateThinkingLevel();
|
||||
await refresh(ctx, true);
|
||||
});
|
||||
|
||||
pi.on("thinking_level_select", async (event, ctx) => {
|
||||
pi.on("thinking_level_select", async (event: any, ctx: any) => {
|
||||
statusbarState.thinkingLevel = event.level;
|
||||
rerender(ctx);
|
||||
});
|
||||
|
||||
pi.on("agent_end", async (_event, ctx) => {
|
||||
pi.on("agent_end", async (_event: any, ctx: any) => {
|
||||
updateThinkingLevel();
|
||||
await refresh(ctx);
|
||||
});
|
||||
|
||||
pi.registerCommand("refresh-usage", {
|
||||
description: "Refresh account usage for the active provider",
|
||||
handler: async (_args, ctx) => {
|
||||
handler: async (_args: any, ctx: any) => {
|
||||
await refresh(ctx, true);
|
||||
ctx.ui.notify(usageSummary(statusbarState.report, statusbarState.error), statusbarState.error ? "warning" : "info");
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user