(props: { func: FunctionSymbolDocumentation })
| 29 | ); |
| 30 | |
| 31 | async function FuncDocTable(props: { func: FunctionSymbolDocumentation }) { |
| 32 | const { func } = props; |
| 33 | |
| 34 | const scriptKey = useId(); |
| 35 | const params = func.jsdocTags |
| 36 | .filter((tag) => tag.name === 'param') |
| 37 | .map((tag) => tag.text) |
| 38 | .map((text) => ({ |
| 39 | name: text[0].text, |
| 40 | description: text |
| 41 | .slice(2) |
| 42 | .map((t) => t.text) |
| 43 | .join(' '), |
| 44 | })); |
| 45 | |
| 46 | return ( |
| 47 | <> |
| 48 | <Heading as="h3"> |
| 49 | Function <code>{func.name}</code> |
| 50 | </Heading> |
| 51 | <p>{func.description}</p> |
| 52 | |
| 53 | <h4>Signature</h4> |
| 54 | <DynamicCodeBlock lang="ts" code={func.signature} options={{}} /> |
| 55 | |
| 56 | {/*<h4>Description</h4>*/} |
| 57 | |
| 58 | <h4>Parameters</h4> |
| 59 | <table className="whitespace-nowrap text-sm text-fd-muted-foreground"> |
| 60 | <thead> |
| 61 | <tr> |
| 62 | <th className="w-[20%]">Name</th> |
| 63 | <th className="w-[30%]">Type</th> |
| 64 | <th className="w-[40%]">Description</th> |
| 65 | <th className="w-1/4">Default</th> |
| 66 | </tr> |
| 67 | </thead> |
| 68 | <tbody> |
| 69 | {params.map(({ name, description }, i) => ( |
| 70 | <tr key={name}> |
| 71 | <td> |
| 72 | <div className={field()}> |
| 73 | <code className={cn(code({ color: 'primary' }))}>{name}</code> |
| 74 | </div> |
| 75 | </td> |
| 76 | <td> |
| 77 | <div className={field()}> |
| 78 | {func.parameterTypes[i]} |
| 79 | {/*<PrerenderScript scriptKey={scriptKey} code={func.parameterTypes[i]}/>*/} |
| 80 | {/*{codeToHtml(func.parameterTypes[i], { lang: 'ts', theme: 'default' })}*/} |
| 81 | </div> |
| 82 | </td> |
| 83 | <td> |
| 84 | <div className={field()}>{description}</div> |
| 85 | </td> |
| 86 | <td> |
| 87 | {/*{value.default ? ( |
| 88 | <code className={code()}>{value.default}</code> |
nothing calls this directly
no outgoing calls
no test coverage detected