使用ou.d.ts从typescript文件中调用Js-lib



我想使用一个javascript库,在我的typescript项目中提供控件,但在typescript或.d.ts中没有这个库的定义。有可能吗?

所以让我纠正一下我想使用devexpress库面板查看器https://documentation.devexpress.com/Dashboard/119108/Building-the-Designer-and-Viewer-Applications/Web-Dashboard/HTML-JavaScript-Dashboard-Controlhttps://documentation.devexpress.com/Dashboard/119158/Building-the-Designer-and-Viewer-Applications/Web-Dashboard/HTML-JavaScript-Dashboard-Control/Client-Side-Configuration-Global-Namespaces

但在devexpress组的typescript.d.ts中,他们没有计划使用此功能进行控制

DevExpress.Dashboard.ResourceManager.embedBundledResources();
// Creates a new Web Dashboard control with the specified ID and settings:
var dashboardControl = new DevExpress.Dashboard.DashboardControl(document.getElementById("container"), {
// Configures an URL where the Web Dashboard's server-side is hosted:
endpoint: "https://demos.devexpress.com/services/dashboard/api",
workingMode: "Viewer",
extensions: {
"dashboard-panel": (control) => new DevExpress.Dashboard.DashboardPanelExtension(control)
}
});

我想在我的typescript文件中使用它,这样即使javascript加载在我的html文件中,它也不会被识别

Thx,Razgort

我通过运行命令npm i @types/knockout修复了它

最新更新