@backstage/plugin-home-react
Version:
A Backstage plugin that contains react components helps you build a home page
118 lines (112 loc) • 3.1 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { JSX as JSX$1 } from 'react';
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
import { RJSFSchema, UiSchema } from '@rjsf/utils';
import { Overrides } from '@material-ui/core/styles/overrides';
import { StyleRules } from '@material-ui/core/styles/withStyles';
/** @public */
declare const SettingsModal: (props: {
open: boolean;
close: Function;
componentName?: string;
children: JSX.Element;
}) => react_jsx_runtime.JSX.Element;
/** @public */
type PluginHomeContentModalClassKey = 'contentModal' | 'linkText';
/**
* Props customizing the <ContentModal/> component.
*
* @public
*/
type ContentModalProps = {
modalContent: JSX$1.Element;
linkContent: string | JSX$1.Element;
};
/**
* A component to expand given content into a full screen modal.
*
* @public
*/
declare const ContentModal: (props: ContentModalProps) => react_jsx_runtime.JSX.Element;
/**
* @public
*/
type ComponentRenderer = {
Renderer?: (props: RendererProps) => JSX.Element;
};
/**
* @public
*/
type ComponentParts = {
Content: (props?: any) => JSX.Element;
Actions?: () => JSX.Element;
Settings?: () => JSX.Element;
ContextProvider?: (props: any) => JSX.Element;
};
/**
* @public
*/
type RendererProps = {
title?: string;
} & ComponentParts;
/**
* @public
*/
type CardExtensionProps<T> = ComponentRenderer & {
title?: string;
} & T;
/**
* @public
*/
type CardLayout = {
width?: {
minColumns?: number;
maxColumns?: number;
defaultColumns?: number;
};
height?: {
minRows?: number;
maxRows?: number;
defaultRows?: number;
};
};
/**
* @public
*/
type CardSettings = {
schema?: RJSFSchema;
uiSchema?: UiSchema;
};
/**
* @public
*/
type CardConfig = {
layout?: CardLayout;
settings?: CardSettings;
};
/**
* An extension creator to create card based components for the homepage
*
* @public
*/
declare function createCardExtension<T>(options: {
title?: string;
components: () => Promise<ComponentParts>;
name?: string;
description?: string;
layout?: CardLayout;
settings?: CardSettings;
}): _backstage_core_plugin_api.Extension<(props: CardExtensionProps<T>) => react_jsx_runtime.JSX.Element>;
/** @public */
type PluginHomeComponentsNameToClassKey = {
PluginHomeContentModal: PluginHomeContentModalClassKey;
};
/** @public */
type BackstageOverrides = Overrides & {
[Name in keyof PluginHomeComponentsNameToClassKey]?: Partial<StyleRules<PluginHomeComponentsNameToClassKey[Name]>>;
};
declare module '@backstage/theme' {
interface OverrideComponentNameToClassKeys extends PluginHomeComponentsNameToClassKey {
}
}
export { type BackstageOverrides, type CardConfig, type CardExtensionProps, type CardLayout, type CardSettings, type ComponentParts, type ComponentRenderer, ContentModal, type ContentModalProps, type PluginHomeComponentsNameToClassKey, type PluginHomeContentModalClassKey, type RendererProps, SettingsModal, createCardExtension };