Skip to content

fix(@types): improve types of DiagramNode#91

Open
kei711 wants to merge 3 commits intoantonioru:masterfrom
caddijp:fix/diagram-schema-types
Open

fix(@types): improve types of DiagramNode#91
kei711 wants to merge 3 commits intoantonioru:masterfrom
caddijp:fix/diagram-schema-types

Conversation

@kei711
Copy link
Copy Markdown

@kei711 kei711 commented Dec 4, 2020

Description

  • Fixed argument type of render props in Node

Related Issue

Motivation and Context

How Has This Been Tested?

yarn test-types

Screenshots (if appropriate):

❯ yarn test-types
yarn run v1.22.5
$ npx tsc -p . --noEmit
✨  Done in 3.28s.

Comment on lines +26 to +29
export type NodeRenderProps<P> = Omit<
Node<P>,
'coordinates' | 'disableDrag' | 'inputs' | 'outputs'
> & { inputs: ReactElement<Port>[]; outputs: ReactElement<Port>[] };
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@antonioru
Copy link
Copy Markdown
Owner

Hello @kei711

thank you very much for your contribution, it looks great... I'm not a TS expert so I ask for the help of @9renpoto on this as he improved the exported types part.

Copy link
Copy Markdown
Contributor

@9renpoto 9renpoto left a comment

Choose a reason for hiding this comment

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

LGTM :)

@antonioru thank you review!

@kresli
Copy link
Copy Markdown

kresli commented Apr 13, 2021

any updates on this?

@kresli
Copy link
Copy Markdown

kresli commented Apr 13, 2021

actually, I think this is still missing style prop

image

@kresli
Copy link
Copy Markdown

kresli commented Apr 13, 2021

All works if we change it to

export type NodeRenderProps<P> = Omit<
  Node<P>,
  'coordinates' | 'disableDrag' | 'inputs' | 'outputs'
> & { 
  inputs: ReactElement<Port & HTMLAttributes<HTMLDivElement>>[]; 
  outputs: ReactElement<Port & HTMLAttributes<HTMLDivElement>>[] 
};

@kei711
Copy link
Copy Markdown
Author

kei711 commented Apr 16, 2021

Hi @kresli, thanks for the feedback.
I've committed your suggestion in 57dbbff.

Comment on lines +26 to +32
export type NodeRenderProps<P> = Omit<
Node<P>,
'coordinates' | 'disableDrag' | 'inputs' | 'outputs'
> & {
inputs: ReactElement<Port & HTMLAttributes<HTMLDivElement>>[];
outputs: ReactElement<Port & HTMLAttributes<HTMLDivElement>>[];
};
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants