Merge pull request #20736 from ivangonzalezacuna/kubernetes/exported-types

(kubernetes-react): Make sure types are exported
This commit is contained in:
Jamie Klassen
2023-10-31 10:30:43 -04:00
committed by GitHub
7 changed files with 64 additions and 3 deletions
+2
View File
@@ -27,3 +27,5 @@ export * from './hooks';
export * from './api';
export * from './kubernetes-auth-provider';
export * from './components';
export * from './utils';
export * from './types';
@@ -16,6 +16,9 @@
import type { JsonObject } from '@backstage/types';
/**
* @public
*/
export interface ClusterLinksFormatterOptions {
dashboardUrl?: URL;
dashboardParameters?: JsonObject;
@@ -23,6 +26,9 @@ export interface ClusterLinksFormatterOptions {
kind: string;
}
/**
* @public
*/
export type ClusterLinksFormatter = (
options: ClusterLinksFormatterOptions,
) => URL;
@@ -17,7 +17,9 @@
import type { JsonObject } from '@backstage/types';
import { defaultFormatterName, clusterLinksFormatters } from './formatters';
// @Deprecated use import { FormatClusterLinkOptions } from '@backstage/kubernetes-react'
/**
* @public
*/
export type FormatClusterLinkOptions = {
dashboardUrl?: string;
dashboardApp?: string;
@@ -26,7 +28,9 @@ export type FormatClusterLinkOptions = {
kind: string;
};
// @Deprecated use import { formatClusterLink } from '@backstage/kubernetes-react'
/**
* @public
*/
export function formatClusterLink(options: FormatClusterLinkOptions) {
if (!options.dashboardUrl && !options.dashboardParameters) {
return undefined;
@@ -21,6 +21,9 @@ import { aksFormatter } from './aks';
import { eksFormatter } from './eks';
import { gkeFormatter } from './gke';
/**
* @public
*/
export const clusterLinksFormatters: Record<string, ClusterLinksFormatter> = {
standard: standardFormatter,
rancher: rancherFormatter,
@@ -14,5 +14,8 @@
* limitations under the License.
*/
export { formatClusterLink } from './formatClusterLink';
export {
formatClusterLink,
type FormatClusterLinkOptions,
} from './formatClusterLink';
export { clusterLinksFormatters } from './formatters';