# Auto-generated by `python -m gen` — do not edit manually.

from typing import TYPE_CHECKING

import bpy

from ...builder import BaseNode, SocketAccessor

from ...types import (
    InputColor,
)

from ...builder.socket import (
    ColorSocket,
)


class FileOutput(BaseNode):
    """
    Write image file to disk
    """

    _bl_idname = "CompositorNodeOutputFile"
    node: bpy.types.CompositorNodeOutputFile

    class _Inputs(SocketAccessor):
        pass

    class _Outputs(SocketAccessor):
        pass

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        directory: str = "",
        file_name: str = "",
        save_as_render: bool = False,
        use_file_extension: bool = False,
    ):
        super().__init__()
        key_args = {}
        self.directory = directory
        self.file_name = file_name
        self.save_as_render = save_as_render
        self.use_file_extension = use_file_extension
        self._establish_links(**key_args)

    @property
    def directory(self) -> str:
        return self.node.directory

    @directory.setter
    def directory(self, value: str):
        self.node.directory = value

    @property
    def file_name(self) -> str:
        return self.node.file_name

    @file_name.setter
    def file_name(self, value: str):
        self.node.file_name = value

    @property
    def save_as_render(self) -> bool:
        return self.node.save_as_render

    @save_as_render.setter
    def save_as_render(self, value: bool):
        self.node.save_as_render = value

    @property
    def use_file_extension(self) -> bool:
        return self.node.use_file_extension

    @use_file_extension.setter
    def use_file_extension(self, value: bool):
        self.node.use_file_extension = value


class Viewer(BaseNode):
    """
    Visualize data from inside a node graph, in the image editor or as a backdrop

    Parameters
    ----------
    image : InputColor
        Image

    Inputs
    ------
    i.image : ColorSocket
        Image
    """

    _bl_idname = "CompositorNodeViewer"
    node: bpy.types.CompositorNodeViewer

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""

    class _Outputs(SocketAccessor):
        pass

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        image: InputColor = None,
        *,
        ui_shortcut: int = 0,
    ):
        super().__init__()
        key_args = {"Image": image}
        self.ui_shortcut = ui_shortcut
        self._establish_links(**key_args)

    @property
    def ui_shortcut(self) -> int:
        return self.node.ui_shortcut

    @ui_shortcut.setter
    def ui_shortcut(self, value: int):
        self.node.ui_shortcut = value
