Settings: Support "DocumentFragment" as setting "name" in the declarative API

The imperative setting API supports DocumentFragment in Setting.setName():

class Setting {
/**
     * @public
     * @since 0.9.7
     */
    setName(name: string): this;
    /**
     * @public
     * @since 0.12.16
     */
    setName(name: string | DocumentFragment): this;
}

However, the declarative API SettingDefinitionItem doesn’t:

interface SettingDefinitionBase {
    /**
     * Display name — used for rendering and search.
     * @public
     * @since 1.13.0
     */
    name: string;
}

This is a hard incompatibility between the old and new API. It would be nice to reintroduce the API of using a DocumentFragment as the a setting name, and DocumentFragment.textContent for setting search indexing, just like desc.

1 Like