import { I18NextLoadResult } from './I18NextLoadResult' ; import * as i18n from 'i18next' ; export interface I18NextErrorHandlingStrategy { handle ( resolve , reject ) : i18n . Callback ; } export class NativeErrorHandlingStrategy implements I18NextErrorHandlingStrategy { handle ( resolve , reject ) { return ( err , t ? ) => { let result = { err : err , t : t } ; resolve ( result ) ; } ; } } export class StrictErrorHandlingStrategy implements I18NextErrorHandlingStrategy { handle ( resolve , reject ) { return ( err , t ? ) => { let result = { err : err , t : t } ; if ( ! err ) { resolve ( result ) ; return ; } reject ( err ) ; } ; } }