import { SetFormPickerType } from '@ulangi/ulangi-common/enums' ; import { ErrorBag } from '@ulangi/ulangi-common/interfaces' ; import { boundClass } from 'autobind-decorator' ; import { DialogDelegate } from '../dialog/DialogDelegate' ; import { NavigatorDelegate } from '../navigator/NavigatorDelegate' ; import { PickerDelegate } from './PickerDelegate' ; import { SetFormDelegate } from './SetFormDelegate' ; @ boundClass export class AddEditSetScreenDelegate { protected setFormDelegate : SetFormDelegate ; protected pickerDelegate : PickerDelegate ; protected dialogDelegate : DialogDelegate ; protected navigatorDelegate : NavigatorDelegate ; public constructor ( setFormDelegate , pickerDelegate , dialogDelegate , navigatorDelegate ) { this . setFormDelegate = setFormDelegate ; this . pickerDelegate = pickerDelegate ; this . dialogDelegate = dialogDelegate ; this . navigatorDelegate = navigatorDelegate ; } public showPicker ( pickerType ) { this . pickerDelegate . showPicker ( pickerType ) ; } public hidePicker ( ) { this . pickerDelegate . hidePicker ( ) ; } public handleLanguageSelected ( languageCode ) { this . setFormDelegate . handleLanguageSelected ( languageCode ) ; } public showLanguageNotSelectedDialog ( languageType ) { this . dialogDelegate . show ( { message : languageType === 'learningLanguage' ? 'Please select a language you want to learn.' : 'Please select a language you want to translate to.' , showCloseButton : true , closeOnTouchOutside : true , } ) ; } public showSelectLearningLanguageFirstDialog ( ) { this . dialogDelegate . show ( { message : 'Please select a language you want to learn first.' , showCloseButton : true , closeOnTouchOutside : true , } ) ; } public showSavingDialog ( ) { this . dialogDelegate . showSavingDialog ( ) ; } public showSaveSucceededDialog ( ) { this . dialogDelegate . showSaveSucceededDialog ( ) ; } public showSaveFailedDialog ( errorBag ) { this . dialogDelegate . showSaveFailedDialog ( errorBag ) ; } public readonly submit ? : ( ) => void = undefined ; }