getLifeCycleFn = (fnName) => () => {
            for (const parser of this.parsers.values()) {
                if (!parser[fnName]) continue
                parser.instanceMap.forEach((instance, cid) => {
                    const preview = this.utils.entities.querySelectorInWrite(`.md-fences[cid=${cid}] .md-diagram-panel-preview`)
                    if (preview) {
                        parser[fnName](preview, instance)
                    }
                })
            }
        }
Since JS doesn't support interfaces, interface functions are passed as parameters.
@param {string} lang: Language.
@param {string} mappingLang: Language to map to.
@param {boolean} destroyWhenUpdate: Whether to clear the HTML in the preview before updating.
@param {boolean} interactiveMode: When in interactive mode, code blocks will not automatically expand.
@param {string} checkSelector: Selector to check if the target Element exists under the current fence.
@param {string|function($pre):string} wrapElement: If the target Element does not exist, create it.
@param {function(): Promise<null>} lazyLoadFunc: Lazy load third-party resources.
@param {function(cid, content, $pre): Promise} setStyleFunc: Set styles.
@param {function(cid, content, $pre): Promise} beforeRenderFunc: Execute before rendering.
@param {function($wrap, string, meta): instance} createFunc: Create a diagram instance, passing in the target Element and the content of the fence.
@param {function($wrap, string, instance, meta): instance} updateFunc: Update the diagram instance when the content is updated.
@param {function(Object): null} destroyFunc: Destroy the diagram instance, passing in the diagram instance.
@param {function(Element, instance): null} beforeExportToNative: Preparation operations before Pandoc export (e.g., adjusting diagram size, color, etc.).
@param {function(Element, instance): null} beforeExportToHTML: Preparation operations before HTML export (e.g., adjusting diagram size, color, etc.).
@param {function(): string} extraStyleGetter: Get extra CSS for export.
@param {function(): string} versionGetter: Get the version.