Skip to main content

DecoratorBase

Home > @backstage/plugin-search-backend-node > DecoratorBase

Base class encapsulating simple async transformations. Useful as a base class for Backstage search decorators.

Signature:

abstract class DecoratorBase extends Transform 

Extends: Transform

Constructors

Constructor

Modifiers

Description

(constructor)()

Constructs a new instance of the DecoratorBase class

Methods

Method

Modifiers

Description

decorate(document)

abstract

Receives a single indexable document. In your decorate method, you can:

  • Resolve undefined to indicate the record should be omitted. - Resolve a single modified document, which could contain new fields, edited fields, or removed fields. - Resolve an array of indexable documents, if the purpose if the decorator is to convert one document into multiple derivative documents.

finalize()

abstract

Any asynchronous teardown tasks can be performed here.

initialize()

abstract

Any asynchronous setup tasks can be performed here.