improve docs, fix example

This commit is contained in:
Franz Heinzmann (Frando)
2022-06-29 17:53:45 +02:00
committed by Simon Laux
parent 035e208e4f
commit 329f498651
5 changed files with 72 additions and 38 deletions

View File

@@ -27,16 +27,29 @@ If you are targetting other architectures (like KaiOS or Android), the webserver
cross build --features=webserver --target armv7-linux-androideabi --release
```
### Using the typescript client
The package includes TypeScript bindings which are partially auto-generated through the JSON-RPC library used by this crate ([yerpc](https://github.com/Frando/yerpc/)). Find the source in the [`typescript`](typescript) folder. The client is also published on npm as `@deltachat/jsonrpc-client`.
To use it locally, first install the dependencies and compile the TypeScript code to JavaScript:
```sh
cd typescript
npm install
npm run build
```
You can also build autogenerated documentation, including all RPC methods:
```sh
cd typescript
npm run docs
```
Now, open the [`typescript/docs`](typescript/docs) folder in a web browser.
### Running the example app
We include a small demo web application that talks to the WebSocket server. To run it, follow these steps:
* The package includes TypeScript bindings which are partially auto-generated through the JSON-RPC library used by this crate ([yerpc](https://github.com/Frando/yerpc/)).
```sh
cd typescript
npm install
npm run build
```
* Then, build and run the example application:
```sh