跳到主要内容

bn.getStorageInfoSync

getStorageInfoSync(): StorageInfo

description Gets information about the current storage synchronously.

example

try {
const res = bn.getStorageInfoSync()
console.log(res.keys)
console.log(res.currentSize)
console.log(res.limitSize)
} catch (error) {
// From the something when catch error
}

Returns

StorageInfo

StorageInfo


Interface: StorageInfo

NameTypeDescription
keysstring[]All keys in the current storage
currentSizenumberCurrent space occupied (in KB)
limitSizenumberSpace size limit (in KB)