Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Lua Intellisense types #9054

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/resources/lua-types/quarto/doc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ which must be copied into the LaTeX output directory.
---@param file string Format resource file (relative path from Lua script)
function quarto.doc.add_format_resource(file) end

--[[
Add a resource to the document. The path to the file should relative to the Lua script calling this function.

Format resources will be copied into the directory next to the rendered file. This is useful
for including arbitrary data from your filter that is referenced in the document.
]]
---@param file string resource file (relative path from Lua script)
function quarto.doc.add_resource(file) end

--[[
Add a resource to the document. The path to the file should relative to the Lua script calling this function.

Resources will be moved into the directory next to the rendered file, unlike `add_resource`, which copies.
This can be used by files generated by your filter.
]]
---@param file string resource file (relative path from Lua script)
function quarto.doc.add_supporting_resource(file) end

--[[
Include text at the specified location (`in-header`, `before-body`, or `after-body`).
]]
Expand Down Expand Up @@ -101,6 +119,12 @@ Does the current output format include Bootstrap themed HTML
---@return boolean
function quarto.doc.has_bootstrap() end

--[[
Detects if filter is activate for this document
]]
---@return boolean
function quarto.doc.is_filter_active(name) end

--[[
Provides the project relative path to the current input
if this render is in the context of a project (otherwise `nil`)
Expand Down
37 changes: 36 additions & 1 deletion src/resources/lua-types/quarto/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@ Note that you should use `quarto.log.output()` instead of this function.
---@param value any Value to dump
function quarto.utils.dump(value) end

--[[
Checks if the given table is a simple array
]]
---@param table table Table to check
---@returns boolean
function quarto.utils.table.isarray(table) end

--[[
Checks if the given table contains a value
]]
---@param table table Table to check
---@param value any Value to check
---@returns boolean
function quarto.utils.table.isarray(table, value) end

--[[
Returns type information related to pandoc or
quarto-specific elements
]]
---@param type any Type to check
---@returns string
function quarto.utils.type(type) end

--[[
Compute the absolute path to a file that is installed alongside the Lua script.

Expand All @@ -30,10 +53,22 @@ syntax in the string.
---@return pandoc.Inlines
function quarto.utils.string_to_inlines(path, sep) end

function quarto.utils.as_inlines(v) end

function quarto.utils.as_blocks(v) end

--[[
Converts a string to a list of Pandoc Blocks, processing any Quarto custom
syntax in the string.
]]
---@param path string String to be converted
---@return pandoc.Blocks
function quarto.utils.string_to_blocks(path) end
function quarto.utils.string_to_blocks(string) end

function quarto.utils.string_to_inlines(string) end

function quarto.utils.render() end

function quarto.utils.match(...) end

function quarto.utils.add_to_blocks(blocks, block) end
9 changes: 9 additions & 0 deletions src/resources/lua-types/quarto/version.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---@meta

quarto = {}

--[[
Returns information about the quarto context version
]]
---@return quarto.Version
function quarto.version() end
Loading