generateDefinition Function
Generate documentation for properties of type and interface and parameters and returns
signature of function.
Exported from nextra/tsdoc.
Signature
Parameters:GeneratedDefinition & (GeneratedType | GeneratedFunction)Parsed TSDoc definition from TypeScript type, interface or function.
Example
To generate documentation for a type, interface, or function, export it via the code
argument.
As a default export
import { generateDefinition, TSDoc } from 'nextra/tsdoc'
 
<TSDoc
  definition={generateDefinition({
    code: "export { yourTypeOrFunction as default } from 'your-package'",
  })}
/>As a named export
import { generateDefinition, TSDoc } from 'nextra/tsdoc'
 
<TSDoc
  definition={generateDefinition({
    code: "export { yourTypeOrFunction } from 'your-package'",
    exportName: 'yourTypeOrFunction'
  })}
/>