https://github.com/totvs/twebchannel-js
https://github.com/totvs/twebchannel-js
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/totvs/twebchannel-js
- Owner: totvs
- License: mit
- Created: 2019-07-26T18:21:58.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-05-25T20:47:35.000Z (about 4 years ago)
- Last Synced: 2025-06-13T03:04:43.847Z (about 1 year ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 4
- Watchers: 10
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# twebchannel-js
Implementação simples de comunicação com o componente AdvPL TWebChannel.
## Instalação:
```shell
npm install @totvs/twebchannel-js --save
```
## Uso:
#### connect
Inicia a conexão com o TWebChannel AdvPL
Parametros:
* callback: Function
```js
twebchannel.connect(callback);
```
#### jsToAdvpl
Executa uma chamada para a execução do bloco de código **bJsToAdvpl** do TWebChannel AdvPL.
Parametros:
* key: string
* value: string
```js
twebchannel.jsToAdvpl("key", "value");
```
#### advplToJs
Função que é executada ao receber uma chamada do metodo **advplToJs** do TWebChannel AdvPL.
Tipo: Function
Parâmetros:
* key: string
* value: string
```js
twebchannel.advplToJs = function(key, value) {
console.log(key, value);
}
```