Extractorclass

new Extractor<I, O>()
Return
Extractor<I, O>
Base class for an extractor that converts an input of type I into a TreeElement output.

Base class for an extractor that converts an input of type I into a TreeElement output.

  • Extractors are composable: outer extractors delegate to inner extractors.
  • The output type is always a TreeElement (or a more specific subtype).

Examples

class JSONExtractor extends Extractor<string, TreeElement> {
	extract(input: string): TreeElement { return JSON.parse(input); }
}

Methods

Go

Extractor.extract()method

Extract a tree element from the given input.

extract(input: I): O | Promise<O>