File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ export interface IStore extends Iterable<IPublisher> {
1818 delete ( name : string ) : Promise < void > ;
1919}
2020
21+ export interface IKeytar {
22+ findCredentials ( service : string ) : Promise < Array < { account : string ; password : string } > > ;
23+ setPassword ( service : string , account : string , password : string ) : Promise < void > ;
24+ deletePassword ( service : string , account : string ) : Promise < boolean > ;
25+ } ;
26+
2127export class FileStore implements IStore {
2228 private static readonly DefaultPath = path . join ( homedir ( ) , '.vsce' ) ;
2329
@@ -75,7 +81,7 @@ export class FileStore implements IStore {
7581
7682export class KeytarStore implements IStore {
7783 static async open ( serviceName = 'vscode-vsce' ) : Promise < KeytarStore > {
78- const keytar = await import ( 'keytar' ) ;
84+ const keytar = await import ( 'keytar' ) . then ( module => module . default ) ;
7985 const creds = await keytar . findCredentials ( serviceName ) ;
8086
8187 return new KeytarStore (
@@ -90,7 +96,7 @@ export class KeytarStore implements IStore {
9096 }
9197
9298 private constructor (
93- private readonly keytar : typeof import ( 'keytar' ) ,
99+ private readonly keytar : IKeytar ,
94100 private readonly serviceName : string ,
95101 private publishers : IPublisher [ ]
96102 ) { }
You can’t perform that action at this time.
0 commit comments