ts-markdown
Version:
An extensible TypeScript markdown generator that takes JSON and creates a markdown document.
45 lines (44 loc) • 1.29 kB
TypeScript
import { MarkdownRenderer } from '../rendering.types';
import { InlineTypes, MarkdownEntry } from '../shared.types';
/**
* A markdown entry for generating task lists.
*/
export interface TaskListEntry extends MarkdownEntry {
/**
* The task list entries and identifying property for the renderer.
*/
tasks: (InlineTypes | TaskEntry)[];
/**
* Option which will arbitrarily append a string immediately below the task list, ignoring block-level settings.
*/
append?: string;
}
/**
* A task in the task list.
*/
export declare type TaskEntry = {
/**
* Inline content for the current task.
*/
task: InlineTypes;
/**
* Indicator of whether the task has been completed or not.
* Default: false
*/
completed?: boolean;
};
/**
* The renderer for task list entries.
*
* @param entry The task list entry.
* @param options Document-level render options.
* @returns Block-level task list markdown content.
*/
export declare const tasksRenderer: MarkdownRenderer;
/**
* Helper which creates a task list entry.
*
* @param options Entry-level options for this element.
* @returns a task list entry
*/
export declare function tasks(content: TaskListEntry['tasks'], options?: Omit<TaskListEntry, 'tasks'>): TaskListEntry;