@@ -43,6 +43,8 @@ class Storage {
43
43
44
44
const { peerId, keychain, isNew } = await loadRepo ( repo , options )
45
45
46
+ // TODO: throw error?
47
+ // @ts -ignore On start, keychain will always be available
46
48
return new Storage ( peerId , keychain , repo , print , isNew )
47
49
}
48
50
}
@@ -52,7 +54,7 @@ module.exports = Storage
52
54
*
53
55
* @param {Repo } repo
54
56
* @param {RepoOptions & InitOptions } options
55
- * @returns {Promise<{peerId: PeerId, keychain:Keychain, isNew:boolean }> }
57
+ * @returns {Promise<{peerId: PeerId, keychain: Keychain | undefined , isNew:boolean }> }
56
58
*/
57
59
const loadRepo = async ( repo , options ) => {
58
60
const openError = await openRepo ( repo )
@@ -96,7 +98,7 @@ const openRepo = async (repo) => {
96
98
/**
97
99
* @param {Repo } repo
98
100
* @param {RepoOptions & InitOptions } options
99
- * @returns {Promise<{peerId: PeerId, keychain:Keychain}> }
101
+ * @returns {Promise<{peerId: PeerId, keychain: Keychain | undefined }> }
100
102
*/
101
103
const initRepo = async ( repo , options ) => {
102
104
// 1. Verify that repo does not exist yet (if it does and we could not
@@ -197,7 +199,7 @@ const peerIdToIdentity = (peerId) => ({
197
199
*
198
200
* @param {Repo } repo
199
201
* @param {ConfigureOptions } options
200
- * @returns {Promise<{peerId: PeerId, keychain:Keychain}> }
202
+ * @returns {Promise<{peerId: PeerId, keychain: Keychain | undefined }> }
201
203
*/
202
204
const configureRepo = async ( repo , { config, profiles, pass } ) => {
203
205
const original = await repo . config . getAll ( )
@@ -297,5 +299,5 @@ const applyProfiles = (config, profiles) => {
297
299
* @typedef {import('.').IPFSConfig } IPFSConfig
298
300
* @typedef {import('../interface/repo').Repo<IPFSConfig> } Repo
299
301
* @typedef {import('libp2p-crypto').KeyType } KeyType
300
- * @typedef {import('libp2p').LibP2PKeychain } Keychain
302
+ * @typedef {import('libp2p/src/keychain') } Keychain
301
303
*/
0 commit comments