/** * [[include:src/codecs/md/README.md]] * * @module codecs/md */ import stencila, { TypeMapGeneric } from '@stencila/schema'; import * as MDAST from 'mdast'; import * as UNIST from 'unist'; import * as vfile from '../../util/vfile'; import { Codec, CommonDecodeOptions, CommonEncodeOptions } from '../types'; export declare const log: import("@stencila/logga").Logger; export declare class MdCodec extends Codec implements Codec { readonly mediaTypes: string[]; /** * Decode a `VFile` with Markdown contents to a `stencila.Node`. * * @param file The `VFile` to decode * @returns A promise that resolves to a `stencila.Node` */ readonly decode: (file: vfile.VFile, options?: CommonDecodeOptions) => Promise; /** * Encode a `stencila.Node` to a `VFile` with Markdown contents. * * @param thing The `stencila.Node` to encode * @returns A promise that resolves to a `VFile` */ readonly encode: (node: stencila.Node, options?: CommonEncodeOptions) => Promise; } export declare const mdastBlockContentTypes: TypeMapGeneric; export declare const mdastPhrasingContentTypes: TypeMapGeneric; /** * Decode a string of Markdown content to a `UNIST.Node` */ export declare function stringToMdast(content: string): UNIST.Node; /** * Decode a string of Markdown content to a Stencila `Node` */ export declare function decodeMarkdown(md: string): stencila.Article; /** * Encode a Stencila `Node` to a Markdown `string`. */ export declare function encodeMarkdown(node: stencila.Node): string;