ts-markdown
Version:
An extensible TypeScript markdown generator that takes JSON and creates a markdown document.
25 lines (24 loc) • 940 B
TypeScript
import { MarkdownRenderer } from '../rendering.types';
import { RichTextEntry, InlineTypes, SupportedPrimitive } from '../shared.types';
import { CodeEntry } from './code';
import { ImageEntry } from './img';
import { LinkEntry } from './link';
/**
* A markdown entry for generating inline text.
* Used for injecting rich inline text in most places, such as a paragraph or a table cell.
*/
export interface TextEntry extends InlineTypes {
/**
* The inline text contents and identifying property for the renderer.
*/
text: SupportedPrimitive | (RichTextEntry | LinkEntry | ImageEntry | CodeEntry | SupportedPrimitive)[];
}
/**
* The renderer for inline text entries.
*
* @param entry The text entry.
* @param options Document-level render options.
* @returns Inline text markdown content.
*/
export declare const textRenderer: MarkdownRenderer;
export declare function text(content: TextEntry['text']): TextEntry;