from typing import TypedDict

class DataCodeResult(TypedDict):
    digest: bytes

class InstanceCodeResult(TypedDict):
    digest: bytes
    multihash: str
    filesize: int

class IsccSumResult:
    iscc: str
    datahash: str
    filesize: int
    units: list[str] | None

    def __new__(
        cls, iscc: str, datahash: str, filesize: int, units: list[str] | None = None
    ) -> IsccSumResult: ...
    def __getitem__(self, key: str) -> str | int | list[str] | None: ...
    def __contains__(self, key: str) -> bool: ...
    def __len__(self) -> int: ...
    def __repr__(self) -> str: ...

class DataCodeProcessor:
    def __new__(cls) -> DataCodeProcessor: ...
    def update(self, data: bytes) -> None: ...
    def result(self) -> DataCodeResult: ...

class InstanceCodeProcessor:
    def __new__(cls) -> InstanceCodeProcessor: ...
    def update(self, data: bytes) -> None: ...
    def result(self) -> InstanceCodeResult: ...

class IsccSumProcessor:
    def __new__(cls) -> IsccSumProcessor: ...
    def update(self, data: bytes) -> None: ...
    def result(self, wide: bool = False, add_units: bool = False) -> IsccSumResult: ...

def code_iscc_sum(path: str, wide: bool = False, add_units: bool = False) -> IsccSumResult: ...
