Skip to content

tabs.ts: Loosen type of SvgGraph.svg#193

Open
SamB wants to merge 1 commit intorems-project:masterfrom
SamB:fix-svg-property-type
Open

tabs.ts: Loosen type of SvgGraph.svg#193
SamB wants to merge 1 commit intorems-project:masterfrom
SamB:fix-svg-property-type

Conversation

@SamB
Copy link
Copy Markdown

@SamB SamB commented Mar 16, 2022

@types/jquery version 3.3.35 and 3.3.36 made some changes to the type
of JQuery.find(), see the PRs:

As a result, the following line in SvgGraph.setSVG would fail to
typecheck:

      this.svg = this.container.find('svg')

But if we change the svg property's type from JQuery<HTMLElement> to
JQuery<Element>, we don't have to care about the changes: it typechecks
either way.

`@types/jquery` version 3.3.35 and 3.3.36 made some changes to the type
of JQuery.find(), see the PRs:

  * DefinitelyTyped/DefinitelyTyped#43857

  * DefinitelyTyped/DefinitelyTyped#44051

As a result, the following line in SvgGraph.setSVG would fail to
typecheck:

```typescript
      this.svg = this.container.find('svg')
```

But if we change the svg property's type from `JQuery<HTMLElement>` to
`JQuery<Element>`, we don't have to care about the changes: it typechecks
either way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant