/** * [[include:src/codecs/html/README.md]] * * @module codecs/html */ import stencila from '@stencila/schema'; import { VFileContents } from 'vfile'; import * as vfile from '../../util/vfile'; import { Codec, CommonEncodeOptions } from '../types'; export declare const stencilaItemType = "data-itemtype"; export declare const stencilaItemProp = "data-itemprop"; export declare class HTMLCodec extends Codec implements Codec { readonly mediaTypes: string[]; /** * Decode HTML content. * * Note that, if the HTML does not contain any handled elements, this will * return `undefined`. */ decodeHtml: (htmlContent: VFileContents) => stencila.Node; /** * Decode a `VFile` with HTML 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) => Promise; /** * Encode a Stencila `Node` to a `VFile` with HTML contents. * * The attribute `data-itemscope="root"` is added to the root node * of the encoded HTML. This attribute can be used to scope CSS variables * to within the top-level Stencila Node. * * @param node The `Node` to encode. * @returns A promise that resolves to a `VFile` */ readonly encode: (node: stencila.Node, options?: CommonEncodeOptions) => Promise; } export declare const beautify: (html: string) => string; export declare const decodeHref: (href?: string | null) => string; export declare const encodeHref: (href?: string | null) => string;