Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getNextPosition ts type bug in AutoPlaceUtil.d.ts #843

Closed
d591342 opened this issue Jan 9, 2024 · 2 comments · Fixed by #844
Closed

getNextPosition ts type bug in AutoPlaceUtil.d.ts #843

d591342 opened this issue Jan 9, 2024 · 2 comments · Fixed by #844
Assignees
Labels
bug Something isn't working types

Comments

@d591342
Copy link

d591342 commented Jan 9, 2024

Describe the Bug

in diagram-js\lib\features\auto-place\AutoPlaceUtil.d.ts
/**

  • Get free position starting from given position.
  • @param source
  • @param element
  • @param position
  • @param getNextPosition
  • @return
    */
    export function findFreePosition(source: Shape, element: Shape, position: Point, getNextPosition: (element: Element, position: Point, connectedAtPosition: Element) => Element): Point;
    return type of getNextPosition seems need to be Point, but now is Element

Steps to Reproduce

return findFreePosition(
source,
element,
position,
generateGetNextPosition(nextPositionDirection),
)
will report compilation errors in ts :

Argument of type '(element: Element, previousPosition: Point, connectedAtPosition: Element) => Point' is not assignable to parameter of type '(element: Element, position: Point, connectedAtPosition: Element) => Element'.
Type 'Point' is not assignable to type 'Element'.
Property 'id' is missing in type 'Point' but required in type '{ id: string; businessObject?: any; }'.

71 generateGetNextPosition(nextPositionDirection),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@d591342 d591342 added the bug Something isn't working label Jan 9, 2024
@nikku nikku added the types label Jan 9, 2024
@nikku
Copy link
Member

nikku commented Jan 9, 2024

@philippfromme Can you have a look at this report?

@philippfromme philippfromme added the ready Ready to be worked on label Jan 9, 2024 — with bpmn-io-tasks
@philippfromme
Copy link
Contributor

I will check this out.

@philippfromme philippfromme added the in progress Currently worked on label Jan 16, 2024 — with bpmn-io-tasks
@philippfromme philippfromme removed the ready Ready to be worked on label Jan 16, 2024
philippfromme added a commit that referenced this issue Jan 16, 2024
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Jan 16, 2024
nikku pushed a commit that referenced this issue Jan 16, 2024
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants