File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import * as types from './types/index.js';
1111import { translateText } from '../translate.js' ;
1212import RegisteredSetting from './RegisteredSetting.js' ;
1313import styles from './settings.css' ;
14+ import { registry } from './settingRegistry.js' ;
1415
1516const defaultSetting = new RegisteredSetting ( ) ;
1617
@@ -22,10 +23,6 @@ style.add(styles.split('\n\n'));
2223const settingReg = {
2324 // key: setting
2425} ;
25- /**
26- * @type {Map<string, SettingType> }
27- */
28- const registry = new Map ( ) ;
2926const events = eventEmitter ( ) ;
3027const configs = new Map ( ) ;
3128let dialog = null ;
Original file line number Diff line number Diff line change 1+ import SettingType from './types/setting.js' ;
2+
3+ /**
4+ * @type {Map<string, SettingType> }
5+ */
6+ export const registry = new Map ( ) ;
7+
8+ export function getSettingType ( type ) {
9+ if ( isSettingType ( type ) ) return type ;
10+ return registry . get ( type ) ;
11+ }
12+
13+ export function isSettingType ( type ) {
14+ return type instanceof SettingType ;
15+ }
16+
17+ export default registry ;
You can’t perform that action at this time.
0 commit comments