0.1.8 • Published 10 months ago

@saber2pr/vscode-webview v0.1.8

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months 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

10 months ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.0.9

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.5

2 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.1

3 years ago