【问题标题】:How to access iOS native types?如何访问 iOS 原生类型?
【发布时间】:2021-05-27 13:47:42
【问题描述】:

继承并尝试更新 Nativescript 项目。看起来我之前的开发人员正在访问 iOS 本机 PDFKit 以处理 PDF,但输入时出现错误“找不到名称‘PDFDocument’”

所有发生的事情是在我的 .ts 文件中声明了一个变量: private _document: PDFDocument;

有什么需要进口的吗?有什么我遗漏的吗?

【问题讨论】:

    标签: nativescript angular2-nativescript nativescript-angular


    【解决方案1】:

    当您使用 Nativescript 7+ 时,请确保您的 references.d.ts 中有以下代码。这应该可以让您获得PDFKit 的类型,包括PDFDocument

    /// <reference path="./node_modules/@nativescript/types-ios/index.d.ts" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-25
      • 2018-07-14
      • 1970-01-01
      • 2023-01-27
      • 1970-01-01
      • 2021-04-30
      • 1970-01-01
      相关资源
      最近更新 更多