Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rawNotations Property Missing from SignaturePacket Type #1569

Closed
LeoKotschenreuther opened this issue Oct 19, 2022 · 3 comments
Closed

rawNotations Property Missing from SignaturePacket Type #1569

LeoKotschenreuther opened this issue Oct 19, 2022 · 3 comments

Comments

@LeoKotschenreuther
Copy link
Contributor

  • OpenPGP.js version: v5.5.0
  • Affected platform (Browser or Node.js version): Node.js v14.17.5

The rawNotations property is missing from the SignaturePacket type in the projects openpgp.d.ts file.

Consider the following function:

import openpgp from 'openpgp';

async function getNumberOfRawNotations(signature: openpgp.Key): Promise<number> {
  const primaryUser = await walletSignature.getPrimaryUser();
  return primaryUser.user.otherCertifications[0].rawNotations.length;
}

TypeScript errors on compilation with the error TS2339: Property 'rawNotations' does not exist on type 'SignaturePacket'. even though the property exists on the implementation of the SignaturePacket.

I can submit a PR to fix this myself if somebody is so kind and lets me know what type the rawNotations property is.

@larabr
Copy link
Collaborator

larabr commented Oct 19, 2022

Hi, thanks for spotting this, it'd be great if you could open a PR.
The type of a rawNotation entry is { name: string; value: Uint8Array(); humanReadable: boolean } -- rawNotations is an array of those. 🙂

LeoKotschenreuther added a commit to LeoKotschenreuther/openpgpjs that referenced this issue Oct 20, 2022
This commits adds the `rawNotations` property and the appropriate
interface definition to the SignaturePacket class in the d.ts file.
@LeoKotschenreuther
Copy link
Contributor Author

Here you go: #1571

@larabr
Copy link
Collaborator

larabr commented Oct 24, 2022

Thanks for the fix!

@larabr larabr closed this as completed Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants