@sanity/tsdoc
Version:
Generate API reference docs from TypeScript projects and store in a Sanity-friendly JSON format. Render a static frontend, or as React components.
56 lines (53 loc) • 1.12 kB
text/typescript
import {defineType} from 'sanity'
import {TsdocComment} from './components/TsdocComment'
export const tsdocCommentType = defineType({
type: 'object',
name: 'tsdoc.docComment',
title: 'TSDoc comment',
components: {input: TsdocComment as any},
fields: [
{
type: 'array',
name: 'summary',
title: 'Summary',
of: [{type: 'block'}],
},
{
type: 'tsdoc.remarksBlock',
name: 'remarks',
title: 'Remarks',
},
{
type: 'array',
name: 'seeBlocks',
title: 'See',
of: [{type: 'tsdoc.seeBlock'}],
},
{
type: 'array',
name: 'parameters',
title: 'Parameters',
of: [{type: 'tsdoc.paramBlock'}],
},
{
type: 'tsdoc.returnsBlock',
name: 'returns',
title: 'Returns',
},
{
type: 'array',
name: 'exampleBlocks',
title: 'Example blocks',
of: [{type: 'tsdoc.exampleBlock'}],
},
{
type: 'array',
name: 'modifierTags',
title: 'Modifier tags',
of: [{type: 'tsdoc.modifierTag'}],
},
],
options: {
collapsible: true,
},
})