feat: simplify types used to register shapes by tbouffard · Pull Request #768 · maxGraph/maxGraph · GitHub
Skip to content

feat: simplify types used to register shapes#768

Merged
tbouffard merged 1 commit into
mainfrom
fix/improve_type_to_registerShape
Apr 17, 2025
Merged

feat: simplify types used to register shapes#768
tbouffard merged 1 commit into
mainfrom
fix/improve_type_to_registerShape

Conversation

@tbouffard

@tbouffard tbouffard commented Apr 17, 2025

Copy link
Copy Markdown
Member

Previously, there were TSC errors when registering some builtin or custom shape because their constructor didn't match
the signature of the Shape constructor.
The type of various CellRenderer properties and methods has been updated to fix this, so it is no longer necessary to
add some 'ts-ignore' to silently ignore these false errors.

In addition:

  • Various improvements in the JSDoc of CellRenderer
  • CellRenderer.getShape allows undefined parameter
  • Move ActorShape to the directory storing vertex shapes for consistency

Summary by CodeRabbit

  • New Features

    • Added a new type for shape constructors, improving type safety when creating custom shapes.
  • Refactor

    • Updated and standardized import paths for shape modules.
    • Improved type annotations and clarity around shape registration and usage.
  • Style

    • Removed unnecessary TypeScript ignore comments from sample and story files for cleaner code.

Previously, there were TSC errors when registering some builtin or custom shape because their constructor didn't match
the signature of the `Shape` constructor.
The type of various `CellRenderer` properties and methods has been updated to fix this, so it is no longer necessary to
add some 'ts-ignore' to silently ignore these false errors.

In addition:
  - Various improvements in the JSDoc of `CellRenderer`
  - `CellRenderer.getShape` allows `undefined` parameter
  - Move `ActorShape` to the directory storing vertex shapes for consistency
@tbouffard tbouffard added the bug Something isn't working label Apr 17, 2025
@coderabbitai

coderabbitai Bot commented Apr 17, 2025

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@tbouffard tbouffard marked this pull request as ready for review April 17, 2025 06:34
@tbouffard tbouffard added enhancement New feature or request and removed bug Something isn't working labels Apr 17, 2025
@tbouffard tbouffard changed the title fix: simplify types used to register shapes feat: simplify types used to register shapes Apr 17, 2025
@tbouffard tbouffard merged commit 7cac321 into main Apr 17, 2025
@tbouffard tbouffard deleted the fix/improve_type_to_registerShape branch April 17, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant