Typescript: ResizeObserver API declarations missing

Created on 9 Apr 2020  ·  10Comments  ·  Source: microsoft/TypeScript

Search Terms

Suggestion

  • lib.dom.ts does not include ResizeObserver API declarations.
  • ResizeObserver is already supported by all modern browser, typescript should provide the typs

Examples

https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver

Checklist

My suggestion meets these guidelines:

  • [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • [x] This wouldn't change the runtime behavior of existing JavaScript code
  • [x] This could be implemented without emitting different JS based on the types of the expressions
  • [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • [x] This feature would agree with the rest of TypeScript's Design Goals.
Bug lib.d.ts help wanted

Most helpful comment

Any progress on this?

All 10 comments

@orta hey! i just tried to prepare the PR:

  bareMessage: 'Attributes cannot accept sequence types',
  context: 'Syntax error at line 23, since `interface ResizeObserverEntry`:\n' +
    ' attribute sequence<ResizeObserverSize> borderBoxSize;\n' +

and got this error...

I'd make a work in progress PR on that repo, and ask for help if the IDL -> DTS translation requires changes

GitHub user @strothj implemented the type definitions in a gist. It should be possible to make a PR based on this.

Any progress on this?

Any updates here ?

If an issue is marked as “help wanted” and “milestone: backlog”, it means it's low priority. Furthermore there's a really simple walkaround. There is no open PR currently, but if you want this implemented in TS, you can start one 😁️

There is no open PR currently, but if you want this implemented in TS, you can start one
-m93a

As @sapkra said, https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/847 will fix this issue. Unfortunately the PR is inactive.

@m93a, In case you didn't know, just beneath the title of the issue and in the section on the right you can see if there are any pull requests that address the issue.

image

Unfortunately the PR is inactive.

Since that PR is inactive, I've done required changes in https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/948 (that's PR on top of changes from https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/847).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

weswigham picture weswigham  ·  3Comments

dlaberge picture dlaberge  ·  3Comments

blendsdk picture blendsdk  ·  3Comments

kyasbal-1994 picture kyasbal-1994  ·  3Comments

jbondc picture jbondc  ·  3Comments