fix: export GraphSelectionModel - #1184
redfish4ktc wants to merge 1 commit into
Conversation
The `selectionModel` option of `BaseGraph` is typed `(graph: AbstractGraph) => GraphSelectionModel`, so an application supplying its own selection model has to name that class. It was reachable only from inside the package, and `@maxgraph/core` has a single entry point, which left the option unusable from TypeScript: there was no way to import the base class a custom selection model must extend, nor to type the value the factory returns. The four other collaborators an application can inject through the constructor options, `CellRenderer`, `GraphDataModel`, `GraphView` and `Stylesheet`, were already exported.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughThe core package index now exports ChangesPublic API
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This change makes the existing selection model available through the package entry point. No material merge risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



BaseGraphaccepts aselectionModeloption, typed(graph: AbstractGraph) => GraphSelectionModel, so an application that supplies its own selection model has to name that class.GraphSelectionModelwas never re-exported frompackages/core/src/index.ts, and@maxgraph/coreexposes a single entry point, so a TypeScript application had no way to import the base class its selection model must extend, nor to type the value its factory returns. The option was documented and unusable.The four other collaborators an application can inject through the constructor options were already exported:
CellRenderer,GraphDataModel,GraphViewandStylesheet. This adds the fifth, next to them, re-exporting the default export under its name exactly asCellRendererdoes.The class itself is unchanged, and nothing else in the package is affected.
Summary by CodeRabbit