CI: Test type definitions

Also, fix a typo in the typings.
This commit is contained in:
Daniel Huigens 2021-03-27 11:27:17 +01:00
parent e1fc91958c
commit eb496d2018
3 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1,21 @@
name: Types
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
lint:
name: Test type definitions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '15'
- run: npm ci
- run: npm run test-type-definitions

2
openpgp.d.ts vendored
View File

@ -147,7 +147,7 @@ export function readMessage<T extends MaybeStream<string>>(options: { armoredMes
export function readMessage<T extends MaybeStream<Uint8Array>>(options: { binaryMessage: T, config?: PartialConfig }): Promise<Message<T>>;
export function createMessage<T extends MaybeStream<string>>(options: { text: T, filename?: string, date?: Date, type?: DataPacketType }): Message<T>;
export function createMessage<T extends MaybeStream<Uint8Array>>(options: { bytes: T, filename?: string, date?: Date, type?: DataPacketType }): Message<T>;
export function createMessage<T extends MaybeStream<Uint8Array>>(options: { binary: T, filename?: string, date?: Date, type?: DataPacketType }): Message<T>;
export function encrypt<T extends MaybeStream<Data>>(options: EncryptOptions & { message: Message<T>, armor: false }): Promise<
T extends WebStream<infer X> ? WebStream<Uint8Array> :

View File

@ -6,7 +6,7 @@
* - if it fails to run, edit this file to match the actual library API, then edit the definitions file (openpgp.d.ts) accordingly.
*/
import { generateKey, readKey, readKeys, Key, readMessage, createMessage, createCleartextMessage, encrypt, decrypt, sign, verify, config } from '../..';
import { generateKey, readKey, readKeys, Key, readMessage, createMessage, Message, createCleartextMessage, encrypt, decrypt, sign, verify, config } from '../..';
import { expect } from 'chai';