/** * [[include:src/codecs/gdoc/README.md]] * * @module codecs/gdoc */ import { schema } from '@stencila/jesta'; import * as vfile from '../../util/vfile'; import { Codec, CommonDecodeOptions, CommonEncodeOptions } from '../types'; interface DecodeOptions extends CommonDecodeOptions { fetch: boolean; } /** * A codec for Google Docs. * * This codec currently does encoding of Google Docs via `docx`. * That is because (at the time of writing) the Google Docs API does not allow * creation of a Google Doc using the sample JSON as it does for getting a Google Doc. * A previous version of this file had encoding functions for various nodes types * but this was removed. See https://github.com/stencila/encoda/blob/4c87ea79450e50fbdc2aa6e12ededa597266d4e0/src/codecs/gdoc/index.ts#L35 */ export declare class GDocCodec extends Codec<{}, DecodeOptions> implements Codec<{}, DecodeOptions> { readonly mediaTypes: string[]; /** * Decode a `VFile` with `gdoc` 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?: DecodeOptions) => Promise; /** * Encode a `stencila.Node` to a Microsoft Word document suitable for uploading * as a Google Doc. * * @param node The `stencila.Node` to encode * @returns A promise that resolves to a `VFile` */ readonly encode: (node: schema.Node, options?: CommonEncodeOptions) => Promise; /** * @override Overrides {@link Codec.preWrite} so that media files * do NOT get written to a sibling folder (since they are embedded * in the DOCX file during encoding). */ preWrite(node: schema.Node): Promise; } export {};