0.1.8 • Published 2 years ago

@saber2pr/vscode-webview v0.1.8

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@saber2pr/vscode-webview

vscode webview utils.

yarn add @saber2pr/vscode-webview

Feature

import {
  callService,
  createServiceHandler,
  Pair,
} from '@saber2pr/vscode-webview'

// service type define
export type Services = {
  sayHello: Pair<any, any>
}

const handleServiceMessage = createServiceHandler<Services>({
  sayHello: () => vscode.window.showInformationMessage('Hello! Webview!'),
})

// extension.ts
webviewPanel.webview.onDidReceiveMessage(
  message => handleServiceMessage(webviewPanel, message),
  null,
  context.subscriptions
)

// web
callService<Services, 'sayHello'>('sayHello', null).then(res => {})
0.1.8

2 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.9

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.5

3 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.1

4 years ago