/** * [[include:src/codecs/dar/README.md]] * * @module codecs/dar */ import stencila from '@stencila/schema'; import * as vfile from '../../util/vfile'; import { Codec, CommonEncodeOptions } from '../types'; export declare class DarCodec extends Codec implements Codec { readonly extNames: string[]; /** * A regex to test that a `manifest.xml` file * is a DAR manifest file. */ private MANIFEST_REGEX; readonly sniff: (content: string) => Promise; /** * Decode a `VFile` pointing to a DAR folder to a Stencila `Node`. * * If there is only one document in the DAR, then this function * will return an `Article`, otherwise it will return a `Collection` * with `parts`. * * @param file The `VFile` to decode * @returns A promise that resolves to a Stencila `Node` */ decode: () => Promise; /** * Encode a Stencila `Node` to a `VFile` pointing to a DAR folder. * * @param node The Stencila `Node` to encode * @returns A promise that resolves to a `VFile` */ encode: (node: stencila.Node, options?: CommonEncodeOptions) => Promise; }