Skip to content

Improve typescript typing #14

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

Merged
merged 2 commits into from
Oct 25, 2021
Merged

Conversation

lightningspirit
Copy link
Contributor

@lightningspirit lightningspirit commented Oct 25, 2021

This commit adds the new RenderFn type which all renders are now based on.

The signature is:
RenderFn<DataProps, Config>: JSX.Element

Where:

  • DataProps is the object of data attribute or undefined in the case of blocks without data.
  • Config can be undefined or an object of extra configs passed to renderers.

No tests were touch to maintain backward compatibility.

Closes #13

This commit adds the new RenderFn type which all renders now
are based on.

The signature is:
RenderFn<DataProps, Config>: JSX.Element

Alongside, to maintain compatibility with previous renders, we
introduce the RenderFnWithoutData, which does not receive any data
prop. It's the case of delimiter renderer.

No existing tests were touch to maintain backward compatibility.
@lightningspirit lightningspirit force-pushed the improve-typescript-typing branch from 43c1346 to 0b27de0 Compare October 25, 2021 12:18
@lightningspirit lightningspirit merged commit ffee96d into master Oct 25, 2021
@lightningspirit lightningspirit deleted the improve-typescript-typing branch October 25, 2021 12:31
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.

Enforce a more strict typing programming style
1 participant