import { upperCaseFirst } from './helper' ; export default class Constants { static readonly ALL_WORDS_WORDLIST_ID = 0 ; static readonly DOMAIN_MODES = { NORMAL : 0 , ADVANCED : 1 , DEEP : 2 } ; static readonly FALSE = 0 ; static readonly FILTER_METHODS = { CENSOR : 0 , SUBSTITUTE : 1 , REMOVE : 2 , OFF : 3 } ; static readonly MATCH_METHODS = { EXACT : 0 , PARTIAL : 1 , WHOLE : 2 , REGEX : 3 } ; static readonly MUTE_METHODS = { TAB : 0 , VIDEO_VOLUME : 1 , VIDEO_MUTE : 2 , NONE : 9 } ; static readonly SHOW_SUBTITLES = { ALL : 0 , FILTERED : 1 , UNFILTERED : 2 , NONE : 3 } ; static readonly STATS_TYPE_AUDIO = 'audio' ; static readonly STATS_TYPE_TEXT = 'text' ; static readonly TRUE = 1 ; static filterMethodName ( id ) { return this . nameById ( this . FILTER_METHODS , id ) ; } static matchMethodName ( id ) { return this . nameById ( this . MATCH_METHODS , id ) ; } static nameById ( obj , id ) { return upperCaseFirst ( Object . entries ( obj ) . filter ( ( arr ) => arr [ 1 ] === id ) [ 0 ] [ 0 ] ) ; } static orderedArray ( obj ) { const result = [ ] ; Object . values ( obj ) . sort ( ) . forEach ( ( id ) => { result . push ( Constants . nameById ( obj , id ) ) ; } ) ; return result ; } }