add exports

Signed-off-by: Karl Haworth <karl.haworth@aa.com>
This commit is contained in:
Karl Haworth
2024-04-04 11:39:18 -04:00
parent a03eb38ae8
commit 7a4074d3ad
3 changed files with 15 additions and 5 deletions
@@ -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<string>;
@@ -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) => {
<Content noPadding>
<ApolloExplorerBrowser
endpoints={endpoints}
authCallback={() => authCallback({ apiHolder })}
authCallback={
authCallback ? () => authCallback({ apiHolder }) : undefined
}
/>
</Content>
</Page>
@@ -14,4 +14,4 @@
* limitations under the License.
*/
export { ApolloExplorerPage } from './ApolloExplorerPage';
export type { EndpointProps } from './ApolloExplorerPage';
export type { EndpointProps, AuthCallback } from './ApolloExplorerPage';
+4 -1
View File
@@ -20,4 +20,7 @@
* @packageDocumentation
*/
export { apolloExplorerPlugin, ApolloExplorerPage } from './plugin';
export type { EndpointProps } from './components/ApolloExplorerPage';
export type {
EndpointProps,
AuthCallback,
} from './components/ApolloExplorerPage';