javascript - Calling typescript interface from commonJS function call
问题描述
I have this code sample in ts AuthorityProvider is an interface its implemented on the library like this
export interface AuthorityProvider {
/** Get subset of `availableKeys` needed to meet authorities in `transaction` */
getRequiredKeys: (args: AuthorityProviderArgs) => Promise<string[]>;
}
TScode
const authorityProvider: AuthorityProvider = {
getRequiredKeys: (args: AuthorityProviderArgs): Promise<string[]> => {
return Promise.resolve([accountPublicKey])
},
}
I tried to recode this on CommonJS but no luck please advice this is my code
const authorityProvider = ( getRequiredKeys => {
return Promise.resolve([accountPublicKey])
})
解决方案
推荐阅读
- oracle - Toad:自动在两个 Oracle 表之间进行每日传输?
- javascript - 为什么 useEffect 不再运行我的 API 提取并将结果保存到状态?
- zend-framework - LUCENE FULLTEXT INDEX (Orientdb / Lucene) 上的十进制范围搜索查询
- javascript - 在 NodeJS 中过滤和排序文档数组
- sql - 提取 XML 数据并输出到文件以保存在文件夹中
- sql - WHEN 语句中具有多个 LIKE 和 NOT LIKE 的 SQL 查询
- c# - 无法使用c#运行命令
- html - 打印时如何在 React 中操作主题?
- c++ - 如何实现电压降的计算?
- c# - 为什么将值分配给小数后使用“m”?