from __future__ import annotations

from .autocomplete import (
    AutocompleteItem,
    AutocompleteProvider,
    CombinedAutocompleteProvider,
    SlashCommand,
)
from .components import (
    Box,
    CancellableLoader,
    Editor,
    EditorOptions,
    EditorTheme,
    Image,
    ImageOptions,
    ImageTheme,
    Input,
    Loader,
    Markdown,
    SelectItem,
    SelectList,
    SelectListLayoutOptions,
    SelectListTheme,
    SelectListTruncatePrimaryContext,
    SettingItem,
    SettingsList,
    SettingsListTheme,
    Spacer,
    Text,
    TruncatedText,
)
from .editor_component import EditorComponent
from .fuzzy import FuzzyMatch, fuzzy_filter, fuzzy_match
from .keybindings import (
    DEFAULT_EDITOR_KEYBINDINGS,
    EditorAction,
    EditorKeybindingsManager,
    get_editor_keybindings,
    set_editor_keybindings,
)
from .keys import (
    Key,
    decode_kitty_printable,
    is_key_release,
    is_key_repeat,
    is_kitty_protocol_active,
    matches_key,
    parse_key,
    set_kitty_protocol_active,
)
from .kill_ring import KillRing
from .stdin_buffer import StdinBuffer
from .terminal import ProcessTerminal, Terminal
from .terminal_image import (
    CellDimensions,
    ImageDimensions,
    ImageRenderOptions,
    TerminalCapabilities,
    allocate_image_id,
    calculate_image_rows,
    delete_all_kitty_images,
    delete_kitty_image,
    detect_capabilities,
    encode_iterm2,
    encode_kitty,
    get_capabilities,
    get_cell_dimensions,
    get_gif_dimensions,
    get_image_dimensions,
    get_jpeg_dimensions,
    get_png_dimensions,
    get_webp_dimensions,
    image_fallback,
    is_image_line,
    render_image,
    reset_capabilities_cache,
    set_cell_dimensions,
)
from .tui import (
    CURSOR_MARKER,
    TUI,
    Component,
    Container,
    Focusable,
    OverlayAnchor,
    OverlayHandle,
    OverlayMargin,
    OverlayOptions,
    SizeValue,
    is_focusable,
)
from .undo_stack import UndoStack
from .utils import (
    apply_background_to_line,
    extract_ansi_code,
    extract_segments,
    get_segmenter,
    is_punctuation_char,
    is_whitespace_char,
    slice_by_column,
    slice_with_width,
    truncate_to_width,
    visible_width,
    wrap_text_with_ansi,
)

__all__ = [
    "AutocompleteItem",
    "AutocompleteProvider",
    "Box",
    "CancellableLoader",
    "CellDimensions",
    "CombinedAutocompleteProvider",
    "Component",
    "Container",
    "CURSOR_MARKER",
    "DEFAULT_EDITOR_KEYBINDINGS",
    "Editor",
    "EditorAction",
    "EditorComponent",
    "EditorOptions",
    "EditorTheme",
    "EditorKeybindingsManager",
    "Focusable",
    "FuzzyMatch",
    "Image",
    "ImageDimensions",
    "ImageOptions",
    "ImageRenderOptions",
    "ImageTheme",
    "Input",
    "Key",
    "KillRing",
    "Loader",
    "Markdown",
    "OverlayHandle",
    "OverlayMargin",
    "OverlayOptions",
    "OverlayAnchor",
    "ProcessTerminal",
    "SelectItem",
    "SelectList",
    "SelectListLayoutOptions",
    "SelectListTheme",
    "SelectListTruncatePrimaryContext",
    "SettingItem",
    "SettingsList",
    "SettingsListTheme",
    "SizeValue",
    "SlashCommand",
    "Spacer",
    "StdinBuffer",
    "Terminal",
    "TerminalCapabilities",
    "Text",
    "TruncatedText",
    "TUI",
    "UndoStack",
    "allocate_image_id",
    "apply_background_to_line",
    "calculate_image_rows",
    "decode_kitty_printable",
    "delete_all_kitty_images",
    "delete_kitty_image",
    "detect_capabilities",
    "encode_iterm2",
    "encode_kitty",
    "extract_ansi_code",
    "extract_segments",
    "fuzzy_filter",
    "fuzzy_match",
    "get_capabilities",
    "get_cell_dimensions",
    "get_gif_dimensions",
    "get_image_dimensions",
    "get_editor_keybindings",
    "get_jpeg_dimensions",
    "get_png_dimensions",
    "get_webp_dimensions",
    "get_segmenter",
    "image_fallback",
    "is_focusable",
    "is_image_line",
    "is_key_release",
    "is_key_repeat",
    "is_kitty_protocol_active",
    "is_punctuation_char",
    "is_whitespace_char",
    "matches_key",
    "parse_key",
    "render_image",
    "reset_capabilities_cache",
    "set_cell_dimensions",
    "set_editor_keybindings",
    "set_kitty_protocol_active",
    "slice_by_column",
    "slice_with_width",
    "truncate_to_width",
    "visible_width",
    "wrap_text_with_ansi",
]
