clean up api reports for search-common package

Signed-off-by: Emma Indal <emma.indahl@gmail.com>
This commit is contained in:
Emma Indal
2022-06-02 13:19:51 +02:00
parent b39d3ee499
commit 18e05f2b54
2 changed files with 32 additions and 32 deletions
+16 -16
View File
@@ -11,46 +11,46 @@ import { Readable } from 'stream';
import { Transform } from 'stream';
import { Writable } from 'stream';
// @beta
// @public
export interface DocumentCollatorFactory {
getCollator(): Promise<Readable>;
readonly type: string;
readonly visibilityPermission?: Permission;
}
// @beta
// @public
export interface DocumentDecoratorFactory {
getDecorator(): Promise<Transform>;
readonly types?: string[];
}
// @beta
// @public
export type DocumentTypeInfo = {
visibilityPermission?: Permission;
};
// @beta
// @public
export type IndexableDocument = SearchDocument & {
authorization?: {
resourceRef: string;
};
};
// @beta (undocumented)
// @public (undocumented)
export type IndexableResult = Result<IndexableDocument>;
// @beta (undocumented)
// @public (undocumented)
export type IndexableResultSet = ResultSet<IndexableDocument>;
// @beta
// @public
export type QueryRequestOptions = {
token?: string;
};
// @beta
// @public
export type QueryTranslator = (query: SearchQuery) => unknown;
// @beta (undocumented)
// @public (undocumented)
export interface Result<TDocument extends SearchDocument> {
// (undocumented)
document: TDocument;
@@ -60,7 +60,7 @@ export interface Result<TDocument extends SearchDocument> {
type: string;
}
// @beta
// @public
export interface ResultHighlight {
// (undocumented)
fields: {
@@ -70,7 +70,7 @@ export interface ResultHighlight {
preTag: string;
}
// @beta (undocumented)
// @public (undocumented)
export interface ResultSet<TDocument extends SearchDocument> {
// (undocumented)
nextPageCursor?: string;
@@ -80,14 +80,14 @@ export interface ResultSet<TDocument extends SearchDocument> {
results: Result<TDocument>[];
}
// @beta
// @public
export interface SearchDocument {
location: string;
text: string;
title: string;
}
// @beta
// @public
export interface SearchEngine {
getIndexer(type: string): Promise<Writable>;
query(
@@ -97,7 +97,7 @@ export interface SearchEngine {
setTranslator(translator: QueryTranslator): void;
}
// @beta (undocumented)
// @public (undocumented)
export interface SearchQuery {
// (undocumented)
filters?: JsonObject;
@@ -109,9 +109,9 @@ export interface SearchQuery {
types?: string[];
}
// @beta (undocumented)
// @public (undocumented)
export type SearchResult = Result<SearchDocument>;
// @beta (undocumented)
// @public (undocumented)
export type SearchResultSet = ResultSet<SearchDocument>;
```
+16 -16
View File
@@ -19,7 +19,7 @@ import { JsonObject } from '@backstage/types';
import { Readable, Transform, Writable } from 'stream';
/**
* @beta
* @public
*/
export interface SearchQuery {
term: string;
@@ -29,10 +29,10 @@ export interface SearchQuery {
}
/**
* @beta
* Metadata for result relevant document fields with matched terms highlighted
* via wrapping in associated pre/post tags. The UI is expected to parse these
* field excerpts by replacing wrapping tags with applicable UI elements for rendering.
* @public
*/
export interface ResultHighlight {
/**
@@ -53,7 +53,7 @@ export interface ResultHighlight {
}
/**
* @beta
* @public
*/
export interface Result<TDocument extends SearchDocument> {
type: string;
@@ -62,7 +62,7 @@ export interface Result<TDocument extends SearchDocument> {
}
/**
* @beta
* @public
*/
export interface ResultSet<TDocument extends SearchDocument> {
results: Result<TDocument>[];
@@ -71,28 +71,28 @@ export interface ResultSet<TDocument extends SearchDocument> {
}
/**
* @beta
* @public
*/
export type SearchResult = Result<SearchDocument>;
/**
* @beta
* @public
*/
export type SearchResultSet = ResultSet<SearchDocument>;
/**
* @beta
* @public
*/
export type IndexableResult = Result<IndexableDocument>;
/**
* @beta
* @public
*/
export type IndexableResultSet = ResultSet<IndexableDocument>;
/**
* Base properties that all search documents must include.
* @beta
* @public
*/
export interface SearchDocument {
/**
@@ -117,7 +117,7 @@ export interface SearchDocument {
* backends working directly with documents being inserted or retrieved from
* search indexes. When dealing with documents in the frontend, use
* {@link SearchDocument}.
* @beta
* @public
*/
export type IndexableDocument = SearchDocument & {
/**
@@ -136,7 +136,7 @@ export type IndexableDocument = SearchDocument & {
* Information about a specific document type. Intended to be used in the
* {@link @backstage/plugin-search-backend-node#IndexBuilder} to collect information
* about the types stored in the index.
* @beta
* @public
*/
export type DocumentTypeInfo = {
/**
@@ -148,7 +148,7 @@ export type DocumentTypeInfo = {
/**
* Factory class for instantiating collators.
* @beta
* @public
*/
export interface DocumentCollatorFactory {
/**
@@ -171,7 +171,7 @@ export interface DocumentCollatorFactory {
/**
* Factory class for instantiating decorators.
* @beta
* @public
*/
export interface DocumentDecoratorFactory {
/**
@@ -190,13 +190,13 @@ export interface DocumentDecoratorFactory {
/**
* A type of function responsible for translating an abstract search query into
* a concrete query relevant to a particular search engine.
* @beta
* @public
*/
export type QueryTranslator = (query: SearchQuery) => unknown;
/**
* Options when querying a search engine.
* @beta
* @public
*/
export type QueryRequestOptions = {
token?: string;
@@ -206,7 +206,7 @@ export type QueryRequestOptions = {
* Interface that must be implemented by specific search engines, responsible
* for performing indexing and querying and translating abstract queries into
* concrete, search engine-specific queries.
* @beta
* @public
*/
export interface SearchEngine {
/**