diff --git a/sphinx_js/typedoc.py b/sphinx_js/typedoc.py index e134107f..166c3a98 100644 --- a/sphinx_js/typedoc.py +++ b/sphinx_js/typedoc.py @@ -868,7 +868,7 @@ def inner(param: Param) -> Iterator[str | ir.TypeXRef]: yield from riffle((inner(param) for param in self.parameters), ", ") - yield "): " + yield ") => " return_type = self.return_type(converter) if return_type: ret = return_type[0].type diff --git a/tests/test_typedoc_analysis/test_typedoc_analysis.py b/tests/test_typedoc_analysis/test_typedoc_analysis.py index 8e16a7b6..0b10521c 100644 --- a/tests/test_typedoc_analysis/test_typedoc_analysis.py +++ b/tests/test_typedoc_analysis/test_typedoc_analysis.py @@ -560,9 +560,9 @@ def test_constrained_by_constructor(self): """Make sure ``new ()`` expressions and, more generally, per-property constraints are rendered properly.""" obj = self.analyzer.get_object(["create1"]) - assert join_type(obj.params[0].type) == "{new (x: number): A}" + assert join_type(obj.params[0].type) == "{new (x: number) => A}" obj = self.analyzer.get_object(["create2"]) - assert join_type(obj.params[0].type) == "{new (): T}" + assert join_type(obj.params[0].type) == "{new () => T}" def test_utility_types(self): """Test that a representative one of TS's utility types renders.""" @@ -619,4 +619,4 @@ def test_destructured(self): def test_funcarg(self): obj = self.analyzer.get_object(["funcArg"]) assert obj.params[0].name == "a" - assert join_type(obj.params[0].type) == "(b: number, c: number): number" + assert join_type(obj.params[0].type) == "(b: number, c: number) => number"