Coverage for src \ syriantaxes \ types.py: 100%
21 statements
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-12 14:00 +0200
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-12 14:00 +0200
1from collections.abc import Iterable
2from decimal import Decimal
3from typing import ClassVar, Literal, Protocol, TypeAlias, TypedDict
5Method: TypeAlias = Literal["floor", "ceil"]
6Number: TypeAlias = int | float | Decimal | str
9class Rounder(Protocol):
10 def round(self, number: Number) -> Decimal: ...
13class SocialSecurity(Protocol):
14 def calculate_deduction(self, salary: Number) -> Decimal: ...
17class BracketWithProps(Protocol):
18 @property
19 def min(self) -> Number: ...
21 @property
22 def max(self) -> Number: ...
24 @property
25 def rate(self) -> Number: ...
28class BracketWithVars(Protocol):
29 min: Number
30 max: Number
31 rate: Number
34class BracketWithClassVars(Protocol):
35 min: ClassVar[Number]
36 max: ClassVar[Number]
37 rate: ClassVar[Number]
40class BracketDict(TypedDict):
41 min: Number
42 max: Number
43 rate: Number
46Brackets: TypeAlias = (
47 Iterable[BracketWithProps]
48 | Iterable[BracketWithVars]
49 | Iterable[BracketWithClassVars]
50 | Iterable[BracketDict]
51)