diff --git a/plugins/catalog-react/api-report.md b/plugins/catalog-react/api-report.md index 0103ac2f0e..1a94af6052 100644 --- a/plugins/catalog-react/api-report.md +++ b/plugins/catalog-react/api-report.md @@ -225,8 +225,8 @@ export const EntityListProvider: ({ }: PropsWithChildren<{}>) => JSX.Element; // @public (undocumented) -export type EntityLoadingStatus = { - entity?: Entity; +export type EntityLoadingStatus = { + entity?: TEntity; loading: boolean; error?: Error; refresh?: VoidFunction; @@ -525,23 +525,16 @@ export type UnregisterEntityDialogProps = { // @public export function useAsyncEntity< - T extends Entity = Entity, ->(): UseAsyncEntityResponse; + TEntity extends Entity = Entity, +>(): EntityLoadingStatus; // @public -export interface UseAsyncEntityResponse { - // (undocumented) - entity?: T; - // (undocumented) - error?: Error; - // (undocumented) +export function useEntity(): { + entity: TEntity; loading: boolean; - // (undocumented) + error?: Error; refresh?: VoidFunction; -} - -// @public -export function useEntity(): UseEntityResponse; +}; // @public @deprecated export const useEntityCompoundName: () => { @@ -583,18 +576,6 @@ export function useEntityPermission(permission: Permission): { error?: Error; }; -// @public -export interface UseEntityResponse { - // (undocumented) - entity: T; - // @deprecated (undocumented) - error?: Error; - // @deprecated (undocumented) - loading: boolean; - // @deprecated (undocumented) - refresh?: VoidFunction; -} - // @public export function useEntityTypeFilter(): { loading: boolean; diff --git a/plugins/catalog-react/src/hooks/index.ts b/plugins/catalog-react/src/hooks/index.ts index 8e0fc48e72..da23d54ad7 100644 --- a/plugins/catalog-react/src/hooks/index.ts +++ b/plugins/catalog-react/src/hooks/index.ts @@ -24,8 +24,6 @@ export type { EntityLoadingStatus, EntityProviderProps, AsyncEntityProviderProps, - UseEntityResponse, - UseAsyncEntityResponse, } from './useEntity'; export { useEntityCompoundName } from './useEntityCompoundName'; export { diff --git a/plugins/catalog-react/src/hooks/useEntity.tsx b/plugins/catalog-react/src/hooks/useEntity.tsx index 8ff5df9349..f70adef708 100644 --- a/plugins/catalog-react/src/hooks/useEntity.tsx +++ b/plugins/catalog-react/src/hooks/useEntity.tsx @@ -27,7 +27,7 @@ import { catalogApiRef } from '../api'; import { useEntityCompoundName } from './useEntityCompoundName'; /** @public */ -export type EntityLoadingStatus = { +export type EntityLoadingStatus = { entity?: TEntity; loading: boolean; error?: Error;