import { DeepPartial } from '@ulangi/extended-types' ; import { Definition , ErrorBag } from '@ulangi/ulangi-common/interfaces' ; import { EventBus } from '@ulangi/ulangi-event' ; import { ObservableVocabulary } from '@ulangi/ulangi-observable' ; import { boundClass } from 'autobind-decorator' ; import { DialogDelegate } from '../dialog/DialogDelegate' ; import { NavigatorDelegate } from '../navigator/NavigatorDelegate' ; import { VocabularyFormDelegate } from './VocabularyFormDelegate' ; @ boundClass export abstract class AddEditVocabularyScreenDelegate { protected eventBus : EventBus ; protected vocabularyFormDelegate : VocabularyFormDelegate ; protected dialogDelegate : DialogDelegate ; protected navigatorDelegate : NavigatorDelegate ; public constructor ( eventBus , vocabularyFormDelegate , dialogDelegate , navigatorDelegate ) { this . eventBus = eventBus ; this . vocabularyFormDelegate = vocabularyFormDelegate ; this . dialogDelegate = dialogDelegate ; this . navigatorDelegate = navigatorDelegate ; } public abstract createPreview ( ) ; public addDefinitionSlot ( ) { this . vocabularyFormDelegate . addDefinitionSlot ( ) ; } public addDefinition ( definition ) { this . vocabularyFormDelegate . addDefinition ( definition ) ; } public deleteDefinition ( index ) { this . vocabularyFormDelegate . showConfirmDeleteDefinition ( index ) ; } public lookUp ( ) { this . vocabularyFormDelegate . lookUp ( ) ; } public showSuggestions ( ) { this . vocabularyFormDelegate . showSuggestions ( ) ; } public showVocabularyExtraFieldsPicker ( ) { this . vocabularyFormDelegate . showVocabularyExtraFieldsPicker ( ) ; } public showDefinitionExtraFieldsPicker ( index ) { this . vocabularyFormDelegate . showDefinitionExtraFieldsPicker ( index ) ; } public editCategory ( ) { this . vocabularyFormDelegate . editCategory ( ) ; } protected showSavingDialog ( ) { this . dialogDelegate . showSavingDialog ( ) ; } protected showSaveSucceededDialog ( ) { this . dialogDelegate . showSaveSucceededDialog ( ) ; } protected showSaveFailedDialog ( errorBag ) { this . dialogDelegate . showSaveFailedDialog ( errorBag ) ; } }