From 9b2044012ff1592a78be6b944fd99d34e155b0a8 Mon Sep 17 00:00:00 2001 From: Lucas Rosa Date: Thu, 1 Dec 2022 04:46:04 -0300 Subject: [PATCH] Fix type of `td`, `th` props Closes GH-713. Closes GH-714. Reviewed-by: Christian Murphy Reviewed-by: Titus Wormer --- lib/ast-to-react.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ast-to-react.js b/lib/ast-to-react.js index 2134381a..afa847e6 100644 --- a/lib/ast-to-react.js +++ b/lib/ast-to-react.js @@ -58,7 +58,8 @@ * @typedef {ComponentPropsWithoutRef<'h1'> & ReactMarkdownProps & {level: number}} HeadingProps * @typedef {ComponentPropsWithoutRef<'li'> & ReactMarkdownProps & {checked: boolean|null, index: number, ordered: boolean}} LiProps * @typedef {ComponentPropsWithoutRef<'ol'> & ReactMarkdownProps & {depth: number, ordered: true}} OrderedListProps - * @typedef {ComponentPropsWithoutRef<'table'> & ReactMarkdownProps & {style?: Record, isHeader: boolean}} TableCellProps + * @typedef {ComponentPropsWithoutRef<'td'> & ReactMarkdownProps & {style?: Record, isHeader: false}} TableDataCellProps + * @typedef {ComponentPropsWithoutRef<'th'> & ReactMarkdownProps & {style?: Record, isHeader: true}} TableHeaderCellProps * @typedef {ComponentPropsWithoutRef<'tr'> & ReactMarkdownProps & {isHeader: boolean}} TableRowProps * @typedef {ComponentPropsWithoutRef<'ul'> & ReactMarkdownProps & {depth: number, ordered: false}} UnorderedListProps * @@ -66,7 +67,8 @@ * @typedef {ComponentType} HeadingComponent * @typedef {ComponentType} LiComponent * @typedef {ComponentType} OrderedListComponent - * @typedef {ComponentType} TableCellComponent + * @typedef {ComponentType} TableDataCellComponent + * @typedef {ComponentType} TableHeaderCellComponent * @typedef {ComponentType} TableRowComponent * @typedef {ComponentType} UnorderedListComponent * @@ -80,8 +82,8 @@ * @property {HeadingComponent|ReactMarkdownNames} h6 * @property {LiComponent|ReactMarkdownNames} li * @property {OrderedListComponent|ReactMarkdownNames} ol - * @property {TableCellComponent|ReactMarkdownNames} td - * @property {TableCellComponent|ReactMarkdownNames} th + * @property {TableDataCellComponent|ReactMarkdownNames} td + * @property {TableHeaderCellComponent|ReactMarkdownNames} th * @property {TableRowComponent|ReactMarkdownNames} tr * @property {UnorderedListComponent|ReactMarkdownNames} ul *