Coverage for src/pdfbaker/types.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-04-20 04:55 +1200

1"""Type definitions for pdfbaker.""" 

2 

3from typing import NotRequired, TypedDict 

4 

5__all__ = [ 

6 "ImageSpec", 

7 "PathSpec", 

8 "StyleDict", 

9] 

10 

11 

12class _ImageDict(TypedDict): 

13 """Image specification.""" 

14 

15 name: str 

16 type: NotRequired[str] 

17 data: NotRequired[str] 

18 

19 

20ImageSpec = str | _ImageDict 

21 

22 

23class StyleDict(TypedDict): 

24 """Style configuration.""" 

25 

26 highlight_color: NotRequired[str] 

27 

28 

29class _PathSpecDict(TypedDict): 

30 """File/Directory location in YAML config.""" 

31 

32 path: NotRequired[str] 

33 name: NotRequired[str] 

34 

35 

36PathSpec = str | _PathSpecDict