Skip to content

LLS annotations for poki defold sdk#36

Open
H1core wants to merge 1 commit into
defold:mainfrom
H1core:lls-annotations
Open

LLS annotations for poki defold sdk#36
H1core wants to merge 1 commit into
defold:mainfrom
H1core:lls-annotations

Conversation

@H1core
Copy link
Copy Markdown

@H1core H1core commented Apr 28, 2026

This repository provides Lua Language Server (LLS) annotations for the Poki SDK used with the Defold engine.

The goal is to improve the developer experience in VS Code by enabling:

API autocompletion
Inline documentation (hover tooltips)
Type hints for Poki SDK functions and objects

These annotations do not modify the SDK itself. Instead, they supply metadata that allows the Lua Language Server to better understand the Poki API surface.

---Signals that gameplay has stopped.
function poki_sdk.gameplay_stop() end

---Requests a commercial break (ad). The callback is called when the ad finishes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
---Requests a commercial break (ad). The callback is called when the ad finishes.
---Requests a commercial break (ad). The callback is called when the ad starts and when it finishes.

---@param callback fun(self: userdata, status: number) Called with one of the statuses: `poki_sdk.COMMERCIAL_BREAK_START`, `poki_sdk.COMMERCIAL_BREAK_SUCCESS`
function poki_sdk.commercial_break(callback) end

---Requests a rewarded break (rewarded ad). The callback is called when the ad finishes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
---Requests a rewarded break (rewarded ad). The callback is called when the ad finishes.
---Requests a rewarded break (rewarded ad). The callback is called when the ad starts and when it finishes.


---Generates a shareable URL with the given parameters.
---@param params table
---@param callback function
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function gets the generated url as parameter.

Comment on lines +32 to +34
---@param size string The size of the reward. Accepted values are `"small"`, `"medium"` and `"large"`. Optional, default is `"small"`.
---@param callback fun(self: userdata, status: number) Called with one of the statuses: `poki_sdk.REWARDED_BREAK_ERROR`, `poki_sdk.REWARDED_BREAK_START`, `poki_sdk.REWARDED_BREAK_SUCCESS`
function poki_sdk.rewarded_break(size, callback) end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how these lua types work. But would it also be possible to add:

function poki_sdk.rewarded_break(callback) end

So that editors can suggest and validate both ways to call the function?


---Returns the value of a URL query parameter by key.
---@param key string
---@return string value
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also return nil if there param was not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants