import { ScreenName } from '@ulangi/ulangi-common/enums' ; import { FeatureSettings } from '@ulangi/ulangi-common/interfaces' ; import { boundClass } from 'autobind-decorator' ; import { NavigatorDelegate } from '../navigator/NavigatorDelegate' ; import { InAppRatingDelegate } from '../rating/InAppRatingDelegate' ; import { FeatureSettingsDelegate } from './FeatureSettingsDelegate' ; @ boundClass export class LearnScreenDelegate { private featureSettingsDelegate : FeatureSettingsDelegate ; private inAppRatingDelegate : InAppRatingDelegate ; private navigatorDelegate : NavigatorDelegate ; public constructor ( featureSettingsDelegate , inAppRatingDelegate , navigatorDelegate ) { this . featureSettingsDelegate = featureSettingsDelegate ; this . inAppRatingDelegate = inAppRatingDelegate ; this . navigatorDelegate = navigatorDelegate ; } public getCurrentFeatureSettings ( ) { return this . featureSettingsDelegate . getCurrentSettings ( ) ; } public navigateToFeatureManagementScreen ( ) { this . navigatorDelegate . push ( ScreenName . FEATURE_MANAGEMENT_SCREEN , { } ) ; } public navigateToSpacedRepetitionScreen ( ) { this . navigatorDelegate . push ( ScreenName . SPACED_REPETITION_SCREEN , { selectedCategoryNames : undefined , onClose : ( ) : void => { this . inAppRatingDelegate . autoShowInAppRating ( ) ; } , } ) ; } public navigateToWritingScreen ( ) { this . navigatorDelegate . push ( ScreenName . WRITING_SCREEN , { selectedCategoryNames : undefined , } ) ; } public navigateToQuizScreen ( ) { this . navigatorDelegate . push ( ScreenName . QUIZ_SCREEN , { selectedCategoryNames : undefined , } ) ; } public navigateToAtomScreen ( ) { this . navigatorDelegate . push ( ScreenName . ATOM_SCREEN , { selectedCategoryNames : undefined , } ) ; } public navigateToReflexScreen ( ) { this . navigatorDelegate . push ( ScreenName . REFLEX_SCREEN , { selectedCategoryNames : undefined , } ) ; } }