"""
This type stub file was generated by pyright.
"""

import nukescripts
from threading import Thread

class DialogState:
    def __init__(self) -> None: ...
    def get(self, knob, defaultValue=...):
        """Return the given knob's stored last state value.
        If none exists, defaultValue is returned.
        Values are stored in a dict referenced by knob name, so names must be unique!"""
        ...
    def save(self, knob):
        """Store the knob's current value as the 'last state' for the next time the dialog is opened.
        Values are stored in a dict referenced by knob name, so names must be unique!"""
        ...
    def setKnob(self, knob, defaultValue=...):
        """Convenience method for setting a value straight on a knob."""
        ...
    def saveValue(self, id, value):
        """Stores the value with the given id."""
        ...
    def getValue(self, id, defaultValue=...):
        """Recalls the value. If it was not set before, it will return the defaultValue."""
        ...

_gRenderDialogState = DialogState()
_gFlipbookDialogState = DialogState()
_gViewerCaptureDialogState = DialogState()

class ExecuteDialog(nukescripts.PythonPanel):
    def addKnob(self, knob):
        """Add the knob and make sure it cannot be animated."""
        ...
    def __init__(
        self, dialogState, groupContext, nodeSelection=..., exceptOnError=...
    ) -> None: ...
    def knobChanged(self, knob): ...
    def addToPane(self): ...
    def run(self): ...

class RenderDialog(ExecuteDialog):
    def __init__(
        self, dialogState, groupContext, nodeSelection=..., exceptOnError=...
    ) -> None: ...
    def knobChanged(self, knob): ...
    def isBackgrounded(self):
        """Return whether the background rendering option is enabled."""
        ...
    def isTimelineWrite(self): ...
    def run(self): ...

class FlipbookDialog(RenderDialog):
    def __init__(self, dialogState, groupContext, node, takeNodeSettings) -> None: ...
    def flipbookKnobs(self): ...
    def knobChanged(self, knob): ...
    def run(self): ...

class ViewerCaptureDialog(FlipbookDialog):
    def __init__(self, dialogState, groupContext, node) -> None: ...
    def knobChanged(self, knob): ...
    def captureViewer(self):
        """Return an instance of a CaptureViewer class, which when executed captures the viewer."""
        ...

def showExecuteDialog(nodesToExecute, exceptOnError=...):
    """Present a dialog that executes the given list of nodes."""
    ...

def showRenderDialog(nodesToRender, exceptOnError=...):
    """Present a dialog that renders the given list of nodes."""
    ...

def showFlipbookDialog(node, takeNodeSettings=...):
    """Present a dialog that flipbooks the given node."""
    ...

class ViewerCaptureDialogThread(Thread):
    def __init__(self, captureViewer) -> None: ...
    def run(self): ...

def showViewerCaptureDialog(node): ...
def showFlipbookDialogForSelected():
    """Present a dialog that flipbooks the currently selected node."""
    ...

def bboxToTopLeft(height, roi):
    """Convert the roi passed from a origin at the bottom left to the top left.
    Also replaces the r and t keys with w and h keys.
    @param height: the height used to determine the top.
    @param roi: the roi with a bottom left origin, must have x, y, r & t keys.
    @result dict with x, y, w & h keys"""
    ...

def setRenderDialogDefaultOption(name, value):
    """Set a particular option to the given value. The type of the value differs per option, giving the wrong value may result in exceptions. The options are read every time the dialog is opened, though not every knob in the dialog has it's value stored."""
    ...

def setFlipbookDefaultOption(name, value):
    """Set a particular option to the given value. The type of the value differs per option, giving the wrong value may result in exceptions. The options are read every time the dialog is opened, though not every knob in the dialog has it's value stored."""
    ...
