@deepseek-harness-tui/dsh-tui 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +235 -0
- package/bin/dsh-tui.js +95 -0
- package/cordis.patch.yml +218 -0
- package/cordis.yml +185 -0
- package/lib/invariant.js +28 -0
- package/lib/types/activityPrefs.d.ts +29 -0
- package/lib/types/activityPrefs.d.ts.map +1 -0
- package/lib/types/activityPrefs.js +60 -0
- package/lib/types/bootstrap/state.d.ts +13 -0
- package/lib/types/bootstrap/state.d.ts.map +1 -0
- package/lib/types/bootstrap/state.js +12 -0
- package/lib/types/cc/cliHighlight.d.ts +20 -0
- package/lib/types/cc/cliHighlight.d.ts.map +1 -0
- package/lib/types/cc/cliHighlight.js +53 -0
- package/lib/types/cc/figures.d.ts +59 -0
- package/lib/types/cc/figures.d.ts.map +1 -0
- package/lib/types/cc/figures.js +69 -0
- package/lib/types/cc/format.d.ts +26 -0
- package/lib/types/cc/format.d.ts.map +1 -0
- package/lib/types/cc/format.js +55 -0
- package/lib/types/cc/hash.d.ts +25 -0
- package/lib/types/cc/hash.d.ts.map +1 -0
- package/lib/types/cc/hash.js +41 -0
- package/lib/types/cc/hyperlink.d.ts +21 -0
- package/lib/types/cc/hyperlink.d.ts.map +1 -0
- package/lib/types/cc/hyperlink.js +31 -0
- package/lib/types/cc/markdown.d.ts +43 -0
- package/lib/types/cc/markdown.d.ts.map +1 -0
- package/lib/types/cc/markdown.js +345 -0
- package/lib/types/cc/spinnerVerbs.d.ts +3 -0
- package/lib/types/cc/spinnerVerbs.d.ts.map +1 -0
- package/lib/types/cc/spinnerVerbs.js +190 -0
- package/lib/types/cc/terminal.d.ts +15 -0
- package/lib/types/cc/terminal.d.ts.map +1 -0
- package/lib/types/cc/terminal.js +84 -0
- package/lib/types/channel.d.ts +672 -0
- package/lib/types/channel.d.ts.map +1 -0
- package/lib/types/channel.js +2427 -0
- package/lib/types/childStderr.d.ts +63 -0
- package/lib/types/childStderr.d.ts.map +1 -0
- package/lib/types/childStderr.js +161 -0
- package/lib/types/commands.d.ts +55 -0
- package/lib/types/commands.d.ts.map +1 -0
- package/lib/types/commands.js +101 -0
- package/lib/types/components/ActivityLine.d.ts +29 -0
- package/lib/types/components/ActivityLine.d.ts.map +1 -0
- package/lib/types/components/ActivityLine.js +47 -0
- package/lib/types/components/ActivityPicker.d.ts +13 -0
- package/lib/types/components/ActivityPicker.d.ts.map +1 -0
- package/lib/types/components/ActivityPicker.js +24 -0
- package/lib/types/components/CommandSuggestions.d.ts +14 -0
- package/lib/types/components/CommandSuggestions.d.ts.map +1 -0
- package/lib/types/components/CommandSuggestions.js +33 -0
- package/lib/types/components/FileSuggestions.d.ts +12 -0
- package/lib/types/components/FileSuggestions.d.ts.map +1 -0
- package/lib/types/components/FileSuggestions.js +26 -0
- package/lib/types/components/GoalTodoPanel.d.ts +13 -0
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -0
- package/lib/types/components/GoalTodoPanel.js +57 -0
- package/lib/types/components/HelpMenu.d.ts +12 -0
- package/lib/types/components/HelpMenu.d.ts.map +1 -0
- package/lib/types/components/HelpMenu.js +12 -0
- package/lib/types/components/HistorySearchDialog.d.ts +16 -0
- package/lib/types/components/HistorySearchDialog.d.ts.map +1 -0
- package/lib/types/components/HistorySearchDialog.js +31 -0
- package/lib/types/components/InterruptedByUser.d.ts +7 -0
- package/lib/types/components/InterruptedByUser.d.ts.map +1 -0
- package/lib/types/components/InterruptedByUser.js +9 -0
- package/lib/types/components/LoadedContextPanel.d.ts +20 -0
- package/lib/types/components/LoadedContextPanel.d.ts.map +1 -0
- package/lib/types/components/LoadedContextPanel.js +30 -0
- package/lib/types/components/LogoV2.d.ts +23 -0
- package/lib/types/components/LogoV2.d.ts.map +1 -0
- package/lib/types/components/LogoV2.js +95 -0
- package/lib/types/components/Markdown.d.ts +24 -0
- package/lib/types/components/Markdown.d.ts.map +1 -0
- package/lib/types/components/Markdown.js +106 -0
- package/lib/types/components/MarkdownTable.d.ts +17 -0
- package/lib/types/components/MarkdownTable.d.ts.map +1 -0
- package/lib/types/components/MarkdownTable.js +272 -0
- package/lib/types/components/MessageList.d.ts +41 -0
- package/lib/types/components/MessageList.d.ts.map +1 -0
- package/lib/types/components/MessageList.js +303 -0
- package/lib/types/components/ModelPicker.d.ts +14 -0
- package/lib/types/components/ModelPicker.d.ts.map +1 -0
- package/lib/types/components/ModelPicker.js +15 -0
- package/lib/types/components/PresetPicker.d.ts +17 -0
- package/lib/types/components/PresetPicker.d.ts.map +1 -0
- package/lib/types/components/PresetPicker.js +25 -0
- package/lib/types/components/PromptInput.d.ts +67 -0
- package/lib/types/components/PromptInput.d.ts.map +1 -0
- package/lib/types/components/PromptInput.js +778 -0
- package/lib/types/components/ResumePicker.d.ts +15 -0
- package/lib/types/components/ResumePicker.d.ts.map +1 -0
- package/lib/types/components/ResumePicker.js +34 -0
- package/lib/types/components/RewindPicker.d.ts +14 -0
- package/lib/types/components/RewindPicker.d.ts.map +1 -0
- package/lib/types/components/RewindPicker.js +23 -0
- package/lib/types/components/SearchBox.d.ts +20 -0
- package/lib/types/components/SearchBox.d.ts.map +1 -0
- package/lib/types/components/SearchBox.js +33 -0
- package/lib/types/components/Select.d.ts +22 -0
- package/lib/types/components/Select.d.ts.map +1 -0
- package/lib/types/components/Select.js +19 -0
- package/lib/types/components/Spinner/GlimmerMessage.d.ts +19 -0
- package/lib/types/components/Spinner/GlimmerMessage.d.ts.map +1 -0
- package/lib/types/components/Spinner/GlimmerMessage.js +78 -0
- package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +31 -0
- package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts.map +1 -0
- package/lib/types/components/Spinner/SpinnerAnimationRow.js +162 -0
- package/lib/types/components/Spinner/SpinnerGlyph.d.ts +16 -0
- package/lib/types/components/Spinner/SpinnerGlyph.d.ts.map +1 -0
- package/lib/types/components/Spinner/SpinnerGlyph.js +36 -0
- package/lib/types/components/Spinner/spinnerMode.d.ts +6 -0
- package/lib/types/components/Spinner/spinnerMode.d.ts.map +1 -0
- package/lib/types/components/Spinner/spinnerMode.js +1 -0
- package/lib/types/components/Spinner/spinnerUtils.d.ts +41 -0
- package/lib/types/components/Spinner/spinnerUtils.d.ts.map +1 -0
- package/lib/types/components/Spinner/spinnerUtils.js +104 -0
- package/lib/types/components/Spinner/useStalledAnimation.d.ts +16 -0
- package/lib/types/components/Spinner/useStalledAnimation.d.ts.map +1 -0
- package/lib/types/components/Spinner/useStalledAnimation.js +71 -0
- package/lib/types/components/StreamingMarkdown.d.ts +12 -0
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -0
- package/lib/types/components/StreamingMarkdown.js +39 -0
- package/lib/types/components/ThemePicker.d.ts +22 -0
- package/lib/types/components/ThemePicker.d.ts.map +1 -0
- package/lib/types/components/ThemePicker.js +51 -0
- package/lib/types/components/ThinkingToggle.d.ts +17 -0
- package/lib/types/components/ThinkingToggle.d.ts.map +1 -0
- package/lib/types/components/ThinkingToggle.js +30 -0
- package/lib/types/components/ToolUseLoader.d.ts +13 -0
- package/lib/types/components/ToolUseLoader.d.ts.map +1 -0
- package/lib/types/components/ToolUseLoader.js +17 -0
- package/lib/types/components/Whale.d.ts +22 -0
- package/lib/types/components/Whale.d.ts.map +1 -0
- package/lib/types/components/Whale.js +78 -0
- package/lib/types/components/WorkingSpinner.d.ts +26 -0
- package/lib/types/components/WorkingSpinner.d.ts.map +1 -0
- package/lib/types/components/WorkingSpinner.js +68 -0
- package/lib/types/components/activityFrames.d.ts +31 -0
- package/lib/types/components/activityFrames.d.ts.map +1 -0
- package/lib/types/components/activityFrames.js +83 -0
- package/lib/types/components/bigfont.d.ts +28 -0
- package/lib/types/components/bigfont.d.ts.map +1 -0
- package/lib/types/components/bigfont.js +91 -0
- package/lib/types/components/design-system/Byline.d.ts +14 -0
- package/lib/types/components/design-system/Byline.d.ts.map +1 -0
- package/lib/types/components/design-system/Byline.js +17 -0
- package/lib/types/components/design-system/Divider.d.ts +40 -0
- package/lib/types/components/design-system/Divider.d.ts.map +1 -0
- package/lib/types/components/design-system/Divider.js +24 -0
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts +19 -0
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts.map +1 -0
- package/lib/types/components/design-system/KeyboardShortcutHint.js +14 -0
- package/lib/types/components/design-system/ListItem.d.ts +36 -0
- package/lib/types/components/design-system/ListItem.d.ts.map +1 -0
- package/lib/types/components/design-system/ListItem.js +48 -0
- package/lib/types/components/design-system/LoadingState.d.ts +19 -0
- package/lib/types/components/design-system/LoadingState.d.ts.map +1 -0
- package/lib/types/components/design-system/LoadingState.js +22 -0
- package/lib/types/components/design-system/Pane.d.ts +17 -0
- package/lib/types/components/design-system/Pane.d.ts.map +1 -0
- package/lib/types/components/design-system/Pane.js +15 -0
- package/lib/types/components/design-system/ProgressBar.d.ts +22 -0
- package/lib/types/components/design-system/ProgressBar.d.ts.map +1 -0
- package/lib/types/components/design-system/ProgressBar.js +27 -0
- package/lib/types/components/design-system/StatusIcon.d.ts +15 -0
- package/lib/types/components/design-system/StatusIcon.d.ts.map +1 -0
- package/lib/types/components/design-system/StatusIcon.js +20 -0
- package/lib/types/components/design-system/ThemeProvider.d.ts +11 -0
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -0
- package/lib/types/components/design-system/ThemeProvider.js +135 -0
- package/lib/types/components/design-system/ThemedBox.d.ts +37 -0
- package/lib/types/components/design-system/ThemedBox.d.ts.map +1 -0
- package/lib/types/components/design-system/ThemedBox.js +26 -0
- package/lib/types/components/design-system/ThemedText.d.ts +56 -0
- package/lib/types/components/design-system/ThemedText.d.ts.map +1 -0
- package/lib/types/components/design-system/ThemedText.js +45 -0
- package/lib/types/components/messages/AssistantTextMessage.d.ts +18 -0
- package/lib/types/components/messages/AssistantTextMessage.d.ts.map +1 -0
- package/lib/types/components/messages/AssistantTextMessage.js +15 -0
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +23 -0
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -0
- package/lib/types/components/messages/AssistantThinkingMessage.js +23 -0
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +23 -0
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -0
- package/lib/types/components/messages/AssistantToolUseMessage.js +220 -0
- package/lib/types/components/messages/MessageMetadata.d.ts +15 -0
- package/lib/types/components/messages/MessageMetadata.d.ts.map +1 -0
- package/lib/types/components/messages/MessageMetadata.js +20 -0
- package/lib/types/components/messages/UserPromptMessage.d.ts +19 -0
- package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -0
- package/lib/types/components/messages/UserPromptMessage.js +15 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +39 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -0
- package/lib/types/components/questions/AskUserQuestionPanel.js +228 -0
- package/lib/types/components/shimmer.d.ts +35 -0
- package/lib/types/components/shimmer.d.ts.map +1 -0
- package/lib/types/components/shimmer.js +43 -0
- package/lib/types/components/whaleFrames.d.ts +25 -0
- package/lib/types/components/whaleFrames.d.ts.map +1 -0
- package/lib/types/components/whaleFrames.js +419 -0
- package/lib/types/customTheme.d.ts +104 -0
- package/lib/types/customTheme.d.ts.map +1 -0
- package/lib/types/customTheme.js +268 -0
- package/lib/types/effortPrefs.d.ts +22 -0
- package/lib/types/effortPrefs.d.ts.map +1 -0
- package/lib/types/effortPrefs.js +45 -0
- package/lib/types/history.d.ts +24 -0
- package/lib/types/history.d.ts.map +1 -0
- package/lib/types/history.js +75 -0
- package/lib/types/hooks/useBlink.d.ts +11 -0
- package/lib/types/hooks/useBlink.d.ts.map +1 -0
- package/lib/types/hooks/useBlink.js +20 -0
- package/lib/types/i18n.d.ts +926 -0
- package/lib/types/i18n.d.ts.map +1 -0
- package/lib/types/i18n.js +356 -0
- package/lib/types/index.d.ts +70 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +31 -0
- package/lib/types/ink/Ansi.d.ts +11 -0
- package/lib/types/ink/Ansi.d.ts.map +1 -0
- package/lib/types/ink/Ansi.js +269 -0
- package/lib/types/ink/bidi.d.ts +18 -0
- package/lib/types/ink/bidi.d.ts.map +1 -0
- package/lib/types/ink/bidi.js +119 -0
- package/lib/types/ink/clearTerminal.d.ts +22 -0
- package/lib/types/ink/clearTerminal.d.ts.map +1 -0
- package/lib/types/ink/clearTerminal.js +72 -0
- package/lib/types/ink/colorize.d.ts +33 -0
- package/lib/types/ink/colorize.d.ts.map +1 -0
- package/lib/types/ink/colorize.js +213 -0
- package/lib/types/ink/components/AlternateScreen.d.ts +22 -0
- package/lib/types/ink/components/AlternateScreen.d.ts.map +1 -0
- package/lib/types/ink/components/AlternateScreen.js +74 -0
- package/lib/types/ink/components/App.d.ts +73 -0
- package/lib/types/ink/components/App.d.ts.map +1 -0
- package/lib/types/ink/components/App.js +597 -0
- package/lib/types/ink/components/AppContext.d.ts +15 -0
- package/lib/types/ink/components/AppContext.d.ts.map +1 -0
- package/lib/types/ink/components/AppContext.js +11 -0
- package/lib/types/ink/components/Box.d.ts +49 -0
- package/lib/types/ink/components/Box.d.ts.map +1 -0
- package/lib/types/ink/components/Box.js +153 -0
- package/lib/types/ink/components/Button.d.ts +37 -0
- package/lib/types/ink/components/Button.d.ts.map +1 -0
- package/lib/types/ink/components/Button.js +166 -0
- package/lib/types/ink/components/ClockContext.d.ts +10 -0
- package/lib/types/ink/components/ClockContext.d.ts.map +1 -0
- package/lib/types/ink/components/ClockContext.js +108 -0
- package/lib/types/ink/components/CursorDeclarationContext.d.ts +30 -0
- package/lib/types/ink/components/CursorDeclarationContext.d.ts.map +1 -0
- package/lib/types/ink/components/CursorDeclarationContext.js +6 -0
- package/lib/types/ink/components/ErrorOverview.d.ts +7 -0
- package/lib/types/ink/components/ErrorOverview.d.ts.map +1 -0
- package/lib/types/ink/components/ErrorOverview.js +49 -0
- package/lib/types/ink/components/Link.d.ts +8 -0
- package/lib/types/ink/components/Link.d.ts.map +1 -0
- package/lib/types/ink/components/Link.js +33 -0
- package/lib/types/ink/components/Newline.d.ts +13 -0
- package/lib/types/ink/components/Newline.d.ts.map +1 -0
- package/lib/types/ink/components/Newline.js +29 -0
- package/lib/types/ink/components/NoSelect.d.ts +20 -0
- package/lib/types/ink/components/NoSelect.d.ts.map +1 -0
- package/lib/types/ink/components/NoSelect.js +56 -0
- package/lib/types/ink/components/RawAnsi.d.ts +17 -0
- package/lib/types/ink/components/RawAnsi.d.ts.map +1 -0
- package/lib/types/ink/components/RawAnsi.js +45 -0
- package/lib/types/ink/components/ScrollBox.d.ts +78 -0
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -0
- package/lib/types/ink/components/ScrollBox.js +174 -0
- package/lib/types/ink/components/Spacer.d.ts +6 -0
- package/lib/types/ink/components/Spacer.d.ts.map +1 -0
- package/lib/types/ink/components/Spacer.js +19 -0
- package/lib/types/ink/components/StdinContext.d.ts +32 -0
- package/lib/types/ink/components/StdinContext.d.ts.map +1 -0
- package/lib/types/ink/components/StdinContext.js +16 -0
- package/lib/types/ink/components/TerminalFocusContext.d.ts +11 -0
- package/lib/types/ink/components/TerminalFocusContext.d.ts.map +1 -0
- package/lib/types/ink/components/TerminalFocusContext.js +45 -0
- package/lib/types/ink/components/TerminalSizeContext.d.ts +6 -0
- package/lib/types/ink/components/TerminalSizeContext.d.ts.map +1 -0
- package/lib/types/ink/components/TerminalSizeContext.js +3 -0
- package/lib/types/ink/components/Text.d.ts +56 -0
- package/lib/types/ink/components/Text.d.ts.map +1 -0
- package/lib/types/ink/components/Text.js +194 -0
- package/lib/types/ink/constants.d.ts +3 -0
- package/lib/types/ink/constants.d.ts.map +1 -0
- package/lib/types/ink/constants.js +2 -0
- package/lib/types/ink/cursor.d.ts +11 -0
- package/lib/types/ink/cursor.d.ts.map +1 -0
- package/lib/types/ink/cursor.js +1 -0
- package/lib/types/ink/devtools.d.ts +7 -0
- package/lib/types/ink/devtools.d.ts.map +1 -0
- package/lib/types/ink/devtools.js +1 -0
- package/lib/types/ink/dom.d.ts +178 -0
- package/lib/types/ink/dom.d.ts.map +1 -0
- package/lib/types/ink/dom.js +424 -0
- package/lib/types/ink/events/click-event.d.ts +32 -0
- package/lib/types/ink/events/click-event.d.ts.map +1 -0
- package/lib/types/ink/events/click-event.js +36 -0
- package/lib/types/ink/events/dispatcher.d.ts +63 -0
- package/lib/types/ink/events/dispatcher.d.ts.map +1 -0
- package/lib/types/ink/events/dispatcher.js +194 -0
- package/lib/types/ink/events/emitter.d.ts +20 -0
- package/lib/types/ink/events/emitter.d.ts.map +1 -0
- package/lib/types/ink/events/emitter.js +43 -0
- package/lib/types/ink/events/event-handlers.d.ts +47 -0
- package/lib/types/ink/events/event-handlers.d.ts.map +1 -0
- package/lib/types/ink/events/event-handlers.js +30 -0
- package/lib/types/ink/events/event.d.ts +19 -0
- package/lib/types/ink/events/event.d.ts.map +1 -0
- package/lib/types/ink/events/event.js +22 -0
- package/lib/types/ink/events/focus-event.d.ts +19 -0
- package/lib/types/ink/events/focus-event.d.ts.map +1 -0
- package/lib/types/ink/events/focus-event.js +21 -0
- package/lib/types/ink/events/input-event.d.ts +53 -0
- package/lib/types/ink/events/input-event.d.ts.map +1 -0
- package/lib/types/ink/events/input-event.js +180 -0
- package/lib/types/ink/events/keyboard-event.d.ts +40 -0
- package/lib/types/ink/events/keyboard-event.d.ts.map +1 -0
- package/lib/types/ink/events/keyboard-event.js +65 -0
- package/lib/types/ink/events/paste-event.d.ts +11 -0
- package/lib/types/ink/events/paste-event.d.ts.map +1 -0
- package/lib/types/ink/events/paste-event.js +13 -0
- package/lib/types/ink/events/resize-event.d.ts +13 -0
- package/lib/types/ink/events/resize-event.d.ts.map +1 -0
- package/lib/types/ink/events/resize-event.js +16 -0
- package/lib/types/ink/events/terminal-event.d.ts +112 -0
- package/lib/types/ink/events/terminal-event.d.ts.map +1 -0
- package/lib/types/ink/events/terminal-event.js +131 -0
- package/lib/types/ink/events/terminal-focus-event.d.ts +21 -0
- package/lib/types/ink/events/terminal-focus-event.d.ts.map +1 -0
- package/lib/types/ink/events/terminal-focus-event.js +18 -0
- package/lib/types/ink/focus.d.ts +74 -0
- package/lib/types/ink/focus.d.ts.map +1 -0
- package/lib/types/ink/focus.js +188 -0
- package/lib/types/ink/frame.d.ts +119 -0
- package/lib/types/ink/frame.d.ts.map +1 -0
- package/lib/types/ink/frame.js +43 -0
- package/lib/types/ink/get-max-width.d.ts +20 -0
- package/lib/types/ink/get-max-width.d.ts.map +1 -0
- package/lib/types/ink/get-max-width.js +25 -0
- package/lib/types/ink/hit-test.d.ts +47 -0
- package/lib/types/ink/hit-test.d.ts.map +1 -0
- package/lib/types/ink/hit-test.js +126 -0
- package/lib/types/ink/hooks/use-animation-frame.d.ts +27 -0
- package/lib/types/ink/hooks/use-animation-frame.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-animation-frame.js +48 -0
- package/lib/types/ink/hooks/use-app.d.ts +8 -0
- package/lib/types/ink/hooks/use-app.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-app.js +8 -0
- package/lib/types/ink/hooks/use-copy-on-select.d.ts +22 -0
- package/lib/types/ink/hooks/use-copy-on-select.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-copy-on-select.js +40 -0
- package/lib/types/ink/hooks/use-declared-cursor.d.ts +31 -0
- package/lib/types/ink/hooks/use-declared-cursor.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-declared-cursor.js +65 -0
- package/lib/types/ink/hooks/use-input.d.ts +41 -0
- package/lib/types/ink/hooks/use-input.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-input.js +73 -0
- package/lib/types/ink/hooks/use-interval.d.ts +23 -0
- package/lib/types/ink/hooks/use-interval.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-interval.js +58 -0
- package/lib/types/ink/hooks/use-search-highlight.d.ts +34 -0
- package/lib/types/ink/hooks/use-search-highlight.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-search-highlight.js +35 -0
- package/lib/types/ink/hooks/use-selection.d.ts +44 -0
- package/lib/types/ink/hooks/use-selection.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-selection.js +64 -0
- package/lib/types/ink/hooks/use-stdin.d.ts +8 -0
- package/lib/types/ink/hooks/use-stdin.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-stdin.js +8 -0
- package/lib/types/ink/hooks/use-tab-status.d.ts +18 -0
- package/lib/types/ink/hooks/use-tab-status.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-tab-status.js +58 -0
- package/lib/types/ink/hooks/use-terminal-focus.d.ts +11 -0
- package/lib/types/ink/hooks/use-terminal-focus.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-terminal-focus.js +15 -0
- package/lib/types/ink/hooks/use-terminal-size.d.ts +6 -0
- package/lib/types/ink/hooks/use-terminal-size.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-terminal-size.js +12 -0
- package/lib/types/ink/hooks/use-terminal-title.d.ts +14 -0
- package/lib/types/ink/hooks/use-terminal-title.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-terminal-title.js +30 -0
- package/lib/types/ink/hooks/use-terminal-viewport.d.ts +32 -0
- package/lib/types/ink/hooks/use-terminal-viewport.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-terminal-viewport.js +79 -0
- package/lib/types/ink/ink.d.ts +370 -0
- package/lib/types/ink/ink.d.ts.map +1 -0
- package/lib/types/ink/ink.js +1665 -0
- package/lib/types/ink/instances.d.ts +10 -0
- package/lib/types/ink/instances.d.ts.map +1 -0
- package/lib/types/ink/instances.js +13 -0
- package/lib/types/ink/layout/engine.d.ts +7 -0
- package/lib/types/ink/layout/engine.d.ts.map +1 -0
- package/lib/types/ink/layout/engine.js +8 -0
- package/lib/types/ink/layout/geometry.d.ts +86 -0
- package/lib/types/ink/layout/geometry.d.ts.map +1 -0
- package/lib/types/ink/layout/geometry.js +95 -0
- package/lib/types/ink/layout/node.d.ts +151 -0
- package/lib/types/ink/layout/node.d.ts.map +1 -0
- package/lib/types/ink/layout/node.js +72 -0
- package/lib/types/ink/layout/yoga.d.ts +69 -0
- package/lib/types/ink/layout/yoga.d.ts.map +1 -0
- package/lib/types/ink/layout/yoga.js +249 -0
- package/lib/types/ink/line-width-cache.d.ts +9 -0
- package/lib/types/ink/line-width-cache.d.ts.map +1 -0
- package/lib/types/ink/line-width-cache.js +45 -0
- package/lib/types/ink/log-update.d.ts +57 -0
- package/lib/types/ink/log-update.d.ts.map +1 -0
- package/lib/types/ink/log-update.js +710 -0
- package/lib/types/ink/measure-element.d.ts +19 -0
- package/lib/types/ink/measure-element.d.ts.map +1 -0
- package/lib/types/ink/measure-element.js +10 -0
- package/lib/types/ink/measure-text.d.ts +13 -0
- package/lib/types/ink/measure-text.d.ts.map +1 -0
- package/lib/types/ink/measure-text.js +38 -0
- package/lib/types/ink/node-cache.d.ts +33 -0
- package/lib/types/ink/node-cache.d.ts.map +1 -0
- package/lib/types/ink/node-cache.js +42 -0
- package/lib/types/ink/optimizer.d.ts +18 -0
- package/lib/types/ink/optimizer.d.ts.map +1 -0
- package/lib/types/ink/optimizer.js +83 -0
- package/lib/types/ink/output.d.ts +200 -0
- package/lib/types/ink/output.d.ts.map +1 -0
- package/lib/types/ink/output.js +663 -0
- package/lib/types/ink/parse-keypress.d.ts +132 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -0
- package/lib/types/ink/parse-keypress.js +707 -0
- package/lib/types/ink/reconciler.d.ts +43 -0
- package/lib/types/ink/reconciler.d.ts.map +1 -0
- package/lib/types/ink/reconciler.js +413 -0
- package/lib/types/ink/render-border.d.ts +36 -0
- package/lib/types/ink/render-border.d.ts.map +1 -0
- package/lib/types/ink/render-border.js +143 -0
- package/lib/types/ink/render-node-to-output.d.ts +93 -0
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -0
- package/lib/types/ink/render-node-to-output.js +1290 -0
- package/lib/types/ink/render-to-screen.d.ts +65 -0
- package/lib/types/ink/render-to-screen.d.ts.map +1 -0
- package/lib/types/ink/render-to-screen.js +189 -0
- package/lib/types/ink/renderer.d.ts +24 -0
- package/lib/types/ink/renderer.d.ts.map +1 -0
- package/lib/types/ink/renderer.js +136 -0
- package/lib/types/ink/root.d.ts +91 -0
- package/lib/types/ink/root.d.ts.map +1 -0
- package/lib/types/ink/root.js +93 -0
- package/lib/types/ink/screen.d.ts +443 -0
- package/lib/types/ink/screen.d.ts.map +1 -0
- package/lib/types/ink/screen.js +1295 -0
- package/lib/types/ink/searchHighlight.d.ts +25 -0
- package/lib/types/ink/searchHighlight.d.ts.map +1 -0
- package/lib/types/ink/searchHighlight.js +82 -0
- package/lib/types/ink/selection.d.ts +323 -0
- package/lib/types/ink/selection.d.ts.map +1 -0
- package/lib/types/ink/selection.js +881 -0
- package/lib/types/ink/squash-text-nodes.d.ts +30 -0
- package/lib/types/ink/squash-text-nodes.d.ts.map +1 -0
- package/lib/types/ink/squash-text-nodes.js +63 -0
- package/lib/types/ink/stringWidth.d.ts +11 -0
- package/lib/types/ink/stringWidth.d.ts.map +1 -0
- package/lib/types/ink/stringWidth.js +209 -0
- package/lib/types/ink/styles.d.ts +324 -0
- package/lib/types/ink/styles.d.ts.map +1 -0
- package/lib/types/ink/styles.js +307 -0
- package/lib/types/ink/supports-hyperlinks.d.ts +20 -0
- package/lib/types/ink/supports-hyperlinks.d.ts.map +1 -0
- package/lib/types/ink/supports-hyperlinks.js +44 -0
- package/lib/types/ink/tabstops.d.ts +9 -0
- package/lib/types/ink/tabstops.d.ts.map +1 -0
- package/lib/types/ink/tabstops.js +46 -0
- package/lib/types/ink/terminal-focus-state.d.ts +35 -0
- package/lib/types/ink/terminal-focus-state.d.ts.map +1 -0
- package/lib/types/ink/terminal-focus-state.js +57 -0
- package/lib/types/ink/terminal-querier.d.ts +161 -0
- package/lib/types/ink/terminal-querier.d.ts.map +1 -0
- package/lib/types/ink/terminal-querier.js +204 -0
- package/lib/types/ink/terminal.d.ts +80 -0
- package/lib/types/ink/terminal.d.ts.map +1 -0
- package/lib/types/ink/terminal.js +268 -0
- package/lib/types/ink/termio/ansi.d.ts +75 -0
- package/lib/types/ink/termio/ansi.d.ts.map +1 -0
- package/lib/types/ink/termio/ansi.js +79 -0
- package/lib/types/ink/termio/csi.d.ts +253 -0
- package/lib/types/ink/termio/csi.d.ts.map +1 -0
- package/lib/types/ink/termio/csi.js +347 -0
- package/lib/types/ink/termio/dec.d.ts +61 -0
- package/lib/types/ink/termio/dec.d.ts.map +1 -0
- package/lib/types/ink/termio/dec.js +76 -0
- package/lib/types/ink/termio/esc.d.ts +15 -0
- package/lib/types/ink/termio/esc.d.ts.map +1 -0
- package/lib/types/ink/termio/esc.js +57 -0
- package/lib/types/ink/termio/osc.d.ts +208 -0
- package/lib/types/ink/termio/osc.d.ts.map +1 -0
- package/lib/types/ink/termio/osc.js +466 -0
- package/lib/types/ink/termio/parser.d.ts +46 -0
- package/lib/types/ink/termio/parser.d.ts.map +1 -0
- package/lib/types/ink/termio/parser.js +366 -0
- package/lib/types/ink/termio/sgr.d.ts +17 -0
- package/lib/types/ink/termio/sgr.d.ts.map +1 -0
- package/lib/types/ink/termio/sgr.js +300 -0
- package/lib/types/ink/termio/tokenize.d.ts +50 -0
- package/lib/types/ink/termio/tokenize.d.ts.map +1 -0
- package/lib/types/ink/termio/tokenize.js +266 -0
- package/lib/types/ink/termio/types.d.ts +211 -0
- package/lib/types/ink/termio/types.d.ts.map +1 -0
- package/lib/types/ink/termio/types.js +68 -0
- package/lib/types/ink/termio.d.ts +25 -0
- package/lib/types/ink/termio.d.ts.map +1 -0
- package/lib/types/ink/termio.js +24 -0
- package/lib/types/ink/truncateToWidth.d.ts +7 -0
- package/lib/types/ink/truncateToWidth.d.ts.map +1 -0
- package/lib/types/ink/truncateToWidth.js +18 -0
- package/lib/types/ink/useTerminalNotification.d.ts +45 -0
- package/lib/types/ink/useTerminalNotification.d.ts.map +1 -0
- package/lib/types/ink/useTerminalNotification.js +70 -0
- package/lib/types/ink/warn.d.ts +7 -0
- package/lib/types/ink/warn.d.ts.map +1 -0
- package/lib/types/ink/warn.js +15 -0
- package/lib/types/ink/widest-line.d.ts +7 -0
- package/lib/types/ink/widest-line.d.ts.map +1 -0
- package/lib/types/ink/widest-line.js +19 -0
- package/lib/types/ink/wrap-text.d.ts +10 -0
- package/lib/types/ink/wrap-text.d.ts.map +1 -0
- package/lib/types/ink/wrap-text.js +61 -0
- package/lib/types/ink/wrapAnsi.d.ts +18 -0
- package/lib/types/ink/wrapAnsi.d.ts.map +1 -0
- package/lib/types/ink/wrapAnsi.js +16 -0
- package/lib/types/invariant.d.ts +20 -0
- package/lib/types/invariant.d.ts.map +1 -0
- package/lib/types/invariant.js +26 -0
- package/lib/types/modelPrefs.d.ts +37 -0
- package/lib/types/modelPrefs.d.ts.map +1 -0
- package/lib/types/modelPrefs.js +66 -0
- package/lib/types/modelRoute.d.ts +79 -0
- package/lib/types/modelRoute.d.ts.map +1 -0
- package/lib/types/modelRoute.js +96 -0
- package/lib/types/native-ts/yoga-layout/enums.d.ts +183 -0
- package/lib/types/native-ts/yoga-layout/enums.d.ts.map +1 -0
- package/lib/types/native-ts/yoga-layout/enums.js +150 -0
- package/lib/types/native-ts/yoga-layout/index.d.ts +788 -0
- package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -0
- package/lib/types/native-ts/yoga-layout/index.js +2571 -0
- package/lib/types/packaged-skills.d.ts +10 -0
- package/lib/types/packaged-skills.d.ts.map +1 -0
- package/lib/types/packaged-skills.js +63 -0
- package/lib/types/plugin.d.ts +33 -0
- package/lib/types/plugin.d.ts.map +1 -0
- package/lib/types/plugin.js +454 -0
- package/lib/types/presetPrefs.d.ts +29 -0
- package/lib/types/presetPrefs.d.ts.map +1 -0
- package/lib/types/presetPrefs.js +61 -0
- package/lib/types/presets.d.ts +110 -0
- package/lib/types/presets.d.ts.map +1 -0
- package/lib/types/presets.js +114 -0
- package/lib/types/questions.d.ts +97 -0
- package/lib/types/questions.d.ts.map +1 -0
- package/lib/types/questions.js +201 -0
- package/lib/types/screens/Chat.d.ts +23 -0
- package/lib/types/screens/Chat.d.ts.map +1 -0
- package/lib/types/screens/Chat.js +1263 -0
- package/lib/types/screens/StatusLine.d.ts +16 -0
- package/lib/types/screens/StatusLine.d.ts.map +1 -0
- package/lib/types/screens/StatusLine.js +105 -0
- package/lib/types/screens/StatusMetrics.d.ts +87 -0
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -0
- package/lib/types/screens/StatusMetrics.js +252 -0
- package/lib/types/sessionHistory.d.ts +32 -0
- package/lib/types/sessionHistory.d.ts.map +1 -0
- package/lib/types/sessionHistory.js +87 -0
- package/lib/types/theme.d.ts +115 -0
- package/lib/types/theme.d.ts.map +1 -0
- package/lib/types/theme.js +300 -0
- package/lib/types/themePrefs.d.ts +28 -0
- package/lib/types/themePrefs.d.ts.map +1 -0
- package/lib/types/themePrefs.js +59 -0
- package/lib/types/ui.d.ts +28 -0
- package/lib/types/ui.d.ts.map +1 -0
- package/lib/types/ui.js +25 -0
- package/lib/types/update.d.ts +76 -0
- package/lib/types/update.d.ts.map +1 -0
- package/lib/types/update.js +203 -0
- package/lib/types/utils/clipboard.d.ts +43 -0
- package/lib/types/utils/clipboard.d.ts.map +1 -0
- package/lib/types/utils/clipboard.js +82 -0
- package/lib/types/utils/debug.d.ts +8 -0
- package/lib/types/utils/debug.d.ts.map +1 -0
- package/lib/types/utils/debug.js +12 -0
- package/lib/types/utils/earlyInput.d.ts +7 -0
- package/lib/types/utils/earlyInput.d.ts.map +1 -0
- package/lib/types/utils/earlyInput.js +6 -0
- package/lib/types/utils/env.d.ts +10 -0
- package/lib/types/utils/env.d.ts.map +1 -0
- package/lib/types/utils/env.js +9 -0
- package/lib/types/utils/envUtils.d.ts +8 -0
- package/lib/types/utils/envUtils.d.ts.map +1 -0
- package/lib/types/utils/envUtils.js +13 -0
- package/lib/types/utils/execFileNoThrow.d.ts +34 -0
- package/lib/types/utils/execFileNoThrow.d.ts.map +1 -0
- package/lib/types/utils/execFileNoThrow.js +31 -0
- package/lib/types/utils/fullscreen.d.ts +8 -0
- package/lib/types/utils/fullscreen.d.ts.map +1 -0
- package/lib/types/utils/fullscreen.js +10 -0
- package/lib/types/utils/intl.d.ts +7 -0
- package/lib/types/utils/intl.d.ts.map +1 -0
- package/lib/types/utils/intl.js +9 -0
- package/lib/types/utils/loaded-context.d.ts +20 -0
- package/lib/types/utils/loaded-context.d.ts.map +1 -0
- package/lib/types/utils/loaded-context.js +36 -0
- package/lib/types/utils/log.d.ts +7 -0
- package/lib/types/utils/log.d.ts.map +1 -0
- package/lib/types/utils/log.js +9 -0
- package/lib/types/utils/mentions.d.ts +30 -0
- package/lib/types/utils/mentions.d.ts.map +1 -0
- package/lib/types/utils/mentions.js +72 -0
- package/lib/types/utils/narration.d.ts +11 -0
- package/lib/types/utils/narration.d.ts.map +1 -0
- package/lib/types/utils/narration.js +16 -0
- package/lib/types/utils/semver.d.ts +9 -0
- package/lib/types/utils/semver.d.ts.map +1 -0
- package/lib/types/utils/semver.js +24 -0
- package/lib/types/utils/sliceAnsi.d.ts +12 -0
- package/lib/types/utils/sliceAnsi.d.ts.map +1 -0
- package/lib/types/utils/sliceAnsi.js +79 -0
- package/lib/types/working-activity.d.ts +19 -0
- package/lib/types/working-activity.d.ts.map +1 -0
- package/lib/types/working-activity.js +18 -0
- package/package.json +141 -0
- package/skills/audit/SKILL.md +24 -0
- package/skills/bug/SKILL.md +27 -0
- package/skills/pr-comments/SKILL.md +20 -0
- package/skills/practice/SKILL.md +22 -0
- package/skills/release-notes/SKILL.md +25 -0
- package/skills/review/SKILL.md +25 -0
- package/skills/vuln-check/SKILL.md +25 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type Ink from './ink.js';
|
|
2
|
+
/**
|
|
3
|
+
* Live Ink instances keyed by their output stream, so consecutive render()
|
|
4
|
+
* calls reuse the instance for a stream instead of creating a new one.
|
|
5
|
+
* Lives in its own module: render.js creates instances while instance.js
|
|
6
|
+
* deletes its own entry on unmount.
|
|
7
|
+
*/
|
|
8
|
+
declare const instances: Map<NodeJS.WriteStream, Ink>;
|
|
9
|
+
export default instances;
|
|
10
|
+
//# sourceMappingURL=instances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../../src/ink/instances.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAE/B;;;;;GAKG;AACH,QAAA,MAAM,SAAS,8BAAqC,CAAA;AACpD,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Store all instances of Ink (instance.js) to ensure that consecutive render() calls
|
|
2
|
+
// use the same instance of Ink and don't create a new one
|
|
3
|
+
//
|
|
4
|
+
// This map has to be stored in a separate file, because render.js creates instances,
|
|
5
|
+
// but instance.js should delete itself from the map on unmount
|
|
6
|
+
/**
|
|
7
|
+
* Live Ink instances keyed by their output stream, so consecutive render()
|
|
8
|
+
* calls reuse the instance for a stream instead of creating a new one.
|
|
9
|
+
* Lives in its own module: render.js creates instances while instance.js
|
|
10
|
+
* deletes its own entry on unmount.
|
|
11
|
+
*/
|
|
12
|
+
const instances = new Map();
|
|
13
|
+
export default instances;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LayoutNode } from './node.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create a new layout node backed by the Yoga adapter.
|
|
4
|
+
* @returns an empty layout node with no children, styles, or measure function.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createLayoutNode(): LayoutNode;
|
|
7
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../../src/ink/layout/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAG3C;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,CAE7C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createYogaLayoutNode } from './yoga.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create a new layout node backed by the Yoga adapter.
|
|
4
|
+
* @returns an empty layout node with no children, styles, or measure function.
|
|
5
|
+
*/
|
|
6
|
+
export function createLayoutNode() {
|
|
7
|
+
return createYogaLayoutNode();
|
|
8
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** A 2D point in grid coordinates. */
|
|
2
|
+
export type Point = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
};
|
|
6
|
+
/** A width and height in terminal cells. */
|
|
7
|
+
export type Size = {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
/** A rectangle: an origin point plus a size. */
|
|
12
|
+
export type Rectangle = Point & Size;
|
|
13
|
+
/** Edge insets (padding, margin, border) */
|
|
14
|
+
export type Edges = {
|
|
15
|
+
top: number;
|
|
16
|
+
right: number;
|
|
17
|
+
bottom: number;
|
|
18
|
+
left: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Create uniform edges with the same value on every side.
|
|
22
|
+
* @param all - the value applied to all four sides.
|
|
23
|
+
* @returns edges with every side set to `all`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function edges(all: number): Edges;
|
|
26
|
+
/**
|
|
27
|
+
* Create edges from vertical and horizontal values.
|
|
28
|
+
* @param vertical - the value for the top and bottom sides.
|
|
29
|
+
* @param horizontal - the value for the left and right sides.
|
|
30
|
+
* @returns edges with the vertical value on top/bottom and the horizontal value on left/right.
|
|
31
|
+
*/
|
|
32
|
+
export declare function edges(vertical: number, horizontal: number): Edges;
|
|
33
|
+
/**
|
|
34
|
+
* Create edges from four individual side values.
|
|
35
|
+
* @param top - the value for the top side.
|
|
36
|
+
* @param right - the value for the right side.
|
|
37
|
+
* @param bottom - the value for the bottom side.
|
|
38
|
+
* @param left - the value for the left side.
|
|
39
|
+
* @returns edges with each side set to its own value.
|
|
40
|
+
*/
|
|
41
|
+
export declare function edges(top: number, right: number, bottom: number, left: number): Edges;
|
|
42
|
+
/**
|
|
43
|
+
* Add two edge values side by side.
|
|
44
|
+
* @param a - the first edges.
|
|
45
|
+
* @param b - the second edges.
|
|
46
|
+
* @returns edges whose each side is the sum of the corresponding sides of `a` and `b`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function addEdges(a: Edges, b: Edges): Edges;
|
|
49
|
+
/** Zero edges constant */
|
|
50
|
+
export declare const ZERO_EDGES: Edges;
|
|
51
|
+
/**
|
|
52
|
+
* Convert partial edges to full edges with defaults.
|
|
53
|
+
* @param partial - edges with optional sides; omitted sides default to zero.
|
|
54
|
+
* @returns full edges where every missing side is zero.
|
|
55
|
+
*/
|
|
56
|
+
export declare function resolveEdges(partial?: Partial<Edges>): Edges;
|
|
57
|
+
/**
|
|
58
|
+
* Compute the smallest rectangle containing both input rectangles.
|
|
59
|
+
* @param a - the first rectangle.
|
|
60
|
+
* @param b - the second rectangle.
|
|
61
|
+
* @returns the union of `a` and `b`.
|
|
62
|
+
*/
|
|
63
|
+
export declare function unionRect(a: Rectangle, b: Rectangle): Rectangle;
|
|
64
|
+
/**
|
|
65
|
+
* Clamp a rectangle into a size's bounds, keeping it inside the grid.
|
|
66
|
+
* @param rect - the rectangle to clamp.
|
|
67
|
+
* @param size - the bounding grid size.
|
|
68
|
+
* @returns the intersection of `rect` with the grid; empty when they do not overlap.
|
|
69
|
+
*/
|
|
70
|
+
export declare function clampRect(rect: Rectangle, size: Size): Rectangle;
|
|
71
|
+
/**
|
|
72
|
+
* Test whether a point lies inside a size's bounds.
|
|
73
|
+
* @param size - the grid size.
|
|
74
|
+
* @param point - the point to test.
|
|
75
|
+
* @returns true when `point` is inside `size` (edges exclusive).
|
|
76
|
+
*/
|
|
77
|
+
export declare function withinBounds(size: Size, point: Point): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Clamp a value to an optional range.
|
|
80
|
+
* @param value - the value to clamp.
|
|
81
|
+
* @param min - the lower bound, or undefined for none.
|
|
82
|
+
* @param max - the upper bound, or undefined for none.
|
|
83
|
+
* @returns `value` clamped to [`min`, `max`].
|
|
84
|
+
*/
|
|
85
|
+
export declare function clamp(value: number, min?: number, max?: number): number;
|
|
86
|
+
//# sourceMappingURL=geometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../../src/ink/layout/geometry.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV,CAAA;AAED,4CAA4C;AAC5C,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,gDAAgD;AAChD,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,IAAI,CAAA;AAEpC,4CAA4C;AAC5C,MAAM,MAAM,KAAK,GAAG;IAClB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;AACzC;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,CAAA;AAClE;;;;;;;GAOG;AACH,wBAAgB,KAAK,CACnB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,KAAK,CAAA;AAWR;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK,CAOlD;AAED,0BAA0B;AAC1B,eAAO,MAAM,UAAU,EAAE,KAAgD,CAAA;AAEzE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAO5D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,SAAS,CAM/D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,SAAS,CAWhE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAO9D;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAIvE"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export function edges(a, b, c, d) {
|
|
2
|
+
if (b === undefined) {
|
|
3
|
+
return { top: a, right: a, bottom: a, left: a };
|
|
4
|
+
}
|
|
5
|
+
if (c === undefined) {
|
|
6
|
+
return { top: a, right: b, bottom: a, left: b };
|
|
7
|
+
}
|
|
8
|
+
return { top: a, right: b, bottom: c, left: d };
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Add two edge values side by side.
|
|
12
|
+
* @param a - the first edges.
|
|
13
|
+
* @param b - the second edges.
|
|
14
|
+
* @returns edges whose each side is the sum of the corresponding sides of `a` and `b`.
|
|
15
|
+
*/
|
|
16
|
+
export function addEdges(a, b) {
|
|
17
|
+
return {
|
|
18
|
+
top: a.top + b.top,
|
|
19
|
+
right: a.right + b.right,
|
|
20
|
+
bottom: a.bottom + b.bottom,
|
|
21
|
+
left: a.left + b.left,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Zero edges constant */
|
|
25
|
+
export const ZERO_EDGES = { top: 0, right: 0, bottom: 0, left: 0 };
|
|
26
|
+
/**
|
|
27
|
+
* Convert partial edges to full edges with defaults.
|
|
28
|
+
* @param partial - edges with optional sides; omitted sides default to zero.
|
|
29
|
+
* @returns full edges where every missing side is zero.
|
|
30
|
+
*/
|
|
31
|
+
export function resolveEdges(partial) {
|
|
32
|
+
return {
|
|
33
|
+
top: partial?.top ?? 0,
|
|
34
|
+
right: partial?.right ?? 0,
|
|
35
|
+
bottom: partial?.bottom ?? 0,
|
|
36
|
+
left: partial?.left ?? 0,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Compute the smallest rectangle containing both input rectangles.
|
|
41
|
+
* @param a - the first rectangle.
|
|
42
|
+
* @param b - the second rectangle.
|
|
43
|
+
* @returns the union of `a` and `b`.
|
|
44
|
+
*/
|
|
45
|
+
export function unionRect(a, b) {
|
|
46
|
+
const minX = Math.min(a.x, b.x);
|
|
47
|
+
const minY = Math.min(a.y, b.y);
|
|
48
|
+
const maxX = Math.max(a.x + a.width, b.x + b.width);
|
|
49
|
+
const maxY = Math.max(a.y + a.height, b.y + b.height);
|
|
50
|
+
return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Clamp a rectangle into a size's bounds, keeping it inside the grid.
|
|
54
|
+
* @param rect - the rectangle to clamp.
|
|
55
|
+
* @param size - the bounding grid size.
|
|
56
|
+
* @returns the intersection of `rect` with the grid; empty when they do not overlap.
|
|
57
|
+
*/
|
|
58
|
+
export function clampRect(rect, size) {
|
|
59
|
+
const minX = Math.max(0, rect.x);
|
|
60
|
+
const minY = Math.max(0, rect.y);
|
|
61
|
+
const maxX = Math.min(size.width - 1, rect.x + rect.width - 1);
|
|
62
|
+
const maxY = Math.min(size.height - 1, rect.y + rect.height - 1);
|
|
63
|
+
return {
|
|
64
|
+
x: minX,
|
|
65
|
+
y: minY,
|
|
66
|
+
width: Math.max(0, maxX - minX + 1),
|
|
67
|
+
height: Math.max(0, maxY - minY + 1),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Test whether a point lies inside a size's bounds.
|
|
72
|
+
* @param size - the grid size.
|
|
73
|
+
* @param point - the point to test.
|
|
74
|
+
* @returns true when `point` is inside `size` (edges exclusive).
|
|
75
|
+
*/
|
|
76
|
+
export function withinBounds(size, point) {
|
|
77
|
+
return (point.x >= 0 &&
|
|
78
|
+
point.y >= 0 &&
|
|
79
|
+
point.x < size.width &&
|
|
80
|
+
point.y < size.height);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Clamp a value to an optional range.
|
|
84
|
+
* @param value - the value to clamp.
|
|
85
|
+
* @param min - the lower bound, or undefined for none.
|
|
86
|
+
* @param max - the upper bound, or undefined for none.
|
|
87
|
+
* @returns `value` clamped to [`min`, `max`].
|
|
88
|
+
*/
|
|
89
|
+
export function clamp(value, min, max) {
|
|
90
|
+
if (min !== undefined && value < min)
|
|
91
|
+
return min;
|
|
92
|
+
if (max !== undefined && value > max)
|
|
93
|
+
return max;
|
|
94
|
+
return value;
|
|
95
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/** Edge names accepted by the layout engine's style setters. */
|
|
2
|
+
export declare const LayoutEdge: {
|
|
3
|
+
readonly All: "all";
|
|
4
|
+
readonly Horizontal: "horizontal";
|
|
5
|
+
readonly Vertical: "vertical";
|
|
6
|
+
readonly Left: "left";
|
|
7
|
+
readonly Right: "right";
|
|
8
|
+
readonly Top: "top";
|
|
9
|
+
readonly Bottom: "bottom";
|
|
10
|
+
readonly Start: "start";
|
|
11
|
+
readonly End: "end";
|
|
12
|
+
};
|
|
13
|
+
/** Union of `LayoutEdge` values. */
|
|
14
|
+
export type LayoutEdge = (typeof LayoutEdge)[keyof typeof LayoutEdge];
|
|
15
|
+
/** Gutter axes accepted by the layout engine's gap setter. */
|
|
16
|
+
export declare const LayoutGutter: {
|
|
17
|
+
readonly All: "all";
|
|
18
|
+
readonly Column: "column";
|
|
19
|
+
readonly Row: "row";
|
|
20
|
+
};
|
|
21
|
+
/** Union of `LayoutGutter` values. */
|
|
22
|
+
export type LayoutGutter = (typeof LayoutGutter)[keyof typeof LayoutGutter];
|
|
23
|
+
/** Display modes: flex lays out children, none hides the node. */
|
|
24
|
+
export declare const LayoutDisplay: {
|
|
25
|
+
readonly Flex: "flex";
|
|
26
|
+
readonly None: "none";
|
|
27
|
+
};
|
|
28
|
+
/** Union of `LayoutDisplay` values. */
|
|
29
|
+
export type LayoutDisplay = (typeof LayoutDisplay)[keyof typeof LayoutDisplay];
|
|
30
|
+
/** Main-axis directions for flex layout. */
|
|
31
|
+
export declare const LayoutFlexDirection: {
|
|
32
|
+
readonly Row: "row";
|
|
33
|
+
readonly RowReverse: "row-reverse";
|
|
34
|
+
readonly Column: "column";
|
|
35
|
+
readonly ColumnReverse: "column-reverse";
|
|
36
|
+
};
|
|
37
|
+
/** Union of `LayoutFlexDirection` values. */
|
|
38
|
+
export type LayoutFlexDirection = (typeof LayoutFlexDirection)[keyof typeof LayoutFlexDirection];
|
|
39
|
+
/** Cross-axis alignment values for flex items. */
|
|
40
|
+
export declare const LayoutAlign: {
|
|
41
|
+
readonly Auto: "auto";
|
|
42
|
+
readonly Stretch: "stretch";
|
|
43
|
+
readonly FlexStart: "flex-start";
|
|
44
|
+
readonly Center: "center";
|
|
45
|
+
readonly FlexEnd: "flex-end";
|
|
46
|
+
};
|
|
47
|
+
/** Union of `LayoutAlign` values. */
|
|
48
|
+
export type LayoutAlign = (typeof LayoutAlign)[keyof typeof LayoutAlign];
|
|
49
|
+
/** Main-axis distribution values for flex containers. */
|
|
50
|
+
export declare const LayoutJustify: {
|
|
51
|
+
readonly FlexStart: "flex-start";
|
|
52
|
+
readonly Center: "center";
|
|
53
|
+
readonly FlexEnd: "flex-end";
|
|
54
|
+
readonly SpaceBetween: "space-between";
|
|
55
|
+
readonly SpaceAround: "space-around";
|
|
56
|
+
readonly SpaceEvenly: "space-evenly";
|
|
57
|
+
};
|
|
58
|
+
/** Union of `LayoutJustify` values. */
|
|
59
|
+
export type LayoutJustify = (typeof LayoutJustify)[keyof typeof LayoutJustify];
|
|
60
|
+
/** Wrapping modes for flex lines. */
|
|
61
|
+
export declare const LayoutWrap: {
|
|
62
|
+
readonly NoWrap: "nowrap";
|
|
63
|
+
readonly Wrap: "wrap";
|
|
64
|
+
readonly WrapReverse: "wrap-reverse";
|
|
65
|
+
};
|
|
66
|
+
/** Union of `LayoutWrap` values. */
|
|
67
|
+
export type LayoutWrap = (typeof LayoutWrap)[keyof typeof LayoutWrap];
|
|
68
|
+
/** Positioning modes: relative keeps the node in flow, absolute takes it out. */
|
|
69
|
+
export declare const LayoutPositionType: {
|
|
70
|
+
readonly Relative: "relative";
|
|
71
|
+
readonly Absolute: "absolute";
|
|
72
|
+
};
|
|
73
|
+
/** Union of `LayoutPositionType` values. */
|
|
74
|
+
export type LayoutPositionType = (typeof LayoutPositionType)[keyof typeof LayoutPositionType];
|
|
75
|
+
/** Overflow modes: visible lets children expand the node, hidden and scroll constrain it. */
|
|
76
|
+
export declare const LayoutOverflow: {
|
|
77
|
+
readonly Visible: "visible";
|
|
78
|
+
readonly Hidden: "hidden";
|
|
79
|
+
readonly Scroll: "scroll";
|
|
80
|
+
};
|
|
81
|
+
/** Union of `LayoutOverflow` values. */
|
|
82
|
+
export type LayoutOverflow = (typeof LayoutOverflow)[keyof typeof LayoutOverflow];
|
|
83
|
+
/** Measures a leaf node's content size given a width and its measure mode. */
|
|
84
|
+
export type LayoutMeasureFunc = (width: number, widthMode: LayoutMeasureMode) => {
|
|
85
|
+
width: number;
|
|
86
|
+
height: number;
|
|
87
|
+
};
|
|
88
|
+
/** Width constraints passed to a measure function. */
|
|
89
|
+
export declare const LayoutMeasureMode: {
|
|
90
|
+
readonly Undefined: "undefined";
|
|
91
|
+
readonly Exactly: "exactly";
|
|
92
|
+
readonly AtMost: "at-most";
|
|
93
|
+
};
|
|
94
|
+
/** Union of `LayoutMeasureMode` values. */
|
|
95
|
+
export type LayoutMeasureMode = (typeof LayoutMeasureMode)[keyof typeof LayoutMeasureMode];
|
|
96
|
+
/**
|
|
97
|
+
* Adapter interface for the layout engine (Yoga): tree manipulation, layout
|
|
98
|
+
* computation, computed-geometry reads, style setters, and lifecycle.
|
|
99
|
+
*/
|
|
100
|
+
export type LayoutNode = {
|
|
101
|
+
insertChild(child: LayoutNode, index: number): void;
|
|
102
|
+
removeChild(child: LayoutNode): void;
|
|
103
|
+
getChildCount(): number;
|
|
104
|
+
getParent(): LayoutNode | null;
|
|
105
|
+
calculateLayout(width?: number, height?: number): void;
|
|
106
|
+
setMeasureFunc(fn: LayoutMeasureFunc): void;
|
|
107
|
+
unsetMeasureFunc(): void;
|
|
108
|
+
markDirty(): void;
|
|
109
|
+
getComputedLeft(): number;
|
|
110
|
+
getComputedTop(): number;
|
|
111
|
+
getComputedWidth(): number;
|
|
112
|
+
getComputedHeight(): number;
|
|
113
|
+
getComputedBorder(edge: LayoutEdge): number;
|
|
114
|
+
getComputedPadding(edge: LayoutEdge): number;
|
|
115
|
+
setWidth(value: number): void;
|
|
116
|
+
setWidthPercent(value: number): void;
|
|
117
|
+
setWidthAuto(): void;
|
|
118
|
+
setHeight(value: number): void;
|
|
119
|
+
setHeightPercent(value: number): void;
|
|
120
|
+
setHeightAuto(): void;
|
|
121
|
+
setMinWidth(value: number): void;
|
|
122
|
+
setMinWidthPercent(value: number): void;
|
|
123
|
+
setMinHeight(value: number): void;
|
|
124
|
+
setMinHeightPercent(value: number): void;
|
|
125
|
+
setMaxWidth(value: number): void;
|
|
126
|
+
setMaxWidthPercent(value: number): void;
|
|
127
|
+
setMaxHeight(value: number): void;
|
|
128
|
+
setMaxHeightPercent(value: number): void;
|
|
129
|
+
setFlexDirection(dir: LayoutFlexDirection): void;
|
|
130
|
+
setFlexGrow(value: number): void;
|
|
131
|
+
setFlexShrink(value: number): void;
|
|
132
|
+
setFlexBasis(value: number): void;
|
|
133
|
+
setFlexBasisPercent(value: number): void;
|
|
134
|
+
setFlexWrap(wrap: LayoutWrap): void;
|
|
135
|
+
setAlignItems(align: LayoutAlign): void;
|
|
136
|
+
setAlignSelf(align: LayoutAlign): void;
|
|
137
|
+
setJustifyContent(justify: LayoutJustify): void;
|
|
138
|
+
setDisplay(display: LayoutDisplay): void;
|
|
139
|
+
getDisplay(): LayoutDisplay;
|
|
140
|
+
setPositionType(type: LayoutPositionType): void;
|
|
141
|
+
setPosition(edge: LayoutEdge, value: number): void;
|
|
142
|
+
setPositionPercent(edge: LayoutEdge, value: number): void;
|
|
143
|
+
setOverflow(overflow: LayoutOverflow): void;
|
|
144
|
+
setMargin(edge: LayoutEdge, value: number): void;
|
|
145
|
+
setPadding(edge: LayoutEdge, value: number): void;
|
|
146
|
+
setBorder(edge: LayoutEdge, value: number): void;
|
|
147
|
+
setGap(gutter: LayoutGutter, value: number): void;
|
|
148
|
+
free(): void;
|
|
149
|
+
freeRecursive(): void;
|
|
150
|
+
};
|
|
151
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../src/ink/layout/node.ts"],"names":[],"mappings":"AAGA,gEAAgE;AAChE,eAAO,MAAM,UAAU;;;;;;;;;;CAUb,CAAA;AACV,oCAAoC;AACpC,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAA;AAErE,8DAA8D;AAC9D,eAAO,MAAM,YAAY;;;;CAIf,CAAA;AACV,sCAAsC;AACtC,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAA;AAE3E,kEAAkE;AAClE,eAAO,MAAM,aAAa;;;CAGhB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C,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAA;IAC3C,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAChD,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACjD,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAChD,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAGjD,IAAI,IAAI,IAAI,CAAA;IACZ,aAAa,IAAI,IAAI,CAAA;CACtB,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// --
|
|
2
|
+
// Adapter interface for the layout engine (Yoga)
|
|
3
|
+
/** Edge names accepted by the layout engine's style setters. */
|
|
4
|
+
export const LayoutEdge = {
|
|
5
|
+
All: 'all',
|
|
6
|
+
Horizontal: 'horizontal',
|
|
7
|
+
Vertical: 'vertical',
|
|
8
|
+
Left: 'left',
|
|
9
|
+
Right: 'right',
|
|
10
|
+
Top: 'top',
|
|
11
|
+
Bottom: 'bottom',
|
|
12
|
+
Start: 'start',
|
|
13
|
+
End: 'end',
|
|
14
|
+
};
|
|
15
|
+
/** Gutter axes accepted by the layout engine's gap setter. */
|
|
16
|
+
export const LayoutGutter = {
|
|
17
|
+
All: 'all',
|
|
18
|
+
Column: 'column',
|
|
19
|
+
Row: 'row',
|
|
20
|
+
};
|
|
21
|
+
/** Display modes: flex lays out children, none hides the node. */
|
|
22
|
+
export const LayoutDisplay = {
|
|
23
|
+
Flex: 'flex',
|
|
24
|
+
None: 'none',
|
|
25
|
+
};
|
|
26
|
+
/** Main-axis directions for flex layout. */
|
|
27
|
+
export const LayoutFlexDirection = {
|
|
28
|
+
Row: 'row',
|
|
29
|
+
RowReverse: 'row-reverse',
|
|
30
|
+
Column: 'column',
|
|
31
|
+
ColumnReverse: 'column-reverse',
|
|
32
|
+
};
|
|
33
|
+
/** Cross-axis alignment values for flex items. */
|
|
34
|
+
export const LayoutAlign = {
|
|
35
|
+
Auto: 'auto',
|
|
36
|
+
Stretch: 'stretch',
|
|
37
|
+
FlexStart: 'flex-start',
|
|
38
|
+
Center: 'center',
|
|
39
|
+
FlexEnd: 'flex-end',
|
|
40
|
+
};
|
|
41
|
+
/** Main-axis distribution values for flex containers. */
|
|
42
|
+
export const LayoutJustify = {
|
|
43
|
+
FlexStart: 'flex-start',
|
|
44
|
+
Center: 'center',
|
|
45
|
+
FlexEnd: 'flex-end',
|
|
46
|
+
SpaceBetween: 'space-between',
|
|
47
|
+
SpaceAround: 'space-around',
|
|
48
|
+
SpaceEvenly: 'space-evenly',
|
|
49
|
+
};
|
|
50
|
+
/** Wrapping modes for flex lines. */
|
|
51
|
+
export const LayoutWrap = {
|
|
52
|
+
NoWrap: 'nowrap',
|
|
53
|
+
Wrap: 'wrap',
|
|
54
|
+
WrapReverse: 'wrap-reverse',
|
|
55
|
+
};
|
|
56
|
+
/** Positioning modes: relative keeps the node in flow, absolute takes it out. */
|
|
57
|
+
export const LayoutPositionType = {
|
|
58
|
+
Relative: 'relative',
|
|
59
|
+
Absolute: 'absolute',
|
|
60
|
+
};
|
|
61
|
+
/** Overflow modes: visible lets children expand the node, hidden and scroll constrain it. */
|
|
62
|
+
export const LayoutOverflow = {
|
|
63
|
+
Visible: 'visible',
|
|
64
|
+
Hidden: 'hidden',
|
|
65
|
+
Scroll: 'scroll',
|
|
66
|
+
};
|
|
67
|
+
/** Width constraints passed to a measure function. */
|
|
68
|
+
export const LayoutMeasureMode = {
|
|
69
|
+
Undefined: 'undefined',
|
|
70
|
+
Exactly: 'exactly',
|
|
71
|
+
AtMost: 'at-most',
|
|
72
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type Node as YogaNode } from '../../native-ts/yoga-layout/index.js';
|
|
2
|
+
import { type LayoutAlign, LayoutDisplay, type LayoutEdge, type LayoutFlexDirection, type LayoutGutter, type LayoutJustify, type LayoutMeasureFunc, type LayoutNode, type LayoutOverflow, type LayoutPositionType, type LayoutWrap } from './node.js';
|
|
3
|
+
/**
|
|
4
|
+
* Yoga-backed implementation of `LayoutNode`.
|
|
5
|
+
*
|
|
6
|
+
* Wraps a yoga-layout node, mapping layout enums to their Yoga counterparts
|
|
7
|
+
* and translating measure-mode values across the adapter boundary. The
|
|
8
|
+
* underlying Yoga instance is synchronous and available at import time.
|
|
9
|
+
*/
|
|
10
|
+
export declare class YogaLayoutNode implements LayoutNode {
|
|
11
|
+
/** The underlying Yoga node this adapter wraps. */
|
|
12
|
+
readonly yoga: YogaNode;
|
|
13
|
+
constructor(yoga: YogaNode);
|
|
14
|
+
insertChild(child: LayoutNode, index: number): void;
|
|
15
|
+
removeChild(child: LayoutNode): void;
|
|
16
|
+
getChildCount(): number;
|
|
17
|
+
getParent(): LayoutNode | null;
|
|
18
|
+
calculateLayout(width?: number, _height?: number): void;
|
|
19
|
+
setMeasureFunc(fn: LayoutMeasureFunc): void;
|
|
20
|
+
unsetMeasureFunc(): void;
|
|
21
|
+
markDirty(): void;
|
|
22
|
+
getComputedLeft(): number;
|
|
23
|
+
getComputedTop(): number;
|
|
24
|
+
getComputedWidth(): number;
|
|
25
|
+
getComputedHeight(): number;
|
|
26
|
+
getComputedBorder(edge: LayoutEdge): number;
|
|
27
|
+
getComputedPadding(edge: LayoutEdge): number;
|
|
28
|
+
setWidth(value: number): void;
|
|
29
|
+
setWidthPercent(value: number): void;
|
|
30
|
+
setWidthAuto(): void;
|
|
31
|
+
setHeight(value: number): void;
|
|
32
|
+
setHeightPercent(value: number): void;
|
|
33
|
+
setHeightAuto(): void;
|
|
34
|
+
setMinWidth(value: number): void;
|
|
35
|
+
setMinWidthPercent(value: number): void;
|
|
36
|
+
setMinHeight(value: number): void;
|
|
37
|
+
setMinHeightPercent(value: number): void;
|
|
38
|
+
setMaxWidth(value: number): void;
|
|
39
|
+
setMaxWidthPercent(value: number): void;
|
|
40
|
+
setMaxHeight(value: number): void;
|
|
41
|
+
setMaxHeightPercent(value: number): void;
|
|
42
|
+
setFlexDirection(dir: LayoutFlexDirection): void;
|
|
43
|
+
setFlexGrow(value: number): void;
|
|
44
|
+
setFlexShrink(value: number): void;
|
|
45
|
+
setFlexBasis(value: number): void;
|
|
46
|
+
setFlexBasisPercent(value: number): void;
|
|
47
|
+
setFlexWrap(wrap: LayoutWrap): void;
|
|
48
|
+
setAlignItems(align: LayoutAlign): void;
|
|
49
|
+
setAlignSelf(align: LayoutAlign): void;
|
|
50
|
+
setJustifyContent(justify: LayoutJustify): void;
|
|
51
|
+
setDisplay(display: LayoutDisplay): void;
|
|
52
|
+
getDisplay(): LayoutDisplay;
|
|
53
|
+
setPositionType(type: LayoutPositionType): void;
|
|
54
|
+
setPosition(edge: LayoutEdge, value: number): void;
|
|
55
|
+
setPositionPercent(edge: LayoutEdge, value: number): void;
|
|
56
|
+
setOverflow(overflow: LayoutOverflow): void;
|
|
57
|
+
setMargin(edge: LayoutEdge, value: number): void;
|
|
58
|
+
setPadding(edge: LayoutEdge, value: number): void;
|
|
59
|
+
setBorder(edge: LayoutEdge, value: number): void;
|
|
60
|
+
setGap(gutter: LayoutGutter, value: number): void;
|
|
61
|
+
free(): void;
|
|
62
|
+
freeRecursive(): void;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Create a new layout node backed by a fresh Yoga node.
|
|
66
|
+
* @returns a `YogaLayoutNode` with no children, styles, or measure function.
|
|
67
|
+
*/
|
|
68
|
+
export declare function createYogaLayoutNode(): LayoutNode;
|
|
69
|
+
//# sourceMappingURL=yoga.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yoga.d.ts","sourceRoot":"","sources":["../../../../src/ink/layout/yoga.ts"],"names":[],"mappings":"AAAA,OAAa,EAYX,KAAK,IAAI,IAAI,QAAQ,EACtB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EACL,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