Lua: Fix comment line endings

Change-Id: I00a5ece580b69a65c8fa60eae8458526d1df257e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-06-13 06:59:00 +02:00
parent e331329e4f
commit 8f715a350b
12 changed files with 156 additions and 162 deletions

View File

@@ -4,30 +4,30 @@ local action = {}
---@enum CommandAttributes ---@enum CommandAttributes
action.CommandAttribute = { action.CommandAttribute = {
---Hide the command from the menu ---Hide the command from the menu.
CA_Hide = 1, CA_Hide = 1,
---Update the text of the command ---Update the text of the command.
CA_UpdateText = 2, CA_UpdateText = 2,
---Update the icon of the command ---Update the icon of the command.
CA_UpdateIcon = 4, CA_UpdateIcon = 4,
---The command cannot be configured ---The command cannot be configured.
CA_NonConfigurable = 8, CA_NonConfigurable = 8,
} }
---@class ActionOptions ---@class ActionOptions
---@field context? string The context in which the action is available ---@field context? string The context in which the action is available.
---@field text? string The text to display for the action ---@field text? string The text to display for the action.
---@field iconText? string The icon text to display for the action ---@field iconText? string The icon text to display for the action.
---@field toolTip? string The tooltip to display for the action ---@field toolTip? string The tooltip to display for the action.
---@field onTrigger? function The callback to call when the action is triggered ---@field onTrigger? function The callback to call when the action is triggered.
---@field commandAttributes? CommandAttributes The attributes of the action ---@field commandAttributes? CommandAttributes The attributes of the action.
---@field commandDescription? string The description of the command ---@field commandDescription? string The description of the command.
---@field defaultKeySequence? string The default key sequence for the action ---@field defaultKeySequence? string The default key sequence for the action.
---@field defaultKeySequences? string[] The default key sequences for the action ---@field defaultKeySequences? string[] The default key sequences for the action.
local ActionOptions = {} local ActionOptions = {}
---Creates a new Action ---Creates a new Action.
---@param id string The id of the action ---@param id string The id of the action.
---@param options ActionOptions ---@param options ActionOptions
function action.create(id, options) end function action.create(id, options) end

View File

@@ -20,7 +20,7 @@ local async = {}
function async.sync(func) end function async.sync(func) end
---@async ---@async
---Calls an async function and waits for it to finish. **Must** be called from async.sync() ---Calls an async function and waits for it to finish. **Must** be called from async.sync().
--- ---
--- Example: --- Example:
--- ```lua --- ```lua
@@ -39,7 +39,7 @@ function async.sync(func) end
function async.wait(func) end function async.wait(func) end
---@async ---@async
---Calls multiple async functions and waits for all of them to finish. **Must** be called from async.sync() ---Calls multiple async functions and waits for all of them to finish. **Must** be called from async.sync().
--- ---
--- Example: --- Example:
--- ```lua --- ```lua

View File

@@ -16,10 +16,10 @@ Core.GeneratedFile.Attribute = {
---@field filePath FilePath ---@field filePath FilePath
---@field contents string ---@field contents string
---@field isBinary boolean ---@field isBinary boolean
---@field attributes Attribute A combination of Attribute ---@field attributes Attribute A combination of Attribute.
Core.GeneratedFile = {} Core.GeneratedFile = {}
---Create a new GeneratedFile ---Create a new GeneratedFile.
---@return GeneratedFile ---@return GeneratedFile
function Core.GeneratedFile.new() end function Core.GeneratedFile.new() end

View File

@@ -1,12 +1,12 @@
---@meta Fetch ---@meta Fetch
local Fetch = {} local Fetch = {}
---A network reply from fetch ---A network reply from fetch.
---@class QNetworkReply ---@class QNetworkReply
---@field error integer The error code of the reply or 0 if no error ---@field error integer The error code of the reply or 0 if no error.
local QNetworkReply = {} local QNetworkReply = {}
---Returns the data of the reply ---Returns the data of the reply.
---@return string ---@return string
function QNetworkReply:readAll() end function QNetworkReply:readAll() end
@@ -16,15 +16,15 @@ function QNetworkReply:readAll() end
function Fetch.fetch(options) end function Fetch.fetch(options) end
--@param options FetchOptions --@param options FetchOptions
--@param callback function The callback to call when the fetch is done --@param callback function The callback to call when the fetch is done.
function Fetch.fetch_cb(options, callback) end function Fetch.fetch_cb(options, callback) end
---@class FetchOptions ---@class FetchOptions
---@field url string The url to fetch ---@field url string The url to fetch.
---@field method? string The method to use (GET, POST, ...), default is GET ---@field method? string The method to use (GET, POST, ...), default is GET.
---@field headers? table The headers to send ---@field headers? table The headers to send.
---@field body? string The body to send ---@field body? string The body to send.
---@field convertToTable? boolean If true, the resulting data will expect JSON and converted it to a table ---@field convertToTable? boolean If true, the resulting data will expect JSON and converted it to a table.
local FetchOptions = {} local FetchOptions = {}
return Fetch return Fetch

View File

@@ -2,11 +2,11 @@
local gui = {} local gui = {}
---The base class of all ui related classes ---The base class of all ui related classes.
---@class Object ---@class Object
gui.Object = {} gui.Object = {}
---The base class of all gui layout classes ---The base class of all gui layout classes.
---@class Layout : Object ---@class Layout : Object
gui.Layout = {} gui.Layout = {}
@@ -26,14 +26,14 @@ local column = {}
---@return Column ---@return Column
function gui.Column(children) end function gui.Column(children) end
---A group box with a title ---A group box with a title.
---@class Group : Widget ---@class Group : Widget
local group = {} local group = {}
---@return Group ---@return Group
function gui.Group(children) end function gui.Group(children) end
---Row layout ---Row layout.
---@class Row : Layout ---@class Row : Layout
local row = {} local row = {}
@@ -41,7 +41,7 @@ local row = {}
---@return Row ---@return Row
function gui.Row(children) end function gui.Row(children) end
---Flow layout ---Flow layout.
---@class Flow : Layout ---@class Flow : Layout
local flow = {} local flow = {}
@@ -49,7 +49,7 @@ local flow = {}
---@return Flow ---@return Flow
function gui.Flow(children) end function gui.Flow(children) end
---Grid layout ---Grid layout.
---@class Grid : Layout ---@class Grid : Layout
local grid = {} local grid = {}
@@ -57,7 +57,7 @@ local grid = {}
---@return Grid ---@return Grid
function gui.Grid(children) end function gui.Grid(children) end
---Form layout ---Form layout.
---@class Form : Layout ---@class Form : Layout
local form = {} local form = {}
@@ -66,7 +66,7 @@ local form = {}
function gui.Form(children) end function gui.Form(children) end
---A stack of multiple widgets ---A stack of multiple widgets.
---@class Stack : Widget ---@class Stack : Widget
local stack = {} local stack = {}
@@ -74,7 +74,7 @@ local stack = {}
---@return Stack ---@return Stack
function gui.Stack(children) end function gui.Stack(children) end
---A Tab widget ---A Tab widget.
---@class Tab : Widget ---@class Tab : Widget
local tab = {} local tab = {}
@@ -82,7 +82,7 @@ local tab = {}
---@return Tab ---@return Tab
function gui.Tab(children) end function gui.Tab(children) end
---A Multiline text edit ---A Multiline text edit.
---@class TextEdit : Widget ---@class TextEdit : Widget
local textEdit = {} local textEdit = {}
@@ -90,7 +90,6 @@ local textEdit = {}
---@return TextEdit ---@return TextEdit
function gui.TextEdit(children) end function gui.TextEdit(children) end
---A PushButton
---@class PushButton : Widget ---@class PushButton : Widget
local pushButton = {} local pushButton = {}
@@ -98,7 +97,6 @@ local pushButton = {}
---@return PushButton ---@return PushButton
function gui.PushButton(children) end function gui.PushButton(children) end
---A Label
---@class Label : LayoutItem ---@class Label : LayoutItem
local label = {} local label = {}
@@ -106,7 +104,6 @@ local label = {}
---@return Label ---@return Label
function gui.Label(children) end function gui.Label(children) end
---A SpinBox
---@class SpinBox : Widget ---@class SpinBox : Widget
local spinBox = {} local spinBox = {}
@@ -114,7 +111,6 @@ local spinBox = {}
---@return SpinBox ---@return SpinBox
function gui.SpinBox(children) end function gui.SpinBox(children) end
---A Splitter
---@class Splitter : Widget ---@class Splitter : Widget
local splitter = {} local splitter = {}
@@ -122,7 +118,6 @@ local splitter = {}
---@return Splitter ---@return Splitter
function gui.Splitter(children) end function gui.Splitter(children) end
---A Toolbar
---@class ToolBar : Widget ---@class ToolBar : Widget
local toolBar = {} local toolBar = {}
@@ -130,7 +125,6 @@ local toolBar = {}
---@return ToolBar ---@return ToolBar
function gui.ToolBar(children) end function gui.ToolBar(children) end
---A TabWidget
---@class TabWidget : Widget ---@class TabWidget : Widget
local tabWidget = {} local tabWidget = {}
@@ -142,40 +136,40 @@ function gui.TabWidget(children) end
---@param child Layout|string|BaseAspect|function ---@param child Layout|string|BaseAspect|function
---@return TabWidget ---@return TabWidget
function gui.TabWidget(name, child) end function gui.TabWidget(name, child) end
---A "Line break" in the gui ---A "Line break" in the gui.
function gui.br() end function gui.br() end
---A "Stretch" in the layout ---A "Stretch" in the layout.
function gui.st() end function gui.st() end
---An empty grid cell in a grid layout ---An empty grid cell in a grid layout.
function gui.empty() end function gui.empty() end
---A horizontal line in the layout ---A horizontal line in the layout.
function gui.hr() end function gui.hr() end
---Clears the margin of the layout ---Clears the margin of the layout.
function gui.noMargin() end function gui.noMargin() end
---Sets the margin of the layout to the default value ---Sets the margin of the layout to the default value.
function gui.normalMargin() end function gui.normalMargin() end
---Sets the alignment of a Grid layout according to the Form layout rules ---Sets the alignment of a Grid layout according to the Form layout rules.
function gui.withFormAlignment() end function gui.withFormAlignment() end
---Sets the size of the parent object if possible ---Sets the size of the parent object if possible.
function gui.resize(width, height) end function gui.resize(width, height) end
---Sets the spacing of the gui ---Sets the spacing of the gui.
function gui.spacing(spacing) end function gui.spacing(spacing) end
---Sets the field growth policy of the gui ---Sets the field growth policy of the gui.
function gui.fieldGrowthPolicy(policy) end function gui.fieldGrowthPolicy(policy) end
---Sets the onClicked handler of the parent object if possible ---Sets the onClicked handler of the parent object if possible.
function gui.onClicked(f) end function gui.onClicked(f) end
---Sets the onTextChanged handler of the parent object if possible ---Sets the onTextChanged handler of the parent object if possible.
function gui.onTextChanged(f) end function gui.onTextChanged(f) end
return gui return gui

View File

@@ -3,26 +3,26 @@
local Install = {} local Install = {}
---@class PackageInfo ---@class PackageInfo
---@field name string The name of the package ---@field name string The name of the package.
---@field version string The version of the package ---@field version string The version of the package.
---@field path FilePath The path to the package ---@field path FilePath The path to the package.
local PackageInfo = {} local PackageInfo = {}
---@class InstallOptions ---@class InstallOptions
---@field name string The name of the package to install ---@field name string The name of the package to install.
---@field url string The url to fetch the package from ---@field url string The url to fetch the package from.
---@field version string The version of the package to install ---@field version string The version of the package to install.
local InstallOptions = {} local InstallOptions = {}
---Install something ---Install something
---@param msg string The message to display to the user asking for permission to install ---@param msg string The message to display to the user asking for permission to install.
---@param options InstallOptions|[InstallOptions] The options to install ---@param options InstallOptions|[InstallOptions] The options to install.
---@return boolean Result Whether the installation was successful ---@return boolean Result Whether the installation was successful.
---@return string Error The error message if the installation failed. ---@return string Error The error message if the installation failed.
function Install.install(msg, options) end function Install.install(msg, options) end
---Get the package info ---Get the package info
---@param name any The name of the package ---@param name any The name of the package.
---@return PackageInfo ---@return PackageInfo
function Install.packageInfo(name) end function Install.packageInfo(name) end

View File

@@ -1,38 +1,38 @@
---@meta LSP ---@meta LSP.
local lsp = {} local lsp = {}
---@class ClientOptions ---@class ClientOptions
---@field name string The name under which to register the language server. ---@field name string The name under which to register the language server.
---@field cmd function|string[] The command to start the language server, or a function returning a string[]. ---@field cmd function|string[] The command to start the language server, or a function returning a string[].
---@field transport? "stdio"|"localsocket" Defaults to stdio ---@field transport? "stdio"|"localsocket" Defaults to stdio.
---@field serverName? string The socket path when transport == "localsocket" ---@field serverName? string The socket path when transport == "localsocket".
---@field languageFilter LanguageFilter The language filter deciding which files to open with the language server ---@field languageFilter LanguageFilter The language filter deciding which files to open with the language server.
---@field startBehavior? "AlwaysOn"|"RequiresFile"|"RequiresProject" ---@field startBehavior? "AlwaysOn"|"RequiresFile"|"RequiresProject"
---@field initializationOptions? table|string The initialization options to pass to the language server, either a json string, or a table ---@field initializationOptions? table|string The initialization options to pass to the language server, either a JSON string, or a table.
---@field settings? AspectContainer ---@field settings? AspectContainer
---@field onStartFailed? function This callback is called when client failed to start. ---@field onStartFailed? function This callback is called when client failed to start.
local ClientOptions = {} local ClientOptions = {}
---@class LanguageFilter ---@class LanguageFilter
---@field patterns? string[] The file patterns supported by the language server ---@field patterns? string[] The file patterns supported by the language server.
---@field mimeTypes? string[] The mime types supported by the language server ---@field mimeTypes? string[] The mime types supported by the language server.
local LanguageFilter = {} local LanguageFilter = {}
---@class Client ---@class Client
---@field on_instance_start function The callback to call when a language client starts ---@field on_instance_start function The callback to call when a language client starts.
lsp.Client = {} lsp.Client = {}
---@param msg string The name of the message to handle ---@param msg string The name of the message to handle.
---@param callback function The callback to call when the message is received ---@param callback function The callback to call when the message is received.
---Registers a message handler for the message named 'msg' ---Registers a message handler for the message named 'msg'.
function lsp.Client:registerMessage(msg, callback) end function lsp.Client:registerMessage(msg, callback) end
---@param msg table the message to send ---@param msg table the message to send.
---Sends a message to the language server ---Sends a message to the language server.
function lsp.Client:sendMessage(msg, callback) end function lsp.Client:sendMessage(msg, callback) end
---Creates a new Language Client ---Creates a new Language Client.
---@param options ClientOptions ---@param options ClientOptions
---@return Client ---@return Client
function lsp.Client.create(options) end function lsp.Client.create(options) end

View File

@@ -2,15 +2,15 @@
local messagemanager = {} local messagemanager = {}
---Writes a message to the Output pane ---Writes a message to the Output pane.
---@param ... any ---@param ... any
function messagemanager.writeSilently(...) end function messagemanager.writeSilently(...) end
---Writes a message to the Output pane and flashes the pane if its not open ---Writes a message to the Output pane and flashes the pane if its not open.
---@param ... any ---@param ... any
function messagemanager.writeFlashing(...) end function messagemanager.writeFlashing(...) end
---Writes a message to the Output pane and opens the pane if its not open ---Writes a message to the Output pane and opens the pane if its not open.
---@param ... any ---@param ... any
function messagemanager.writeDisrupting(...) end function messagemanager.writeDisrupting(...) end

View File

@@ -4,14 +4,14 @@ local process = {}
---@async ---@async
---Runs a command in a terminal, has to be called from a coroutine! ---Runs a command in a terminal, has to be called from a coroutine!
---@param cmd string The command to run ---@param cmd string The command to run.
---@return number The exit code of the command ---@return number exitCode The exit code of the command.
function process.runInTerminal(cmd) end function process.runInTerminal(cmd) end
---@async ---@async
---Runs a command and returns the output! ---Runs a command and returns the output!
---@param cmd string The command to run ---@param cmd string The command to run.
---@return string The output of the command ---@return string output The output of the command.
function process.commandOutput(cmd) end function process.commandOutput(cmd) end
return process return process

View File

@@ -8,48 +8,48 @@ local settings = {}
---@class BaseAspect ---@class BaseAspect
settings.BaseAspect = {} settings.BaseAspect = {}
---Applies the changes from its volatileValue to its value ---Applies the changes from its volatileValue to its value.
function settings.BaseAspect:apply() end function settings.BaseAspect:apply() end
---@class AspectCreate ---@class AspectCreate
---@field settingsKey? string The settings key of the aspect ---@field settingsKey? string The settings key of the aspect.
---@field displayName? string The display name of the aspect ---@field displayName? string The display name of the aspect.
---@field labelText? string The label text of the aspect ---@field labelText? string The label text of the aspect.
---@field toolTip? string The tool tip of the aspect ---@field toolTip? string The tool tip of the aspect.
---@field enabler? BoolAspect Enable / Disable this aspect based on the state of the `enabler` ---@field enabler? BoolAspect Enable / Disable this aspect based on the state of the `enabler`.
---@field onValueChanged? function () Called when the value of the aspect changes ---@field onValueChanged? function () Called when the value of the aspect changes.
---@field onVolatileValueChanged? function () Called when the volatile value of the aspect changes ---@field onVolatileValueChanged? function () Called when the volatile value of the aspect changes.
local AspectCreate = {} local AspectCreate = {}
---The base class of most typed aspects ---The base class of most typed aspects.
---@generic T ---@generic T
---@class TypedAspect<T> : BaseAspect ---@class TypedAspect<T> : BaseAspect
---@field value `T` The value of the aspect ---@field value `T` The value of the aspect.
---@field volatileValue `T` The temporary value of the aspect ---@field volatileValue `T` The temporary value of the aspect.
---@field defaultValue `T` The default value of the aspect ---@field defaultValue `T` The default value of the aspect.
local TypedAspect = {} local TypedAspect = {}
---@generic T ---@generic T
---@class TypedAspectCreate<T> : AspectCreate ---@class TypedAspectCreate<T> : AspectCreate
---@field defaultValue `T` The default value of the aspect ---@field defaultValue `T` The default value of the aspect.
local TypedAspectCreate = {} local TypedAspectCreate = {}
---A container for aspects ---A container for aspects.
---@class AspectContainer : BaseAspect ---@class AspectContainer : BaseAspect
settings.AspectContainer = {} settings.AspectContainer = {}
---Options for creating an AspectContainer ---Options for creating an AspectContainer.
---@class AspectContainerCreate ---@class AspectContainerCreate
---@field autoApply? boolean Whether the aspects should be applied automatically or not ---@field autoApply? boolean Whether the aspects should be applied automatically or not.
AspectContainerCreate = {} AspectContainerCreate = {}
---Create a new AspectContainer ---Create a new AspectContainer.
---@param options AspectContainerCreate ---@param options AspectContainerCreate
---@return AspectContainer ---@return AspectContainer
function settings.AspectContainer.create(options) end function settings.AspectContainer.create(options) end
---A aspect containing a boolean value ---A aspect containing a boolean value.
---@class BoolAspect : TypedAspect<boolean> ---@class BoolAspect : TypedAspect<boolean>
settings.BoolAspect = {} settings.BoolAspect = {}
@@ -63,7 +63,7 @@ settings.LabelPlacement = {
---@field labelPlacement? LabelPlacement: ---@field labelPlacement? LabelPlacement:
BoolAspectCreate = {} BoolAspectCreate = {}
---Create a new BoolAspect ---Create a new BoolAspect.
---@param options BoolAspectCreate ---@param options BoolAspectCreate
---@return BoolAspect ---@return BoolAspect
function settings.BoolAspect.create(options) end function settings.BoolAspect.create(options) end
@@ -86,15 +86,15 @@ settings.StringDisplayStyle = {
}; };
---@class StringAspectCreate : TypedAspectCreate<string> ---@class StringAspectCreate : TypedAspectCreate<string>
---@field displayStyle? StringDisplayStyle The display type of the aspect ---@field displayStyle? StringDisplayStyle The display type of the aspect.
---@field historyId? string The history id of the aspect ---@field historyId? string The history id of the aspect.
---@field valueAcceptor? function string (oldvalue: string, newValue: string) ---@field valueAcceptor? function string (oldvalue: string, newValue: string)
---@field showToolTipOnLabel? boolean ---@field showToolTipOnLabel? boolean
---@field displayFilter? function string (value: string) ---@field displayFilter? function string (value: string)
---@field placeHolderText? string ---@field placeHolderText? string
---@field acceptRichText? boolean ---@field acceptRichText? boolean
---@field autoApplyOnEditingFinished? boolean ---@field autoApplyOnEditingFinished? boolean
---@field elideMode? Qt.TextElideMode The elide mode of the aspect ---@field elideMode? Qt.TextElideMode The elide mode of the aspect.
StringAspectCreate = {} StringAspectCreate = {}
---@class StringAspect : TypedAspect<string> ---@class StringAspect : TypedAspect<string>
@@ -116,9 +116,9 @@ settings.Kind = {
}; };
---@class FilePathAspectCreate ---@class FilePathAspectCreate
---@field expectedKind? Kind The kind of path we want to select ---@field expectedKind? Kind The kind of path we want to select.
---@field historyId? string The history id of the aspect ---@field historyId? string The history id of the aspect.
---@field defaultPath? FilePath The default path of the aspect ---@field defaultPath? FilePath The default path of the aspect.
---@field promptDialogFilter? string ---@field promptDialogFilter? string
---@field promptDialogTitle? string ---@field promptDialogTitle? string
---@field commandVersionArguments? string[] ---@field commandVersionArguments? string[]
@@ -136,8 +136,8 @@ settings.Kind = {
FilePathAspectCreate = {} FilePathAspectCreate = {}
---@class FilePathAspect ---@class FilePathAspect
---@field expandedValue FilePath The expanded value of the aspect ---@field expandedValue FilePath The expanded value of the aspect.
---@field defaultPath FilePath The default path of the aspect ---@field defaultPath FilePath The default path of the aspect.
settings.FilePathAspect = {} settings.FilePathAspect = {}
---Create a new FilePathAspect ---Create a new FilePathAspect
@@ -146,7 +146,7 @@ settings.FilePathAspect = {}
function settings.FilePathAspect.create(options) end function settings.FilePathAspect.create(options) end
---Set the value of the aspect ---Set the value of the aspect
---@param value string|FilePath The value to set ---@param value string|FilePath The value to set.
function settings.FilePathAspect:setValue(value) end function settings.FilePathAspect:setValue(value) end
settings.IntegerAspect = {} settings.IntegerAspect = {}
@@ -179,7 +179,7 @@ settings.OptionsPage = {}
---@field aspectContainer AspectContainer ---@field aspectContainer AspectContainer
OptionsPageCreate = {} OptionsPageCreate = {}
---Creates a new OptionsPage ---Creates a new OptionsPage.
---@param options OptionsPageCreate ---@param options OptionsPageCreate
---@return OptionsPage ---@return OptionsPage
function settings.OptionsPage.create(options) end function settings.OptionsPage.create(options) end

View File

@@ -1,36 +1,36 @@
---@meta ---@meta
---@class QRect ---@class QRect
---@field x integer The x position of the rectangle ---@field x integer The x position of the rectangle.
---@field y integer The y position of the rectangle ---@field y integer The y position of the rectangle.
---@field width integer The width of the rectangle ---@field width integer The width of the rectangle.
---@field height integer The height of the rectangle ---@field height integer The height of the rectangle.
QRect = {} QRect = {}
---@class QSize ---@class QSize
---@field width integer The width of the size ---@field width integer The width of the size.
---@field height integer The height of the size ---@field height integer The height of the size.
QSize = {} QSize = {}
---@class QPoint ---@class QPoint
---@field x integer The x position of the point ---@field x integer The x position of the point.
---@field y integer The y position of the point ---@field y integer The y position of the point.
QPoint = {} QPoint = {}
---@class QPointF ---@class QPointF
---@field x number The x position of the floating point ---@field x number The x position of the floating point.
---@field y number The y position of the floating point ---@field y number The y position of the floating point.
QPointF = {} QPointF = {}
---@class QSizeF ---@class QSizeF
---@field width number The width of the floating point size ---@field width number The width of the floating point size.
---@field height number The height of the floating point size ---@field height number The height of the floating point size.
QSizeF = {} QSizeF = {}
---@class QRectF ---@class QRectF
---@field x number The x position of the floating point rectangle ---@field x number The x position of the floating point rectangle.
---@field y number The y position of the floating point rectangle ---@field y number The y position of the floating point rectangle.
---@field width number The width of the floating point rectangle ---@field width number The width of the floating point rectangle.
---@field height number The height of the floating point rectangle ---@field height number The height of the floating point rectangle.
QRectF = {} QRectF = {}

View File

@@ -3,99 +3,99 @@
local utils = {} local utils = {}
---Suspends the current coroutine for the given amount of milliseconds. Call `a.wait` on the returned value to get the result. ---Suspends the current coroutine for the given amount of milliseconds. Call `a.wait` on the returned value to get the result.
---@param ms number The amount of milliseconds to wait ---@param ms number The amount of milliseconds to wait.
function utils.waitms(ms) end function utils.waitms(ms) end
---Calls the callback after the given amount of milliseconds ---Calls the callback after the given amount of milliseconds.
---@param ms number The amount of milliseconds to wait ---@param ms number The amount of milliseconds to wait.
---@param callback function The callback to call ---@param callback function The callback to call.
function utils.waitms_cb(ms, callback) end function utils.waitms_cb(ms, callback) end
---@class FilePath ---@class FilePath
utils.FilePath = {} utils.FilePath = {}
---@param path string The path to convert ---@param path string The path to convert.
---@return FilePath The converted path ---@return FilePath The converted path.
---Convert and clean a path, returning a FilePath object ---Convert and clean a path, returning a FilePath object.
function utils.FilePath.fromUserInput(path) end function utils.FilePath.fromUserInput(path) end
---@return FilePath The new absolute path ---@return FilePath The new absolute path.
---Searches for the path inside the PATH environment variable. Call `a.wait` on the returned value to get the result. ---Searches for the path inside the PATH environment variable. Call `a.wait` on the returned value to get the result.
function utils.FilePath:searchInPath() end function utils.FilePath:searchInPath() end
---@class (exact) DirEntriesOptions ---@class (exact) DirEntriesOptions
---@field nameFilters? string[] The name filters to use (e.g. "*.lua"), defaults to all files ---@field nameFilters? string[] The name filters to use (e.g. "*.lua"), defaults to all files.
---@field fileFilters? integer The filters to use (combination of QDir.Filters.*), defaults to QDir.Filters.NoFilter ---@field fileFilters? integer The filters to use (combination of QDir.Filters.*), defaults to QDir.Filters.NoFilter.
---@field flags? integer The iterator flags (combination of QDirIterator.Flags.*), defaults to QDirIterator.Flags.NoIteratorFlags ---@field flags? integer The iterator flags (combination of QDirIterator.Flags.*), defaults to QDirIterator.Flags.NoIteratorFlags.
---Returns all entries in the directory. Call `a.wait` on the returned value to get the result. ---Returns all entries in the directory. Call `a.wait` on the returned value to get the result.
---@param options DirEntriesOptions ---@param options DirEntriesOptions
---@return FilePath[] ---@return FilePath[]
function utils.FilePath:dirEntries(options) end function utils.FilePath:dirEntries(options) end
---Returns the FilePath as it should be displayed to the user ---Returns the FilePath as it should be displayed to the user.
---@return string ---@return string
function utils.FilePath:toUserOutput() end function utils.FilePath:toUserOutput() end
---Returns whether the target exists ---Returns whether the target exists.
---@return boolean ---@return boolean
function utils.FilePath:exists() end function utils.FilePath:exists() end
---Returns whether the target is a file and executable ---Returns whether the target is a file and executable.
---@return boolean ---@return boolean
function utils.FilePath:isExecutableFile() end function utils.FilePath:isExecutableFile() end
---Returns the path portion of FilePath as a string in the hosts native format ---Returns the path portion of FilePath as a string in the hosts native format.
---@return string ---@return string
function utils.FilePath:nativePath() end function utils.FilePath:nativePath() end
---Returns the last part of the path ---Returns the last part of the path.
---@return string ---@return string
function utils.FilePath:fileName() end function utils.FilePath:fileName() end
---Returns the current working path of Qt Creator ---Returns the current working path of Qt Creator.
---@return FilePath ---@return FilePath
function utils.FilePath.currentWorkingPath() end function utils.FilePath.currentWorkingPath() end
---Returns a new FilePath with the given tail appended ---Returns a new FilePath with the given tail appended.
---@param tail string|FilePath The tail to append ---@param tail string|FilePath The tail to append.
---@return FilePath ---@return FilePath
function utils.FilePath:resolvePath(tail) end function utils.FilePath:resolvePath(tail) end
---Returns the parent directory of the path ---Returns the parent directory of the path.
---@return FilePath ---@return FilePath
function utils.FilePath:parentDir() end function utils.FilePath:parentDir() end
---If the path targets a symlink, this function returns the target of the symlink ---If the path targets a symlink, this function returns the target of the symlink.
---@return FilePath The resolved path ---@return FilePath resolvedPath The resolved path.
function utils.FilePath:resolveSymlinks() end function utils.FilePath:resolveSymlinks() end
---Returns the suffix of the path (e.g. "test.ui.qml" -> ".qml") ---Returns the suffix of the paths (e.g. "test.ui.qml" -> ".qml").
---@return string ---@return string
function utils.FilePath:suffix() end function utils.FilePath:suffix() end
---Returns the complete suffix of the path (e.g. "test.ui.qml" -> "ui.qml") ---Returns the complete suffix of the paths (e.g. "test.ui.qml" -> "ui.qml").
---@return string ---@return string
function utils.FilePath:completeSuffix() end function utils.FilePath:completeSuffix() end
---Returns whether the path is absolute ---Returns whether the path is absolute.
---@return boolean ---@return boolean
function utils.FilePath:isAbsolutePath() end function utils.FilePath:isAbsolutePath() end
---@class HostOsInfo ---@class HostOsInfo
---@field os "mac"|"windows"|"linux" The current host operating system ---@field os "mac"|"windows"|"linux" The current host operating system.
---@field architecture "unknown"|"x86"|"x86_64"|"itanium"|"arm"|"arm64" The current host architecture ---@field architecture "unknown"|"x86"|"x86_64"|"itanium"|"arm"|"arm64" The current host architecture.
utils.HostOsInfo = {} utils.HostOsInfo = {}
---Returns whether the host operating system is windows ---Returns whether the host operating system is windows.
---@return boolean ---@return boolean
function utils.HostOsInfo.isWindowsHost() end function utils.HostOsInfo.isWindowsHost() end
---Returns whether the host operating system is mac ---Returns whether the host operating system is mac.
---@return boolean ---@return boolean
function utils.HostOsInfo.isMacHost() end function utils.HostOsInfo.isMacHost() end
---Returns whether the host operating system is linux ---Returns whether the host operating system is linux.
---@return boolean ---@return boolean
function utils.HostOsInfo.isLinuxHost() end function utils.HostOsInfo.isLinuxHost() end