Skip to content

Commit f12afda

Browse files
authoredJun 26, 2024··
Refactor to use TypeScript @import JSDoc tags
Closes GH-2498. Reviewed-by: Titus Wormer <tituswormer@gmail.com>
1 parent 8ccbba8 commit f12afda

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+367
-319
lines changed
 

Diff for: ‎docs/_asset/editor.jsx

+19-19
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
/* @jsxImportSource react */
33

44
/**
5-
* @typedef {import('@wooorm/starry-night').Grammar} Grammar
6-
* @typedef {import('estree').Node} EstreeNode
7-
* @typedef {import('estree').Program} Program
8-
* @typedef {import('hast').Nodes} HastNodes
9-
* @typedef {import('hast').Root} HastRoot
10-
* @typedef {import('mdast').Nodes} MdastNodes
11-
* @typedef {import('mdast').Root} MdastRoot
12-
* @typedef {import('mdast-util-mdx-jsx').MdxJsxAttribute} MdxJsxAttribute
13-
* @typedef {import('mdast-util-mdx-jsx').MdxJsxAttributeValueExpression} MdxJsxAttributeValueExpression
14-
* @typedef {import('mdast-util-mdx-jsx').MdxJsxExpressionAttribute} MdxJsxExpressionAttribute
15-
* @typedef {import('mdx/types.js').MDXModule} MDXModule
16-
* @typedef {import('react-error-boundary').FallbackProps} FallbackProperties
17-
* @typedef {import('unified').PluggableList} PluggableList
18-
* @typedef {import('unist').Node} UnistNode
5+
* @import {Grammar} from '@wooorm/starry-night'
6+
* @import {Node as EstreeNode, Program} from 'estree'
7+
* @import {Nodes as HastNodes, Root as HastRoot} from 'hast'
8+
* @import {Nodes as MdastNodes, Root as MdastRoot} from 'mdast'
9+
* @import {
10+
MdxJsxAttribute,
11+
MdxJsxAttributeValueExpression,
12+
MdxJsxExpressionAttribute
13+
* } from 'mdast-util-mdx-jsx'
14+
* @import {MDXModule} from 'mdx/types.js'
15+
* @import {ReactNode} from 'react'
16+
* @import {FallbackProps} from 'react-error-boundary'
17+
* @import {PluggableList} from 'unified'
18+
* @import {Node as UnistNode} from 'unist'
1919
*/
2020

2121
/**
@@ -35,7 +35,7 @@
3535
* OK.
3636
* @property {true} ok
3737
* Whether OK.
38-
* @property {JSX.Element} value
38+
* @property {ReactNode} value
3939
* Result.
4040
*
4141
* @typedef {EvalNok | EvalOk} EvalResult
@@ -315,7 +315,7 @@ function Playground() {
315315
const scope = formatMarkdown ? 'text.md' : 'source.mdx'
316316
// Cast to actual value.
317317
const compiledResult = /** @type {EvalResult | undefined} */ (evalResult)
318-
/** @type {JSX.Element | undefined} */
318+
/** @type {ReactNode | undefined} */
319319
let display
320320

321321
if (compiledResult) {
@@ -579,9 +579,9 @@ function Playground() {
579579

580580
/**
581581
*
582-
* @param {Readonly<FallbackProperties>} properties
582+
* @param {Readonly<FallbackProps>} properties
583583
* Properties.
584-
* @returns {JSX.Element}
584+
* @returns {ReactNode}
585585
* Element.
586586
*/
587587
function ErrorFallback(properties) {
@@ -601,7 +601,7 @@ function ErrorFallback(properties) {
601601
/**
602602
* @param {DisplayProperties} properties
603603
* Properties.
604-
* @returns {JSX.Element}
604+
* @returns {ReactNode}
605605
* Element.
606606
*/
607607
function DisplayError(properties) {

Diff for: ‎docs/_component/blog.jsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
2-
* @typedef {import('./sort.js').Item} Item
2+
* @import {ReactNode} from 'react'
3+
* @import {Item} from './sort.js'
34
*/
45

56
/**
@@ -29,7 +30,7 @@ const dateTimeFormat = new Intl.DateTimeFormat('en', {dateStyle: 'long'})
2930
/**
3031
* @param {Readonly<EntryProperties>} properties
3132
* Properties.
32-
* @returns {JSX.Element}
33+
* @returns {ReactNode}
3334
* Element.
3435
*/
3536
export function BlogEntry(properties) {
@@ -106,7 +107,7 @@ export function BlogEntry(properties) {
106107
/**
107108
* @param {Readonly<GroupProperties>} properties
108109
* Properties.
109-
* @returns {JSX.Element}
110+
* @returns {ReactNode}
110111
* Element.
111112
*/
112113
export function BlogGroup(properties) {

0 commit comments

Comments
 (0)
Please sign in to comment.