Skip to content

[jquery.fancytree] Add dnd & glyph extensions; widen icon, replaceWith, node members#75088

Open
daberni wants to merge 1 commit into
DefinitelyTyped:masterfrom
daberni:fancytree-extensions
Open

[jquery.fancytree] Add dnd & glyph extensions; widen icon, replaceWith, node members#75088
daberni wants to merge 1 commit into
DefinitelyTyped:masterfrom
daberni:fancytree-extensions

Conversation

@daberni

@daberni daberni commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Adds the still-missing pieces of the fancytree 2.38 API surface and tightens a few existing members. Every change was checked against the bundled jquery.fancytree-all.js 2.38.0 runtime.

Added

  • Legacy dnd extension (Extensions.DragAndDrop) + DragAndDropEventData callback context + HitMode type. Previously only dnd5 was declared, so the jQuery-UI-based dnd callbacks (dragStart/dragEnter/dragDrop/…) were untyped.
  • glyph extension (Extensions.Glyph).
  • Fancytree#cancelDrag() and FancytreeStatic#setSpanIcon().
  • Documented FancytreeNode members: selected, iconTooltip, type.

Widened / fixed

  • FancytreeOptions.icon / NodeData.icon now also accept a callback (matches evalOption and the existing dynamic options such as checkbox/unselectable); FancytreeNode.iconboolean | string.
  • FancytreeNode#replaceWith() accepts SourceData (it forwards source to nodeLoadChildren, e.g. an ajax { url } descriptor).
  • FancytreeNode#moveTo() mode is now optional (the runtime defaults undefined/"over" to "child").
  • NodeData.data: ObjectRecord<string, unknown>.

Tests in jquery.fancytree-tests.ts exercise each addition. tsc (strict) and dprint pass locally; opening as draft while the full dtslint/pnpm test run is verified.

…h, node members

- Add the legacy jQuery-UI `dnd` extension: Extensions.DragAndDrop, the
  DragAndDropEventData callback context, and a HitMode type (these callbacks
  were previously untyped; only `dnd5` was declared).
- Add the `glyph` extension: Extensions.Glyph.
- Widen FancytreeOptions.icon / NodeData.icon to also accept a callback
  (consistent with the other dynamic options and the runtime evalOption).
- Widen FancytreeNode#replaceWith() to accept SourceData.
- Add documented FancytreeNode members selected / iconTooltip / type, and
  widen icon to `boolean | string`.
- Add Fancytree#cancelDrag() and FancytreeStatic#setSpanIcon().
- Make FancytreeNode#moveTo() `mode` optional (runtime defaults to "child").
- NodeData#data: replace `Object` with `Record<string, unknown>`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@typescript-bot typescript-bot moved this to Needs Author Action in Pull Request Status Board Jun 7, 2026
@daberni daberni marked this pull request as ready for review June 7, 2026 16:22
@typescript-bot

typescript-bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

@daberni Thank you for submitting this PR!

This is a live comment that I will keep updated.

1 package in this PR

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

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 type definition owners, DT maintainers or others

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": 75088,
  "author": "daberni",
  "headCommitOid": "db15c9d38d2717691c58d04b507b517e392cb45d",
  "mergeBaseOid": "ca65e20b1c0aba452e9be1407798945801c758f5",
  "lastPushDate": "2026-06-07T16:08:25.000Z",
  "lastActivityDate": "2026-06-07T16:22:00.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "tooManyCommits": false,
  "tooManyReviews": false,
  "popularityLevel": "Well-liked by everyone",
  "pkgInfo": [
    {
      "name": "jquery.fancytree",
      "kind": "edit",
      "files": [
        {
          "path": "types/jquery.fancytree/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jquery.fancytree/jquery.fancytree-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "alphaleonis",
        "itsmattius",
        "niikoo",
        "Nitecube",
        "hosni"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [],
  "mainBotCommentID": 4643241380,
  "ciResult": "pass"
}

@typescript-bot

Copy link
Copy Markdown
Contributor

🔔 @alphaleonis @itsmattius @niikoo @Nitecube @hosni — 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-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in Pull Request Status Board Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting for Code Reviews

Development

Successfully merging this pull request may close these issues.

2 participants