Skip to content

Commit 98cca9e

Browse files
rzhao271Copilot
andauthored
fix: module type mismatch (#1266)
Co-authored-by: Copilot <copilot@github.com>
1 parent 9329b35 commit 98cca9e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/store.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff 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+
2127
export class FileStore implements IStore {
2228
private static readonly DefaultPath = path.join(homedir(), '.vsce');
2329

@@ -75,7 +81,7 @@ export class FileStore implements IStore {
7581

7682
export 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
) { }

0 commit comments

Comments
 (0)