From d0d2bf79c8253630d5fed8327cb208e084afb636 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Tue, 1 Jun 2021 12:13:36 +0200 Subject: [PATCH] API Report and document types. Signed-off-by: Eric Peterson --- packages/search-common/api-report.md | 4 +++- packages/search-common/src/types.ts | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/search-common/api-report.md b/packages/search-common/api-report.md index 35a868849d..a3de27b5a9 100644 --- a/packages/search-common/api-report.md +++ b/packages/search-common/api-report.md @@ -10,12 +10,14 @@ import { JsonObject } from '@backstage/config'; export interface DocumentCollator { // (undocumented) execute(): Promise; + readonly type: string; } // @public export interface DocumentDecorator { // (undocumented) - execute(type: string, documents: IndexableDocument[]): Promise; + execute(documents: IndexableDocument[]): Promise; + readonly types?: string[]; } // @public diff --git a/packages/search-common/src/types.ts b/packages/search-common/src/types.ts index 792b9f3a2a..2e7ca97edc 100644 --- a/packages/search-common/src/types.ts +++ b/packages/search-common/src/types.ts @@ -58,6 +58,10 @@ export interface IndexableDocument { * search. */ export interface DocumentCollator { + /** + * The type or name of the document set returned by this collator. Used as an + * index name by Search Engines. + */ readonly type: string; execute(): Promise; } @@ -67,6 +71,11 @@ export interface DocumentCollator { * additional metadata. */ export interface DocumentDecorator { + /** + * An optional array of document/index types on which this decorator should + * be applied. If no types are provided, this decorator will be applied to + * all document/index types. + */ readonly types?: string[]; execute(documents: IndexableDocument[]): Promise; }