Source: widget/help/project/_Special.js

(function() {
    /**
     * this backend connector is a base class to handle special content catalogues
     * @abstract
     */
    Help4.widget.help.project._Special = class {
        static NAME = '_Special';

        /**
         * delivers a dummy project; real data is added in {@link Help4.widget.help.Data.prototype.getHelpTiles}
         * @param {string} projectId - project ID
         * @param {Help4.typedef.SystemConfiguration} config - the system configuration
         * @param {Help4.widget.help.Data} data
         * @returns {Help4.widget.help.Projects}
         */
        static load(projectId, {core: {screenId, language, product, system, version}}, data) {
            const {published} = Help4.widget.help.PUBLISHED_STATUS;
            const {[this.NAME]: catalogue} = Help4.widget.help.catalogues;
            const {ID, CATALOGUE_TYPE} = catalogue;

            const project = /** @type {Help4.widget.help.Project} */ {
                alias: ID,
                conditions: [],
                contextType: 'HELP',
                hidden: false,
                id: ID,
                language: language.wpb,
                loio: ID,
                playbackTag: null,
                product,
                published,
                screen: screenId,
                system,
                special: true,  // differentiate special projects from regular ones
                tiles: [],  // no need to put tiles here, project is not requested again. see: widget/help/data.js -> getHelpTiles
                title: ID,
                version,
                _catalogueType: CATALOGUE_TYPE,
                _dataType: catalogue.getDataType()
            };

            const head = Help4.cloneObject(project);
            return {pub: project, head};
        }

        /** @returns {number} */
        static getUpdateTS() {
            return this.lastUpdate;
        }

        /**
         * @protected
         * @returns {Promise<void>}
         */
        static async _refreshWidget() {
            const widget = /** @type {?Help4.widget.help.Widget} */ Help4.widget.getInstance('help');
            await widget?.redraw();
        }
    }
})();