Adjusted the dialog API types to have more sensible defaults

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2025-08-06 13:54:37 +02:00
parent 0fde3e26a6
commit 9831f4e4c7
6 changed files with 17 additions and 17 deletions
+1 -7
View File
@@ -1,9 +1,3 @@
# app
Welcome to the app plugin!
_This plugin was created through the Backstage CLI_
## Getting started
Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn start` in the root directory, and then navigating to [/app](http://localhost:3000/app).
This plugin is part of the new frontend system, and represents the foundation of the frontend application itself, which then other features attach themselves into.
+3 -3
View File
@@ -19,7 +19,7 @@ import { DialogApi, DialogApiDialog } from '@backstage/frontend-plugin-api';
export type OnShowDialog = (options: {
component: (props: { dialog: DialogApiDialog<any> }) => React.JSX.Element;
modal: boolean;
}) => DialogApiDialog;
}) => DialogApiDialog<unknown>;
/**
* Default implementation for the {@link DialogApi}.
@@ -28,7 +28,7 @@ export type OnShowDialog = (options: {
export class DefaultDialogApi implements DialogApi {
#onShow?: OnShowDialog;
show<TResult = {}>(
show<TResult = void>(
elementOrComponent:
| JSX.Element
| ((props: {
@@ -47,7 +47,7 @@ export class DefaultDialogApi implements DialogApi {
}) as DialogApiDialog<TResult | undefined>;
}
showModal<TResult = {}>(
showModal<TResult = void>(
elementOrComponent:
| JSX.Element
| ((props: { dialog: DialogApiDialog<TResult> }) => JSX.Element),
+1 -1
View File
@@ -31,7 +31,7 @@ function getDialogId() {
return dialogId.toString(36);
}
type DialogState = DialogApiDialog & {
type DialogState = DialogApiDialog<unknown> & {
id: string;
modal: boolean;
};