Coverage for src/jsoncrack_for_sphinx/config/config_classes.py: 100%
14 statements
« prev ^ index » next coverage.py v7.10.0, created at 2025-07-24 22:26 +0000
« prev ^ index » next coverage.py v7.10.0, created at 2025-07-24 22:26 +0000
1"""
2Configuration classes for JSONCrack components.
3"""
5from typing import Union
7from ..utils.types import Directions, RenderMode
10class ContainerConfig:
11 """Container configuration."""
13 def __init__(
14 self,
15 direction: Directions = Directions.RIGHT,
16 height: Union[int, str] = "500",
17 width: Union[int, str] = "100%",
18 ):
19 """
20 Args:
21 direction: Visualization direction
22 height: Container height in pixels or string
23 width: Container width in pixels, percentage, or string
24 """
25 self.direction = direction
26 self.height = str(height)
27 self.width = str(width)
29 def __repr__(self) -> str:
30 return (
31 f"ContainerConfig(direction={self.direction}, "
32 f"height='{self.height}', width='{self.width}')"
33 )
36class RenderConfig:
37 """Render configuration."""
39 def __init__(
40 self, mode: Union[RenderMode.OnClick, RenderMode.OnLoad, RenderMode.OnScreen]
41 ):
42 """
43 Args:
44 mode: Render mode instance
45 """
46 self.mode = mode
48 def __repr__(self) -> str:
49 return f"RenderConfig(mode={self.mode})"