diff options
Diffstat (limited to 'src/hydrilla/proxy/state.py')
-rw-r--r-- | src/hydrilla/proxy/state.py | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/src/hydrilla/proxy/state.py b/src/hydrilla/proxy/state.py index 803e727..e8d8b15 100644 --- a/src/hydrilla/proxy/state.py +++ b/src/hydrilla/proxy/state.py @@ -227,10 +227,8 @@ class MappingStore(Store[MappingRef]): def get_display_infos(self) -> t.Sequence[MappingDisplayInfo]: ... - @dc.dataclass(frozen=True, unsafe_hash=True) # type: ignore[misc] class MappingVersionRef(Ref): - """....""" @abstractmethod def install(self) -> None: ... @@ -248,15 +246,49 @@ class MappingVersionStore(Store[MappingVersionRef]): pass +@dc.dataclass(frozen=True) +class ResourceDisplayInfo: + ref: 'ResourceRef' + identifier: str + +@dc.dataclass(frozen=True) +class ResourceVersionDisplayInfo: + ref: 'ResourceVersionRef' + info: item_infos.ResourceInfo + installed: InstalledStatus + active: ActiveStatus + is_orphan: bool + is_local: bool + @dc.dataclass(frozen=True, unsafe_hash=True) # type: ignore[misc] class ResourceRef(Ref): - """....""" - pass + @abstractmethod + def get_version_display_infos(self) \ + -> t.Sequence[ResourceVersionDisplayInfo]: + ... + +class ResourceStore(Store[ResourceRef]): + @abstractmethod + def get_display_infos(self) -> t.Sequence[ResourceDisplayInfo]: + ... @dc.dataclass(frozen=True, unsafe_hash=True) # type: ignore[misc] class ResourceVersionRef(Ref): - """....""" + @abstractmethod + def install(self) -> None: + ... + + @abstractmethod + def uninstall(self) -> t.Optional['ResourceVersionRef']: + ... + + @abstractmethod + def get_all_version_display_infos(self) \ + -> t.Sequence[ResourceVersionDisplayInfo]: + ... + +class ResourceVersionStore(Store[ResourceVersionRef]): pass @@ -360,23 +392,18 @@ class HaketiloState(ABC): @abstractmethod def mapping_store(self) -> MappingStore: - """....""" ... @abstractmethod def mapping_version_store(self) -> MappingVersionStore: - """....""" ... @abstractmethod - def get_resource(self, resource_id: str) -> ResourceRef: - """....""" + def resource_store(self) -> ResourceStore: ... @abstractmethod - def get_resource_version(self, resource_version_id: str) \ - -> ResourceVersionRef: - """....""" + def resource_version_store(self) -> ResourceVersionStore: ... @abstractmethod |