有没有办法强制打字稿的window
对象解析PaymentRequest
属性?这是我的角度组件中的代码示例:
if (window.PaymentRequest) {
// This browser supports Payment Request
} else {
// Browser does not support Payment Request
}
这是我得到的一个错误:
error TS2339: Property 'PaymentRequest' does not exist on type 'Window'.