mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 14:24:56 -04:00
Add type hints to some handlers (#8505)
This commit is contained in:
parent
a97cec18bb
commit
a93f3121f8
10 changed files with 60 additions and 22 deletions
|
@ -12,16 +12,24 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from typing import TYPE_CHECKING, List, Tuple
|
||||
|
||||
from synapse.types import JsonDict, UserID
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from synapse.app.homeserver import HomeServer
|
||||
|
||||
|
||||
class AccountDataEventSource:
|
||||
def __init__(self, hs):
|
||||
def __init__(self, hs: "HomeServer"):
|
||||
self.store = hs.get_datastore()
|
||||
|
||||
def get_current_key(self, direction="f"):
|
||||
def get_current_key(self, direction: str = "f") -> int:
|
||||
return self.store.get_max_account_data_stream_id()
|
||||
|
||||
async def get_new_events(self, user, from_key, **kwargs):
|
||||
async def get_new_events(
|
||||
self, user: UserID, from_key: int, **kwargs
|
||||
) -> Tuple[List[JsonDict], int]:
|
||||
user_id = user.to_string()
|
||||
last_stream_id = from_key
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue