chore: fixing api-docs and simplifying types a little

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-06-13 04:36:06 +02:00
parent 6109f32b78
commit 00815e520b
3 changed files with 11 additions and 15 deletions
+6 -2
View File
@@ -238,9 +238,13 @@ export type ErrorBoundaryFallbackProps = {
export const FeatureFlagged: (props: FeatureFlaggedProps) => JSX.Element | null;
// @public (undocumented)
export type FeatureFlaggedProps = FeatureFlaggedSelector & {
export type FeatureFlaggedProps = {
children: JSX.Element | null;
};
} & ({
with: string;
} | {
without: string;
});
// @public (undocumented)
export const FlatRoutes: (props: FlatRoutesProps) => JSX.Element | null;
+1
View File
@@ -37,6 +37,7 @@ describe('index', () => {
ConfigReader: expect.any(Function),
ErrorAlerter: expect.any(Function),
ErrorApiForwarder: expect.any(Function),
FeatureFlagged: expect.any(Function),
GithubAuth: expect.any(Function),
GitlabAuth: expect.any(Function),
GoogleAuth: expect.any(Function),
@@ -20,19 +20,10 @@ import {
attachComponentData,
} from '@backstage/core-plugin-api';
export type FeatureFlaggedWith = {
with: string;
};
export type FeatureFlaggedWithout = {
without: string;
};
export type FeatureFlaggedSelector = FeatureFlaggedWith | FeatureFlaggedWithout;
export type FeatureFlaggedProps = FeatureFlaggedSelector & {
children: JSX.Element | null;
};
export type FeatureFlaggedProps = { children: JSX.Element | null } & (
| { with: string }
| { without: string }
);
export const FeatureFlagged = (props: FeatureFlaggedProps) => {
const { children } = props;
const featureFlagApi = useApi(featureFlagsApiRef);