Skip to content

Fix: TypeScript Type Error when exactOptionalPropertyTypes is enabled#93

Open
taranda wants to merge 1 commit into
PeculiarVentures:masterfrom
taranda:patch-1
Open

Fix: TypeScript Type Error when exactOptionalPropertyTypes is enabled#93
taranda wants to merge 1 commit into
PeculiarVentures:masterfrom
taranda:patch-1

Conversation

@taranda
Copy link
Copy Markdown

@taranda taranda commented Mar 18, 2026

This PR should resolve issue #92.

Right now, when exactOptionalPropertyTypes: true, running npx tsc results in the following error:

node_modules/node-webcrypto-p11/build/index.d.ts:156:15 - error TS2420: Class 'CryptoKey$1<T>' incorrectly implements interface 'AlwaysAuthenticateParams'.
  Types of property 'alwaysAuthenticate' are incompatible.
    Type 'boolean | undefined' is not assignable to type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.

156 declare class CryptoKey$1<T extends Pkcs11KeyAlgorithm = Pkcs11KeyAlgorithm> extends core.CryptoKey implements AlwaysAuthenticateParams {
                  ~~~~~~~~~~~


Found 1 error in node_modules/node-webcrypto-p11/build/index.d.ts:156

This PR should fix that.

to make CryptoKey class properly implment AlwaysAuthenticateParams. Issue PeculiarVentures#92.
@fenichelar
Copy link
Copy Markdown

@microshine sorry to ping you but would it be possible for this to be reviewed?

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

Successfully merging this pull request may close these issues.

2 participants