簡體   English   中英

Forge Viewer 的 TypeScript 定義缺少 Profiles 相關的類型

[英]TypeScript Definitions for Forge Viewer missing Profiles related typings

我正在使用來自絕對類型存儲庫的 Forge 打字稿定義: https : //github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/forge-viewer

但我缺少很多類型,特別是與配置文件管理相關的類型:

viewer.registerProfile(...)
wiewer.setProfile(...)
constructor: Autodesk.Viewing.Profile(customProfileSettings...)
Autodesk.Viewing.ProfileSettings.AEC
Autodesk.Viewing.ProfileSettings.clone(...)

還需要設置 FPS 的功能:

viewer.impl.setFPSTargets(...)

我不知道如何聲明它們,因為即使在 Autodesk 的文檔中它們也不見了:

https://forge.autodesk.com/en/docs/viewer/v7/reference/globals/TypeDefs/ProfileSettings/

任何人都有關於如何實施它們的這些類型的一些指導(不太籠統)?

並非所有函數或屬性都在類型定義中聲明,而您可以按照查看器源代碼中的定義添加它們。 例如對於 setFPSTargets,查看器源中的定義是:

在此處輸入圖片說明

在類型中,聲明可以是:

在此處輸入圖片說明

impl 中的函數或屬性並未正式發布,因此未在 API 幫助文檔中公開。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM