# This file is auto-generated by the CDP protocol generator.
# Do not edit this file manually as your changes will be overwritten.
# Generated from Chrome DevTools Protocol specifications.

"""CDP IO Domain Commands"""

from typing_extensions import NotRequired, TypedDict

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from ..runtime.types import RemoteObjectId
    from .types import StreamHandle


class CloseParameters(TypedDict):
    handle: "StreamHandle"
    """Handle of the stream to close."""


class ReadParameters(TypedDict):
    handle: "StreamHandle"
    """Handle of the stream to read."""
    offset: "NotRequired[int]"
    """Seek to the specified offset before reading (if not specified, proceed with offset
following the last read). Some types of streams may only support sequential reads."""
    size: "NotRequired[int]"
    """Maximum number of bytes to read (left upon the agent discretion if not specified)."""


class ReadReturns(TypedDict):
    base64Encoded: "bool"
    """Set if the data is base64-encoded"""
    data: "str"
    """Data that were read."""
    eof: "bool"
    """Set if the end-of-file condition occurred while reading."""


class ResolveBlobParameters(TypedDict):
    objectId: "RemoteObjectId"
    """Object id of a Blob object wrapper."""


class ResolveBlobReturns(TypedDict):
    uuid: "str"
    """UUID of the specified Blob."""
