split lua stubs into one set for ldoc, and one set for lua-ls

This commit is contained in:
jacqueline
2024-01-05 17:15:47 +11:00
parent aa1dd3d522
commit e12a68a74d
24 changed files with 206 additions and 79 deletions
+11
View File
@@ -0,0 +1,11 @@
--- @meta
--- @class alerts
local alerts = {}
--- @param constructor function
function alerts.show(constructor) end
function alerts.hide() end
return alerts
+11
View File
@@ -0,0 +1,11 @@
--- @meta
--- @class backstack
local backstack = {}
--- @param constructor function
function backstack.push(constructor) end
function backstack.pop() end
return backstack
+8
View File
@@ -0,0 +1,8 @@
--- @meta
--- @class bluetooth
--- @field enabled Property
--- @field connected Property
local bluetooth = {}
return bluetooth
+33
View File
@@ -0,0 +1,33 @@
--- @meta
--- @class database
local database = {}
--- @return Index[]
function database.indexes() end
--- @class Iterator
local Iterator = {}
--- @class TrackId
local TrackId = {}
--- @class Record
local Record = {}
--- @return string
function Record:title() end
--- @return TrackId|Iterator(Record)
function Record:contents() end
--- @class Index
local Index = {}
--- @return string
function Index:name() end
--- @return Iterator(Record)
function Index:iter() end
return database
+10
View File
@@ -0,0 +1,10 @@
--- @meta
--- Properties for interacting with the audio playback system
--- @class playback
--- @field playing Property Whether or not audio is allowed to be played. if there is a current track, then this indicated whether playback is paused or unpaused. If there is no current track, this determines what will happen when the first track is added to the queue.
--- @field track Property The currently playing track.
--- @field position Property The current playback position within the current track, in seconds.
local playback = {}
return playback
+10
View File
@@ -0,0 +1,10 @@
--- @meta
--- Properties and functions that deal with the device's battery and power state.
--- @class power
--- @field battery_pct Property The battery's current charge, as a percentage of the maximum charge.
--- @field battery_millivolts Property The battery's current voltage, in millivolts.
--- @field plugged_in Property Whether or not the device is currently receiving external power.
local power = {}
return power
+11
View File
@@ -0,0 +1,11 @@
--- @meta
--- Properties and functions for inspecting and manipulating the track playback queue
--- @class queue
--- @field position Property The index in the queue of the currently playing track. This may be zero if the queue is empty. Writeable.
--- @field size Property The total number of tracks in the queue, including tracks which have already been played.
--- @field replay Property Whether or not the queue will be restarted after the final track is played. Writeable.
--- @field random Property Determines whether, when progressing to the next track in the queue, the next track will be chosen randomly. The random selection algorithm used is a Miller Shuffle, which guarantees that no repeat selections will be made until every item in the queue has been played. Writeable.
local queue = {}
return queue
+13
View File
@@ -0,0 +1,13 @@
--- @meta
---@class Property
local property = {}
function property:get() end
function property:set(val) end
--- @param fn function
function property:bind(fn) end
return property
+8
View File
@@ -0,0 +1,8 @@
--- @meta
--- @class volume
--- @field current_pct Property
--- @field current_db Property
local volume = {}
return volume