MCPcopy Index your code
hub / github.com/tinymce/tinymce / getParam

Method getParam

modules/tinymce/src/core/main/ts/api/Editor.ts:451–465  ·  view source on GitHub ↗
(name: string, defaultVal?: any, type?: BuiltInOptionType)

Source from the content-addressed store, hash-verified

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.

Callers 2

EditorTest.tsFile · 0.80
getFunction · 0.80

Calls 1

getMethod · 0.65

Tested by

no test coverage detected