/** * [[include:src/codecs/txt/README.md]] * * @module codecs/txt */ import stencila from '@stencila/schema'; import * as vfile from '../../util/vfile'; import { Codec } from '../types'; export declare class TxtCodec extends Codec implements Codec { /** * Media types that this codec can decode/encode. */ readonly mediaTypes: string[]; /** * File extension names that this codec will match. */ readonly extNames: string[]; /** * Decode a `VFile` with text content to a primitive node. * * @param file The `VFile` to decode * @returns A promise that resolves to a Stencila `Node` */ readonly decode: (file: vfile.VFile) => Promise; /** * Encode a Stencila `Node` to a `VFile` with text content. * * @param node The Stencila `Node` to encode * @returns A promise that resolves to a `VFile` */ readonly encode: (node: stencila.Node) => Promise; /** * Encode a Stencila `Node` to a `string`. * * @param node The Stencila `Node` to encode * @returns A string with the text content of the node */ static readonly stringify: (node: stencila.Node) => string; }