Skip to content

Public API Reference

This page is a compact index of the documented public surface. The root package exports the common app-building primitives, while focused subpackages expose the same concepts by responsibility.

The export surfaces are snapshot-tested in tests/test_public_api.py; additions and removals should be intentional.

Import common primitives directly from lazy_cuh:

from lazy_cuh import ListViewModel, NavigableItem, PanelSpec, TabSpec
  • Items and options: NavigableItem, KeyValueItem, OptionItem, EditableOption, OptionEditRequest, OptionEditOutcome, OptionEditOutcomeKind, OptionSet, parse_bool, format_bool
  • Tree data: TreeItem, VisibleTreeItem, flatten_visible_tree, find_tree_item, set_tree_item_expanded, toggle_tree_item_expanded
  • Selection and notices: SelectionState, Notice, NoticeLevel
  • Events and commands: Event, ItemHighlighted, ItemSelected, ActionRequested, TabChanged, Command, GlobalCommand, ItemCommand, command_from_action
  • Action metadata: ActionBinding, ActionId, ActionMap, ActionDispatcher, ActionDispatchContext, ActionDispatchResult, ActionHandlerSpec
  • Hints: Hint, HintGroup, HintPlacement, HintVisibility, HintViewSpec, hints_from_actions, hint_groups_from_actions
  • Key sequences: KeySequence, PrefixedKeySequence, KeyPrefix, KeyPrefixMap, KeyDisplayMap
  • Input resolution: InputResolver, InputResolution, InputResolutionKind
  • Binding registry: BindingRegistry, ScopedBinding, BindingContext, BindingCollision, BindingDiagnostic, BindingDiagnosticKind, BindingDiagnosticSeverity, CollisionPolicy, format_binding_diagnostics
  • Profiles and navigation: KeyHandlingProfile, CountPolicy, SIMPLE_KEYS, VIM_NAVIGATION_KEYS, ListNavigationState, NavigableKeymap, NavigableInputResolver, NavigationCommand, NavigationCommandKind, NavigableInput, NavigableIntent, ShellCommandState, ShellCommandKeymap, ShellCommand
  • Lists: ListViewModel, ListViewSpec
  • Trees: TreeViewModel, TreeViewSpec, TreeGuideStyle
  • Text: TextViewModel, TextViewSpec, TextContent
  • Shared view settings: ViewSettings
  • Panels and tabs: PanelSpec, PanelTitle, TabSpec, panel_title
  • Shell state: ShellState, ShellController, ShellKeyResult, FocusGraph, Direction, TabChange, shell_command_handlers, shell_tab_handlers
  • Layout: LineNumberMode, LineNumberSpec, WrapMode, next_line_number_mode
  • Viewport: ViewportMap, ScrollPolicy, ScrollState, clamp_line, effective_scroll_margin, half_page_step
  • Keybars: KeybarSpec, KeyHint, ContextualKeybar, keybar_spec_from_actions, render_keybar, render_expanded_keybar, render_keybindings_help, render_notice
  • Modals: InputModalSpec, ConfirmModalSpec, InfoModalSpec, ModalState, ModalResult, ModalKind, ModalSpec, ModalContent, InputParser, InputValidator, InputParseErrorFormatter
  • Styles: Palette, StyleRole

Use focused subpackages when working on one layer of the framework or when a downstream app wants narrower imports.

| Package | Responsibility | | --- | --- | | lazy_cuh.core | Plain item, option, tree, event, command, notice, and selection models | | lazy_cuh.input | Actions, key sequences, binding registry, input resolution, and navigation profiles | | lazy_cuh.keybar | Keybar models, contextual keybars, and keybar renderers | | lazy_cuh.layout | Item-to-line rendering, wrapping, line numbers, and row composition | | lazy_cuh.modals | Pure modal specs, results, and state transitions | | lazy_cuh.styles | Palette roles and default Textual CSS | | lazy_cuh.view | List, tree, text, panel, tab, and shell view models | | lazy_cuh.viewport | Visual-line mapping and scroll policy helpers | | lazy_cuh.widgets | Textual adapter widgets and widget messages |

Textual adapters live under lazy_cuh.widgets:

  • Widgets: ListViewWidget, TreeViewWidget, TextViewWidget, KeybarWidget, ModalWidget
  • Shell/modal adapters: ShellViewAdapter, ShellRuntime, ModalHost
  • Adapter specs: PanelWidgetSpec, ContentWidgetSpec
  • Messages and actions: ItemHighlightedMessage, ItemSelectedMessage, ItemActionMessage, ModalResultMessage, NavigableAction
  • Widget configuration/helpers: NavigableKeymap, render_model_lines, render_tree_lines, render_text_lines, center_modal_offset

Use widget imports only at the Textual boundary. Keep app state and user intentions in pure models, action maps, and commands.