countWords
functionSource L33Public function export from Use Markdown Editor.
function countWords(value: string)Parameters
| Name | Type |
|---|---|
value | string |
Open-code aq-ui React hook for Use Markdown Editor.
pnpm dlx aq-ui@alpha add use-markdown-editorImport the parts you need, then jump to an export for its contract.
"use client"
import { useMarkdownEditor } from "@/hooks/use-markdown-editor"
const result = useMarkdownEditor()Public function export from Use Markdown Editor.
function countWords(value: string)| Name | Type |
|---|---|
value | string |
Type contract for MarkdownCommand.
type MarkdownCommand = "bold" | "italic" | "strike" | "heading" | "bullet-list" | "ordered-list" | "task-list" | "quote" | "link" | "image" | "table" | "code"Type contract for MarkdownEditorMode.
type MarkdownEditorMode = "write" | "preview" | "split"Open-code aq-ui React hook for Use Markdown Editor.
function useMarkdownEditor({ value, defaultValue = "", onChange, mode, defaultMode = "write", onModeChange, maxLength, }: UseMarkdownEditorOptions = {})| Name | Type | Default |
|---|---|---|
options? | UseMarkdownEditorOptions | {} |
Type contract for UseMarkdownEditorOptions.
interface UseMarkdownEditorOptions| Name | Type | Default |
|---|---|---|
value? | string | — |
defaultValue? | string | "" |
onChange? | (value: string) => void | — |
mode? | MarkdownEditorMode | — |
defaultMode? | MarkdownEditorMode | "write" |
onModeChange? | (mode: MarkdownEditorMode) => void | — |
maxLength? | number | — |
use-code-editor