summary refs log tree commit diff
path: root/synapse/rest/client/sync.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-09-01 11:59:32 -0400
committerGitHub <noreply@github.com>2021-09-01 11:59:32 -0400
commitd1f1b46c2cfe612790aebdd54765953951c94e45 (patch)
tree19b13d2d8b152ab7d3d05739c3124f2522aa85e1 /synapse/rest/client/sync.py
parentPopulate `rooms.creator` field for easy lookup (#10697) (diff)
downloadsynapse-d1f1b46c2cfe612790aebdd54765953951c94e45.tar.xz
Additional type hints for client REST servlets (part 4) (#10728)
Diffstat (limited to '')
-rw-r--r--synapse/rest/client/sync.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/synapse/rest/client/sync.py b/synapse/rest/client/sync.py
index 65c37be3e9..1259058b9b 100644
--- a/synapse/rest/client/sync.py
+++ b/synapse/rest/client/sync.py
@@ -14,12 +14,24 @@
 import itertools
 import logging
 from collections import defaultdict
-from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union
+from typing import (
+    TYPE_CHECKING,
+    Any,
+    Awaitable,
+    Callable,
+    Dict,
+    Iterable,
+    List,
+    Optional,
+    Tuple,
+    Union,
+)
 
 from synapse.api.constants import Membership, PresenceState
 from synapse.api.errors import Codes, StoreError, SynapseError
 from synapse.api.filtering import DEFAULT_FILTER_COLLECTION, FilterCollection
 from synapse.api.presence import UserPresenceState
+from synapse.events import EventBase
 from synapse.events.utils import (
     format_event_for_client_v2_without_room_id,
     format_event_raw,
@@ -504,7 +516,7 @@ class SyncRestServlet(RestServlet):
             The room, encoded in our response format
         """
 
-        def serialize(events):
+        def serialize(events: Iterable[EventBase]) -> Awaitable[List[JsonDict]]:
             return self._event_serializer.serialize_events(
                 events,
                 time_now=time_now,