diff --git a/src/matrix/storage/idb/Transaction.js b/src/matrix/storage/idb/Transaction.js index 93690017..8b85b795 100644 --- a/src/matrix/storage/idb/Transaction.js +++ b/src/matrix/storage/idb/Transaction.js @@ -33,7 +33,7 @@ import {InboundGroupSessionStore} from "./stores/InboundGroupSessionStore"; import {OutboundGroupSessionStore} from "./stores/OutboundGroupSessionStore"; import {GroupSessionDecryptionStore} from "./stores/GroupSessionDecryptionStore"; import {OperationStore} from "./stores/OperationStore"; -import {AccountDataStore} from "./stores/AccountDataStore.js"; +import {AccountDataStore} from "./stores/AccountDataStore"; export class Transaction { constructor(txn, allowedStoreNames, IDBKeyRange) { diff --git a/src/matrix/storage/idb/stores/AccountDataStore.js b/src/matrix/storage/idb/stores/AccountDataStore.ts similarity index 57% rename from src/matrix/storage/idb/stores/AccountDataStore.js rename to src/matrix/storage/idb/stores/AccountDataStore.ts index 7f22a518..1a7e3e68 100644 --- a/src/matrix/storage/idb/stores/AccountDataStore.js +++ b/src/matrix/storage/idb/stores/AccountDataStore.ts @@ -13,17 +13,25 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +import {Store} from "../Store" + +interface AccountDataEntry { + type: string + content: { [key : string] : any } +} export class AccountDataStore { - constructor(store) { - this._store = store; - } + private _store: Store - async get(type) { - return await this._store.get(type); - } + constructor(store: Store) { + this._store = store; + } - set(event) { - return this._store.put(event); - } + async get(type: string): Promise { + return await this._store.get(type); + } + + set(event: AccountDataEntry): Promise { + return this._store.put(event); + } }