ResizeObserver not present on the Window interface

未关闭
#1,683 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
typescript
领域
tooling

调研方向

首先跟踪 ResizeObserver 和 Window 的生成器输入以及生成的 DOM 声明。验证 Window 接口是如何表示的,然后运行仓库中相关的生成或类型检查;当 popup.ResizeObserver 通过类型检查且全局声明仍然可用时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

The ResizeObserver class is only available as a global declaration and not on the Window interface. I think it should also be available on the Window interface for at least two reasons:

  • The specification (https://drafts.csswg.org/resize-observer/#idl-index) says [Exposed=(Window)], which I’m guessing means that it is supposed to be on the Window interface (I’m actually surprised, isn’t the specification supposed to be automatically translated to Typescript declarations?)
  • For applications with several windows, it behaves differently depending on the window from which it is taken (see https://codepen.io/Latcarf/pen/RwdyLXr?editors=0010). So it would make a lot of sense to be able to do the following, which currently doesn’t typecheck as popup is of type Window.
const popup = window.open(...)!;
new popup.ResizeObserver(...);
主要语言
TypeScript
星标
740
派生
474
平均合并
2 天 8 小时
30 天内合并 PR
15

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/TypeScript-DOM-lib-generator 的其他 Issue

查看 microsoft/TypeScript-DOM-lib-generator 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。