summaryrefslogtreecommitdiff
path: root/sphinx/domains/javascript.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/domains/javascript.py')
-rw-r--r--sphinx/domains/javascript.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/sphinx/domains/javascript.py b/sphinx/domains/javascript.py
index f612fb914..92d0e1d61 100644
--- a/sphinx/domains/javascript.py
+++ b/sphinx/domains/javascript.py
@@ -28,6 +28,7 @@ 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
+from sphinx.util.typing import OptionSpec
logger = logging.getLogger(__name__)
@@ -41,13 +42,13 @@ class JSObject(ObjectDescription[Tuple[str, str]]):
has_arguments = False
#: what is displayed right before the documentation entry
- display_prefix = None # type: str
+ display_prefix: str = None
#: If ``allow_nesting`` is ``True``, the object prefixes will be accumulated
#: based on directive nesting
allow_nesting = False
- option_spec = {
+ option_spec: OptionSpec = {
'noindex': directives.flag,
'noindexentry': directives.flag,
}
@@ -253,7 +254,7 @@ class JSModule(SphinxDirective):
required_arguments = 1
optional_arguments = 0
final_argument_whitespace = False
- option_spec = {
+ option_spec: OptionSpec = {
'noindex': directives.flag
}
@@ -261,7 +262,7 @@ class JSModule(SphinxDirective):
mod_name = self.arguments[0].strip()
self.env.ref_context['js:module'] = mod_name
noindex = 'noindex' in self.options
- ret = [] # type: List[Node]
+ ret: List[Node] = []
if not noindex:
domain = cast(JavaScriptDomain, self.env.get_domain('js'))
@@ -345,10 +346,10 @@ class JavaScriptDomain(Domain):
'attr': JSXRefRole(),
'mod': JSXRefRole(),
}
- initial_data = {
+ initial_data: Dict[str, Dict[str, Tuple[str, str]]] = {
'objects': {}, # fullname -> docname, node_id, objtype
'modules': {}, # modname -> docname, node_id
- } # type: Dict[str, Dict[str, Tuple[str, str]]]
+ }
@property
def objects(self) -> Dict[str, Tuple[str, str, str]]: