apiKeys in setApiKeys has the wrong TS type
Silver-Golden opened this issue · 1 comments
Silver-Golden commented
remotestorage.js/src/remotestorage.ts
Line 521 in 8ff81f0
Currently it is as above, which is the JSDoc format I believe.
However for typescript it could be better to repersent it as
interface ApiKeys {
googledrive?: string;
dropbox?: string;
}
setApiKeys (apiKeys: ApiKeys ): void | boolean {
// ...
}
In its current state the mismatch is causing me to use @ts-ignore
// current
// @ts-ignore
remoteStorage.setApiKeys({googledrive: 'key'});
// what TS expects based off the current types
remoteStorage.setApiKeys({type: 'googledrive', key: "key"});
raucao commented
Good catch! Your solution looks good to me. Want to open a PR with that?