diff --git a/.github/README.md b/.github/README.md index 3fb5ba7..8581e41 100644 --- a/.github/README.md +++ b/.github/README.md @@ -139,7 +139,7 @@ The Style Editor (`ImGui.ShowStyleEditor()`) and the Metrics/Debugger (`ImGui.Sh With [Wally](https://wally.run): add `ImGui = "bug/imgui-luau@0.1.0"` under `[dependencies]` in your `wally.toml`, run `wally install`, then `require(ReplicatedStorage.Packages.ImGui)`. Or from source: -1. Build the module: `python3 tools/bundle.py` writes `build/ImGui.luau` (`--no-demo` leaves the demo out). +1. Build the module: `python3 tools/bundle.py` writes `build/ImGui.luau` (`--no-demo` leaves the demo out) and `build/ImGuiTyped.luau`, a small typed entry module (Luau types for the public `ImGui.*` API, `ImVec2`/`ImVec4` and the flag enums) that requires `build/ImGui.luau` as its child `Impl`. The Wally package and the Rojo projects use that layout, so you get autocomplete and type errors in `--!strict` scripts. The single-file `ImGui.luau` also works on its own, just untyped. 2. Sync with [Rojo](https://rojo.space): [`default.project.json`](/default.project.json) puts the module in `ReplicatedStorage.ImGui` and the example LocalScript in `StarterPlayerScripts`. 3. A minimal LocalScript (full version: [examples/example_roblox/main.client.luau](/examples/example_roblox/main.client.luau)): diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f1cffa..9ff1a53 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,6 +42,7 @@ jobs: python3 tools/sync_github_readme.py --check luau-compile --null dist/roblox/ImGui.luau luau-compile --null dist/roblox-nodemo/ImGui.luau + sed 's|require(script:WaitForChild("Impl"))|nil|' dist/roblox/ImGuiTyped.luau > /tmp/ImGuiTyped.luau && luau-analyze /tmp/ImGuiTyped.luau luajit -bl dist/love/imgui_love.lua > /dev/null luajit -bl dist/love-nodemo/imgui_love.lua > /dev/null python3 tools/test/run.py --main tools/test/scripts/t_readme.luau --frames 30 --quiet --roblox --timeout 300 | tee /tmp/r.txt @@ -59,7 +60,7 @@ jobs: cp love/imgui_love.lua imgui_love.lua cp love-nodemo/imgui_love.lua imgui_love-nodemo.lua # Roblox: module + example LocalScript + Rojo project - mkdir -p pkg-roblox/build && cp ImGui.luau pkg-roblox/build/ && cp ../default.project.json pkg-roblox/ + mkdir -p pkg-roblox/build && cp ImGui.luau roblox/ImGuiTyped.luau pkg-roblox/build/ && cp ../default.project.json pkg-roblox/ mkdir -p pkg-roblox/examples && cp -r ../examples/example_roblox ../examples/example_shared pkg-roblox/examples/ (cd pkg-roblox && zip -qr ../imgui-luau-roblox-$V.zip .) # LÖVE: bundle + fonts + examples (run: love examples/example_love) @@ -89,7 +90,7 @@ jobs: grep -q "^version = \"${GITHUB_REF_NAME#v}\"" wally.toml || { echo "wally.toml version != tag"; exit 1; } curl -fsSL -o wally.zip https://github.com/UpliftGames/wally/releases/download/v0.3.2/wally-v0.3.2-linux.zip unzip -q wally.zip -d wallybin && chmod +x wallybin/wally - mkdir -p dist/wally/src && cp wally.toml dist/wally/ && cp dist/roblox/ImGui.luau dist/wally/src/init.luau + mkdir -p dist/wally/src && cp wally.toml dist/wally/ && cp dist/roblox/ImGuiTyped.luau dist/wally/src/init.luau && cp dist/roblox/ImGui.luau dist/wally/src/Impl.luau echo '{"name":"imgui-luau","tree":{"$path":"src"}}' > dist/wally/default.project.json wallybin/wally login --token "$WALLY_TOKEN" wallybin/wally publish --project-path dist/wally diff --git a/.gitignore b/.gitignore index 5c56424..e21550e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .opencode/ Packages/ wally.lock +__pycache__/ diff --git a/README.md b/README.md index 4e8773c..4759422 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ The Style Editor (`ImGui.ShowStyleEditor()`) and the Metrics/Debugger (`ImGui.Sh With [Wally](https://wally.run): add `ImGui = "bug/imgui-luau@0.1.0"` under `[dependencies]` in your `wally.toml`, run `wally install`, then `require(ReplicatedStorage.Packages.ImGui)`. Or from source: -1. Build the module: `python3 tools/bundle.py` writes `build/ImGui.luau` (`--no-demo` leaves the demo out). +1. Build the module: `python3 tools/bundle.py` writes `build/ImGui.luau` (`--no-demo` leaves the demo out) and `build/ImGuiTyped.luau`, a small typed entry module (Luau types for the public `ImGui.*` API, `ImVec2`/`ImVec4` and the flag enums) that requires `build/ImGui.luau` as its child `Impl`. The Wally package and the Rojo projects use that layout, so you get autocomplete and type errors in `--!strict` scripts. The single-file `ImGui.luau` also works on its own, just untyped. 2. Sync with [Rojo](https://rojo.space): [`default.project.json`](default.project.json) puts the module in `ReplicatedStorage.ImGui` and the example LocalScript in `StarterPlayerScripts`. 3. A minimal LocalScript (full version: [examples/example_roblox/main.client.luau](examples/example_roblox/main.client.luau)): diff --git a/build/ImGuiTyped.luau b/build/ImGuiTyped.luau new file mode 100644 index 0000000..f22324f --- /dev/null +++ b/build/ImGuiTyped.luau @@ -0,0 +1,957 @@ +--!strict +-- GENERATED by tools/gen_types.py - do not edit. The library is the child ModuleScript 'Impl'. + +export type ImVec2 = { x: number, y: number, [any]: any } +export type ImVec4 = { x: number, y: number, z: number, w: number, [any]: any } +export type ImGuiAPI = { + AcceptDragDropPayload: (type: string, flags: number?) -> any, + ActivateItemByID: (...any) -> ...any, + AddDrawListToDrawDataEx: (...any) -> ...any, + AddSettingsHandler: (...any) -> ...any, + AddUpdateViewport: (...any) -> ...any, + AlignTextToFramePadding: () -> (), + ArrowButton: (str_id: string, dir: number) -> boolean, + ArrowButtonEx: (...any) -> ...any, + Begin: (name: string, open: boolean?, flags: number?) -> (boolean, boolean?), + BeginChild: (...any) -> ...any, + BeginChildEx: (...any) -> ...any, + BeginColumns: (...any) -> ...any, + BeginCombo: (label: string, preview_value: string, flags: number?) -> boolean, + BeginComboPopup: (...any) -> ...any, + BeginComboPreview: (...any) -> ...any, + BeginDisabled: (disabled: boolean?) -> (), + BeginDisabledOverrideReenable: (...any) -> ...any, + BeginDockableDragDropSource: (...any) -> ...any, + BeginDockableDragDropTarget: (...any) -> ...any, + BeginDocked: (...any) -> ...any, + BeginDragDropSource: (flags: number?) -> boolean, + BeginDragDropTarget: () -> boolean, + BeginDragDropTargetCustom: (...any) -> ...any, + BeginDragDropTargetViewport: (...any) -> ...any, + BeginErrorTooltip: (...any) -> ...any, + BeginGroup: () -> (), + BeginItemTooltip: () -> boolean, + BeginListBox: (label: string, size_arg: ImVec2?) -> boolean, + BeginMainMenuBar: () -> boolean, + BeginMenu: (label: string, enabled: boolean?) -> boolean, + BeginMenuBar: () -> boolean, + BeginMenuEx: (...any) -> ...any, + BeginPopup: (str_id: string, flags: number?) -> boolean, + BeginPopupContextItem: (str_id: string?, popup_flags: number?) -> boolean, + BeginPopupContextVoid: (str_id: string?, popup_flags: number?) -> boolean, + BeginPopupContextWindow: (str_id: string?, popup_flags: number?) -> boolean, + BeginPopupEx: (...any) -> ...any, + BeginPopupMenuEx: (...any) -> ...any, + BeginPopupModal: (name: string, p_open: boolean?, flags: number?) -> (boolean, boolean?), + BeginTabBar: (str_id: string, flags: number?) -> boolean, + BeginTabBarEx: (...any) -> ...any, + BeginTabItem: (label: string, p_open: boolean?, flags: number?) -> (boolean, boolean?), + BeginTable: (str_id: string, columns_count: number, flags: number?, outer_size: ImVec2?, inner_width: number?) -> boolean, + BeginTableEx: (...any) -> ...any, + BeginTooltip: () -> boolean, + BeginTooltipEx: (...any) -> ...any, + BeginTooltipHidden: (...any) -> ...any, + BeginViewportSideBar: (...any) -> ...any, + BringWindowToDisplayBack: (...any) -> ...any, + BringWindowToDisplayBehind: (...any) -> ...any, + BringWindowToDisplayFront: (...any) -> ...any, + BringWindowToFocusFront: (...any) -> ...any, + Bullet: () -> (), + BulletText: (fmt: string, ...any) -> (), + Button: (label: string, size_arg: ImVec2?) -> boolean, + ButtonBehavior: (...any) -> ...any, + ButtonEx: (...any) -> ...any, + CalcClipRectVisibleItemsY: (...any) -> ...any, + CalcItemSize: (...any) -> ...any, + CalcItemWidth: () -> number, + CalcRoundingFlagsForRectInRect: (...any) -> ...any, + CalcTextSize: (text: string, text_end: string?, hide_text_after_double_hash: boolean?, wrap_width: number?) -> ImVec2, + CalcTextSizeEx: (...any) -> ...any, + CalcTypematicRepeatAmount: (...any) -> ...any, + CalcWindowNextAutoFitSize: (...any) -> ...any, + CalcWrapWidthForPos: (...any) -> ...any, + Checkbox: (label: string, v: boolean?) -> (boolean, boolean?), + CheckboxFlags: (...any) -> ...any, + CleanupIniSettings: (...any) -> ...any, + ClearActiveID: (...any) -> ...any, + ClearDragDrop: (...any) -> ...any, + ClearIniSettings: (...any) -> ...any, + ClearWindowSettings: (...any) -> ...any, + CloseButton: (...any) -> ...any, + CloseCurrentPopup: () -> (), + ClosePopupToLevel: (...any) -> ...any, + ClosePopupsExceptModals: (...any) -> ...any, + ClosePopupsOverWindow: (...any) -> ...any, + CollapseButton: (...any) -> ...any, + CollapsingHeader: (...any) -> ...any, + ColorButton: (desc_id: string, col: ImVec4, flags: number?, size_arg: ImVec2?) -> boolean, + ColorConvertFloat4ToU32: (in_col: ImVec4) -> number, + ColorConvertHSVtoRGB: (...any) -> ...any, + ColorConvertRGBtoHSV: (...any) -> ...any, + ColorConvertU32ToFloat4: (...any) -> ...any, + ColorEdit3: (label: string, col: any, flags: number?) -> boolean, + ColorEdit4: (label: string, col: any, flags: number?) -> boolean, + ColorEditOptionsPopup: (...any) -> ...any, + ColorPicker3: (label: string, col: any, flags: number?) -> boolean, + ColorPicker4: (label: string, col: any, flags: number?, ref_col: any) -> boolean, + ColorPickerOptionsPopup: (...any) -> ...any, + ColorTooltip: (...any) -> ...any, + Columns: (columns_count: number?, id: string?, borders: boolean?) -> (), + Combo: (...any) -> ...any, + ConvertSingleModFlagToKey: (...any) -> ...any, + CreateContext: (shared_font_atlas: any) -> ...any, + CreateNewWindowSettings: (...any) -> ...any, + DataTypeApplyFromText: (...any) -> ...any, + DataTypeApplyOp: (...any) -> ...any, + DataTypeClamp: (...any) -> ...any, + DataTypeCompare: (...any) -> ...any, + DataTypeFormatString: (...any) -> ...any, + DataTypeGetInfo: (...any) -> ...any, + DataTypeIsZero: (...any) -> ...any, + DebugAllocHook: (...any) -> ...any, + DebugHookIdInfo: (...any) -> ...any, + DebugLog: (fmt: string, ...any) -> (), + DebugNodeColumns: (...any) -> ...any, + DebugNodeDockNode: (...any) -> ...any, + DebugNodeDrawList: (...any) -> ...any, + DebugNodeFont: (...any) -> ...any, + DebugNodeFontGlyph: (...any) -> ...any, + DebugNodeFontGlyphsForSrcMask: (...any) -> ...any, + DebugNodeStorage: (...any) -> ...any, + DebugNodeTabBar: (...any) -> ...any, + DebugNodeTable: (...any) -> ...any, + DebugNodeTableSettings: (...any) -> ...any, + DebugNodeTexture: (...any) -> ...any, + DebugNodeViewport: (...any) -> ...any, + DebugNodeWindow: (...any) -> ...any, + DebugNodeWindowSettings: (...any) -> ...any, + DebugNodeWindowsList: (...any) -> ...any, + DebugNodeWindowsListByBeginStackParent: (...any) -> ...any, + DebugRenderViewportThumbnail: (...any) -> ...any, + DebugTextEncoding: (str: string) -> (), + DestroyContext: (ctx: any) -> ...any, + DestroyPlatformWindow: (...any) -> ...any, + DestroyPlatformWindows: () -> (), + DestroyViewport: (...any) -> ...any, + DockBuilderAddNode: (...any) -> ...any, + DockBuilderCopyDockSpace: (...any) -> ...any, + DockBuilderCopyNode: (...any) -> ...any, + DockBuilderCopyWindowSettings: (...any) -> ...any, + DockBuilderDockWindow: (...any) -> ...any, + DockBuilderFinish: (...any) -> ...any, + DockBuilderGetCentralNode: (...any) -> ...any, + DockBuilderGetNode: (...any) -> ...any, + DockBuilderRemoveNode: (...any) -> ...any, + DockBuilderRemoveNodeChildNodes: (...any) -> ...any, + DockBuilderRemoveNodeDockedWindows: (...any) -> ...any, + DockBuilderSetNodePos: (...any) -> ...any, + DockBuilderSetNodeSize: (...any) -> ...any, + DockBuilderSplitNode: (...any) -> ...any, + DockContextAddNode: (...any) -> ...any, + DockContextBindNodeToWindow: (...any) -> ...any, + DockContextBuildAddWindowsToNodes: (...any) -> ...any, + DockContextBuildNodesFromSettings: (...any) -> ...any, + DockContextCalcDropPosForDocking: (...any) -> ...any, + DockContextClearNodes: (...any) -> ...any, + DockContextDeleteNode: (...any) -> ...any, + DockContextEndFrame: (...any) -> ...any, + DockContextFindNodeByID: (...any) -> ...any, + DockContextGenNodeID: (...any) -> ...any, + DockContextInitialize: (...any) -> ...any, + DockContextNewFrameUpdateDocking: (...any) -> ...any, + DockContextNewFrameUpdateUndocking: (...any) -> ...any, + DockContextProcessDock: (...any) -> ...any, + DockContextProcessUndockNode: (...any) -> ...any, + DockContextProcessUndockWindow: (...any) -> ...any, + DockContextPruneUnusedSettingsNodes: (...any) -> ...any, + DockContextQueueDock: (...any) -> ...any, + DockContextQueueNotifyRemovedNode: (...any) -> ...any, + DockContextQueueUndockNode: (...any) -> ...any, + DockContextQueueUndockWindow: (...any) -> ...any, + DockContextRebuildNodes: (...any) -> ...any, + DockContextRemoveNode: (...any) -> ...any, + DockContextShutdown: (...any) -> ...any, + DockNodeAddTabBar: (...any) -> ...any, + DockNodeAddWindow: (...any) -> ...any, + DockNodeApplyPosSizeToWindows: (...any) -> ...any, + DockNodeBeginAmendTabBar: (...any) -> ...any, + DockNodeCalcDropRectsAndTestMousePos: (...any) -> ...any, + DockNodeCalcSplitRects: (...any) -> ...any, + DockNodeCalcTabBarLayout: (...any) -> ...any, + DockNodeEndAmendTabBar: (...any) -> ...any, + DockNodeFindWindowByID: (...any) -> ...any, + DockNodeGetDepth: (...any) -> ...any, + DockNodeGetRootNode: (...any) -> ...any, + DockNodeGetTabOrder: (...any) -> ...any, + DockNodeGetWindowMenuButtonId: (...any) -> ...any, + DockNodeHideHostWindow: (...any) -> ...any, + DockNodeIsDropAllowed: (...any) -> ...any, + DockNodeIsInHierarchyOf: (...any) -> ...any, + DockNodeMoveChildNodes: (...any) -> ...any, + DockNodeMoveWindows: (...any) -> ...any, + DockNodePreviewDockRender: (...any) -> ...any, + DockNodePreviewDockSetup: (...any) -> ...any, + DockNodeRemoveTabBar: (...any) -> ...any, + DockNodeRemoveWindow: (...any) -> ...any, + DockNodeStartMouseMovingWindow: (...any) -> ...any, + DockNodeTreeFindFallbackLeafNode: (...any) -> ...any, + DockNodeTreeFindVisibleNodeByPos: (...any) -> ...any, + DockNodeTreeMerge: (...any) -> ...any, + DockNodeTreeSplit: (...any) -> ...any, + DockNodeTreeUpdatePosSize: (...any) -> ...any, + DockNodeTreeUpdateSplitter: (...any) -> ...any, + DockNodeUpdate: (...any) -> ...any, + DockNodeUpdateFlagsAndCollapse: (...any) -> ...any, + DockNodeUpdateForRootNode: (...any) -> ...any, + DockNodeUpdateHasCentralNodeChild: (...any) -> ...any, + DockNodeUpdateTabBar: (...any) -> ...any, + DockNodeUpdateVisibleFlag: (...any) -> ...any, + DockNodeWindowMenuHandler_Default: (...any) -> ...any, + DockNodeWindowMenuUpdate: (...any) -> ...any, + DockSpace: (dockspace_id: number, size_arg: ImVec2?, flags: number?, window_class: any) -> number, + DockSpaceOverViewport: (dockspace_id: number?, viewport: any, dockspace_flags: number?, window_class: any) -> number, + DragBehavior: (...any) -> ...any, + DragBehaviorT: (...any) -> ...any, + DragFloat: (label: string, v: number, v_speed: number?, v_min: number?, v_max: number?, format: string?, flags: number?) -> (number, boolean), + DragFloatRange2: (label: string, v_current_min: number, v_current_max: number, v_speed: number?, v_min: number?, v_max: number?, format: string?, format_max: string?, flags: number?) -> ...any, + DragInt: (label: string, v: number, v_speed: number?, v_min: number?, v_max: number?, format: string?, flags: number?) -> (number, boolean), + DragIntRange2: (label: string, v_current_min: number, v_current_max: number, v_speed: number?, v_min: number?, v_max: number?, format: string?, format_max: string?, flags: number?) -> ...any, + DragScalar: (label: string, data_type: number, data: any, v_speed: number?, min: any, max: any, format: string?, flags: number?) -> ...any, + DragScalarN: (label: string, data_type: number, v: any, components: number, v_speed: number?, v_min: any, v_max: any, format: string?, flags: number?) -> ...any, + Dummy: (size: ImVec2) -> (), + End: () -> (), + EndChild: () -> (), + EndColumns: (...any) -> ...any, + EndCombo: () -> (), + EndComboPreview: (...any) -> ...any, + EndDisabled: () -> (), + EndDisabledOverrideReenable: (...any) -> ...any, + EndDragDropSource: () -> (), + EndDragDropTarget: () -> (), + EndErrorTooltip: (...any) -> ...any, + EndFrame: () -> (), + EndGroup: () -> (), + EndListBox: () -> (), + EndMainMenuBar: () -> (), + EndMenu: () -> (), + EndMenuBar: () -> (), + EndPopup: () -> (), + EndTabBar: () -> (), + EndTabItem: () -> (), + EndTable: () -> (), + EndTooltip: () -> (), + ErrorCheckEndFrameFinalizeErrorTooltip: (...any) -> ...any, + ErrorCheckUsingSetCursorPosToExtendParentBoundaries: (...any) -> ...any, + ErrorLog: (...any) -> ...any, + ErrorRecoveryStoreState: (...any) -> ...any, + ErrorRecoveryTryToRecoverState: (...any) -> ...any, + ErrorRecoveryTryToRecoverWindowState: (...any) -> ...any, + ExtendHitBoxWhenNearViewportEdge: (...any) -> ...any, + FindBestWindowPosForPopup: (...any) -> ...any, + FindBestWindowPosForPopupEx: (...any) -> ...any, + FindBlockingModal: (...any) -> ...any, + FindBottomMostVisibleWindowWithinBeginStack: (...any) -> ...any, + FindFrontMostVisibleChildWindow: (...any) -> ...any, + FindHoveredViewportFromPlatformWindowStack: (...any) -> ...any, + FindOrCreateColumns: (...any) -> ...any, + FindPlatformMonitorForPos: (...any) -> ...any, + FindPlatformMonitorForRect: (...any) -> ...any, + FindRenderedTextEnd: (...any) -> ...any, + FindSettingsHandler: (...any) -> ...any, + FindViewportByID: (viewport_id: number) -> any, + FindWindowByID: (...any) -> ...any, + FindWindowByName: (...any) -> ...any, + FindWindowDisplayIndex: (...any) -> ...any, + FindWindowFocusIndex: (...any) -> ...any, + FindWindowNavFocusable: (...any) -> ...any, + FindWindowSettingsByID: (...any) -> ...any, + FindWindowSettingsByWindow: (...any) -> ...any, + FixupKeyChord: (...any) -> ...any, + FocusItem: (...any) -> ...any, + FocusTopMostWindowUnderOne: (...any) -> ...any, + FocusWindow: (...any) -> ...any, + GcAwakeTransientWindowBuffers: (...any) -> ...any, + GcCompactTransientMiscBuffers: (...any) -> ...any, + GcCompactTransientWindowBuffers: (...any) -> ...any, + GetBackgroundDrawList: (viewport: any) -> ...any, + GetClipboardText: () -> any, + GetColorU32: (...any) -> ...any, + GetColumnIndex: () -> number, + GetColumnNormFromOffset: (...any) -> ...any, + GetColumnOffset: (column_index: number?) -> number, + GetColumnOffsetFromNorm: (...any) -> ...any, + GetColumnWidth: (column_index: number?) -> number, + GetColumnsCount: () -> number, + GetColumnsID: (...any) -> ...any, + GetContentRegionAvail: () -> ImVec2, + GetContentRegionMax: (...any) -> ...any, + GetCurrentContext: () -> any, + GetCurrentWindow: (...any) -> ...any, + GetCurrentWindowRead: (...any) -> ...any, + GetCursorPos: () -> ImVec2, + GetCursorPosX: () -> number, + GetCursorPosY: () -> number, + GetCursorScreenPos: () -> ImVec2, + GetCursorStartPos: () -> ImVec2, + GetDefaultFont: (...any) -> ...any, + GetDragDropPayload: () -> any, + GetDrawData: () -> any, + GetDrawListSharedData: () -> any, + GetFont: () -> any, + GetFontSize: () -> number, + GetFontTexUvWhitePixel: () -> ImVec2, + GetForegroundDrawList: (viewport: any) -> ...any, + GetFrameCount: () -> number, + GetFrameHeight: () -> number, + GetFrameHeightWithSpacing: () -> number, + GetHoveredID: (...any) -> ...any, + GetID: (...any) -> ...any, + GetIDWithSeed: (...any) -> ...any, + GetIO: () -> any, + GetInputTextState: (...any) -> ...any, + GetItemClickedCountWithSingleClickDelay: (mouse_button: number?, delay: number?) -> number, + GetItemFlags: () -> number, + GetItemID: () -> number, + GetItemRectMax: () -> ImVec2, + GetItemRectMin: () -> ImVec2, + GetItemRectSize: () -> ImVec2, + GetKeyChordName: (...any) -> ...any, + GetKeyData: (...any) -> ...any, + GetKeyMagnitude2d: (...any) -> ...any, + GetKeyName: (key: number) -> any, + GetKeyOwner: (...any) -> ...any, + GetKeyOwnerData: (...any) -> ...any, + GetKeyPressedAmount: (key: number, repeat_delay: number, repeat_rate: number) -> number, + GetMainViewport: () -> any, + GetMergedModsFromKeys: (...any) -> ...any, + GetMetatables: (...any) -> ...any, + GetMouseButtonFromPopupFlags: (...any) -> ...any, + GetMouseClickedCount: (button: number) -> number, + GetMouseCursor: () -> number, + GetMouseDragDelta: (button: number?, lock_threshold: number?) -> ImVec2, + GetMousePos: () -> ImVec2, + GetMousePosOnOpeningCurrentPopup: () -> ImVec2, + GetNavTweakPressedAmount: (...any) -> ...any, + GetPlatformIO: () -> any, + GetPopupAllowedExtentRect: (...any) -> ...any, + GetRoundedFontSize: (...any) -> ...any, + GetScale: (...any) -> ...any, + GetScrollMaxX: () -> number, + GetScrollMaxY: () -> number, + GetScrollX: () -> number, + GetScrollY: () -> number, + GetShortcutRoutingData: (...any) -> ...any, + GetStateStorage: () -> any, + GetStyle: () -> any, + GetStyleColorName: (idx: number) -> any, + GetStyleColorVec4: (idx: number) -> ImVec4, + GetStyleVarInfo: (...any) -> ...any, + GetTextLineHeight: () -> number, + GetTextLineHeightWithSpacing: () -> number, + GetTime: () -> number, + GetTopMostAndVisiblePopupModal: (...any) -> ...any, + GetTopMostPopupModal: (...any) -> ...any, + GetTreeNodeToLabelSpacing: () -> number, + GetTypematicRepeatRate: (...any) -> ...any, + GetVersion: () -> any, + GetViewportPlatformMonitor: (...any) -> ...any, + GetWindowAlwaysWantOwnTabBar: (...any) -> ...any, + GetWindowAlwaysWantOwnViewport: (...any) -> ...any, + GetWindowContentRegionMax: (...any) -> ...any, + GetWindowContentRegionMin: (...any) -> ...any, + GetWindowDockID: () -> number, + GetWindowDpiScale: () -> number, + GetWindowDrawList: () -> any, + GetWindowHeight: () -> number, + GetWindowPos: () -> ImVec2, + GetWindowScrollbarID: (...any) -> ...any, + GetWindowScrollbarRect: (...any) -> ...any, + GetWindowSize: () -> ImVec2, + GetWindowViewport: () -> any, + GetWindowWidth: () -> number, + Image: (tex_ref: any, image_size: ImVec2, uv0: ImVec2?, uv1: ImVec2?) -> (), + ImageButton: (str_id: string, tex_ref: any, image_size: ImVec2, uv0: ImVec2?, uv1: ImVec2?, bg_col: ImVec4?, tint_col: ImVec4?) -> boolean, + ImageButtonEx: (...any) -> ...any, + ImageWithBg: (tex_ref: any, image_size: ImVec2, uv0: ImVec2?, uv1: ImVec2?, bg_col: ImVec4?, tint_col: ImVec4?) -> (), + Indent: (indent_w: number?) -> (), + Initialize: (...any) -> ...any, + InputDouble: (label: string, v: number, step: number?, step_fast: number?, format: string?, flags: number?) -> (number, boolean), + InputFloat: (label: string, v: number, step: number?, step_fast: number?, format: string?, flags: number?) -> (number, boolean), + InputFloat2: (label: string, v: any, format: string?, flags: number?) -> boolean, + InputFloat3: (label: string, v: any, format: string?, flags: number?) -> boolean, + InputFloat4: (label: string, v: any, format: string?, flags: number?) -> boolean, + InputInt: (label: string, v: number, step: number?, step_fast: number?, flags: number?) -> (number, boolean), + InputInt2: (label: string, v: any, flags: number?) -> boolean, + InputInt3: (label: string, v: any, flags: number?) -> boolean, + InputInt4: (label: string, v: any, flags: number?) -> boolean, + InputScalar: (label: string, data_type: number, data: any, step: any, step_fast: any, format: string?, flags: number?) -> ...any, + InputScalarN: (label: string, data_type: number, data: any, components: number, step: any, step_fast: any, format: string?, flags: number?) -> ...any, + InputText: (label: string, buf: any, buf_size: number, flags: number?, callback: any, user_data: any) -> ...any, + InputTextDeactivateHook: (...any) -> ...any, + InputTextEx: (...any) -> ...any, + InputTextMultiline: (label: string, buf: any, buf_size: number, size: ImVec2?, flags: number?, callback: any, user_data: any) -> ...any, + InputTextWithHint: (label: string, hint: string, buf: any, buf_size: number, flags: number?, callback: any, user_data: any) -> ...any, + InvisibleButton: (str_id: string, size_arg: ImVec2, flags: number?) -> boolean, + IsActiveIdUsingNavDir: (...any) -> ...any, + IsAliasKey: (...any) -> ...any, + IsAnyItemActive: () -> boolean, + IsAnyItemFocused: () -> boolean, + IsAnyItemHovered: () -> boolean, + IsAnyMouseDown: () -> boolean, + IsClippedEx: (...any) -> ...any, + IsDragDropActive: (...any) -> ...any, + IsDragDropPayloadBeingAccepted: (...any) -> ...any, + IsGamepadKey: (...any) -> ...any, + IsInNavFocusRoute: (...any) -> ...any, + IsItemActivated: () -> boolean, + IsItemActive: () -> boolean, + IsItemClicked: (mouse_button: number?) -> boolean, + IsItemDeactivated: () -> boolean, + IsItemDeactivatedAfterEdit: () -> boolean, + IsItemEdited: () -> boolean, + IsItemFocused: () -> boolean, + IsItemHovered: (flags: number?) -> boolean, + IsItemToggledOpen: () -> boolean, + IsItemToggledSelection: () -> boolean, + IsItemVisible: () -> boolean, + IsKeyChordPressed: (...any) -> ...any, + IsKeyDown: (...any) -> ...any, + IsKeyPressed: (key: number, is_repeat: boolean?) -> boolean, + IsKeyPressedEx: (...any) -> ...any, + IsKeyReleased: (...any) -> ...any, + IsKeyboardKey: (...any) -> ...any, + IsLRModKey: (...any) -> ...any, + IsMouseClicked: (button: number, is_repeat: boolean?) -> boolean, + IsMouseClickedEx: (...any) -> ...any, + IsMouseDoubleClicked: (...any) -> ...any, + IsMouseDown: (...any) -> ...any, + IsMouseDragPastThreshold: (...any) -> ...any, + IsMouseDragging: (button: number, lock_threshold: number?) -> boolean, + IsMouseHoveringRect: (r_min: ImVec2, r_max: ImVec2, clip: boolean?) -> boolean, + IsMouseKey: (...any) -> ...any, + IsMousePosValid: (mouse_pos: any) -> boolean, + IsMouseReleased: (...any) -> ...any, + IsMouseReleasedWithDelay: (button: number, delay: number?) -> boolean, + IsNamedKey: (...any) -> ...any, + IsNamedKeyOrMod: (...any) -> ...any, + IsPopupOpen: (id: string, popup_flags: number?) -> boolean, + IsPopupOpenRequestForItem: (...any) -> ...any, + IsPopupOpenRequestForWindow: (...any) -> ...any, + IsRectVisible: (...any) -> ...any, + IsViewportAbove: (...any) -> ...any, + IsWindowAbove: (...any) -> ...any, + IsWindowActiveAndVisible: (...any) -> ...any, + IsWindowAppearing: () -> boolean, + IsWindowChildOf: (...any) -> ...any, + IsWindowCollapsed: () -> boolean, + IsWindowContentHoverable: (...any) -> ...any, + IsWindowDocked: () -> boolean, + IsWindowFocused: (flags: number?) -> boolean, + IsWindowHovered: (flags: number?) -> boolean, + IsWindowInBeginStack: (...any) -> ...any, + IsWindowNavFocusable: (...any) -> ...any, + IsWindowWithinBeginStackOf: (...any) -> ...any, + ItemAdd: (...any) -> ...any, + ItemHandleShortcut: (...any) -> ...any, + ItemHoverable: (...any) -> ...any, + ItemSize: (...any) -> ...any, + KeepAliveID: (...any) -> ...any, + LabelText: (label: string, fmt: string, ...any) -> (), + ListBox: (...any) -> ...any, + LoadIniSettingsFromDisk: (ini_filename: string) -> (), + LoadIniSettingsFromMemory: (ini_data: string, ini_size: number?) -> (), + LocalizeGetMsg: (...any) -> ...any, + LocalizeRegisterEntries: (...any) -> ...any, + LogBegin: (...any) -> ...any, + LogButtons: () -> (), + LogFinish: () -> (), + LogRenderedText: (...any) -> ...any, + LogSetNextTextDecoration: (...any) -> ...any, + LogText: (fmt: string, ...any) -> (), + LogToBuffer: (...any) -> ...any, + LogToClipboard: (auto_open_depth: number?) -> (), + LogToFile: (auto_open_depth: number?, filename: string?) -> (), + LogToTTY: (auto_open_depth: number?) -> (), + MarkIniSettingsDirty: (...any) -> ...any, + MarkItemEdited: (...any) -> ...any, + MemAlloc: (...any) -> ...any, + MemFree: (...any) -> ...any, + MenuItem: (...any) -> ...any, + MenuItemEx: (...any) -> ...any, + MouseButtonToKey: (...any) -> ...any, + NavApplyItemToResult: (...any) -> ...any, + NavBiasScoringRect: (...any) -> ...any, + NavCalcPreferredRefPos: (...any) -> ...any, + NavCalcPreferredRefPosSource: (...any) -> ...any, + NavClearPreferredPosForAxis: (...any) -> ...any, + NavEndFrame: (...any) -> ...any, + NavHighlightActivated: (...any) -> ...any, + NavInitRequestApplyResult: (...any) -> ...any, + NavInitWindow: (...any) -> ...any, + NavMoveRequestApplyResult: (...any) -> ...any, + NavMoveRequestButNoResultYet: (...any) -> ...any, + NavMoveRequestCancel: (...any) -> ...any, + NavMoveRequestForward: (...any) -> ...any, + NavMoveRequestResolveWithLastItem: (...any) -> ...any, + NavMoveRequestResolveWithPastTreeNode: (...any) -> ...any, + NavMoveRequestSubmit: (...any) -> ...any, + NavMoveRequestTryWrapping: (...any) -> ...any, + NavProcessItem: (...any) -> ...any, + NavProcessItemForTabbingRequest: (...any) -> ...any, + NavRestoreLastChildNavWindow: (...any) -> ...any, + NavRestoreLayer: (...any) -> ...any, + NavSaveLastChildNavWindowIntoParent: (...any) -> ...any, + NavScoreItem: (...any) -> ...any, + NavUpdate: (...any) -> ...any, + NavUpdateAnyRequestFlag: (...any) -> ...any, + NavUpdateCancelRequest: (...any) -> ...any, + NavUpdateContextMenuRequest: (...any) -> ...any, + NavUpdateCreateMoveRequest: (...any) -> ...any, + NavUpdateCreateTabbingRequest: (...any) -> ...any, + NavUpdateCurrentWindowIsScrollPushableX: (...any) -> ...any, + NavUpdatePageUpPageDown: (...any) -> ...any, + NavUpdateWindowing: (...any) -> ...any, + NavUpdateWindowingApplyFocus: (...any) -> ...any, + NavUpdateWindowingOverlay: (...any) -> ...any, + NavUpdateWindowingTarget: (...any) -> ...any, + NewFrame: () -> (), + NewLine: () -> (), + NewTextBuffer: (...any) -> ...any, + NextColumn: () -> (), + OpenPopup: (...any) -> ...any, + OpenPopupEx: (...any) -> ...any, + OpenPopupOnItemClick: (str_id: string?, popup_flags: number?) -> boolean, + PayloadIsDataType: (...any) -> ...any, + PlotEx: (...any) -> ...any, + PlotHistogram: (...any) -> ...any, + PlotLines: (...any) -> ...any, + PopClipRect: () -> (), + PopColumnsBackground: (...any) -> ...any, + PopFocusScope: (...any) -> ...any, + PopFont: () -> (), + PopID: () -> (), + PopItemFlag: () -> (), + PopItemWidth: () -> (), + PopPasswordFont: (...any) -> ...any, + PopStyleColor: (count: number?) -> (), + PopStyleVar: (count: number?) -> (), + PopTextWrapPos: () -> (), + ProgressBar: (fraction: number, size_arg: ImVec2?, overlay: string?) -> (), + PushClipRect: (clip_rect_min: ImVec2, clip_rect_max: ImVec2, intersect_with_current_clip_rect: boolean) -> (), + PushColumnClipRect: (...any) -> ...any, + PushColumnsBackground: (...any) -> ...any, + PushFocusScope: (...any) -> ...any, + PushFont: (font: any, font_size_base: number) -> ...any, + PushID: (...any) -> ...any, + PushItemFlag: (option: number, enabled: boolean) -> (), + PushItemWidth: (item_width: number) -> (), + PushMultiItemsWidths: (...any) -> ...any, + PushOverrideID: (...any) -> ...any, + PushPasswordFont: (...any) -> ...any, + PushStyleColor: (...any) -> ...any, + PushStyleVar: (...any) -> ...any, + PushStyleVarX: (idx: number, val_x: number) -> (), + PushStyleVarY: (idx: number, val_y: number) -> (), + PushTextWrapPos: (wrap_local_pos_x: number?) -> (), + RadioButton: (...any) -> ...any, + RadioButtonEx: (...any) -> ...any, + RegisterFontAtlas: (...any) -> ...any, + RemoveSettingsHandler: (...any) -> ...any, + Render: () -> (), + RenderArrow: (...any) -> ...any, + RenderArrowDockMenu: (...any) -> ...any, + RenderArrowPointingAt: (...any) -> ...any, + RenderBullet: (...any) -> ...any, + RenderCheckMark: (...any) -> ...any, + RenderColorComponentMarker: (...any) -> ...any, + RenderColorRectWithAlphaCheckerboard: (...any) -> ...any, + RenderDimmedBackgroundBehindWindow: (...any) -> ...any, + RenderDimmedBackgrounds: (...any) -> ...any, + RenderDragDropTargetRectEx: (...any) -> ...any, + RenderDragDropTargetRectForItem: (...any) -> ...any, + RenderDragDropTargetRectForViewport: (...any) -> ...any, + RenderFrame: (...any) -> ...any, + RenderFrameBorder: (...any) -> ...any, + RenderMouseCursor: (...any) -> ...any, + RenderNavCursor: (...any) -> ...any, + RenderPlatformWindowsDefault: (platform_render_arg: any, renderer_render_arg: any) -> ...any, + RenderRectFilledInRangeH: (...any) -> ...any, + RenderRectFilledWithHole: (...any) -> ...any, + RenderText: (...any) -> ...any, + RenderTextClipped: (...any) -> ...any, + RenderTextClippedEx: (...any) -> ...any, + RenderTextEllipsis: (...any) -> ...any, + RenderTextWrapped: (...any) -> ...any, + RenderViewportsThumbnails: (...any) -> ...any, + ResetMouseDragDelta: (button: number?) -> (), + RoundScalarWithFormatT: (...any) -> ...any, + SameLine: (offset_from_start_x: number?, spacing_w: number?) -> (), + SaveIniSettingsToDisk: (ini_filename: string) -> (), + SaveIniSettingsToMemory: (...any) -> ...any, + ScaleRatioFromValueT: (...any) -> ...any, + ScaleValueFromRatioT: (...any) -> ...any, + ScaleWindowsInViewport: (...any) -> ...any, + ScrollToItem: (...any) -> ...any, + ScrollToRect: (...any) -> ...any, + ScrollToRectEx: (...any) -> ...any, + Scrollbar: (...any) -> ...any, + ScrollbarEx: (...any) -> ...any, + Selectable: (...any) -> ...any, + Separator: () -> (), + SeparatorEx: (...any) -> ...any, + SeparatorText: (label: string) -> (), + SeparatorTextEx: (...any) -> ...any, + SetActiveID: (...any) -> ...any, + SetActiveIdUsingAllKeyboardKeys: (...any) -> ...any, + SetAllocatorFunctions: (alloc_func: any, free_func: any, user_data: any) -> ...any, + SetClipboardText: (text: string) -> (), + SetColorEditOptions: (...any) -> ...any, + SetColumnOffset: (column_index: number, offset: number) -> (), + SetColumnWidth: (column_index: number, width: number) -> (), + SetCurrentContext: (ctx: any) -> ...any, + SetCurrentFont: (...any) -> ...any, + SetCurrentViewport: (...any) -> ...any, + SetCursorPos: (local_pos: ImVec2) -> (), + SetCursorPosX: (x: number) -> (), + SetCursorPosY: (y: number) -> (), + SetCursorScreenPos: (pos: ImVec2) -> (), + SetDragDropPayload: (type: string, data: any, data_size: number, cond: number?) -> boolean, + SetFocusID: (...any) -> ...any, + SetHoveredID: (...any) -> ...any, + SetItemDefaultFocus: () -> (), + SetItemKeyOwner: (...any) -> ...any, + SetItemTooltip: (fmt: string, ...any) -> (), + SetKeyOwner: (...any) -> ...any, + SetKeyOwnersForKeyChord: (...any) -> ...any, + SetKeyboardFocusHere: (offset: number?) -> (), + SetLastItemData: (...any) -> ...any, + SetLastItemDataForChildWindowItem: (...any) -> ...any, + SetLastItemDataForWindow: (...any) -> ...any, + SetMouseCursor: (cursor_type: number) -> (), + SetNavCursorVisible: (visible: boolean) -> (), + SetNavCursorVisibleAfterMove: (...any) -> ...any, + SetNavFocusScope: (...any) -> ...any, + SetNavID: (...any) -> ...any, + SetNavWindow: (...any) -> ...any, + SetNextFrameWantCaptureKeyboard: (want: boolean) -> (), + SetNextFrameWantCaptureMouse: (want: boolean) -> (), + SetNextItemAllowOverlap: () -> (), + SetNextItemColorMarker: (...any) -> ...any, + SetNextItemOpen: (is_open: boolean, cond: number?) -> (), + SetNextItemRefVal: (...any) -> ...any, + SetNextItemShortcut: (key_chord: any, flags: number?) -> (), + SetNextItemStorageID: (storage_id: number) -> (), + SetNextItemWidth: (item_width: number) -> (), + SetNextWindowBgAlpha: (alpha: number) -> (), + SetNextWindowChildFlags: (...any) -> ...any, + SetNextWindowClass: (window_class: any) -> (), + SetNextWindowCollapsed: (collapsed: boolean, cond: number?) -> (), + SetNextWindowContentSize: (size: ImVec2) -> (), + SetNextWindowDockID: (id: number, cond: number?) -> (), + SetNextWindowFlags: (...any) -> ...any, + SetNextWindowFocus: () -> (), + SetNextWindowPos: (pos: ImVec2, cond: number?, pivot: ImVec2?) -> (), + SetNextWindowRefreshPolicy: (...any) -> ...any, + SetNextWindowScroll: (scroll: ImVec2) -> (), + SetNextWindowSize: (size: ImVec2, cond: number?) -> (), + SetNextWindowSizeConstraints: (size_min: ImVec2, size_max: ImVec2, custom_callback: any, custom_callback_user_data: any) -> ...any, + SetNextWindowViewport: (id: number) -> (), + SetScrollFromPosX: (...any) -> ...any, + SetScrollFromPosY: (...any) -> ...any, + SetScrollHereX: (center_x_ratio: number?) -> (), + SetScrollHereY: (center_y_ratio: number?) -> (), + SetScrollX: (...any) -> ...any, + SetScrollY: (...any) -> ...any, + SetShortcutRouting: (...any) -> ...any, + SetStateStorage: (tree: any) -> ...any, + SetTabItemClosed: (label: string) -> (), + SetTooltip: (fmt: string, ...any) -> (), + SetWindowClipRectBeforeSetChannel: (...any) -> ...any, + SetWindowCollapsed: (...any) -> ...any, + SetWindowDock: (...any) -> ...any, + SetWindowFocus: (...any) -> ...any, + SetWindowFontScale: (...any) -> ...any, + SetWindowHiddenAndSkipItemsForCurrentFrame: (...any) -> ...any, + SetWindowHitTestHole: (...any) -> ...any, + SetWindowPos: (...any) -> ...any, + SetWindowSize: (...any) -> ...any, + SetWindowViewport: (...any) -> ...any, + ShadeVertsLinearColorGradientKeepAlpha: (...any) -> ...any, + ShadeVertsLinearUV: (...any) -> ...any, + ShadeVertsTransformPos: (...any) -> ...any, + Shortcut: (...any) -> ...any, + ShowAboutWindow: (p_open: boolean?) -> ...any, + ShowDebugLogWindow: (p_open: boolean?) -> ...any, + ShowDemoWindow: (p_open: boolean?) -> ...any, + ShowFontAtlas: (...any) -> ...any, + ShowFontSelector: (label: string) -> (), + ShowIDStackToolWindow: (p_open: boolean?) -> ...any, + ShowMetricsWindow: (p_open: boolean?) -> ...any, + ShowStyleEditor: (ref: any) -> ...any, + ShowStyleSelector: (label: string) -> boolean, + ShowUserGuide: () -> (), + ShrinkWidths: (...any) -> ...any, + Shutdown: (...any) -> ...any, + SliderAngle: (label: string, v_rad: number, v_degrees_min: number?, v_degrees_max: number?, format: string?, flags: number?) -> (number, boolean), + SliderBehavior: (...any) -> ...any, + SliderBehaviorT: (...any) -> ...any, + SliderFloat: (label: string, v: number, v_min: number, v_max: number, format: string?, flags: number?) -> (number, boolean), + SliderFloat2: (label: string, v: any, v_min: number, v_max: number, format: string?, flags: number?) -> boolean, + SliderFloat3: (label: string, v: any, v_min: number, v_max: number, format: string?, flags: number?) -> boolean, + SliderFloat4: (label: string, v: any, v_min: number, v_max: number, format: string?, flags: number?) -> boolean, + SliderInt: (label: string, v: number, v_min: number, v_max: number, format: string?, flags: number?) -> (number, boolean), + SliderInt2: (label: string, v: any, v_min: number, v_max: number, format: string?, flags: number?) -> boolean, + SliderInt3: (label: string, v: any, v_min: number, v_max: number, format: string?, flags: number?) -> boolean, + SliderInt4: (label: string, v: any, v_min: number, v_max: number, format: string?, flags: number?) -> boolean, + SliderScalar: (label: string, data_type: number, data: any, min: any, max: any, format: string?, flags: number?) -> ...any, + SliderScalarN: (label: string, data_type: number, v: any, components: number, v_min: any, v_max: any, format: string?, flags: number?) -> ...any, + SmallButton: (label: string) -> boolean, + Spacing: () -> (), + SplitterBehavior: (...any) -> ...any, + StartMouseMovingWindow: (...any) -> ...any, + StartMouseMovingWindowOrNode: (...any) -> ...any, + StopMouseMovingWindow: (...any) -> ...any, + StyleColorsClassic: (dst: any) -> ...any, + StyleColorsDark: (dst: any) -> ...any, + StyleColorsLight: (dst: any) -> ...any, + TabBarAddTab: (...any) -> ...any, + TabBarCalcMaxTabWidth: (...any) -> ...any, + TabBarCalcTabID: (...any) -> ...any, + TabBarCloseTab: (...any) -> ...any, + TabBarFindByID: (...any) -> ...any, + TabBarFindMostRecentlySelectedTabForActiveWindow: (...any) -> ...any, + TabBarFindTabByID: (...any) -> ...any, + TabBarFindTabByOrder: (...any) -> ...any, + TabBarGetCurrentTab: (...any) -> ...any, + TabBarGetTabName: (...any) -> ...any, + TabBarGetTabOrder: (...any) -> ...any, + TabBarGetTabPos: (...any) -> ...any, + TabBarLayout: (...any) -> ...any, + TabBarProcessReorder: (...any) -> ...any, + TabBarQueueFocus: (...any) -> ...any, + TabBarQueueReorder: (...any) -> ...any, + TabBarQueueReorderFromMousePos: (...any) -> ...any, + TabBarRemove: (...any) -> ...any, + TabBarRemoveTab: (...any) -> ...any, + TabBarScrollClamp: (...any) -> ...any, + TabBarScrollToTab: (...any) -> ...any, + TabBarScrollingButtons: (...any) -> ...any, + TabBarTabListPopupButton: (...any) -> ...any, + TabItemBackground: (...any) -> ...any, + TabItemButton: (label: string, flags: number?) -> boolean, + TabItemCalcSize: (...any) -> ...any, + TabItemEx: (...any) -> ...any, + TabItemLabelAndCloseButton: (...any) -> ...any, + TabItemSpacing: (...any) -> ...any, + TableAngledHeadersRow: () -> (), + TableAngledHeadersRowEx: (...any) -> ...any, + TableApplyExternalUnclipRect: (...any) -> ...any, + TableApplyQueuedRequests: (...any) -> ...any, + TableBeginCell: (...any) -> ...any, + TableBeginContextMenuPopup: (...any) -> ...any, + TableBeginInitMemory: (...any) -> ...any, + TableBeginRow: (...any) -> ...any, + TableCalcMaxColumnWidth: (...any) -> ...any, + TableDrawBorders: (...any) -> ...any, + TableDrawDefaultContextMenu: (...any) -> ...any, + TableEndCell: (...any) -> ...any, + TableEndRow: (...any) -> ...any, + TableFindByID: (...any) -> ...any, + TableFixColumnSortDirection: (...any) -> ...any, + TableFixDisplayOrder: (...any) -> ...any, + TableGcCompactSettings: (...any) -> ...any, + TableGcCompactTransientBuffers: (...any) -> ...any, + TableGetBoundSettings: (...any) -> ...any, + TableGetCellBgRect: (...any) -> ...any, + TableGetColumnCount: () -> number, + TableGetColumnFlags: (column_n: number?) -> number, + TableGetColumnIndex: () -> number, + TableGetColumnName: (...any) -> ...any, + TableGetColumnNextSortDirection: (...any) -> ...any, + TableGetColumnResizeID: (...any) -> ...any, + TableGetColumnWidthAuto: (...any) -> ...any, + TableGetHeaderAngledMaxLabelWidth: (...any) -> ...any, + TableGetHeaderRowHeight: (...any) -> ...any, + TableGetHoveredColumn: () -> number, + TableGetHoveredRow: (...any) -> ...any, + TableGetInstanceData: (...any) -> ...any, + TableGetInstanceID: (...any) -> ...any, + TableGetRowIndex: () -> number, + TableGetSortSpecs: () -> any, + TableHeader: (label: string) -> (), + TableHeadersRow: () -> (), + TableInitColumnDefaults: (...any) -> ...any, + TableLoadSettings: (...any) -> ...any, + TableLoadSettingsForColumn: (...any) -> ...any, + TableLoadSettingsForColumns: (...any) -> ...any, + TableMergeDrawChannels: (...any) -> ...any, + TableNextColumn: () -> boolean, + TableNextRow: (row_flags: number?, row_min_height: number?) -> (), + TableOpenContextMenu: (...any) -> ...any, + TablePopBackgroundChannel: (...any) -> ...any, + TablePopColumnChannel: (...any) -> ...any, + TablePushBackgroundChannel: (...any) -> ...any, + TablePushColumnChannel: (...any) -> ...any, + TableQueueSetColumnDisplayOrder: (...any) -> ...any, + TableReconcileColumns: (...any) -> ...any, + TableRemove: (...any) -> ...any, + TableResetSettings: (...any) -> ...any, + TableSaveSettings: (...any) -> ...any, + TableSetBgColor: (target: number, color: number, column_n: number?) -> (), + TableSetColumnDisplayOrder: (...any) -> ...any, + TableSetColumnEnabled: (column_n: number, enabled: boolean) -> (), + TableSetColumnIndex: (column_n: number) -> boolean, + TableSetColumnSortDirection: (...any) -> ...any, + TableSetColumnWidth: (...any) -> ...any, + TableSetColumnWidthAutoAll: (...any) -> ...any, + TableSetColumnWidthAutoSingle: (...any) -> ...any, + TableSettingsAddSettingsHandler: (...any) -> ...any, + TableSettingsCreate: (...any) -> ...any, + TableSettingsFindByID: (...any) -> ...any, + TableSetupColumn: (label: string, flags: number?, init_width_or_weight: number?, user_data: number?) -> (), + TableSetupDrawChannels: (...any) -> ...any, + TableSetupScrollFreeze: (columns: number, rows: number) -> (), + TableSortSpecsBuild: (...any) -> ...any, + TableSortSpecsSanitize: (...any) -> ...any, + TableUpdateBorders: (...any) -> ...any, + TableUpdateColumnsWeightFromWidth: (...any) -> ...any, + TableUpdateLayout: (...any) -> ...any, + TeleportMousePos: (...any) -> ...any, + TempInputIsActive: (...any) -> ...any, + TempInputScalar: (...any) -> ...any, + TempInputText: (...any) -> ...any, + TestKeyOwner: (...any) -> ...any, + Text: (fmt: string, ...any) -> (), + TextAligned: (...any) -> ...any, + TextBufferToString: (...any) -> ...any, + TextColored: (col: ImVec4, fmt: string, ...any) -> (), + TextDisabled: (fmt: string, ...any) -> (), + TextEx: (...any) -> ...any, + TextLink: (label: string) -> boolean, + TextLinkOpenURL: (label: string, url: string?) -> boolean, + TextUnformatted: (text: string, text_end: string?) -> (), + TextV: (fmt: string, ...any) -> (), + TextWrapped: (fmt: string, ...any) -> (), + TranslateWindow: (...any) -> ...any, + TranslateWindowsInViewport: (...any) -> ...any, + TreeNode: (...any) -> ...any, + TreeNodeBehavior: (...any) -> ...any, + TreeNodeDrawLineToChildNode: (...any) -> ...any, + TreeNodeDrawLineToTreePop: (...any) -> ...any, + TreeNodeEx: (...any) -> ...any, + TreeNodeExV: (...any) -> ...any, + TreeNodeGetOpen: (storage_id: number) -> boolean, + TreeNodeSetOpen: (...any) -> ...any, + TreeNodeUpdateNextOpen: (...any) -> ...any, + TreeNodeV: (...any) -> ...any, + TreePop: () -> (), + TreePush: (...any) -> ...any, + TreePushOverrideID: (...any) -> ...any, + Unindent: (indent_w: number?) -> (), + UnregisterFontAtlas: (...any) -> ...any, + UpdateAliasKey: (...any) -> ...any, + UpdateCurrentFontSize: (...any) -> ...any, + UpdateDebugToolItemPathQuery: (...any) -> ...any, + UpdateFontsEndFrame: (...any) -> ...any, + UpdateFontsNewFrame: (...any) -> ...any, + UpdateHoveredWindowAndCaptureFlags: (...any) -> ...any, + UpdateInputEvents: (...any) -> ...any, + UpdateKeyRoutingTable: (...any) -> ...any, + UpdateKeyboardInputs: (...any) -> ...any, + UpdateMouseInputs: (...any) -> ...any, + UpdateMouseMovingWindowEndFrame: (...any) -> ...any, + UpdateMouseMovingWindowNewFrame: (...any) -> ...any, + UpdateMouseWheel: (...any) -> ...any, + UpdatePlatformWindows: () -> (), + UpdateSettings: (...any) -> ...any, + UpdateTexturesEndFrame: (...any) -> ...any, + UpdateTexturesNewFrame: (...any) -> ...any, + UpdateTryMergeWindowIntoHostViewport: (...any) -> ...any, + UpdateTryMergeWindowIntoHostViewports: (...any) -> ...any, + UpdateViewportPlatformMonitor: (...any) -> ...any, + UpdateViewportsEndFrame: (...any) -> ...any, + UpdateViewportsNewFrame: (...any) -> ...any, + UpdateWindowInFocusOrderList: (...any) -> ...any, + UpdateWindowParentAndRootLinks: (...any) -> ...any, + UpdateWindowSkipRefresh: (...any) -> ...any, + VSliderFloat: (label: string, size: ImVec2, v: number, v_min: number, v_max: number, format: string?, flags: number?) -> (number, boolean), + VSliderInt: (label: string, size: ImVec2, v: number, v_min: number, v_max: number, format: string?, flags: number?) -> (number, boolean), + VSliderScalar: (label: string, size: ImVec2, data_type: number, data: any, min: any, max: any, format: string?, flags: number?) -> ...any, + Value: (...any) -> ...any, + WindowPosAbsToRel: (...any) -> ...any, + WindowRectAbsToRel: (...any) -> ...any, + WindowRectRelToAbs: (...any) -> ...any, + WindowSelectViewport: (...any) -> ...any, + WindowSettingsAddSettingsHandler: (...any) -> ...any, + WindowSyncOwnedViewport: (...any) -> ...any, + _ByteArrayToString: (...any) -> ...any, + _GetTypeFunc: (...any) -> ...any, + _SetCurrentContext_Internal: (...any) -> ...any, + _SetCurrentContext_Tables: (...any) -> ...any, + _SetCurrentContext_Widgets: (...any) -> ...any, + [string]: any, +} +export type ImDrawFlags = { None: number, RoundCornersTopLeft: number, RoundCornersTopRight: number, RoundCornersBottomLeft: number, RoundCornersBottomRight: number, RoundCornersNone: number, Closed: number, RoundCornersTop: number, RoundCornersBottom: number, RoundCornersLeft: number, RoundCornersRight: number, RoundCornersAll: number, RoundCornersDefault_: number, RoundCornersMask_: number, InvalidMask_: number, [string]: number } +export type ImDrawListFlags = { None: number, AntiAliasedLines: number, AntiAliasedLinesUseTex: number, AntiAliasedFill: number, AllowVtxOffset: number, TextNoPixelSnap: number, [string]: number } +export type ImFontFlags = { None: number, NoLoadError: number, NoLoadGlyphs: number, LockBakedSizes: number, ImplicitRefSize: number, [string]: number } +export type ImGuiBackendFlags = { None: number, HasGamepad: number, HasMouseCursors: number, HasSetMousePos: number, RendererHasVtxOffset: number, RendererHasTextures: number, RendererHasViewports: number, PlatformHasViewports: number, HasMouseHoveredViewport: number, HasParentViewport: number, [string]: number } +export type ImGuiButtonFlags = { None: number, MouseButtonLeft: number, MouseButtonRight: number, MouseButtonMiddle: number, EnableNav: number, PressedOnClick: number, PressedOnClickRelease: number, PressedOnClickReleaseAnywhere: number, PressedOnRelease: number, PressedOnDoubleClick: number, PressedOnDragDropHold: number, FlattenChildren: number, AllowOverlap: number, AlignTextBaseLine: number, NoKeyModsAllowed: number, NoHoldingActiveId: number, NoNavFocus: number, NoHoveredOnFocus: number, NoSetKeyOwner: number, NoTestKeyOwner: number, NoFocus: number, MouseButtonMask_: number, PressedOnMask_: number, PressedOnDefault_: number, NoKeyModifiers: number, [string]: number } +export type ImGuiChildFlags = { None: number, Borders: number, AlwaysUseWindowPadding: number, ResizeX: number, ResizeY: number, AutoResizeX: number, AutoResizeY: number, AlwaysAutoResize: number, FrameStyle: number, NavFlattened: number, ResizeBoth: number, ResizeXAndY: number, [string]: number } +export type ImGuiCol = { Text: number, TextDisabled: number, WindowBg: number, ChildBg: number, PopupBg: number, Border: number, BorderShadow: number, FrameBg: number, FrameBgHovered: number, FrameBgActive: number, TitleBg: number, TitleBgActive: number, TitleBgCollapsed: number, MenuBarBg: number, ScrollbarBg: number, ScrollbarGrab: number, ScrollbarGrabHovered: number, ScrollbarGrabActive: number, CheckMark: number, CheckboxSelectedBg: number, SliderGrab: number, SliderGrabActive: number, Button: number, ButtonHovered: number, ButtonActive: number, Header: number, HeaderHovered: number, HeaderActive: number, Separator: number, SeparatorHovered: number, SeparatorActive: number, ResizeGrip: number, ResizeGripHovered: number, ResizeGripActive: number, InputTextCursor: number, TabHovered: number, Tab: number, TabSelected: number, TabSelectedOverline: number, TabDimmed: number, TabDimmedSelected: number, TabDimmedSelectedOverline: number, DockingPreview: number, DockingEmptyBg: number, PlotLines: number, PlotLinesHovered: number, PlotHistogram: number, PlotHistogramHovered: number, TableHeaderBg: number, TableBorderStrong: number, TableBorderLight: number, TableRowBg: number, TableRowBgAlt: number, TextLink: number, TextSelectedBg: number, TreeLines: number, DragDropTarget: number, DragDropTargetBg: number, UnsavedMarker: number, NavCursor: number, NavWindowingHighlight: number, NavWindowingDimBg: number, ModalWindowDimBg: number, COUNT: number, [string]: number } +export type ImGuiColorEditFlags = { None: number, NoAlpha: number, NoPicker: number, NoOptions: number, NoSmallPreview: number, NoInputs: number, NoTooltip: number, NoLabel: number, NoSidePreview: number, NoDragDrop: number, NoBorder: number, NoColorMarkers: number, AlphaOpaque: number, AlphaNoBg: number, AlphaPreviewHalf: number, AlphaBar: number, HDR: number, DisplayRGB: number, DisplayHSV: number, DisplayHex: number, Uint8: number, Float: number, PickerHueBar: number, PickerHueWheel: number, PickerNoRotate: number, InputRGB: number, InputHSV: number, DefaultOptions_: number, AlphaMask_: number, DisplayMask_: number, DataTypeMask_: number, PickerMask_: number, InputMask_: number, [string]: number } +export type ImGuiComboFlags = { None: number, PopupAlignLeft: number, HeightSmall: number, HeightRegular: number, HeightLarge: number, HeightLargest: number, NoArrowButton: number, NoPreview: number, WidthFitPreview: number, HeightMask_: number, CustomPreview: number, [string]: number } +export type ImGuiCond = { None: number, Always: number, Once: number, FirstUseEver: number, Appearing: number, [string]: number } +export type ImGuiConfigFlags = { None: number, NavEnableKeyboard: number, NavEnableGamepad: number, NoMouse: number, NoMouseCursorChange: number, NoKeyboard: number, DockingEnable: number, ViewportsEnable: number, IsSRGB: number, IsTouchScreen: number, [string]: number } +export type ImGuiDragDropFlags = { None: number, SourceNoPreviewTooltip: number, SourceNoDisableHover: number, SourceNoHoldToOpenOthers: number, SourceAllowNullID: number, SourceExtern: number, PayloadAutoExpire: number, PayloadNoCrossContext: number, PayloadNoCrossProcess: number, AcceptBeforeDelivery: number, AcceptNoDrawDefaultRect: number, AcceptNoPreviewTooltip: number, AcceptDrawAsHovered: number, AcceptPeekOnly: number, [string]: number } +export type ImGuiFocusedFlags = { None: number, ChildWindows: number, RootWindow: number, AnyWindow: number, NoPopupHierarchy: number, DockHierarchy: number, RootAndChildWindows: number, [string]: number } +export type ImGuiHoveredFlags = { None: number, ChildWindows: number, RootWindow: number, AnyWindow: number, NoPopupHierarchy: number, DockHierarchy: number, AllowWhenBlockedByPopup: number, AllowWhenBlockedByActiveItem: number, AllowWhenOverlappedByItem: number, AllowWhenOverlappedByWindow: number, AllowWhenDisabled: number, NoNavOverride: number, ForTooltip: number, Stationary: number, DelayNone: number, DelayShort: number, DelayNormal: number, NoSharedDelay: number, AllowWhenOverlapped: number, RectOnly: number, RootAndChildWindows: number, DelayMask_: number, AllowedMaskForIsWindowHovered: number, AllowedMaskForIsItemHovered: number, [string]: number } +export type ImGuiInputFlags = { None: number, Repeat: number, RouteActive: number, RouteFocused: number, RouteGlobal: number, RouteAlways: number, RouteOverFocused: number, RouteOverActive: number, RouteUnlessBgFocused: number, RouteFromRootWindow: number, Tooltip: number, RepeatRateDefault: number, RepeatRateNavMove: number, RepeatRateNavTweak: number, RepeatUntilRelease: number, RepeatUntilKeyModsChange: number, RepeatUntilKeyModsChangeFromNone: number, RepeatUntilOtherKeyPress: number, LockThisFrame: number, LockUntilRelease: number, CondHovered: number, CondActive: number, CondDefault_: number, RepeatRateMask_: number, RepeatUntilMask_: number, RepeatMask_: number, CondMask_: number, RouteTypeMask_: number, RouteOptionsMask_: number, SupportedByIsKeyPressed: number, SupportedByIsMouseClicked: number, SupportedByShortcut: number, SupportedBySetNextItemShortcut: number, SupportedBySetKeyOwner: number, SupportedBySetItemKeyOwner: number, [string]: number } +export type ImGuiInputTextFlags = { None: number, CharsDecimal: number, CharsHexadecimal: number, CharsScientific: number, CharsUppercase: number, CharsNoBlank: number, AllowTabInput: number, EnterReturnsTrue: number, EscapeClearsAll: number, CtrlEnterForNewLine: number, ReadOnly: number, Password: number, AlwaysOverwrite: number, AutoSelectAll: number, ParseEmptyRefVal: number, DisplayEmptyRefVal: number, NoHorizontalScroll: number, NoUndoRedo: number, ElideLeft: number, CallbackCompletion: number, CallbackHistory: number, CallbackAlways: number, CallbackCharFilter: number, CallbackResize: number, CallbackEdit: number, WordWrap: number, Multiline: number, TempInput: number, LocalizeDecimalPoint: number, [string]: number } +export type ImGuiItemFlags = { None: number, NoTabStop: number, NoNav: number, NoNavDefaultFocus: number, ButtonRepeat: number, AutoClosePopups: number, AllowDuplicateId: number, Disabled: number, LiveEditOnInputText: number, LiveEditOnInputScalar: number, LiveEditOnInput: number, ReadOnly: number, MixedValue: number, NoWindowHoverableCheck: number, AllowOverlap: number, NoNavDisableMouseHover: number, NoMarkEdited: number, NoFocus: number, Inputable: number, HasSelectionUserData: number, IsMultiSelect: number, Default_: number, [string]: number } +export type ImGuiItemStatusFlags = { None: number, HoveredRect: number, HasDisplayRect: number, Edited: number, ToggledSelection: number, ToggledOpen: number, HasDeactivated: number, Deactivated: number, HoveredWindow: number, Visible: number, HasClipRect: number, HasShortcut: number, EditedInternal: number, [string]: number } +export type ImGuiKey = { None: number, NamedKey_BEGIN: number, Tab: number, LeftArrow: number, RightArrow: number, UpArrow: number, DownArrow: number, PageUp: number, PageDown: number, Home: number, End: number, Insert: number, Delete: number, Backspace: number, Space: number, Enter: number, Escape: number, LeftCtrl: number, RightCtrl: number, Menu: number, K0: number, A: number, K: number, U: number, F1: number, F7: number, F13: number, F19: number, Apostrophe: number, CapsLock: number, Keypad0: number, KeypadDecimal: number, AppBack: number, AppForward: number, Oem102: number, GamepadStart: number, GamepadFaceLeft: number, GamepadDpadLeft: number, GamepadL1: number, GamepadL2: number, GamepadL3: number, GamepadLStickLeft: number, GamepadRStickLeft: number, MouseLeft: number, ReservedForModCtrl: number, NamedKey_END: number, NamedKey_COUNT: number, NavKeyboardTweakSlow: number, NavKeyboardTweakFast: number, NavGamepadTweakSlow: number, NavGamepadTweakFast: number, NavGamepadMenu: number, NavGamepadContextMenu: number, [string]: number } +export type ImGuiMouseSource = { Mouse: number, TouchScreen: number, Pen: number, COUNT: number, [string]: number } +export type ImGuiNextItemDataFlags = { None: number, HasWidth: number, HasOpen: number, HasShortcut: number, HasRefVal: number, HasStorageID: number, HasColorMarker: number, [string]: number } +export type ImGuiPopupFlags = { None: number, MouseButtonLeft: number, MouseButtonRight: number, MouseButtonMiddle: number, NoReopen: number, NoOpenOverExistingPopup: number, NoOpenOverItems: number, AnyPopupId: number, AnyPopupLevel: number, AnyPopup: number, MouseButtonShift_: number, MouseButtonMask_: number, InvalidMask_: number, [string]: number } +export type ImGuiSelectableFlags = { None: number, NoAutoClosePopups: number, SpanAllColumns: number, AllowDoubleClick: number, Disabled: number, AllowOverlap: number, Highlight: number, SelectOnNav: number, NoHoldingActiveID: number, SelectOnClick: number, SelectOnRelease: number, SpanAvailWidth: number, SetNavIdOnHover: number, NoPadWithHalfSpacing: number, NoSetKeyOwner: number, [string]: number } +export type ImGuiSliderFlags = { None: number, Logarithmic: number, NoRoundToFormat: number, NoInput: number, WrapAround: number, ClampOnInput: number, ClampZeroRange: number, NoSpeedTweaks: number, ColorMarkers: number, InvalidMask_: number, AlwaysClamp: number, Vertical: number, ReadOnly: number, [string]: number } +export type ImGuiStyleVar = { Alpha: number, DisabledAlpha: number, WindowPadding: number, WindowRounding: number, WindowBorderSize: number, WindowMinSize: number, WindowTitleAlign: number, ChildRounding: number, ChildBorderSize: number, PopupRounding: number, PopupBorderSize: number, FramePadding: number, FrameRounding: number, FrameBorderSize: number, ItemSpacing: number, ItemInnerSpacing: number, IndentSpacing: number, CellPadding: number, ScrollbarSize: number, ScrollbarRounding: number, ScrollbarPadding: number, GrabMinSize: number, GrabRounding: number, ImageRounding: number, ImageBorderSize: number, TabRounding: number, TabBorderSize: number, TabMinWidthBase: number, TabMinWidthShrink: number, TabBarBorderSize: number, TabBarOverlineSize: number, TableAngledHeadersAngle: number, TableAngledHeadersTextAlign: number, TreeLinesSize: number, TreeLinesRounding: number, MenuItemRounding: number, SelectableRounding: number, DragDropTargetRounding: number, ButtonTextAlign: number, SelectableTextAlign: number, SeparatorTextBorderSize: number, SeparatorTextAlign: number, SeparatorTextPadding: number, COUNT: number, [string]: number } +export type ImGuiTreeNodeFlags = { None: number, Selected: number, Framed: number, AllowOverlap: number, NoTreePushOnOpen: number, NoAutoOpenOnLog: number, DefaultOpen: number, OpenOnDoubleClick: number, OpenOnArrow: number, Leaf: number, Bullet: number, FramePadding: number, SpanAvailWidth: number, SpanFullWidth: number, SpanLabelWidth: number, SpanAllColumns: number, LabelSpanAllColumns: number, NavLeftJumpsToParent: number, DrawLinesNone: number, DrawLinesFull: number, DrawLinesToNodes: number, NoNavFocus: number, ClipLabelForTrailingButton: number, UpsideDownArrow: number, CollapsingHeader: number, OpenOnMask_: number, DrawLinesMask_: number, [string]: number } +export type ImGuiViewportFlags = { None: number, IsPlatformWindow: number, IsPlatformMonitor: number, OwnedByApp: number, NoDecoration: number, NoTaskBarIcon: number, NoFocusOnAppearing: number, NoFocusOnClick: number, NoInputs: number, NoRendererClear: number, NoAutoMerge: number, TopMost: number, CanHostOtherWindows: number, IsMinimized: number, IsFocused: number, [string]: number } +export type ImGuiWindowFlags = { None: number, NoTitleBar: number, NoResize: number, NoMove: number, NoScrollbar: number, NoScrollWithMouse: number, NoCollapse: number, AlwaysAutoResize: number, NoBackground: number, NoSavedSettings: number, NoMouseInputs: number, MenuBar: number, HorizontalScrollbar: number, NoFocusOnAppearing: number, NoBringToFrontOnFocus: number, AlwaysVerticalScrollbar: number, AlwaysHorizontalScrollbar: number, NoNavInputs: number, NoNavFocus: number, UnsavedDocument: number, NoDocking: number, DockNodeHost: number, ChildWindow: number, Tooltip: number, Popup: number, Modal: number, ChildMenu: number, NoNav: number, NoDecoration: number, NoInputs: number, [string]: number } +export type ImGuiModule = { + ImGui: ImGuiAPI, + ImVec2: (x: number?, y: number?, z: number?, w: number?) -> ImVec2, + ImVec4: (x: number?, y: number?, z: number?, w: number?) -> ImVec4, + ImDrawFlags: ImDrawFlags, + ImDrawListFlags: ImDrawListFlags, + ImFontFlags: ImFontFlags, + ImGuiBackendFlags: ImGuiBackendFlags, + ImGuiButtonFlags: ImGuiButtonFlags, + ImGuiChildFlags: ImGuiChildFlags, + ImGuiCol: ImGuiCol, + ImGuiColorEditFlags: ImGuiColorEditFlags, + ImGuiComboFlags: ImGuiComboFlags, + ImGuiCond: ImGuiCond, + ImGuiConfigFlags: ImGuiConfigFlags, + ImGuiDragDropFlags: ImGuiDragDropFlags, + ImGuiFocusedFlags: ImGuiFocusedFlags, + ImGuiHoveredFlags: ImGuiHoveredFlags, + ImGuiInputFlags: ImGuiInputFlags, + ImGuiInputTextFlags: ImGuiInputTextFlags, + ImGuiItemFlags: ImGuiItemFlags, + ImGuiItemStatusFlags: ImGuiItemStatusFlags, + ImGuiKey: ImGuiKey, + ImGuiMouseSource: ImGuiMouseSource, + ImGuiNextItemDataFlags: ImGuiNextItemDataFlags, + ImGuiPopupFlags: ImGuiPopupFlags, + ImGuiSelectableFlags: ImGuiSelectableFlags, + ImGuiSliderFlags: ImGuiSliderFlags, + ImGuiStyleVar: ImGuiStyleVar, + ImGuiTreeNodeFlags: ImGuiTreeNodeFlags, + ImGuiViewportFlags: ImGuiViewportFlags, + ImGuiWindowFlags: ImGuiWindowFlags, + [string]: any, +} + +return (require(script:WaitForChild("Impl")) :: any) :: ImGuiModule diff --git a/default.project.json b/default.project.json index dfeabc0..35dd797 100644 --- a/default.project.json +++ b/default.project.json @@ -3,7 +3,7 @@ "tree": { "$className": "DataModel", "ReplicatedStorage": { - "ImGui": { "$path": "build/ImGui.luau" } + "ImGui": { "$path": "build/ImGuiTyped.luau", "Impl": { "$path": "build/ImGui.luau" } } }, "StarterPlayer": { "StarterPlayerScripts": { diff --git a/examples/example_shared/default.project.json b/examples/example_shared/default.project.json index c7c3017..5728ad1 100644 --- a/examples/example_shared/default.project.json +++ b/examples/example_shared/default.project.json @@ -3,7 +3,7 @@ "tree": { "$className": "DataModel", "ReplicatedStorage": { - "ImGui": { "$path": "../../build/ImGui.luau" }, + "ImGui": { "$path": "../../build/ImGuiTyped.luau", "Impl": { "$path": "../../build/ImGui.luau" } }, "SharedApp": { "$path": "app.lua" } }, "StarterPlayer": { diff --git a/tools/bundle.py b/tools/bundle.py index fea9769..9b196a0 100644 --- a/tools/bundle.py +++ b/tools/bundle.py @@ -6,6 +6,7 @@ # Why: ModuleScripts don't share globals, and the setfenv() alternative turns off Luau's fast paths / native codegen. # Each source file becomes a function in __FILES; IM_INCLUDE(name) runs it once and caches the result. # The module returns a table with every global the library defines (ImGui, ImVec2, ImGuiConfigFlags, ImGui_ImplRoblox, ...). +# Roblox target also writes ImGuiTyped.luau (types + require(script.Impl), see tools/gen_types.py). import os, re ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -64,4 +65,8 @@ NAME = "imgui_love.lua" if LOVE else "ImGui.luau" open(os.path.join(OUT, NAME), "w").write("\n".join(out) + "\n") import json json.dump(linemap, open(os.path.join(OUT, NAME.rsplit(".", 1)[0] + ".linemap.json"), "w")) +if not LOVE: + sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) + from gen_types import wrapper + open(os.path.join(OUT, "ImGuiTyped.luau"), "w").write(wrapper(FILES)) print("wrote build/%s (%d files, %d exports)" % (NAME, len(FILES), len(names))) diff --git a/tools/gen_types.py b/tools/gen_types.py new file mode 100644 index 0000000..37dc95f --- /dev/null +++ b/tools/gen_types.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +# Typed entry module for the Roblox build: bundle.py writes build/ImGuiTyped.luau = Luau types + `require(script.Impl)`, +# where Impl is the untouched build/ImGui.luau (the bundle itself is too large for Luau's type inference to finish, +# so the types live in this small wrapper instead). Library sources and the LÖVE build are not affected. +# Public ImGui.* signatures come from upstream imgui.h (namespace ImGui), mapped onto the port's own parameter lists. +# Anything ambiguous (overloads, char* buffers, arrays, multiple out-params, count mismatch) falls back to `any`, +# so the types never reject code that runs. Enum tables (ImGuiWindowFlags, ImGuiCol, ...) get their exact keys. +# Self-check: python3 tools/gen_types.py (prints a few signatures) +import os, re + +ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +NUM = re.compile(r"^(int|float|double|unsigned int|unsigned short|short|size_t|ImU32|ImS32|ImU64|ImS64|ImWchar|ImGuiID|Im\w*Flags|ImGui(Col|Cond|StyleVar|Key|MouseButton|MouseCursor|Dir|DataType|SortDirection|TableBgTarget|Axis))$") +VEC = {"ImVec2": "ImVec2", "ImVec4": "ImVec4"} + +def lua_type(ctype): + t = re.sub(r"\bconst\b|&", "", ctype).strip() + t = re.sub(r"\s+", " ", t) + if t == "char*": return "string" if "const" in ctype else None + if t == "bool": return "boolean" + if NUM.match(t): return "number" + return VEC.get(t) + +def split_params(s): + out, depth, cur = [], 0, "" + for ch in s: + if ch in "([": depth += 1 + if ch in ")]": depth -= 1 + if ch == "," and depth == 0: out.append(cur); cur = "" + else: cur += ch + if cur.strip(): out.append(cur) + return [p.strip() for p in out] + +def upstream_decls(): + src = open(os.path.join(ROOT, "tools", "test", "upstream", "imgui.h")).read() + body = src[src.index("namespace ImGui\n"):src.index("} // namespace ImGui")] + decls = {} + for m in re.finditer(r"IMGUI_API\s+([\w\s\*&]+?)\s*\b(\w+)\((.*?)\)\s*(?:IM_FMT\w+\(\d+\))?\s*;", body): + decls.setdefault(m.group(2), []).append((m.group(1).strip(), split_params(m.group(3)) if m.group(3).strip() not in ("", "void") else [])) + return decls + +LOOSE = "(...any) -> ...any" + +def signature(port_params, ret, cparams): + if any(p == "..." for p in cparams): + if port_params and port_params[-1] == "...": port_params = port_params[:-1] + cparams = [p for p in cparams if p != "..."]; vararg = True + else: vararg = False + if len(port_params) != len(cparams): return LOOSE + args, outs = [], [] + for name, cp in zip(port_params, cparams): + decl, _, default = cp.partition("=") + m = re.match(r"(.*?)\b(\w+)\s*(\[\w*\])?\s*$", decl.strip()) + if not m: return LOOSE + ctype, array = m.group(1).strip(), m.group(3) + if "(*" in cp: return LOOSE + ptr = ctype.endswith("*") and not re.search(r"\bchar\s*\*$", ctype) + if array: t = None; outs.append("array") + elif ptr and re.search(r"\bconst\b", ctype): t = None # input array (e.g. ColorPicker4 ref_col) + elif ptr: + t = lua_type(ctype[:-1]) + if t in ("boolean", "number"): outs.append(t) + else: t = None; outs.append("other") + else: t = lua_type(ctype) + if name == "...": args.append("...any"); continue + opt = "?" if (default.strip() or (ptr and t == "boolean")) else "" + args.append("%s: %s%s" % (name, t or "any", opt if t else "")) + if vararg: args.append("...any") + r = re.sub(r"\bconst\b|&|IMGUI_API", "", ret).strip() + if r == "void": rt = "...any" if outs else "()" + elif r == "bool": + scal = [o for o in outs if o != "array"] + if not scal: rt = "boolean" + elif len(scal) == 1 and scal[0] == "boolean": rt = "(boolean, boolean?)" + elif len(scal) == 1 and scal[0] == "number": rt = "(number, boolean)" + else: rt = "...any" + else: + rt = lua_type(r) or "any" + if outs: rt = "...any" + return "(%s) -> %s" % (", ".join(args), rt) + +def port_functions(files): + fns = {} + for src in files.values(): + for m in re.finditer(r"^function ImGui\.(\w+)\((.*?)\)", src, re.M): + fns[m.group(1)] = [p.strip() for p in m.group(2).split(",") if p.strip()] + return fns + +def enums(files): + src = files.get("imgui_h.lua", "") + out = {} + for m in re.finditer(r"^(Im\w+) = \{\n(.*?)^\}", src, re.M | re.S): + keys = re.findall(r"^\s+(\w+)\s*=", m.group(2), re.M) + if keys: out[m.group(1)] = keys + for f in files.values(): # keys added later (ImGuiKey letters in loops are covered by the indexer below) + for name, key in re.findall(r"^\s*(Im\w+)\.(\w+)\s*=", f, re.M): + if name in out and key not in out[name]: out[name].append(key) + return out + +def types_header(files): + decls, fns = upstream_decls(), port_functions(files) + lines = ["export type ImVec2 = { x: number, y: number, [any]: any }", + "export type ImVec4 = { x: number, y: number, z: number, w: number, [any]: any }", + "export type ImGuiAPI = {"] + for name in sorted(fns): + d = decls.get(name) + sig = signature(fns[name], *d[0]) if d and len(d) == 1 else LOOSE + lines.append(" %s: %s," % (name, sig)) + lines += [" [string]: any,", "}"] + for name, keys in sorted(enums(files).items()): + lines.append("export type %s = { %s, [string]: number }" % (name, ", ".join("%s: number" % k for k in keys))) + return lines + module_type(set(enums(files))) + +def wrapper(files): + return "\n".join(["--!strict", "-- GENERATED by tools/gen_types.py - do not edit. The library is the child ModuleScript 'Impl'.", ""] + + types_header(files) + ["", "return (require(script:WaitForChild(\"Impl\")) :: any) :: ImGuiModule", ""]) + +def module_type(enum_names): + # the bundle is too large for Luau to infer, so its return value is cast to this explicit type + lines = ["export type ImGuiModule = {", " ImGui: ImGuiAPI,"] + lines += [" %s: (x: number?, y: number?, z: number?, w: number?) -> %s," % (n, n) for n in ("ImVec2", "ImVec4")] + lines += [" %s: %s," % (n, n) for n in sorted(enum_names)] + return lines + [" [string]: any,", "}"] + +if __name__ == "__main__": + import glob + files = {os.path.basename(f): open(f).read() for f in glob.glob(os.path.join(ROOT, "*.lua"))} + lines = types_header(files) + for l in lines: + if re.match(r" (Begin|Checkbox|SliderFloat|SliderFloat3|Text|Button|Combo|GetCursorPos|InputText|DragFloatRange2):", l): print(l) + loose = sum(LOOSE in l for l in lines); print("%d functions, %d loose" % (sum(l.startswith(" ") for l in lines), loose))