Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stack-spot/vscode-async-webview-client",
"version": "0.7.2",
"version": "0.7.3",
"repository": "github:stack-spot/vscode-async-webview",
"main": "out/index.js",
"module": "out/index.mjs",
Expand Down
18 changes: 15 additions & 3 deletions packages/client/src/VSCodeWebInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ type Unpromisify<T> = T extends Promise<infer R> ? Unpromisify<R> : T
// extract only the functions of the Bridge and make every return type a Promise if not already
export type LinkedBridge<T> = Omit<{
[K in keyof T as T[K] extends (...args: any) => any ? K : never]:
T[K] extends (...args: infer Args) => infer Return
? (...args: Args) => Promise<Unpromisify<Return>>
: never
T[K] extends (...args: infer Args) => infer Return
? (...args: Args) => Promise<Unpromisify<Return>>
: never
}, 'dispose' | 'stream'>

export interface VSCodeWebInterface<
Expand Down Expand Up @@ -59,4 +59,16 @@ export interface VSCodeWebInterface<
* Client communicate that DOM are mounted
*/
setViewReady?: () => void,
/**
* Logs a message to the console.
*
* @param {string} text - The message to log.
*/
log(text: string): void,
/**
* Logs an error message to the console.
*
* @param {string} text - The error message to log.
*/
error(text: string): void
}