返回打字稿中的IDBTRANSACTION
我正在尝试编写一些允许用户在打字稿中与indexedDB构建自己的交易的功能。
调用db.transction(...)
返回iDbpTransaction< ...>
哪种打字稿投诉是私人的。
如何从打字稿中的函数中返回IDBTRANSACTION
?
I'm trying to write some functions that allow a user to build their own transaction with IndexedDB in Typescript.
Calling db.transction(...)
returns an IDBPTransaction<...>
which Typescript complains is private.
How can I return an IDBTransaction
from a function in Typescript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IDBPTRANSACTION
实际上是IDB
npm软件包中的一种类型,而不是本机浏览器实现。为了返回
IDBTRANSACTION
,您需要直接使用indexedDB API。IDBPTransaction
is actually a type from theidb
NPM package, not from the native browser implementation.In order to return an
IDBTransaction
you need to use the IndexedDB API directly.