🏷️ update IMessenger.on return type
This commit is contained in:
parent
6dff57d719
commit
b7a7ed427e
3 changed files with 12 additions and 22 deletions
|
|
@ -38,12 +38,9 @@ export type ToCoreFromIdeOrWebviewProtocol = {
|
|||
void,
|
||||
];
|
||||
"config/ideSettingsUpdate": [IdeSettings, void];
|
||||
"config/getBrowserSerialized": [
|
||||
undefined,
|
||||
Promise<BrowserSerializedContinueConfig>,
|
||||
];
|
||||
"config/getBrowserSerialized": [undefined, BrowserSerializedContinueConfig];
|
||||
"config/deleteModel": [{ title: string }, void];
|
||||
"config/reload": [undefined, Promise<BrowserSerializedContinueConfig>];
|
||||
"config/reload": [undefined, BrowserSerializedContinueConfig];
|
||||
"context/getContextItems": [
|
||||
{
|
||||
name: string;
|
||||
|
|
@ -51,14 +48,11 @@ export type ToCoreFromIdeOrWebviewProtocol = {
|
|||
fullInput: string;
|
||||
selectedCode: RangeInFile[];
|
||||
},
|
||||
Promise<ContextItemWithId[]>,
|
||||
];
|
||||
"context/loadSubmenuItems": [
|
||||
{ title: string },
|
||||
Promise<ContextSubmenuItem[]>,
|
||||
ContextItemWithId[],
|
||||
];
|
||||
"context/loadSubmenuItems": [{ title: string }, ContextSubmenuItem[]];
|
||||
"context/addDocs": [{ title: string; url: string }, void];
|
||||
"autocomplete/complete": [AutocompleteInput, Promise<string[]>];
|
||||
"autocomplete/complete": [AutocompleteInput, string[]];
|
||||
"autocomplete/cancel": [undefined, void];
|
||||
"autocomplete/accept": [{ completionId: string }, void];
|
||||
"command/run": [
|
||||
|
|
@ -80,7 +74,7 @@ export type ToCoreFromIdeOrWebviewProtocol = {
|
|||
completionOptions: LLMFullCompletionOptions;
|
||||
title: string;
|
||||
},
|
||||
Promise<string>,
|
||||
string,
|
||||
];
|
||||
"llm/streamComplete": [
|
||||
{
|
||||
|
|
@ -109,14 +103,8 @@ export type ToCoreFromIdeOrWebviewProtocol = {
|
|||
},
|
||||
ProtocolGeneratorType<DiffLine>,
|
||||
];
|
||||
"stats/getTokensPerDay": [
|
||||
undefined,
|
||||
Promise<{ day: string; tokens: number }[]>,
|
||||
];
|
||||
"stats/getTokensPerModel": [
|
||||
undefined,
|
||||
Promise<{ model: string; tokens: number }[]>,
|
||||
];
|
||||
"stats/getTokensPerDay": [undefined, { day: string; tokens: number }[]];
|
||||
"stats/getTokensPerModel": [undefined, { model: string; tokens: number }[]];
|
||||
"index/setPaused": [boolean, void];
|
||||
"index/forceReIndex": [undefined | string, void];
|
||||
completeOnboarding: [
|
||||
|
|
|
|||
|
|
@ -29,7 +29,9 @@ export interface IMessenger<
|
|||
|
||||
on<T extends keyof ToProtocol>(
|
||||
messageType: T,
|
||||
handler: (message: Message<ToProtocol[T][0]>) => ToProtocol[T][1],
|
||||
handler: (
|
||||
message: Message<ToProtocol[T][0]>,
|
||||
) => Promise<ToProtocol[T][1]> | ToProtocol[T][1],
|
||||
): void;
|
||||
|
||||
request<T extends keyof FromProtocol>(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ToWebviewProtocol } from "core/web/webviewProtocol";
|
||||
import type { ToWebviewProtocol } from "core/protocol";
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { useWebviewListener } from "./useWebviewListener";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue