class_docstr: Directive to mark description of a new JavaScript module.
  
  This directive specifies the module name that will be used by objects that
  follow this directive.
  
  Options
  -------
  
  no-index
      If the ``:no-index:`` option is specified, no linkable elements will be
      created, and the module won't be added to the global module index. This
      is useful for splitting up the module definition across multiple
      sections or files.
  
  :param mod_name: Module name
class_docstr_tok: ["Directive","to","mark","description","of","a","new","JavaScript","module",".","This","directive","specifies","the","module","name","that","will","be","used","by","objects","that","follow","this","directive",".","Options","--","--","--","-","no-index","If","the","``",":","no-index",":","``","option","is","specified",",","no","linkable","elements","will","be","created",",","and","the","module","wo","n't","be","added","to","the","global","module","index",".","This","is","useful","for","splitting","up","the","module","definition","across","multiple","sections","or","files",".",":","param","mod_name",":","Module","name"]
code: def run(self) -> list[Node]:
      mod_name = self.arguments[0].strip()
      self.env.ref_context["js:module"] = mod_name
      no_index = "no-index" in self.options or "noindex" in self.options
  
      content_node: Element = nodes.section()
      # necessary so that the child nodes get the right source/line set
      content_node.document = self.state.document
      nested_parse_with_titles(
          self.state, self.content, content_node, self.content_offset
      )
  
      ret: list[Node] = []
      if not no_index:
          domain = cast(JavaScriptDomain, self.env.get_domain("js"))
  
          node_id = make_id(
              self.env, self.state.document, "module", mod_name
          )
          domain.note_module(mod_name, node_id)
          # Make a duplicate entry in 'objects' to facilitate searching for
          # the module in JavaScriptDomain.find_obj()
          domain.note_object(
              mod_name,
              "module",
              node_id,
              location=(self.env.docname, self.lineno),
          )
  
          # The node order is: index node first, then target node
          indextext = _("%s (module)") % mod_name
          inode = addnodes.index(
              entries=[("single", indextext, node_id, "", None)]
          )
          ret.append(inode)
          target = nodes.target("", "", ids=[node_id], ismod=True)
          self.state.document.note_explicit_target(target)
          ret.append(target)
      ret.extend(content_node.children)
      return ret
  
imports: from __future__ import annotations
  import contextlib
  from typing import TYPE_CHECKING, Any, cast
  from docutils import nodes
  from docutils.parsers.rst import directives
  from sphinx import addnodes
  from sphinx.directives import ObjectDescription
  from sphinx.domains import Domain, ObjType
  from sphinx.domains.python import _pseudo_parse_arglist
  from sphinx.locale import _, __
  from sphinx.roles import XRefRole
  from sphinx.util import logging
  from sphinx.util.docfields import Field, GroupedField, TypedField
  from sphinx.util.docutils import SphinxDirective
  from sphinx.util.nodes import make_id, make_refnode, nested_parse_with_titles
label_desc: Use image node_id 1 for calling the JSModule obj's underlying member method code with example usage: obj.run() and returns: ret