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

ConstructorModifiersDescription
(constructor)()Constructs a new instance of the DecoratorBase class

Methods

MethodModifiersDescription
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()abstractAny asynchronous teardown tasks can be performed here.
initialize()abstractAny asynchronous setup tasks can be performed here.