Skip to main content

Class: Bluehawk

The frontend of Bluehawk.

Constructors

constructor

new Bluehawk(configuration?)

Parameters

NameType
configuration?BluehawkConfiguration

Defined in

src/bluehawk/bluehawk.ts:43

Properties

_parserStore

Private _parserStore: ParserStore

Defined in

src/bluehawk/bluehawk.ts:221


_processor

Private _processor: Processor

Defined in

src/bluehawk/bluehawk.ts:220

Accessors

processor

get processor(): Processor

Returns

Processor

Defined in

src/bluehawk/bluehawk.ts:216

Methods

addLanguage

addLanguage(forFileExtension, languageSpecification): void

Specify the special patterns for a given language.

Parameters

NameType
forFileExtensionstring | string[]
languageSpecificationLanguageSpecification

Returns

void

Defined in

src/bluehawk/bluehawk.ts:78


parse

parse(source, options?): ParseResult

Parses the given source file into tags.

Parameters

NameType
sourceDocument
options?Object
options.languageSpecification?LanguageSpecification
options.reporter?ActionReporter

Returns

ParseResult

Defined in

src/bluehawk/bluehawk.ts:161


parseAndProcess

parseAndProcess(path, optionsIn?): Promise<void>

Runs through all given source paths to parse and process them.

Parameters

NameTypeDescription
pathstring | string[]The path or paths to the directory or files to parse and process.
optionsIn?ParseAndProcessOptions-

Returns

Promise<void>

Defined in

src/bluehawk/bluehawk.ts:91


process

process(parseResult, processOptions?): Promise<BluehawkFiles>

Executes the tags on the given source. Use Bluehawk.subscribe to get results.

Parameters

NameType
parseResultParseResult
processOptions?ProcessOptions

Returns

Promise<BluehawkFiles>

Defined in

src/bluehawk/bluehawk.ts:209


registerTag

registerTag(tag, alternateName?): void

Register the given tag on the processor and validator. This enables support for the tag under the given name.

Parameters

NameType
tagAnyTag
alternateName?string

Returns

void

Defined in

src/bluehawk/bluehawk.ts:71


subscribe

subscribe(listener): void

Subscribe to processed documents as they are processed by Bluehawk.

Parameters

NameType
listenerListener | Listener[]

Returns

void

Defined in

src/bluehawk/bluehawk.ts:197


waitForListeners

waitForListeners(): Promise<void>

Returns

Promise<void>

Defined in

src/bluehawk/bluehawk.ts:154