Skip to content

Commit 25f7b60

Browse files
authored
Document AutoNumericComponent (#6)
1 parent 705c846 commit 25f7b60

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

package-lock.json

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"typedoc": "^0.25.13",
6464
"typedoc-plugin-extra-footer": "^1.0.1",
6565
"typedoc-plugin-mdn-links": "^3.1.22",
66+
"typedoc-plugin-rename-defaults": "^0.7.0",
6667
"typescript": "^5.4.5",
6768
"typescript-eslint": "^7.7.0",
6869
"vite": "^5.2.9",

src/lib/AutoNumericComponent.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@
1818
import AutoNumeric, { CallbackOptions } from "autonumeric";
1919
import { ReactHTML, createElement, useEffect, useRef } from "react";
2020

21+
/** The base React component integrated with {@link !AutoNumeric}.
22+
*
23+
* This component is used as a base to construct higher-level React component that integrates with
24+
* AutoNumeric. See {@link AutoNumericInput} for a live example.
25+
*
26+
* @param options - Options of the component.
27+
* @param options.element - The element of the component, such as `"input"`.
28+
* @param options.refKey - The name of the attribute that refers the underlying DOM element. This is
29+
* typically [`"ref"`](https://react.dev/learn/manipulating-the-dom-with-refs).
30+
* @param options.props - Options passed to the underlying element `options.element`.
31+
* @param options.autoNumericOptions - Options passed to {@link !AutoNumeric}. Same as {@link
32+
* AutoNumeric!Options}.
33+
* @param options.state - The React state that controls and is controlled by {@link !AutoNumeric}.
34+
* If absent, this component will not interact with its parent via React states.
35+
*/
2136
export default function AutoNumericComponent({
2237
element,
2338
refKey,

typedoc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
"./src/lib/AutoNumericComponent.tsx",
66
"./src/lib/AutoNumericInput.tsx"
77
],
8+
"entryPointStrategy": "expand",
89
"plugin": [
910
"@8hobbies/typedoc-plugin-404",
1011
"@8hobbies/typedoc-plugin-plausible",
1112
"typedoc-plugin-extra-footer",
12-
"typedoc-plugin-mdn-links"
13+
"typedoc-plugin-mdn-links",
14+
"typedoc-plugin-rename-defaults"
1315
],
1416
"sitemapBaseUrl": "https://react-autonumeric.8hob.io",
1517
"externalSymbolLinkMappings": {

0 commit comments

Comments
 (0)