From 85a3787114c0b2cb3a4a4aa01f11295272cc6e6a Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Wed, 27 Sep 2023 12:25:32 +0200 Subject: [PATCH] Add export of `ExtraProps` type --- index.js | 1 + readme.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/index.js b/index.js index c0e7314..b24f24d 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,6 @@ /** * @typedef {import('./lib/components.js').Components} Components + * @typedef {import('./lib/components.js').ExtraProps} ExtraProps * @typedef {import('./lib/index.js').ElementAttributeNameCase} ElementAttributeNameCase * @typedef {import('./lib/index.js').Fragment} Fragment * @typedef {import('./lib/index.js').Jsx} Jsx diff --git a/readme.md b/readme.md index d477da3..c247a35 100644 --- a/readme.md +++ b/readme.md @@ -22,6 +22,7 @@ with an automatic JSX runtime. * [`Options`](#options) * [`Components`](#components) * [`ElementAttributeNameCase`](#elementattributenamecase) + * [`ExtraProps`](#extraprops) * [`Fragment`](#fragment) * [`Jsx`](#jsx) * [`JsxDev`](#jsxdev) @@ -256,6 +257,16 @@ React casing is for example `className`, `strokeLinecap`, `xmlLang`. type ElementAttributeNameCase = 'html' | 'react' ``` +### `ExtraProps` + +Extra fields we pass (TypeScript type). + +###### Type + +```ts +type ExtraProps = {node?: Element | undefined} +``` + ### `Fragment` Represent the children, typically a symbol (TypeScript type). @@ -557,6 +568,7 @@ This package is fully typed with [TypeScript][]. It exports the additional types [`Components`][api-components], [`ElementAttributeNameCase`][api-element-attribute-name-case], +[`ExtraProps`][api-extra-props], [`Fragment`][api-fragment], [`Jsx`][api-jsx], [`JsxDev`][api-jsx-dev], @@ -671,6 +683,8 @@ abide by its terms. [api-element-attribute-name-case]: #elementattributenamecase +[api-extra-props]: #extraprops + [api-fragment]: #fragment [api-jsx]: #jsx