Better document contrib addon props.

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Eric Peterson
2022-05-11 13:14:14 +02:00
parent b859092abf
commit a80ae3dae1
3 changed files with 26 additions and 3 deletions
@@ -10,19 +10,19 @@ import { BackstagePlugin } from '@backstage/core-plugin-api';
// @public
export const ReportIssue: (props: ReportIssueProps) => JSX.Element | null;
// @public (undocumented)
// @public
export type ReportIssueProps = {
debounceTime?: number;
templateBuilder?: ReportIssueTemplateBuilder;
};
// @public (undocumented)
// @public
export type ReportIssueTemplate = {
title: string;
body: string;
};
// @public (undocumented)
// @public
export type ReportIssueTemplateBuilder = ({
selection,
}: {
@@ -49,10 +49,21 @@ type Style = {
};
/**
* Props customizing the <ReportIssue /> Addon.
*
* @public
*/
export type ReportIssueProps = {
/**
* Number of milliseconds after a user highlights some text before the report
* issue link appears above the highlighted text. Defaults to 500ms.
*/
debounceTime?: number;
/**
* An optional function defining how a custom issue title and body should be
* constructed, given some selected text.
*/
templateBuilder?: ReportIssueTemplateBuilder;
};
@@ -15,14 +15,26 @@
*/
/**
* Properties for creating an issue in a remote issue tracker.
*
* @public
*/
export type ReportIssueTemplate = {
/**
* The title of the issue.
*/
title: string;
/**
* The body or description of the issue.
*/
body: string;
};
/**
* A function for returning a custom issue template, given a selection of text
* on a TechDocs page.
*
* @public
*/
export type ReportIssueTemplateBuilder = ({