From e0f34a57eacb7403a9f663b81a82ed3b0ad74888 Mon Sep 17 00:00:00 2001 From: Marin Atanasov Date: Mon, 13 Feb 2023 15:04:55 +0200 Subject: [PATCH] Add core/data temp placeholder types --- .../src/components/help-center-more-resources.tsx | 6 +++++- packages/help-center/src/components/help-icon.tsx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/help-center/src/components/help-center-more-resources.tsx b/packages/help-center/src/components/help-center-more-resources.tsx index 4c7cfe2951f61..9dce6382d1e38 100644 --- a/packages/help-center/src/components/help-center-more-resources.tsx +++ b/packages/help-center/src/components/help-center-more-resources.tsx @@ -22,6 +22,10 @@ const circle = ( ); +type CoreDataPlaceholder = { + hasFinishedResolution: ( ...args: unknown[] ) => boolean; +}; + export const HelpCenterMoreResources = () => { const { __ } = useI18n(); const sectionName = useSelector( getSectionName ); @@ -42,7 +46,7 @@ export const HelpCenterMoreResources = () => { hasSeenWhatsNewModal: ( select( HELP_CENTER_STORE ) as HelpCenterSelect ).getHasSeenWhatsNewModal(), - doneLoading: select( 'core/data' ).hasFinishedResolution( + doneLoading: ( select( 'core/data' ) as CoreDataPlaceholder ).hasFinishedResolution( HELP_CENTER_STORE, 'getHasSeenWhatsNewModal', [] diff --git a/packages/help-center/src/components/help-icon.tsx b/packages/help-center/src/components/help-icon.tsx index 1381bf1d0b526..1b2367408198e 100644 --- a/packages/help-center/src/components/help-icon.tsx +++ b/packages/help-center/src/components/help-icon.tsx @@ -3,11 +3,15 @@ import { forwardRef } from 'react'; import { HELP_CENTER_STORE } from '../stores'; import type { HelpCenterSelect } from '@automattic/data-stores'; +type CoreDataPlaceholder = { + hasFinishedResolution: ( ...args: unknown[] ) => boolean; +}; + const HelpIcon = forwardRef< SVGSVGElement >( ( _, ref ) => { const { unreadCount, doneLoading, hasSeenWhatsNewModal } = useSelect( ( select ) => ( { unreadCount: ( select( HELP_CENTER_STORE ) as HelpCenterSelect ).getUnreadCount(), - doneLoading: select( 'core/data' ).hasFinishedResolution( + doneLoading: ( select( 'core/data' ) as CoreDataPlaceholder ).hasFinishedResolution( HELP_CENTER_STORE, 'getHasSeenWhatsNewModal', []