From d8e7aaad1b8d970831fdf9e428e54e99b377b2a8 Mon Sep 17 00:00:00 2001 From: Markus Wolf Date: Fri, 27 Jan 2023 12:40:55 +0100 Subject: [PATCH 1/3] docs: add typescript setup notice Mention that `openpgpjs` does needs types from `@openpgp/web-stream-tools`. --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 144cbf416..7a8902706 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,17 @@ import * as openpgp from './openpgp.min.mjs'; To offload cryptographic operations off the main thread, you can implement a Web Worker in your application and load OpenPGP.js from there. For an example Worker implementation, see `test/worker/worker_example.js`. +#### TypeScript + +For typescript support you have to add `@openpgp/web-stream-tools` to your dependencies as well. + +```sh +npm install --save openpgp +npm install --save-dev @openpgp/web-stream-tools +``` + +We are relying on types from the `web-stream-tools` package but do not want to put TypeScript only dependencies into our dependencies. + ### Examples Here are some examples of how to use OpenPGP.js v5. For more elaborate examples and working code, please check out the [public API unit tests](https://github.com/openpgpjs/openpgpjs/blob/main/test/general/openpgp.js). If you're upgrading from v4 it might help to check out the [changelog](https://github.com/openpgpjs/openpgpjs/wiki/V5-Changelog) and [documentation](https://github.com/openpgpjs/openpgpjs#documentation). From 0e5f5b600465f38000de50152acfaf43726f55c0 Mon Sep 17 00:00:00 2001 From: Markus Wolf Date: Mon, 30 Jan 2023 14:32:00 +0100 Subject: [PATCH 2/3] Update README.md Co-authored-by: larabr --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 7a8902706..e63148656 100644 --- a/README.md +++ b/README.md @@ -174,10 +174,9 @@ To offload cryptographic operations off the main thread, you can implement a Web #### TypeScript -For typescript support you have to add `@openpgp/web-stream-tools` to your dependencies as well. +Since TS is not fully integrated in the library, TS-only dependencies are currently listed as `devDependencies`, so to compile the project you’ll need to add `@openpgp/web-stream-tools` manually: ```sh -npm install --save openpgp npm install --save-dev @openpgp/web-stream-tools ``` From 966eb94a4c56abd8922457f67c698cc1b028b637 Mon Sep 17 00:00:00 2001 From: Markus Wolf Date: Mon, 30 Jan 2023 14:32:06 +0100 Subject: [PATCH 3/3] Update README.md Co-authored-by: larabr --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e63148656..030ff8004 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,7 @@ Since TS is not fully integrated in the library, TS-only dependencies are curren npm install --save-dev @openpgp/web-stream-tools ``` -We are relying on types from the `web-stream-tools` package but do not want to put TypeScript only dependencies into our dependencies. +If you notice missing or incorrect type definitions, feel free to open a PR. ### Examples