From 7a4074d3adc0b76567b36803b611ee57f676c877 Mon Sep 17 00:00:00 2001 From: Karl Haworth Date: Thu, 4 Apr 2024 11:39:18 -0400 Subject: [PATCH] add exports Signed-off-by: Karl Haworth --- .../ApolloExplorerPage/ApolloExplorerPage.tsx | 13 ++++++++++--- .../src/components/ApolloExplorerPage/index.ts | 2 +- plugins/apollo-explorer/src/index.ts | 5 ++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx b/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx index 250b304fac..fbbced24d1 100644 --- a/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx +++ b/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx @@ -41,7 +41,12 @@ export type EndpointProps = { }; }; -export type authCallback = (options: { +/** + * Export types to be used with {@link @backstage/apollo-explorer#ApolloExplorerPage}. + * + * @public + */ +export type AuthCallback = (options: { apiHolder: ApiHolder; }) => Promise; @@ -49,7 +54,7 @@ type Props = { title?: string | undefined; subtitle?: string | undefined; endpoints: EndpointProps[]; - authCallback: authCallback; + authCallback?: AuthCallback; }; export const ApolloExplorerPage = (props: Props) => { @@ -63,7 +68,9 @@ export const ApolloExplorerPage = (props: Props) => { authCallback({ apiHolder })} + authCallback={ + authCallback ? () => authCallback({ apiHolder }) : undefined + } /> diff --git a/plugins/apollo-explorer/src/components/ApolloExplorerPage/index.ts b/plugins/apollo-explorer/src/components/ApolloExplorerPage/index.ts index 1eef091978..3ca6d12fd0 100644 --- a/plugins/apollo-explorer/src/components/ApolloExplorerPage/index.ts +++ b/plugins/apollo-explorer/src/components/ApolloExplorerPage/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ export { ApolloExplorerPage } from './ApolloExplorerPage'; -export type { EndpointProps } from './ApolloExplorerPage'; +export type { EndpointProps, AuthCallback } from './ApolloExplorerPage'; diff --git a/plugins/apollo-explorer/src/index.ts b/plugins/apollo-explorer/src/index.ts index 5911e246f0..471ec9e710 100644 --- a/plugins/apollo-explorer/src/index.ts +++ b/plugins/apollo-explorer/src/index.ts @@ -20,4 +20,7 @@ * @packageDocumentation */ export { apolloExplorerPlugin, ApolloExplorerPage } from './plugin'; -export type { EndpointProps } from './components/ApolloExplorerPage'; +export type { + EndpointProps, + AuthCallback, +} from './components/ApolloExplorerPage';