diff --git a/src/content/__tests__/block-tag.spec-d.ts b/src/content/__tests__/block-tag.spec-d.ts index be2fc5e4..f26addc5 100644 --- a/src/content/__tests__/block-tag.spec-d.ts +++ b/src/content/__tests__/block-tag.spec-d.ts @@ -4,6 +4,7 @@ */ import type { TypeExpression } from '#src/nodes' +import type mdast from 'mdast' import type * as TestSubject from '../block-tag' import type { PhrasingContentMap } from '../phrasing' @@ -14,6 +15,12 @@ describe('unit-d:content/BlockTag', () => { .toMatchTypeOf() }) + it('should match [code: mdast.Code]', () => { + expectTypeOf() + .toHaveProperty('code') + .toEqualTypeOf + }) + it('should match [typeExpression: TypeExpression]', () => { expectTypeOf() .toHaveProperty('typeExpression') diff --git a/src/content/__tests__/description.spec-d.ts b/src/content/__tests__/description.spec-d.ts index 40782ca8..d6b3627b 100644 --- a/src/content/__tests__/description.spec-d.ts +++ b/src/content/__tests__/description.spec-d.ts @@ -20,6 +20,12 @@ describe('unit-d:content/Description', () => { .toEqualTypeOf }) + it('should match [code: mdast.Code]', () => { + expectTypeOf() + .toHaveProperty('code') + .toEqualTypeOf + }) + it('should match [definition: mdast.Definition]', () => { expectTypeOf() .toHaveProperty('definition') @@ -44,18 +50,24 @@ describe('unit-d:content/Description', () => { .toEqualTypeOf }) - it('should match [paragraph: mdast.Paragraph]', () => { - expectTypeOf() - .toHaveProperty('paragraph') - .toEqualTypeOf - }) - it('should match [table: mdast.Table]', () => { expectTypeOf() .toHaveProperty('table') .toEqualTypeOf }) + it('should match [tableCell: mdast.TableCell]', () => { + expectTypeOf() + .toHaveProperty('tableCell') + .toEqualTypeOf + }) + + it('should match [tableRow: mdast.TableRow]', () => { + expectTypeOf() + .toHaveProperty('tableRow') + .toEqualTypeOf + }) + it('should match [thematicBreak: mdast.ThematicBreak]', () => { expectTypeOf() .toHaveProperty('thematicBreak') diff --git a/src/content/__tests__/phrasing.spec-d.ts b/src/content/__tests__/phrasing.spec-d.ts index ee1622a4..e115d3cb 100644 --- a/src/content/__tests__/phrasing.spec-d.ts +++ b/src/content/__tests__/phrasing.spec-d.ts @@ -9,17 +9,11 @@ import type * as TestSubject from '../phrasing' describe('unit-d:content/Phrasing', () => { describe('PhrasingContentMap', () => { - it('should extend { + it('should extend mdast.PhrasingContentMap', () => { expectTypeOf() .toMatchTypeOf() }) - it('should match [code: mdast.Code]', () => { - expectTypeOf() - .toHaveProperty('code') - .toEqualTypeOf - }) - it('should match [inlineTag: InlineTag]', () => { expectTypeOf() .toHaveProperty('inlineTag') diff --git a/src/content/block-tag.ts b/src/content/block-tag.ts index c674b834..b4ba7ee4 100644 --- a/src/content/block-tag.ts +++ b/src/content/block-tag.ts @@ -4,6 +4,7 @@ */ import type { TypeExpression } from '#src/nodes' +import type mdast from 'mdast' import type { PhrasingContentMap } from './phrasing' /** @@ -31,6 +32,7 @@ type BlockTagContent = BlockTagContentMap[keyof BlockTagContentMap] * @extends {PhrasingContentMap} */ interface BlockTagContentMap extends PhrasingContentMap { + code: mdast.Code typeExpression: TypeExpression } diff --git a/src/content/description.ts b/src/content/description.ts index ca38998d..aa90b428 100644 --- a/src/content/description.ts +++ b/src/content/description.ts @@ -3,9 +3,24 @@ * @module docast/content/Description */ +import type { InlineTag } from '#src/nodes' import type mdast from 'mdast' import type { PhrasingContentMap } from './phrasing' +declare module 'mdast' { + interface BlockContentMap { + inlineTag: InlineTag + } + + interface DefinitionContentMap { + inlineTag: InlineTag + } + + interface RootContentMap { + inlineTag: InlineTag + } +} + /** * Union of registered docast nodes that can occur where description content is * expected. @@ -32,12 +47,14 @@ type DescriptionContent = DescriptionContentMap[keyof DescriptionContentMap] */ interface DescriptionContentMap extends PhrasingContentMap { blockquote: mdast.Blockquote + code: mdast.Code definition: mdast.Definition footnoteDefinition: mdast.FootnoteDefinition list: mdast.List listItem: mdast.ListItem - paragraph: mdast.Paragraph table: mdast.Table + tableCell: mdast.TableCell + tableRow: mdast.TableRow thematicBreak: mdast.ThematicBreak } diff --git a/src/content/phrasing.ts b/src/content/phrasing.ts index 1b1b43bd..8ad89f6d 100644 --- a/src/content/phrasing.ts +++ b/src/content/phrasing.ts @@ -6,6 +6,12 @@ import type { InlineTag } from '#src/nodes' import type mdast from 'mdast' +declare module 'mdast' { + interface PhrasingContentMap { + inlineTag: InlineTag + } +} + /** * Union of registered docast nodes that can occur where phrasing content is * expected. @@ -30,9 +36,6 @@ type PhrasingContent = PhrasingContentMap[keyof PhrasingContentMap] * * @extends {mdast.PhrasingContentMap} */ -interface PhrasingContentMap extends mdast.PhrasingContentMap { - code: mdast.Code - inlineTag: InlineTag -} +interface PhrasingContentMap extends mdast.PhrasingContentMap {} export type { PhrasingContent, PhrasingContentMap }