(name: string, defaultVal?: any, type?: BuiltInOptionType)
| 449 | public getParam <K extends keyof NormalizedEditorOptions>(name: K, defaultVal?: NormalizedEditorOptions[K], type?: BuiltInOptionType): NormalizedEditorOptions[K]; |
| 450 | public getParam <T>(name: string, defaultVal: T, type?: BuiltInOptionType): T; |
| 451 | public getParam(name: string, defaultVal?: any, type?: BuiltInOptionType): any { |
| 452 | const options = this.options; |
| 453 | |
| 454 | // To keep the legacy API we need to register the option if it's not already been registered |
| 455 | if (!options.isRegistered(name)) { |
| 456 | if (Type.isNonNullable(type)) { |
| 457 | options.register(name, { processor: type, default: defaultVal }); |
| 458 | } else { |
| 459 | options.register(name, { processor: Fun.always, default: defaultVal }); |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | // Attempt to use the passed default value if nothing has been set already |
| 464 | return !options.isSet(name) && !Type.isUndefined(defaultVal) ? defaultVal : options.get(name); |
| 465 | } |
| 466 | |
| 467 | /** |
| 468 | * Checks that the plugin is in the editor configuration and can optionally check if the plugin has been loaded. |
no test coverage detected