Skip to content

Commit ee13d2e

Browse files
committed
include custom declaration file and fix typing in test file
1 parent 3b8c7ee commit ee13d2e

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

lib/keystore.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ describe('keystore', () => {
2424
privKey: 'privkey1',
2525
cert: 'cert1',
2626
keyAlg: 'RS256',
27-
pubkeyJwk: {kid: '1', x5c: ''},
27+
pubkeyJwk: {kid: '1', x5c: ''} as any,
2828
})
2929
newKeys.set('2', {
3030
timestamp: Math.floor(Date.now() / 1000) - 20000,
3131
privKey: 'privkey2',
3232
cert: 'cert2',
3333
keyAlg: 'RS256',
34-
pubkeyJwk: {kid: '2', x5c: ''},
34+
pubkeyJwk: {kid: '2', x5c: ''} as any,
3535
})
3636
return newKeys
3737
}

tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
"es2018"
1717
],
1818
"resolveJsonModule": true,
19-
"noEmitOnError": true
19+
"noEmitOnError": true,
20+
"typeRoots": [
21+
"node_modules/@types",
22+
"./types"
23+
]
2024
},
2125
"exclude": [
2226
"dist",

jsrsasign.d.ts renamed to types/jsrsasign/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ declare module 'jsrsasign' {
269269
*
270270
* @return returns RSAKey/KJUR.crypto.{ECDSA,DSA} object of public key
271271
*/
272-
static getPublicKeyFromCertHex(h: string)
272+
static getPublicKeyFromCertHex(h: string): any
273273

274274
/**
275275
* Get RSA/DSA/ECDSA public key object from PEM certificate string.
@@ -278,7 +278,7 @@ declare module 'jsrsasign' {
278278
*
279279
* @return returns RSAKey/KJUR.crypto.{ECDSA,DSA} object of public key
280280
*/
281-
static getPublicKeyFromCertPEM(sCertPEM: string)
281+
static getPublicKeyFromCertPEM(sCertPEM: string): any
282282

283283
/**
284284
* Get public key information from PEM certificate.
@@ -287,7 +287,7 @@ declare module 'jsrsasign' {
287287
*
288288
* @return hash of information for public key
289289
*/
290-
static getPublicKeyInfoPropOfCertPEM(sCertPEM: string)
290+
static getPublicKeyInfoPropOfCertPEM(sCertPEM: string): any
291291
}
292292

293293
function hextob64(s: string): string

0 commit comments

Comments
 (0)