fix(techdocs): update api reports
Co-authored-by: Emma Indal <emma.indahl@gmail.com> Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
## API Report File for "@backstage/techdocs-addons"
|
||||
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
import { AsyncState } from 'react-use/lib/useAsyncFn';
|
||||
import { ComponentType } from 'react';
|
||||
import { Extension } from '@backstage/core-plugin-api';
|
||||
import { default as React_2 } from 'react';
|
||||
|
||||
// @public
|
||||
export function createTechDocsAddon<TComponentProps>(
|
||||
options: TechDocsAddonOptions<TComponentProps>,
|
||||
): Extension<ComponentType<TComponentProps>>;
|
||||
|
||||
// @public
|
||||
export const TECHDOCS_ADDONS_WRAPPER_KEY = 'techdocs.addons.wrapper.v1';
|
||||
|
||||
// @public
|
||||
export type TechDocsAddonAsyncMetadata<TValue> = AsyncState<TValue | undefined>;
|
||||
|
||||
// @public
|
||||
export enum TechDocsAddonLocations {
|
||||
COMPONENT = 'component',
|
||||
CONTENT = 'content',
|
||||
HEADER = 'header',
|
||||
PRIMARY_SIDEBAR = 'primary sidebar',
|
||||
SECONDARY_SIDEBAR = 'secondary sidebar',
|
||||
SUBHEADER = 'subheader',
|
||||
}
|
||||
|
||||
// @public
|
||||
export type TechDocsAddonOptions<TAddonProps = {}> = {
|
||||
name: string;
|
||||
location: TechDocsAddonLocations;
|
||||
component: ComponentType<TAddonProps>;
|
||||
};
|
||||
|
||||
// @public
|
||||
export const TechDocsAddons: React_2.ComponentType;
|
||||
|
||||
// @public
|
||||
export const useTechDocsAddons: () => {
|
||||
renderComponentByName: (name: string) => React_2.ReactElement<
|
||||
{
|
||||
[name: string]: unknown;
|
||||
},
|
||||
string | React_2.JSXElementConstructor<any>
|
||||
> | null;
|
||||
renderComponentsByLocation: (location: TechDocsAddonLocations) =>
|
||||
| (React_2.ReactElement<
|
||||
{
|
||||
[name: string]: unknown;
|
||||
},
|
||||
string | React_2.JSXElementConstructor<any>
|
||||
> | null)[]
|
||||
| null;
|
||||
};
|
||||
```
|
||||
@@ -91,6 +91,10 @@ const getAllTechDocsAddonsData = (collection: ElementCollection) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* hook to use addons in components
|
||||
* @public
|
||||
*/
|
||||
export const useTechDocsAddons = () => {
|
||||
const node = useOutlet();
|
||||
const collection = useElementFilter(node, getAllTechDocsAddons);
|
||||
|
||||
Reference in New Issue
Block a user