# Generated by cstruct-stubgen
from typing import BinaryIO, TypeAlias, overload

import dissect.cstruct as __cs__

class _c_asdf(__cs__.cstruct):
    class FILE_FLAG(__cs__.Flag):
        SHA256 = ...

    class BLOCK_FLAG(__cs__.Flag):
        CRC32 = ...
        COMPRESS = ...

    class header(__cs__.Structure):
        magic: __cs__.CharArray
        flags: _c_asdf.FILE_FLAG
        version: _c_asdf.uint8
        reserved1: __cs__.CharArray
        timestamp: _c_asdf.uint64
        reserved2: __cs__.CharArray
        guid: __cs__.CharArray
        @overload
        def __init__(
            self,
            magic: __cs__.CharArray | None = ...,
            flags: _c_asdf.FILE_FLAG | None = ...,
            version: _c_asdf.uint8 | None = ...,
            reserved1: __cs__.CharArray | None = ...,
            timestamp: _c_asdf.uint64 | None = ...,
            reserved2: __cs__.CharArray | None = ...,
            guid: __cs__.CharArray | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class block(__cs__.Structure):
        magic: __cs__.CharArray
        flags: _c_asdf.BLOCK_FLAG
        idx: _c_asdf.uint8
        reserved: __cs__.CharArray
        offset: _c_asdf.uint64
        size: _c_asdf.uint64
        @overload
        def __init__(
            self,
            magic: __cs__.CharArray | None = ...,
            flags: _c_asdf.BLOCK_FLAG | None = ...,
            idx: _c_asdf.uint8 | None = ...,
            reserved: __cs__.CharArray | None = ...,
            offset: _c_asdf.uint64 | None = ...,
            size: _c_asdf.uint64 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class table_entry(__cs__.Structure):
        flags: _c_asdf.BLOCK_FLAG
        idx: _c_asdf.uint8
        reserved: __cs__.CharArray
        offset: _c_asdf.uint64
        size: _c_asdf.uint64
        file_offset: _c_asdf.uint64
        file_size: _c_asdf.uint64
        @overload
        def __init__(
            self,
            flags: _c_asdf.BLOCK_FLAG | None = ...,
            idx: _c_asdf.uint8 | None = ...,
            reserved: __cs__.CharArray | None = ...,
            offset: _c_asdf.uint64 | None = ...,
            size: _c_asdf.uint64 | None = ...,
            file_offset: _c_asdf.uint64 | None = ...,
            file_size: _c_asdf.uint64 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class footer(__cs__.Structure):
        magic: __cs__.CharArray
        reserved: __cs__.CharArray
        table_offset: _c_asdf.uint64
        sha256: __cs__.CharArray
        @overload
        def __init__(
            self,
            magic: __cs__.CharArray | None = ...,
            reserved: __cs__.CharArray | None = ...,
            table_offset: _c_asdf.uint64 | None = ...,
            sha256: __cs__.CharArray | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

# Technically `c_asdf` is an instance of `_c_asdf`, but then we can't use it in type hints
c_asdf: TypeAlias = _c_asdf
