Deprecate EntityTypeReturn type

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2022-02-24 11:07:00 +01:00
parent 97682d25ed
commit 96b8ae9a9e
3 changed files with 23 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-react': patch
---
Deprecated the `EntityTypeReturn` type and inlined the return type to `useEntityTypeFilter` as the type and function name does not align
+8 -2
View File
@@ -410,7 +410,7 @@ export interface EntityTypePickerProps {
initialFilter?: string;
}
// @public (undocumented)
// @public @deprecated (undocumented)
export type EntityTypeReturn = {
loading: boolean;
error?: Error;
@@ -572,7 +572,13 @@ export function useEntityPermission(permission: Permission): {
};
// @public
export function useEntityTypeFilter(): EntityTypeReturn;
export function useEntityTypeFilter(): {
loading: boolean;
error?: Error;
availableTypes: string[];
selectedTypes: string[];
setSelectedTypes: (types: string[]) => void;
};
// @public @deprecated
export function useOwnedEntities(allowedKinds?: string[]): {
@@ -23,7 +23,9 @@ import { catalogApiRef } from '../api';
import { useEntityList } from './useEntityListProvider';
import { EntityTypeFilter } from '../filters';
/** @public */
/** @public
* @deprecated type inlined with {@link useEntityTypeFilter}.
*/
export type EntityTypeReturn = {
loading: boolean;
error?: Error;
@@ -37,7 +39,13 @@ export type EntityTypeReturn = {
* based on the selected EntityKindFilter.
* @public
*/
export function useEntityTypeFilter(): EntityTypeReturn {
export function useEntityTypeFilter(): {
loading: boolean;
error?: Error;
availableTypes: string[];
selectedTypes: string[];
setSelectedTypes: (types: string[]) => void;
} {
const catalogApi = useApi(catalogApiRef);
const {
filters: { kind: kindFilter, type: typeFilter },