Adjusted the dialog API types to have more sensible defaults
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -31,7 +31,7 @@ function getDialogId() {
|
||||
return dialogId.toString(36);
|
||||
}
|
||||
|
||||
type DialogState = DialogApiDialog & {
|
||||
type DialogState = DialogApiDialog<unknown> & {
|
||||
id: string;
|
||||
modal: boolean;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user