summaryrefslogtreecommitdiff
path: root/sphinx/util/typing.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/util/typing.py')
-rw-r--r--sphinx/util/typing.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py
index a26dac473..ecfd61f01 100644
--- a/sphinx/util/typing.py
+++ b/sphinx/util/typing.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""
sphinx.util.typing
~~~~~~~~~~~~~~~~~~
@@ -9,19 +8,24 @@
:license: BSD, see LICENSE for details.
"""
-from typing import Callable, Dict, List, Tuple
+from typing import Any, Callable, Dict, List, Tuple, Union
from docutils import nodes
from docutils.parsers.rst.states import Inliner
-from six import PY3
-if PY3:
- unicode = str
+# An entry of Directive.option_spec
+DirectiveOption = Callable[[str], Any]
+
+# Text like nodes which are initialized with text and rawsource
+TextlikeNode = Union[nodes.Text, nodes.TextElement]
# common role functions
-RoleFunction = Callable[[unicode, unicode, unicode, int, Inliner, Dict, List[unicode]],
- Tuple[List[nodes.Node], List[nodes.Node]]]
+RoleFunction = Callable[[str, str, str, int, Inliner, Dict, List[str]],
+ Tuple[List[nodes.Node], List[nodes.system_message]]]
# title getter functions for enumerable nodes (see sphinx.domains.std)
-TitleGetter = Callable[[nodes.Node], unicode]
+TitleGetter = Callable[[nodes.Node], str]
+
+# inventory data on memory
+Inventory = Dict[str, Dict[str, Tuple[str, str, str, str]]]