APIReference
API Reference
APIReference
({ source }: { source: ExportSource<any>; }) => Promise<JSX.Element | null>
Displays type documentation for all types related to a collection export source.
Parameters
Properties
source *
ExportSource<any>
getName *
() => string
The name of the exported source. If the default export name cannot be derived, the file name will be used.
getType *
() => Promise<ReturnType<typeof resolveType>>
The resolved type of the exported source based on the TypeScript type if it exists.
getTitle *
() => string
The name of the exported source formatted as a title.
getDescription *
() => string | undefined
The description of the exported source based on the JSDoc comment if it exists.
getTags *
() => { tagName: string; text?: string; }[] | undefined
The tags of the exported source based on the JSDoc comment if it exists.
getSlug *
() => string
The URL-friendly slug of the export name.
getText *
() => string
A text representation of the exported source if it is statically analyzable.
getValue *
() => Promise<any>
The runtime value of the export loaded from a dynamic import map generated in the .renoun
directory at the root of the project.
Note, any side-effects in modules of targeted files will be run.
getEnvironment *
() => "server" | "client" | "isomorphic" | "unknown"
The execution environment of the export source.
getPosition *
() => DeclarationPosition
The lines and columns where the export starts and ends.
getSiblings *
() => Promise<[previous?: ExportSource<any>, next?: ExportSource<any>]>
The previous and next export sources within the same file.
isMainExport *
() => boolean
Whether the export is considered the main export of the file based on the name matching the file name or directory name.
getPath *
() => string
The full path to the source formatted to be URL-friendly, taking the
collection baseDirectory
and basePath
configuration into account.
getPathSegments *
() => string[]
An array of path segments to the source excluding the collection basePath
if configured.
getEditPath *
() => string
The path to the source on the local filesystem in development and the git repository in production if configured.