11import { PaymentInformation } from '@paystring/utils'
2- import { JWKECKey , JWKOctKey , JWKOKPKey , JWKRSAKey } from 'jose'
2+ import { JWK } from 'jose/webcrypto/types '
33import * as Vorpal from 'vorpal'
44
55/**
@@ -53,12 +53,10 @@ export default class LocalStorage {
5353 * @param name - The name of the key.
5454 * @returns The key or null.
5555 */
56- public getSigningKeys (
57- name : string ,
58- ) : Array < JWKRSAKey | JWKECKey | JWKOKPKey | JWKOctKey > {
56+ public getSigningKeys ( name : string ) : JWK [ ] {
5957 const existing = this . getItem ( name )
6058 if ( existing ) {
61- return existing as Array < JWKRSAKey | JWKECKey | JWKOKPKey | JWKOctKey >
59+ return existing as JWK [ ]
6260 }
6361 return [ ]
6462 }
@@ -70,10 +68,7 @@ export default class LocalStorage {
7068 * @param name - The name of the key.
7169 * @param key - The key to store.
7270 */
73- public addSigningKey (
74- name : string ,
75- key : JWKRSAKey | JWKECKey | JWKOKPKey | JWKOctKey ,
76- ) : void {
71+ public addSigningKey ( name : string , key : JWK ) : void {
7772 const keys = this . getSigningKeys ( name )
7873 const updated = keys . concat ( key )
7974 this . setItem ( name , JSON . stringify ( updated ) )
@@ -94,12 +89,7 @@ export default class LocalStorage {
9489 * @param name - The name of the item to get.
9590 * @returns The object or undefined if not in localstore.
9691 */
97- private getItem (
98- name : string ,
99- ) :
100- | Array < JWKRSAKey | JWKECKey | JWKOKPKey | JWKOctKey >
101- | PaymentInformation
102- | undefined {
92+ private getItem ( name : string ) : JWK [ ] | PaymentInformation | undefined {
10393 const rawValue = this . localStorage . getItem ( name )
10494 if ( rawValue && typeof rawValue === 'string' ) {
10595 try {
0 commit comments