UNPKG

@mori2003/jsimgui

Version:

JavaScript bindings for Dear ImGui.

1,463 lines 270 kB
export declare const Mod: { export: any; init(enableFreeType: boolean, extensions: boolean, loaderPath?: string): Promise<void>; }; /** * Base class for value structs (passed by value, no native pointer). */ export declare class ValueStruct { } /** * Base class for reference structs (carry native pointer/reference). * These structs manage native memory and require explicit cleanup. */ export declare class ReferenceStruct { /** * The native pointer to the struct. */ ptr: any; /** * Construct a new JavaScript class instance and allocate native memory. */ static New(): any; /** * Create a JavaScript class instance from a native pointer. */ static From(ptr: any): any; /** * Free the struct's native allocated memory. */ Drop(): void; } /** * Default: 16-bit (for maximum compatibility with renderer backends) */ export type ImDrawIdx = number; /** * A unique ID used by widgets (typically the result of hashing a stack of string) */ export type ImGuiID = number; /** * 8-bit signed integer */ export type ImS8 = number; /** * 8-bit unsigned integer */ export type ImU8 = number; /** * 16-bit signed integer */ export type ImS16 = number; /** * 16-bit unsigned integer */ export type ImU16 = number; /** * 32-bit signed integer == int */ export type ImS32 = number; /** * 32-bit unsigned integer (often used to store packed colors) */ export type ImU32 = number; /** * 64-bit signed integer */ export type ImS64 = bigint; /** * 64-bit unsigned integer */ export type ImU64 = bigint; /** * -> enum ImGuiDir // Enum: A cardinal direction (Left, Right, Up, Down) */ export type ImGuiDir = number; /** * -> enum ImGuiKey // Enum: A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value) */ export type ImGuiKey = number; /** * -> enum ImGuiMouseSource // Enum; A mouse input source identifier (Mouse, TouchScreen, Pen) */ export type ImGuiMouseSource = number; /** * -> enum ImGuiSortDirection // Enum: A sorting direction (ascending or descending) */ export type ImGuiSortDirection = ImU8; /** * -> enum ImGuiCol_ // Enum: A color identifier for styling */ export type ImGuiCol = number; /** * -> enum ImGuiCond_ // Enum: A condition for many Set*() functions */ export type ImGuiCond = number; /** * -> enum ImGuiDataType_ // Enum: A primary data type */ export type ImGuiDataType = number; /** * -> enum ImGuiMouseButton_ // Enum: A mouse button identifier (0=left, 1=right, 2=middle) */ export type ImGuiMouseButton = number; /** * -> enum ImGuiMouseCursor_ // Enum: A mouse cursor shape */ export type ImGuiMouseCursor = number; /** * -> enum ImGuiStyleVar_ // Enum: A variable identifier for styling */ export type ImGuiStyleVar = number; /** * -> enum ImGuiTableBgTarget_ // Enum: A color target for TableSetBgColor() */ export type ImGuiTableBgTarget = number; /** * -> enum ImDrawFlags_ // Flags: for ImDrawList functions */ export type ImDrawFlags = number; /** * -> enum ImDrawListFlags_ // Flags: for ImDrawList instance */ export type ImDrawListFlags = number; /** * -> enum ImDrawTextFlags_ // Internal, do not use! */ export type ImDrawTextFlags = number; /** * -> enum ImFontFlags_ // Flags: for ImFont */ export type ImFontFlags = number; /** * -> enum ImFontAtlasFlags_ // Flags: for ImFontAtlas */ export type ImFontAtlasFlags = number; /** * -> enum ImGuiBackendFlags_ // Flags: for io.BackendFlags */ export type ImGuiBackendFlags = number; /** * -> enum ImGuiButtonFlags_ // Flags: for InvisibleButton() */ export type ImGuiButtonFlags = number; /** * -> enum ImGuiChildFlags_ // Flags: for BeginChild() */ export type ImGuiChildFlags = number; /** * -> enum ImGuiColorEditFlags_ // Flags: for ColorEdit4(), ColorPicker4() etc. */ export type ImGuiColorEditFlags = number; /** * -> enum ImGuiConfigFlags_ // Flags: for io.ConfigFlags */ export type ImGuiConfigFlags = number; /** * -> enum ImGuiComboFlags_ // Flags: for BeginCombo() */ export type ImGuiComboFlags = number; /** * -> enum ImGuiDockNodeFlags_ // Flags: for DockSpace() */ export type ImGuiDockNodeFlags = number; /** * -> enum ImGuiDragDropFlags_ // Flags: for BeginDragDropSource(), AcceptDragDropPayload() */ export type ImGuiDragDropFlags = number; /** * -> enum ImGuiFocusedFlags_ // Flags: for IsWindowFocused() */ export type ImGuiFocusedFlags = number; /** * -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc. */ export type ImGuiHoveredFlags = number; /** * -> enum ImGuiInputFlags_ // Flags: for Shortcut(), SetNextItemShortcut() */ export type ImGuiInputFlags = number; /** * -> enum ImGuiInputTextFlags_ // Flags: for InputText(), InputTextMultiline() */ export type ImGuiInputTextFlags = number; /** * -> enum ImGuiItemFlags_ // Flags: for PushItemFlag(), shared by all items */ export type ImGuiItemFlags = number; /** * -> ImGuiKey | ImGuiMod_XXX // Flags: for IsKeyChordPressed(), Shortcut() etc. an ImGuiKey optionally OR-ed with one or more ImGuiMod_XXX values. */ export type ImGuiKeyChord = number; /** * -> enum ImGuiListClipperFlags_// Flags: for ImGuiListClipper */ export type ImGuiListClipperFlags = number; /** * -> enum ImGuiPopupFlags_ // Flags: for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() */ export type ImGuiPopupFlags = number; /** * -> enum ImGuiMultiSelectFlags_// Flags: for BeginMultiSelect() */ export type ImGuiMultiSelectFlags = number; /** * -> enum ImGuiSelectableFlags_ // Flags: for Selectable() */ export type ImGuiSelectableFlags = number; /** * -> enum ImGuiSliderFlags_ // Flags: for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc. */ export type ImGuiSliderFlags = number; /** * -> enum ImGuiTabBarFlags_ // Flags: for BeginTabBar() */ export type ImGuiTabBarFlags = number; /** * -> enum ImGuiTabItemFlags_ // Flags: for BeginTabItem() */ export type ImGuiTabItemFlags = number; /** * -> enum ImGuiTableFlags_ // Flags: For BeginTable() */ export type ImGuiTableFlags = number; /** * -> enum ImGuiTableColumnFlags_// Flags: For TableSetupColumn() */ export type ImGuiTableColumnFlags = number; /** * -> enum ImGuiTableRowFlags_ // Flags: For TableNextRow() */ export type ImGuiTableRowFlags = number; /** * -> enum ImGuiTreeNodeFlags_ // Flags: for TreeNode(), TreeNodeEx(), CollapsingHeader() */ export type ImGuiTreeNodeFlags = number; /** * -> enum ImGuiViewportFlags_ // Flags: for ImGuiViewport */ export type ImGuiViewportFlags = number; /** * -> enum ImGuiWindowFlags_ // Flags: for Begin(), BeginChild() */ export type ImGuiWindowFlags = number; /** * A single decoded U32 character/code point. We encode them as multi bytes UTF-8 when used in strings. */ export type ImWchar32 = number; /** * A single decoded U16 character/code point. We encode them as multi bytes UTF-8 when used in strings. */ export type ImWchar16 = number; /** * Multi-Selection item index or identifier when using BeginMultiSelect() * - Used by SetNextItemSelectionUserData() + and inside ImGuiMultiSelectIO structure. * - Most users are likely to use this store an item INDEX but this may be used to store a POINTER/ID as well. Read comments near ImGuiMultiSelectIO for details. */ export type ImGuiSelectionUserData = ImS64; export type ImGuiInputTextCallback = (data: ImGuiInputTextCallbackData) => number; export type ImGuiSizeCallback = (data: ImGuiSizeCallbackData) => void; /** * Default: store up to 64-bits (any pointer or integer). A majority of backends are ok with that. */ export type ImTextureID = ImU64; export type ImDrawCallback = (parent_list: ImDrawList, cmd: ImDrawCmd) => void; /** * An opaque identifier to a rectangle in the atlas. -1 when invalid. * The rectangle may move and UV may be invalidated, use GetCustomRect() to retrieve it. */ export type ImFontAtlasRectId = number; export type ImWchar = number; /** * Flags for ImGui::Begin() * (Those are per-window flags. There are shared flags in ImGuiIO: io.ConfigWindowsResizeFromEdges and io.ConfigWindowsMoveFromTitleBarOnly) */ export declare const ImGuiWindowFlags: { readonly None: 0; /** * Disable title-bar */ readonly NoTitleBar: 1; /** * Disable user resizing with the lower-right grip */ readonly NoResize: 2; /** * Disable user moving the window */ readonly NoMove: 4; /** * Disable scrollbars (window can still scroll with mouse or programmatically) */ readonly NoScrollbar: 8; /** * Disable user vertically scrolling with mouse wheel. On child window, mouse wheel will be forwarded to the parent unless NoScrollbar is also set. */ readonly NoScrollWithMouse: 16; /** * Disable user collapsing window by double-clicking on it. Also referred to as Window Menu Button (e.g. within a docking node). */ readonly NoCollapse: 32; /** * Resize every window to its content every frame */ readonly AlwaysAutoResize: 64; /** * Disable drawing background color (WindowBg, etc.) and outside border. Similar as using SetNextWindowBgAlpha(0.0f). */ readonly NoBackground: 128; /** * Never load/save settings in .ini file */ readonly NoSavedSettings: 256; /** * Disable catching mouse, hovering test with pass through. */ readonly NoMouseInputs: 512; /** * Has a menu-bar */ readonly MenuBar: 1024; /** * Allow horizontal scrollbar to appear (off by default). You may use SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo in the "Horizontal Scrolling" section. */ readonly HorizontalScrollbar: 2048; /** * Disable taking focus when transitioning from hidden to visible state */ readonly NoFocusOnAppearing: 4096; /** * Disable bringing window to front when taking focus (e.g. clicking on it or programmatically giving it focus) */ readonly NoBringToFrontOnFocus: 8192; /** * Always show vertical scrollbar (even if ContentSize.y < Size.y) */ readonly AlwaysVerticalScrollbar: 16384; /** * Always show horizontal scrollbar (even if ContentSize.x < Size.x) */ readonly AlwaysHorizontalScrollbar: 32768; /** * No keyboard/gamepad navigation within the window */ readonly NoNavInputs: 65536; /** * No focusing toward this window with keyboard/gamepad navigation (e.g. skipped by Ctrl+Tab) */ readonly NoNavFocus: 131072; /** * Display a dot next to the title. When used in a tab/docking context, tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar. */ readonly UnsavedDocument: 262144; /** * Disable docking of this window */ readonly NoDocking: 524288; readonly NoNav: 196608; readonly NoDecoration: 43; readonly NoInputs: 197120; }; /** * Flags for ImGui::BeginChild() * (Legacy: bit 0 must always correspond to ImGuiChildFlags_Borders to be backward compatible with old API using 'bool border = false'.) * About using AutoResizeX/AutoResizeY flags: * - May be combined with SetNextWindowSizeConstraints() to set a min/max size for each axis (see "Demo->Child->Auto-resize with Constraints"). * - Size measurement for a given axis is only performed when the child window is within visible boundaries, or is just appearing. * - This allows BeginChild() to return false when not within boundaries (e.g. when scrolling), which is more optimal. BUT it won't update its auto-size while clipped. * While not perfect, it is a better default behavior as the always-on performance gain is more valuable than the occasional "resizing after becoming visible again" glitch. * - You may also use ImGuiChildFlags_AlwaysAutoResize to force an update even when child window is not in view. * HOWEVER PLEASE UNDERSTAND THAT DOING SO WILL PREVENT BeginChild() FROM EVER RETURNING FALSE, disabling benefits of coarse clipping. */ export declare const ImGuiChildFlags: { readonly None: 0; /** * Show an outer border and enable WindowPadding. (IMPORTANT: this is always == 1 == true for legacy reason) */ readonly Borders: 1; /** * Pad with style.WindowPadding even if no border are drawn (no padding by default for non-bordered child windows because it makes more sense) */ readonly AlwaysUseWindowPadding: 2; /** * Allow resize from right border (layout direction). Enable .ini saving (unless ImGuiWindowFlags_NoSavedSettings passed to window flags) */ readonly ResizeX: 4; /** * Allow resize from bottom border (layout direction). " */ readonly ResizeY: 8; /** * Enable auto-resizing width. Read "IMPORTANT: Size measurement" details above. */ readonly AutoResizeX: 16; /** * Enable auto-resizing height. Read "IMPORTANT: Size measurement" details above. */ readonly AutoResizeY: 32; /** * Combined with AutoResizeX/AutoResizeY. Always measure size even when child is hidden, always return true, always disable clipping optimization! NOT RECOMMENDED. */ readonly AlwaysAutoResize: 64; /** * Style the child window like a framed item: use FrameBg, FrameRounding, FrameBorderSize, FramePadding instead of ChildBg, ChildRounding, ChildBorderSize, WindowPadding. */ readonly FrameStyle: 128; /** * [BETA] Share focus scope, allow keyboard/gamepad navigation to cross over parent border to this child or between sibling child windows. */ readonly NavFlattened: 256; }; /** * Flags for ImGui::PushItemFlag() * (Those are shared by all submitted items) */ export declare const ImGuiItemFlags: { /** * (Default) */ readonly None: 0; /** * false // Disable keyboard tabbing. This is a "lighter" version of ImGuiItemFlags_NoNav. */ readonly NoTabStop: 1; /** * false // Disable any form of focusing (keyboard/gamepad directional navigation and SetKeyboardFocusHere() calls). */ readonly NoNav: 2; /** * false // Disable item being a candidate for default focus (e.g. used by title bar items). */ readonly NoNavDefaultFocus: 4; /** * false // Any button-like behavior will have repeat mode enabled (based on io.KeyRepeatDelay and io.KeyRepeatRate values). Note that you can also call IsItemActive() after any button to tell if it is being held. */ readonly ButtonRepeat: 8; /** * true // MenuItem()/Selectable() automatically close their parent popup window. */ readonly AutoClosePopups: 16; /** * false // Allow submitting an item with the same identifier as an item already submitted this frame without triggering a warning tooltip if io.ConfigDebugHighlightIdConflicts is set. */ readonly AllowDuplicateId: 32; /** * false // [Internal] Disable interactions. DOES NOT affect visuals. This is used by BeginDisabled()/EndDisabled() and only provided here so you can read back via GetItemFlags(). */ readonly Disabled: 64; }; /** * Flags for ImGui::InputText() * (Those are per-item flags. There are shared flags in ImGuiIO: io.ConfigInputTextCursorBlink and io.ConfigInputTextEnterKeepActive) */ export declare const ImGuiInputTextFlags: { /** * Basic filters (also see ImGuiInputTextFlags_CallbackCharFilter) */ readonly None: 0; /** * Allow 0123456789.+-* / */ readonly CharsDecimal: 1; /** * Allow 0123456789ABCDEFabcdef */ readonly CharsHexadecimal: 2; /** * Allow 0123456789.+-* /eE (Scientific notation input) */ readonly CharsScientific: 4; /** * Turn a..z into A..Z */ readonly CharsUppercase: 8; /** * Filter out spaces, tabs */ readonly CharsNoBlank: 16; /** * Pressing TAB input a '\t' character into the text field */ readonly AllowTabInput: 32; /** * Return 'true' when Enter is pressed (as opposed to every time the value was modified). Consider using IsItemDeactivatedAfterEdit() instead! */ readonly EnterReturnsTrue: 64; /** * Escape key clears content if not empty, and deactivate otherwise (contrast to default behavior of Escape to revert) */ readonly EscapeClearsAll: 128; /** * In multi-line mode: validate with Enter, add new line with Ctrl+Enter (default is opposite: validate with Ctrl+Enter, add line with Enter). Note that Shift+Enter always enter a new line either way. */ readonly CtrlEnterForNewLine: 256; /** * Read-only mode */ readonly ReadOnly: 512; /** * Password mode, display all characters as '*', disable copy */ readonly Password: 1024; /** * Overwrite mode */ readonly AlwaysOverwrite: 2048; /** * Select entire text when first taking mouse focus */ readonly AutoSelectAll: 4096; /** * InputFloat(), InputInt(), InputScalar() etc. only: parse empty string as zero value. */ readonly ParseEmptyRefVal: 8192; /** * InputFloat(), InputInt(), InputScalar() etc. only: when value is zero, do not display it. Generally used with ImGuiInputTextFlags_ParseEmptyRefVal. */ readonly DisplayEmptyRefVal: 16384; /** * Disable following the cursor horizontally */ readonly NoHorizontalScroll: 32768; /** * Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID(). */ readonly NoUndoRedo: 65536; /** * When text doesn't fit, elide left side to ensure right side stays visible. Useful for path/filenames. Single-line only! */ readonly ElideLeft: 131072; /** * Callback on pressing TAB (for completion handling) */ readonly CallbackCompletion: 262144; /** * Callback on pressing Up/Down arrows (for history handling) */ readonly CallbackHistory: 524288; /** * Callback on each iteration. User code may query cursor position, modify text buffer. */ readonly CallbackAlways: 1048576; /** * Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard. */ readonly CallbackCharFilter: 2097152; /** * Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this) */ readonly CallbackResize: 4194304; /** * Callback on any edit. Note that InputText() already returns true on edit + you can always use IsItemEdited(). The callback is useful to manipulate the underlying buffer while focus is active. */ readonly CallbackEdit: 8388608; /** * InputTextMultiline(): word-wrap lines that are too long. */ readonly WordWrap: 16777216; }; /** * Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*() */ export declare const ImGuiTreeNodeFlags: { readonly None: 0; /** * Draw as selected */ readonly Selected: 1; /** * Draw frame with background (e.g. for CollapsingHeader) */ readonly Framed: 2; /** * Hit testing will allow subsequent widgets to overlap this one. Require previous frame HoveredId to match before being usable. Shortcut to calling SetNextItemAllowOverlap(). */ readonly AllowOverlap: 4; /** * Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack */ readonly NoTreePushOnOpen: 8; /** * Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes) */ readonly NoAutoOpenOnLog: 16; /** * Default node to be open */ readonly DefaultOpen: 32; /** * Open on double-click instead of simple click (default for multi-select unless any _OpenOnXXX behavior is set explicitly). Both behaviors may be combined. */ readonly OpenOnDoubleClick: 64; /** * Open when clicking on the arrow part (default for multi-select unless any _OpenOnXXX behavior is set explicitly). Both behaviors may be combined. */ readonly OpenOnArrow: 128; /** * No collapsing, no arrow (use as a convenience for leaf nodes). Note: will always open a tree/id scope and return true. If you never use that scope, add ImGuiTreeNodeFlags_NoTreePushOnOpen. */ readonly Leaf: 256; /** * Display a bullet instead of arrow. IMPORTANT: node can still be marked open/close if you don't set the _Leaf flag! */ readonly Bullet: 512; /** * Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding() before the node. */ readonly FramePadding: 1024; /** * Extend hit box to the right-most edge, even if not framed. This is not the default in order to allow adding other items on the same line without using AllowOverlap mode. */ readonly SpanAvailWidth: 2048; /** * Extend hit box to the left-most and right-most edges (cover the indent area). */ readonly SpanFullWidth: 4096; /** * Narrow hit box + narrow hovering highlight, will only cover the label text. */ readonly SpanLabelWidth: 8192; /** * Frame will span all columns of its container table (label will still fit in current column) */ readonly SpanAllColumns: 16384; /** * Label will span all columns of its container table */ readonly LabelSpanAllColumns: 32768; /** * Nav: left arrow moves back to parent. This is processed in TreePop() when there's an unfulfilled Left nav request remaining. */ readonly NavLeftJumpsToParent: 131072; readonly CollapsingHeader: 26; /** * No lines drawn */ readonly DrawLinesNone: 262144; /** * Horizontal lines to child nodes. Vertical line drawn down to TreePop() position: cover full contents. Faster (for large trees). */ readonly DrawLinesFull: 524288; /** * Horizontal lines to child nodes. Vertical line drawn down to bottom-most child node. Slower (for large trees). */ readonly DrawLinesToNodes: 1048576; }; /** * Flags for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() functions. * - IMPORTANT: If you ever used the left mouse button with BeginPopupContextXXX() helpers before 1.92.6: Read "API BREAKING CHANGES" 2026/01/07 (1.92.6) entry in imgui.cpp or GitHub topic #9157. * - Multiple buttons currently cannot be combined/or-ed in those functions (we could allow it later). */ export declare const ImGuiPopupFlags: { readonly None: 0; /** * For BeginPopupContext*(): open on Left Mouse release. Only one button allowed! */ readonly MouseButtonLeft: 4; /** * For BeginPopupContext*(): open on Right Mouse release. Only one button allowed! (default) */ readonly MouseButtonRight: 8; /** * For BeginPopupContext*(): open on Middle Mouse release. Only one button allowed! */ readonly MouseButtonMiddle: 12; /** * For OpenPopup*(), BeginPopupContext*(): don't reopen same popup if already open (won't reposition, won't reinitialize navigation) */ readonly NoReopen: 32; /** * For OpenPopup*(), BeginPopupContext*(): don't open if there's already a popup at the same level of the popup stack */ readonly NoOpenOverExistingPopup: 128; /** * For BeginPopupContextWindow(): don't return true when hovering items, only when hovering empty space */ readonly NoOpenOverItems: 256; /** * For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup. */ readonly AnyPopupId: 1024; /** * For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level) */ readonly AnyPopupLevel: 2048; readonly AnyPopup: 3072; }; /** * Flags for ImGui::Selectable() */ export declare const ImGuiSelectableFlags: { readonly None: 0; /** * Clicking this doesn't close parent popup window (overrides ImGuiItemFlags_AutoClosePopups) */ readonly NoAutoClosePopups: 1; /** * Frame will span all columns of its container table (text will still fit in current column) */ readonly SpanAllColumns: 2; /** * Generate press events on double clicks too */ readonly AllowDoubleClick: 4; /** * Cannot be selected, display grayed out text */ readonly Disabled: 8; /** * Hit testing will allow subsequent widgets to overlap this one. Require previous frame HoveredId to match before being usable. Shortcut to calling SetNextItemAllowOverlap(). */ readonly AllowOverlap: 16; /** * Make the item be displayed as if it is hovered */ readonly Highlight: 32; /** * Auto-select when moved into, unless Ctrl is held. Automatic when in a BeginMultiSelect() block. */ readonly SelectOnNav: 64; }; /** * Flags for ImGui::BeginCombo() */ export declare const ImGuiComboFlags: { readonly None: 0; /** * Align the popup toward the left by default */ readonly PopupAlignLeft: 1; /** * Max ~4 items visible. Tip: If you want your combo popup to be a specific size you can use SetNextWindowSizeConstraints() prior to calling BeginCombo() */ readonly HeightSmall: 2; /** * Max ~8 items visible (default) */ readonly HeightRegular: 4; /** * Max ~20 items visible */ readonly HeightLarge: 8; /** * As many fitting items as possible */ readonly HeightLargest: 16; /** * Display on the preview box without the square arrow button */ readonly NoArrowButton: 32; /** * Display only a square arrow button */ readonly NoPreview: 64; /** * Width dynamically calculated from preview contents */ readonly WidthFitPreview: 128; }; /** * Flags for ImGui::BeginTabBar() */ export declare const ImGuiTabBarFlags: { readonly None: 0; /** * Allow manually dragging tabs to re-order them + New tabs are appended at the end of list */ readonly Reorderable: 1; /** * Automatically select new tabs when they appear */ readonly AutoSelectNewTabs: 2; /** * Disable buttons to open the tab list popup */ readonly TabListPopupButton: 4; /** * Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You may handle this behavior manually on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false. */ readonly NoCloseWithMiddleMouseButton: 8; /** * Disable scrolling buttons (apply when fitting policy is ImGuiTabBarFlags_FittingPolicyScroll) */ readonly NoTabListScrollingButtons: 16; /** * Disable tooltips when hovering a tab */ readonly NoTooltip: 32; /** * Draw selected overline markers over selected tab */ readonly DrawSelectedOverline: 64; /** * Shrink down tabs when they don't fit, until width is style.TabMinWidthShrink, then enable scrolling. Setting TabMinWidthShrink to FLT_MAX makes this behave like ImGuiTabBarFlags_FittingPolicyScroll. */ readonly FittingPolicyMixed: 128; /** * Shrink down tabs when they don't fit */ readonly FittingPolicyShrink: 256; /** * Enable scrolling buttons when tabs don't fit */ readonly FittingPolicyScroll: 512; }; /** * Flags for ImGui::BeginTabItem() */ export declare const ImGuiTabItemFlags: { readonly None: 0; /** * Display a dot next to the title + set ImGuiTabItemFlags_NoAssumedClosure. */ readonly UnsavedDocument: 1; /** * Trigger flag to programmatically make the tab selected when calling BeginTabItem() */ readonly SetSelected: 2; /** * Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You may handle this behavior manually on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false. */ readonly NoCloseWithMiddleMouseButton: 4; /** * Don't call PushID()/PopID() on BeginTabItem()/EndTabItem() */ readonly NoPushId: 8; /** * Disable tooltip for the given tab */ readonly NoTooltip: 16; /** * Disable reordering this tab or having another tab cross over this tab */ readonly NoReorder: 32; /** * Enforce the tab position to the left of the tab bar (after the tab list popup button) */ readonly Leading: 64; /** * Enforce the tab position to the right of the tab bar (before the scrolling buttons) */ readonly Trailing: 128; /** * Tab is selected when trying to close + closure is not immediately assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar. */ readonly NoAssumedClosure: 256; }; /** * Flags for ImGui::IsWindowFocused() */ export declare const ImGuiFocusedFlags: { readonly None: 0; /** * Return true if any children of the window is focused */ readonly ChildWindows: 1; /** * Test from root window (top most parent of the current hierarchy) */ readonly RootWindow: 2; /** * Return true if any window is focused. Important: If you are trying to tell how to dispatch your low-level inputs, do NOT use this. Use 'io.WantCaptureMouse' instead! Please read the FAQ! */ readonly AnyWindow: 4; /** * Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with _ChildWindows or _RootWindow) */ readonly NoPopupHierarchy: 8; /** * Consider docking hierarchy (treat dockspace host as parent of docked window) (when used with _ChildWindows or _RootWindow) */ readonly DockHierarchy: 16; readonly RootAndChildWindows: 3; }; /** * Flags for ImGui::IsItemHovered(), ImGui::IsWindowHovered() * Note: if you are trying to check whether your mouse should be dispatched to Dear ImGui or to your app, you should use 'io.WantCaptureMouse' instead! Please read the FAQ! * Note: windows with the ImGuiWindowFlags_NoInputs flag are ignored by IsWindowHovered() calls. */ export declare const ImGuiHoveredFlags: { /** * Return true if directly over the item/window, not obstructed by another window, not obstructed by an active popup or modal blocking inputs under them. */ readonly None: 0; /** * IsWindowHovered() only: Return true if any children of the window is hovered */ readonly ChildWindows: 1; /** * IsWindowHovered() only: Test from root window (top most parent of the current hierarchy) */ readonly RootWindow: 2; /** * IsWindowHovered() only: Return true if any window is hovered */ readonly AnyWindow: 4; /** * IsWindowHovered() only: Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with _ChildWindows or _RootWindow) */ readonly NoPopupHierarchy: 8; /** * IsWindowHovered() only: Consider docking hierarchy (treat dockspace host as parent of docked window) (when used with _ChildWindows or _RootWindow) */ readonly DockHierarchy: 16; /** * Return true even if a popup window is normally blocking access to this item/window */ readonly AllowWhenBlockedByPopup: 32; /** * Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns. */ readonly AllowWhenBlockedByActiveItem: 128; /** * IsItemHovered() only: Return true even if the item uses AllowOverlap mode and is overlapped by another hoverable item. */ readonly AllowWhenOverlappedByItem: 256; /** * IsItemHovered() only: Return true even if the position is obstructed or overlapped by another window. */ readonly AllowWhenOverlappedByWindow: 512; /** * IsItemHovered() only: Return true even if the item is disabled */ readonly AllowWhenDisabled: 1024; /** * IsItemHovered() only: Disable using keyboard/gamepad navigation state when active, always query mouse */ readonly NoNavOverride: 2048; readonly AllowWhenOverlapped: 768; readonly RectOnly: 928; readonly RootAndChildWindows: 3; /** * Shortcut for standard flags when using IsItemHovered() + SetTooltip() sequence. */ readonly ForTooltip: 4096; /** * Require mouse to be stationary for style.HoverStationaryDelay (~0.15 sec) _at least one time_. After this, can move on same item/window. Using the stationary test tends to reduces the need for a long delay. */ readonly Stationary: 8192; /** * IsItemHovered() only: Return true immediately (default). As this is the default you generally ignore this. */ readonly DelayNone: 16384; /** * IsItemHovered() only: Return true after style.HoverDelayShort elapsed (~0.15 sec) (shared between items) + requires mouse to be stationary for style.HoverStationaryDelay (once per item). */ readonly DelayShort: 32768; /** * IsItemHovered() only: Return true after style.HoverDelayNormal elapsed (~0.40 sec) (shared between items) + requires mouse to be stationary for style.HoverStationaryDelay (once per item). */ readonly DelayNormal: 65536; /** * IsItemHovered() only: Disable shared delay system where moving from one item to the next keeps the previous timer for a short time (standard for tooltips with long delays) */ readonly NoSharedDelay: 131072; }; /** * Flags for ImGui::DockSpace(), shared/inherited by child nodes. * (Some flags can be applied to individual nodes directly) * FIXME-DOCK: Also see ImGuiDockNodeFlagsPrivate_ which may involve using the WIP and internal DockBuilder api. */ export declare const ImGuiDockNodeFlags: { readonly None: 0; /** * // Don't display the dockspace node but keep it alive. Windows docked into this dockspace node won't be undocked. */ readonly KeepAliveOnly: 1; /** * // Disable docking over the Central Node, which will be always kept empty. */ readonly NoDockingOverCentralNode: 4; /** * // Enable passthru dockspace: 1) DockSpace() will render a ImGuiCol_WindowBg background covering everything excepted the Central Node when empty. Meaning the host window should probably use SetNextWindowBgAlpha(0.0f) prior to Begin() when using this. 2) When Central Node is empty: let inputs pass-through + won't display a DockingEmptyBg background. See demo for details. */ readonly PassthruCentralNode: 8; /** * // Disable other windows/nodes from splitting this node. */ readonly NoDockingSplit: 16; /** * Saved // Disable resizing node using the splitter/separators. Useful with programmatically setup dockspaces. */ readonly NoResize: 32; /** * // Tab bar will automatically hide when there is a single window in the dock node. */ readonly AutoHideTabBar: 64; /** * // Disable undocking this node. */ readonly NoUndocking: 128; }; /** * Flags for ImGui::BeginDragDropSource(), ImGui::AcceptDragDropPayload() */ export declare const ImGuiDragDropFlags: { readonly None: 0; /** * Disable preview tooltip. By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disables this behavior. */ readonly SourceNoPreviewTooltip: 1; /** * By default, when dragging we clear data so that IsItemHovered() will return false, to avoid subsequent user code submitting tooltips. This flag disables this behavior so you can still call IsItemHovered() on the source item. */ readonly SourceNoDisableHover: 2; /** * Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item. */ readonly SourceNoHoldToOpenOthers: 4; /** * Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit. */ readonly SourceAllowNullID: 8; /** * External source (from outside of dear imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously. */ readonly SourceExtern: 16; /** * Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged) */ readonly PayloadAutoExpire: 32; /** * Hint to specify that the payload may not be copied outside current dear imgui context. */ readonly PayloadNoCrossContext: 64; /** * Hint to specify that the payload may not be copied outside current process. */ readonly PayloadNoCrossProcess: 128; /** * AcceptDragDropPayload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered. */ readonly AcceptBeforeDelivery: 1024; /** * Do not draw the default highlight rectangle when hovering over target. */ readonly AcceptNoDrawDefaultRect: 2048; /** * Request hiding the BeginDragDropSource tooltip from the BeginDragDropTarget site. */ readonly AcceptNoPreviewTooltip: 4096; /** * Accepting item will render as if hovered. Useful for e.g. a Button() used as a drop target. */ readonly AcceptDrawAsHovered: 8192; /** * For peeking ahead and inspecting the payload before delivery. */ readonly AcceptPeekOnly: 3072; }; /** * A primary data type */ export declare const ImGuiDataType: { /** * signed char / char (with sensible compilers) */ readonly S8: 0; /** * unsigned char */ readonly U8: 1; /** * short */ readonly S16: 2; /** * unsigned short */ readonly U16: 3; /** * int */ readonly S32: 4; /** * unsigned int */ readonly U32: 5; /** * long long / __int64 */ readonly S64: 6; /** * unsigned long long / unsigned __int64 */ readonly U64: 7; /** * float */ readonly Float: 8; /** * double */ readonly Double: 9; /** * bool (provided for user convenience, not supported by scalar widgets) */ readonly Bool: 10; /** * char* (provided for user convenience, not supported by scalar widgets) */ readonly String: 11; readonly COUNT: 12; }; /** * Forward declared enum type ImGuiDir */ export declare const ImGuiDir: { readonly _None: -1; readonly _Left: 0; readonly _Right: 1; readonly _Up: 2; readonly _Down: 3; readonly _COUNT: 4; }; /** * Forward declared enum type ImGuiSortDirection */ export declare const ImGuiSortDirection: { readonly _None: 0; /** * Ascending = 0->9, A->Z etc. */ readonly _Ascending: 1; /** * Descending = 9->0, Z->A etc. */ readonly _Descending: 2; }; /** * Forward declared enum type ImGuiKey */ export declare const ImGuiKey: { /** * Keyboard */ readonly _None: 0; /** * First valid key value (other than 0) */ readonly _NamedKey_BEGIN: 512; /** * == ImGuiKey_NamedKey_BEGIN */ readonly _Tab: 512; readonly _LeftArrow: 513; readonly _RightArrow: 514; readonly _UpArrow: 515; readonly _DownArrow: 516; readonly _PageUp: 517; readonly _PageDown: 518; readonly _Home: 519; readonly _End: 520; readonly _Insert: 521; readonly _Delete: 522; readonly _Backspace: 523; readonly _Space: 524; readonly _Enter: 525; readonly _Escape: 526; readonly _LeftCtrl: 527; readonly _LeftShift: 528; readonly _LeftAlt: 529; /** * Also see ImGuiMod_Ctrl, ImGuiMod_Shift, ImGuiMod_Alt, ImGuiMod_Super below! */ readonly _LeftSuper: 530; readonly _RightCtrl: 531; readonly _RightShift: 532; readonly _RightAlt: 533; readonly _RightSuper: 534; readonly _Menu: 535; readonly _0: 536; readonly _1: 537; readonly _2: 538; readonly _3: 539; readonly _4: 540; readonly _5: 541; readonly _6: 542; readonly _7: 543; readonly _8: 544; readonly _9: 545; readonly _A: 546; readonly _B: 547; readonly _C: 548; readonly _D: 549; readonly _E: 550; readonly _F: 551; readonly _G: 552; readonly _H: 553; readonly _I: 554; readonly _J: 555; readonly _K: 556; readonly _L: 557; readonly _M: 558; readonly _N: 559; readonly _O: 560; readonly _P: 561; readonly _Q: 562; readonly _R: 563; readonly _S: 564; readonly _T: 565; readonly _U: 566; readonly _V: 567; readonly _W: 568; readonly _X: 569; readonly _Y: 570; readonly _Z: 571; readonly _F1: 572; readonly _F2: 573; readonly _F3: 574; readonly _F4: 575; readonly _F5: 576; readonly _F6: 577; readonly _F7: 578; readonly _F8: 579; readonly _F9: 580; readonly _F10: 581; readonly _F11: 582; readonly _F12: 583; readonly _F13: 584; readonly _F14: 585; readonly _F15: 586; readonly _F16: 587; readonly _F17: 588; readonly _F18: 589; readonly _F19: 590; readonly _F20: 591; readonly _F21: 592; readonly _F22: 593; readonly _F23: 594; readonly _F24: 595; /** * ' */ readonly _Apostrophe: 596; /** * , */ readonly _Comma: 597; /** * - */ readonly _Minus: 598; /** * . */ readonly _Period: 599; /** * / */ readonly _Slash: 600; /** * ; */ readonly _Semicolon: 601; /** * = */ readonly _Equal: 602; /** * [ */ readonly _LeftBracket: 603; /** * \ (this text inhibit multiline comment caused by backslash) */ readonly _Backslash: 604; /** * ] */ readonly _RightBracket: 605; /** * ` */ readonly _GraveAccent: 606; readonly _CapsLock: 607; readonly _ScrollLock: 608; readonly _NumLock: 609; readonly _PrintScreen: 610; readonly _Pause: 611; readonly _Keypad0: 612; readonly _Keypad1: 613; readonly _Keypad2: 614; readonly _Keypad3: 615; readonly _Keypad4: 616; readonly _Keypad5: 617; readonly _Keypad6: 618; readonly _Keypad7: 619; readonly _Keypad8: 620; readonly _Keypad9: 621; readonly _KeypadDecimal: 622; readonly _KeypadDivide: 623; readonly _KeypadMultiply: 624; readonly _KeypadSubtract: 625; readonly _KeypadAdd: 626; readonly _KeypadEnter: 627; readonly _KeypadEqual: 628; /** * Available on some keyboard/mouses. Often referred as "Browser Back" */ readonly _AppBack: 629; readonly _AppForward: 630; /** * Non-US backslash. */ readonly _Oem102: 631; /** * Menu | + | Options | */ readonly _GamepadStart: 632; /** * View | - | Share | */ readonly _GamepadBack: 633; /** * X | Y | Square | Toggle Menu. Hold for Windowing mode (Focus/Move/Resize windows) */ readonly _GamepadFaceLeft: 634; /** * B | A | Circle | Cancel / Close / Exit */ readonly _GamepadFaceRight: 635; /** * Y | X | Triangle | Open Context Menu */ readonly _GamepadFaceUp: 636; /** * A | B | Cross | Activate / Open / Toggle. Hold for 0.60f to Activate in Text Input mode (e.g. wired to an on-screen keyboard). */ readonly _GamepadFaceDown: 637; /** * D-pad Left | " | " | Move / Tweak / Resize Window (in Windowing mode) */ readonly _GamepadDpadLeft: 638; /** * D-pad Right | " | " | Move / Tweak / Resize Window (in Windowing mode) */ readonly _GamepadDpadRight: 639; /** * D-pad Up | " | " | Move / Tweak / Resize Window (in Windowing mode) */ readonly _GamepadDpadUp: 640; /** * D-pad Down | " | " | Move / Tweak / Resize Window (in Windowing mode) */ readonly _GamepadDpadDown: 641; /** * L Bumper | L | L1 | Tweak Slower / Focus Previous (in Windowing mode) */ readonly _GamepadL1: 642; /** * R Bumper | R | R1 | Tweak Faster / Focus Next (in Windowing mode) */ readonly _GamepadR1: 643; /** * L Trigger | ZL | L2 | [Analog] */ readonly _GamepadL2: 644; /** * R Trigger | ZR | R2 | [Analog] */ readonly _GamepadR2: 645; /** * L Stick | L3 | L3 | */ readonly _GamepadL3: 646; /** * R Stick | R3 | R3 | */ readonly _GamepadR3: 647; /** * | | | [Analog] Move Window (in Windowing mode) */ readonly _GamepadLStickLeft: 648; /** * | | | [Analog] Move Window (in Windowing mode) */ readonly _GamepadLStickRight: 649; /** * | | | [Analog] Move Window (in Windowing mode) */ readonly _GamepadLStickUp: 650; /** * | | | [Analog] Move Window (in Windowing mode) */ readonly _GamepadLStickDown: 651; /** * | | | [Analog] */ readonly _GamepadRStickLeft: 652; /** * | | | [Analog] */ readonly _GamepadRStickRight: 653; /** * | | | [Analog] */ readonly _GamepadRStickUp: 654; /** * | | | [Analog] */ readonly _GamepadRStickDown: 655; /** * Aliases: Mouse Buttons (auto-submitted from AddMouseButtonEvent() calls) * - This is mirroring the data also written to io.MouseDown[], io.MouseWheel, in a format allowing them to be accessed via standard key API. */ readonly _MouseLeft: 656; readonly _MouseRight: 657; readonly _MouseMiddle: 658; readonly _MouseX1: 659; readonly _MouseX2: 660; readonly _MouseWheelX: 661; readonly _MouseWheelY: 662; /** * Keyboard Modifiers (explicitly submitted by backend via AddKeyEvent() calls) * - Any functions taking a ImGuiKeyChord parameter can binary-or those with regular keys, e.g. Shortcut(ImGuiMod_Ctrl | ImGuiKey_S). * - Those are written back into io.KeyCtrl, io.KeyShift, io.KeyAlt, io.KeySuper for convenience, * but may be accessed via standard key API such as IsKeyPressed(), IsKeyReleased(), querying duration etc. * - Code polling every key (e.g. an interface to detect a key press for input mapping) might want to ignore those * and prefer using the real keys (e.g. ImGuiKey_LeftCtrl, ImGuiKey_RightCtrl instead of ImGuiMod_Ctrl). * - In theory the value of keyboard modifiers should be roughly equivalent to a logical or of the equivalent left/right keys. * In practice: it's complicated; mods are often provided from different sources. Keyboard layout, IME, sticky keys and * backends tend to interfere and break that equivalence. The safer decision is to relay that ambiguity down to the end-user... * - On macOS, we swap Cmd(Super) and Ctrl keys at the time of the io.AddKeyEvent() call. */ readonly ImGuiMod_None: 0; /** * Ctrl (non-macOS), Cmd (macOS) */ readonly ImGuiMod_Ctrl: 4096; /** * Shift */ readonly ImGuiMod_Shift: 8192; /** * Option/Menu */ readonly ImGuiMod_Alt: 16384; /** * Windows/Super (non-macOS), Ctrl (macOS) */ readonly ImGuiMod_Super: 32768; }; /** * Flags for Shortcut(), SetNextItemShortcut(), * (and for upcoming extended versions of IsKeyPressed(), IsMouseClicked(), Shortcut(), SetKeyOwner(), SetItemKeyOwner() that are still in imgui_internal.h) * Don't mistake with ImGuiInputTextFlags! (which is for ImGui::InputText() function) */ export declare const ImGuiInputFlags: { readonly None: 0; /** * Enable repeat. Return true on successive repeats. Default for legacy IsKeyPressed(). NOT Default for legacy IsMouseClicked(). MUST BE == 1. */ readonly Repeat: 1; /** * Route to active item only. */ readonly RouteActive: 1024; /** * Route to windows in the focus stack (DEFAULT). Deep-most focused window takes inputs. Active item takes inputs over deep-most focused window. */ readonly RouteFocused: 2048; /** * Global route (unless a focused window or active item registere