Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Commit aa96269

Browse files
committed
Add improved docs
1 parent 638e615 commit aa96269

File tree

2 files changed

+201
-84
lines changed

2 files changed

+201
-84
lines changed

lib/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,18 @@
2020
* @property {boolean} hyperscript
2121
*
2222
* @typedef Options
23+
* Configuration (optional).
2324
* @property {string|null} [prefix]
25+
* Prefix to use as a prefix for keys passed in `props` to `h()`, this
26+
* behavior is turned off by passing `false` and turned on by passing a
27+
* `string`.
28+
* By default, `h-` is used as a prefix if the given `h` is detected as being
29+
* `virtual-dom/h` or `React.createElement`
2430
* @property {'html'|'svg'} [space]
31+
* Whether `node` is in the `'html'` or `'svg'` space.
32+
* If an `<svg>` element is found when inside the HTML space, `toH`
33+
* automatically switches to the SVG space when entering the element, and
34+
* switches back when exiting.
2535
*/
2636

2737
import {html, svg, find, hastToReact} from 'property-information'
@@ -37,8 +47,11 @@ const own = {}.hasOwnProperty
3747
/**
3848
* @template {CreateElementLike} H
3949
* @param {H} h
50+
* HyperScript function.
4051
* @param {Node} tree
52+
* Tree to transform.
4153
* @param {string|boolean|Options} [options]
54+
* Configuration (optional).
4255
* @returns {ReturnType<H>}
4356
*/
4457
// eslint-disable-next-line complexity

0 commit comments

Comments
 (0)