Skip to content

three: fix SVGResult.xml type to SVGSVGElement - #75563

Open
DanielGekeler wants to merge 1 commit into
DefinitelyTyped:masterfrom
DanielGekeler:master
Open

DanielGekeler wants to merge 1 commit into
DefinitelyTyped:masterfrom
DanielGekeler:master

Conversation

@DanielGekeler

Copy link
Copy Markdown

SVGLoader.parse() returns xml.documentElement from a DOMParser result, which is the parsed SVG root element, not an XMLDocument.

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: three.js/examples/jsm/loaders/SVGLoader.js
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the package.json.

Example

// before change:
(new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg"></svg>`, 'image/svg+xml')).documentElement instanceof XMLDocument === false
// after change:
(new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg"></svg>`, 'image/svg+xml')).documentElement instanceof SVGSVGElement === true

SVGLoader.parse() returns xml.documentElement from a DOMParser result,
which is the parsed SVG root element, not an XMLDocument.
@typescript-automation

typescript-automation Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

@DanielGekeler Thank you for submitting this PR!

This is a live comment that I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 Most recent commit is approved by a DT maintainer

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 75563,
  "author": "DanielGekeler",
  "headCommitOid": "e4d1dc23146109d974615db519879b8f3ed6ddda",
  "mergeBaseOid": "8bdaaa196899f9f2b986311cfe557c471940598b",
  "lastPushDate": "2026-09-12T14:59:26.000Z",
  "lastActivityDate": "2026-09-16T16:32:21.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "tooManyCommits": false,
  "tooManyReviews": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "three",
      "version": "0.186",
      "kind": "edit",
      "files": [
        {
          "path": "types/three/examples/jsm/loaders/SVGLoader.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/three/test/unit/examples/jsm/loaders/SVGLoader.ts",
          "kind": "test"
        },
        {
          "path": "types/three/tsconfig.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [
        "joshuaellis",
        "Methuselah96"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "changereq",
      "reviewer": "Methuselah96",
      "date": "2026-09-14T18:39:04.000Z"
    }
  ],
  "mainBotCommentID": 5646671804,
  "ciResult": "pass"
}

@typescript-automation

Copy link
Copy Markdown
Contributor

🔔 @joshuaellis @Methuselah96 — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-automation typescript-automation Bot moved this to Waiting for Code Reviews in Pull Request Status Board Sep 12, 2026
@typescript-automation typescript-automation Bot moved this from Waiting for Code Reviews to Needs Maintainer Review in Pull Request Status Board Sep 12, 2026

@Methuselah96 Methuselah96 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you create a pull request for this over at https://github.com/three-types/three-ts-types where the types are maintained? Thanks!

@typescript-automation typescript-automation Bot added the Revision needed This PR needs code changes before it can be merged. label Sep 14, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

@DanielGekeler One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@typescript-automation typescript-automation Bot moved this from Needs Maintainer Review to Needs Author Action in Pull Request Status Board Sep 14, 2026
@DanielGekeler

Copy link
Copy Markdown
Author

Can you create a pull request for this over at https://github.com/three-types/three-ts-types where the types are maintained? Thanks!

Here you go: three-types/three-ts-types#2421

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Critical package Revision needed This PR needs code changes before it can be merged.

Projects

Status: Needs Author Action

Development

Successfully merging this pull request may close these issues.

2 participants