Skip to content

Commit

Permalink
Document AutoNumericComponent (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuhdev authored Apr 25, 2024
1 parent 705c846 commit 25f7b60
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"typedoc": "^0.25.13",
"typedoc-plugin-extra-footer": "^1.0.1",
"typedoc-plugin-mdn-links": "^3.1.22",
"typedoc-plugin-rename-defaults": "^0.7.0",
"typescript": "^5.4.5",
"typescript-eslint": "^7.7.0",
"vite": "^5.2.9",
Expand Down
15 changes: 15 additions & 0 deletions src/lib/AutoNumericComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@
import AutoNumeric, { CallbackOptions } from "autonumeric";
import { ReactHTML, createElement, useEffect, useRef } from "react";

/** The base React component integrated with {@link !AutoNumeric}.
*
* This component is used as a base to construct higher-level React component that integrates with
* AutoNumeric. See {@link AutoNumericInput} for a live example.
*
* @param options - Options of the component.
* @param options.element - The element of the component, such as `"input"`.
* @param options.refKey - The name of the attribute that refers the underlying DOM element. This is
* typically [`"ref"`](https://react.dev/learn/manipulating-the-dom-with-refs).
* @param options.props - Options passed to the underlying element `options.element`.
* @param options.autoNumericOptions - Options passed to {@link !AutoNumeric}. Same as {@link
* AutoNumeric!Options}.
* @param options.state - The React state that controls and is controlled by {@link !AutoNumeric}.
* If absent, this component will not interact with its parent via React states.
*/
export default function AutoNumericComponent({
element,
refKey,
Expand Down
4 changes: 3 additions & 1 deletion typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
"./src/lib/AutoNumericComponent.tsx",
"./src/lib/AutoNumericInput.tsx"
],
"entryPointStrategy": "expand",
"plugin": [
"@8hobbies/typedoc-plugin-404",
"@8hobbies/typedoc-plugin-plausible",
"typedoc-plugin-extra-footer",
"typedoc-plugin-mdn-links"
"typedoc-plugin-mdn-links",
"typedoc-plugin-rename-defaults"
],
"sitemapBaseUrl": "https://react-autonumeric.8hob.io",
"externalSymbolLinkMappings": {
Expand Down

0 comments on commit 25f7b60

Please sign in to comment.