Skip to content

TS: missing declaration for verify with CleartextMessage input #1582

@H01001000

Description

@H01001000
  • OpenPGP.js version: checked for 5.2.0 and 5.5.0
  • Affected platform (Browser or Node.js version): nodejs typescript

Following the example sign-and-verify-cleartext-messages on README, typescript will throw a type error for message property in openpgp.verify option:

No overload matches this call.
  Overload 1 of 2, '(options: VerifyOptions & { message: Message<MaybeStream<Data>>; format: "binary"; }): Promise<VerifyMessageResult & { ...; }>', gave the following error.
    Type 'CleartextMessage' is not assignable to type 'Message<MaybeStream<Data>> | (CleartextMessage & Message<MaybeStream<Data>>)'.
  Overload 2 of 2, '(options: VerifyOptions & { message: Message<MaybeStream<Data>>; }): Promise<VerifyMessageResult & { data: WebStream<string>; }>', gave the following error.
    Type 'CleartextMessage' is not assignable to type 'Message<MaybeStream<Data>> | (CleartextMessage & Message<MaybeStream<Data>>)'.ts(2769)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions