diff --git a/.changeset/thin-ghosts-tease.md b/.changeset/thin-ghosts-tease.md new file mode 100644 index 0000000000..68d65b0265 --- /dev/null +++ b/.changeset/thin-ghosts-tease.md @@ -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 diff --git a/plugins/catalog-react/api-report.md b/plugins/catalog-react/api-report.md index 7e6b80bd19..bb5487c4cf 100644 --- a/plugins/catalog-react/api-report.md +++ b/plugins/catalog-react/api-report.md @@ -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[]): { diff --git a/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx b/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx index 4fd3fd43e8..2159c30edc 100644 --- a/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx +++ b/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx @@ -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 },