/** * [[include:src/codecs/http/README.md]] * * @module codecs/http */ import stencila from '@stencila/schema'; import * as vfile from '../../util/vfile'; import { Codec } from '../types'; export declare class HTTPCodec extends Codec implements Codec { /** * Sniff content to see if it is a HTTP/S URL */ readonly sniff: (content: string) => Promise; /** * Decode a `VFile` with a HTTP URL as content to a Stencila `Node`. * * Fetches the content and then delegates to the codec specified in the * `Content-Type` header. * * @param file The `VFile` to decode * @returns A promise that resolves to a Stencila `Node` */ readonly decode: (file: vfile.VFile) => Promise; /** * It is not possible to encode to a HTTP URL so this * function simply throws an error */ readonly encode: () => Promise; }