move TechDocsStorage api from @backstage/plugin-techdocs to @backstage/plugin-techdocs-react
Signed-off-by: Anders Näsman <andersn@spotify.com>
This commit is contained in:
@@ -39,3 +39,40 @@ export interface TechDocsApi {
|
||||
export const techdocsApiRef = createApiRef<TechDocsApi>({
|
||||
id: 'plugin.techdocs.service',
|
||||
});
|
||||
|
||||
/**
|
||||
* The outcome of a docs sync operation.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type SyncResult = 'cached' | 'updated';
|
||||
|
||||
/**
|
||||
* API which talks to TechDocs storage to fetch files to render.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface TechDocsStorageApi {
|
||||
getApiOrigin(): Promise<string>;
|
||||
getStorageUrl(): Promise<string>;
|
||||
getBuilder(): Promise<string>;
|
||||
getEntityDocs(entityId: CompoundEntityRef, path: string): Promise<string>;
|
||||
syncEntityDocs(
|
||||
entityId: CompoundEntityRef,
|
||||
logHandler?: (line: string) => void,
|
||||
): Promise<SyncResult>;
|
||||
getBaseUrl(
|
||||
oldBaseUrl: string,
|
||||
entityId: CompoundEntityRef,
|
||||
path: string,
|
||||
): Promise<string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility API reference for the {@link TechDocsStorageApi}.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const techdocsStorageApiRef = createApiRef<TechDocsStorageApi>({
|
||||
id: 'plugin.techdocs.storageservice',
|
||||
});
|
||||
|
||||
@@ -26,8 +26,8 @@ export {
|
||||
TechDocsAddons,
|
||||
TECHDOCS_ADDONS_WRAPPER_KEY,
|
||||
} from './addons';
|
||||
export { techdocsApiRef } from './api';
|
||||
export type { TechDocsApi } from './api';
|
||||
export { techdocsApiRef, techdocsStorageApiRef } from './api';
|
||||
export type { SyncResult, TechDocsApi, TechDocsStorageApi } from './api';
|
||||
export {
|
||||
defaultTechDocsReaderPageValue,
|
||||
TechDocsReaderPageProvider,
|
||||
|
||||
Reference in New Issue
Block a user