Class: Bluehawk
The frontend of Bluehawk.
Constructors
constructor
• new Bluehawk(configuration?
)
Parameters
Name | Type |
---|---|
configuration? | BluehawkConfiguration |
Defined in
Properties
_parserStore
• Private
_parserStore: ParserStore
Defined in
_processor
• Private
_processor: Processor
Defined in
Accessors
processor
• get
processor(): Processor
Returns
Processor
Defined in
Methods
addLanguage
▸ addLanguage(forFileExtension
, languageSpecification
): void
Specify the special patterns for a given language.
Parameters
Name | Type |
---|---|
forFileExtension | string | string [] |
languageSpecification | LanguageSpecification |
Returns
void
Defined in
parse
▸ parse(source
, options?
): ParseResult
Parses the given source file into tags.
Parameters
Name | Type |
---|---|
source | Document |
options? | Object |
options.languageSpecification? | LanguageSpecification |
options.reporter? | ActionReporter |
Returns
Defined in
parseAndProcess
▸ parseAndProcess(path
, optionsIn?
): Promise
<void
>
Runs through all given source paths to parse and process them.
Parameters
Name | Type | Description |
---|---|---|
path | string | string [] | The path or paths to the directory or files to parse and process. |
optionsIn? | ParseAndProcessOptions | - |
Returns
Promise
<void
>
Defined in
process
▸ process(parseResult
, processOptions?
): Promise
<BluehawkFiles
>
Executes the tags on the given source. Use Bluehawk.subscribe to get results.
Parameters
Name | Type |
---|---|
parseResult | ParseResult |
processOptions? | ProcessOptions |
Returns
Promise
<BluehawkFiles
>
Defined in
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
Name | Type |
---|---|
tag | AnyTag |
alternateName? | string |
Returns
void
Defined in
subscribe
▸ subscribe(listener
): void
Subscribe to processed documents as they are processed by Bluehawk.
Parameters
Name | Type |
---|---|
listener | Listener | Listener [] |
Returns
void
Defined in
waitForListeners
▸ waitForListeners(): Promise
<void
>
Returns
Promise
<void
>