UNPKG

graphdb

Version:

Javascript client library supporting GraphDB and RDF4J REST API.

53 lines (52 loc) 1.54 kB
export = ContentParser; /** * Abstract class defining the API for content type parsers. * * @class * @author Mihail Radkov * @author Svilen Velikov */ declare class ContentParser { /** * @param {Object} config is an object containing the parser configuration. */ constructor(config: any); /** * Configure the parser instance. * * @private * @param {Object} config */ private configureParser; config: any; /** * @return {Object} config is the passed during the initialization parser * config object. */ getConfig(): any; /** * If implemented by successors, this must return boolean <code>true</code> * when the wrapped parser supports stream reading by default or * <code>false</code> otherwise. * * @abstract * @return {boolean} if the parser supports streaming by default */ isStreaming(): boolean; /** * Implementations should delegate the actual parsing to underlying parser * library or to a custom implementation. * * @abstract * @param {string} content which has to be parsed to given format. * @param {Object} [config] optional parser configuration. * @return {Term} the converted content. */ parse(content: string, config?: any): Term; /** * @abstract * @return {string} the type which underlying parser supports which should be * the type under which it was registered in the parser registry. */ getSupportedType(): string; }