From fea739f1caa1987c9edce53bd6398a6da1504dd0 Mon Sep 17 00:00:00 2001 From: John Philip Date: Sat, 22 Jun 2024 21:14:24 -0400 Subject: [PATCH] fix api reports Signed-off-by: John Philip --- plugins/techdocs-node/api-report.md | 22 ++++++++++++++++++- .../techdocs-node/src/stages/publish/index.ts | 1 + .../src/stages/publish/publish.ts | 8 +++---- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/plugins/techdocs-node/api-report.md b/plugins/techdocs-node/api-report.md index 2d3ca90983..364c6dade0 100644 --- a/plugins/techdocs-node/api-report.md +++ b/plugins/techdocs-node/api-report.md @@ -183,11 +183,15 @@ export class Preparers implements PreparerBuilder { } // @public -export class Publisher { +export class Publisher implements PublisherBuilder { static fromConfig( config: Config, options: PublisherFactory, ): Promise; + // (undocumented) + get(config: Config): PublisherBase; + // (undocumented) + register(type: PublisherType | 'techdocs', publisher: PublisherBase): void; } // @public @@ -202,10 +206,17 @@ export interface PublisherBase { publish(request: PublishRequest): Promise; } +// @public +export type PublisherBuilder = { + register(type: PublisherType, publisher: PublisherBase): void; + get(config: Config): PublisherBase; +}; + // @public export type PublisherFactory = { logger: Logger; discovery: PluginEndpointDiscovery; + customPublisher?: PublisherBase | undefined; }; // @public @@ -303,6 +314,15 @@ export interface TechdocsPreparerExtensionPoint { // @public export const techdocsPreparerExtensionPoint: ExtensionPoint; +// @public +export interface TechdocsPublisherExtensionPoint { + // (undocumented) + registerPublisher(type: PublisherType, publisher: PublisherBase): void; +} + +// @public +export const techdocsPublisherExtensionPoint: ExtensionPoint; + // @public export const transformDirLocation: ( entity: Entity, diff --git a/plugins/techdocs-node/src/stages/publish/index.ts b/plugins/techdocs-node/src/stages/publish/index.ts index c6f86f6bc1..f342ccf0ae 100644 --- a/plugins/techdocs-node/src/stages/publish/index.ts +++ b/plugins/techdocs-node/src/stages/publish/index.ts @@ -23,4 +23,5 @@ export type { MigrateRequest, ReadinessResponse, TechDocsMetadata, + PublisherBuilder, } from './types'; diff --git a/plugins/techdocs-node/src/stages/publish/publish.ts b/plugins/techdocs-node/src/stages/publish/publish.ts index 4fb731a0ba..09a6d9b375 100644 --- a/plugins/techdocs-node/src/stages/publish/publish.ts +++ b/plugins/techdocs-node/src/stages/publish/publish.ts @@ -32,13 +32,11 @@ import { * Uses `techdocs.publisher.type`. * @public */ - -type CustomPublisherType = PublisherType | 'techdocs'; - export class Publisher implements PublisherBuilder { - private publishers: Map = new Map(); + private publishers: Map = + new Map(); - register(type: CustomPublisherType, publisher: PublisherBase): void { + register(type: PublisherType | 'techdocs', publisher: PublisherBase): void { this.publishers.set(type, publisher); }