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

feat: Better typescript support #123

Merged
merged 1 commit into from
Oct 6, 2020
Merged

feat: Better typescript support #123

merged 1 commit into from
Oct 6, 2020

Conversation

pveyes
Copy link
Owner

@pveyes pveyes commented Oct 6, 2020

  • exported HtmrOptions as top-level named export
import { HtmrOptions } from 'htmr'
  • Better props type annotation for transform
const transform: HtmrOptions = {
  a: props => {
    // props is now automatically inferred
    if (props.href.startsWith('http') {
    }
  }
}
  • SVG tags support
const transform: HtmrOptions = {
  svg: props => {
    return <>{props.viewBox}</>
  }
}
  • Fixed type definition for default transform return value
  • Adjust README for type limitation for custom elements

@pveyes pveyes merged commit 46a07d5 into master Oct 6, 2020
@pveyes pveyes deleted the better-typings branch October 6, 2020 03:38
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.

None yet

1 participant