You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

38 lines
1.0 KiB

  1. from typing import Any, Collection, Dict, Mapping, Sequence, Tuple, Union
  2. from synapse.types import JsonDict
  3. class PushRule:
  4. @property
  5. def rule_id(self) -> str: ...
  6. @property
  7. def priority_class(self) -> int: ...
  8. @property
  9. def conditions(self) -> Sequence[Mapping[str, str]]: ...
  10. @property
  11. def actions(self) -> Sequence[Union[Mapping[str, Any], str]]: ...
  12. @property
  13. def default(self) -> bool: ...
  14. @property
  15. def default_enabled(self) -> bool: ...
  16. @staticmethod
  17. def from_db(
  18. rule_id: str, priority_class: int, conditions: str, actions: str
  19. ) -> "PushRule": ...
  20. class PushRules:
  21. def __init__(self, rules: Collection[PushRule]): ...
  22. def rules(self) -> Collection[PushRule]: ...
  23. class FilteredPushRules:
  24. def __init__(
  25. self,
  26. push_rules: PushRules,
  27. enabled_map: Dict[str, bool],
  28. msc3786_enabled: bool,
  29. msc3772_enabled: bool,
  30. ): ...
  31. def rules(self) -> Collection[Tuple[PushRule, bool]]: ...
  32. def get_base_rule_ids() -> Collection[str]: ...