Lua API improvements and fixes

Co-authored-by: jacqueline <me@jacqueline.id.au>
This commit is contained in:
ailurux
2024-08-29 15:20:22 +10:00
co-authored by jacqueline
parent 3421bd652c
commit 96a224c0df
7 changed files with 56 additions and 5 deletions
+4
View File
@@ -17,4 +17,8 @@ function backstack.push(screen) end
--- there are no other screens in the stack.
function backstack.pop() end
--- Sets a new root screen, replacing any existing screens
--- @param screen screen The new root screen
function backstack.reset(screen) end
return backstack
+11 -2
View File
@@ -5,8 +5,17 @@
--- @class bluetooth
--- @field enabled Property Whether or not the Bluetooth stack is currently enabled. This property is writeable, and can be used to enable or disable Bluetooth.
--- @field connected Property Whether or not there is an active connection to another Bluetooth device.
--- @field paired_device Property The device that is currently paired. The bluetooth stack will automatically connected to this device if possible.
--- @field devices Property Devices nearby that have been discovered.
--- @field connecting Property Whether or not we are currently connecting to the paired device.
--- @field discovering Property Whether or not we are actively scanning for new devices.
--- @field paired_device Property The device that is currently paired. The bluetooth stack will automatically connect to this device if possible.
--- @field discovered_devices Property Devices nearby that have been discovered.
--- @field known_devices Property Devices that have previously been paired.
local bluetooth = {}
--- Enables Bluetooth, this is the same as bluetooth.enabled:set(true)
function bluetooth.enable() end
--- Disables Bluetooth, this is the same as bluetooth.enabled:set(false)
function bluetooth.disable() end
return bluetooth
+5
View File
@@ -8,4 +8,9 @@
--- @field position Property The current playback position within the current track, in seconds.
local playback = {}
--- Returns whether or not this file can be played (i.e. is this an audio track)
--- @param filepath string
--- @return boolean
function playback.is_playable(filepath) end
return playback
+2 -2
View File
@@ -13,10 +13,10 @@
--- @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 = {}
--- Adds the given track or database iterator to the end of the queue. Database
--- Adds the given track, database iterator, or file to the end of the queue. Database
--- iterators passed to this method will be unnested and expanded into the track
--- ids they contain.
--- @param val TrackId|Iterator
--- @param val TrackId|Iterator|string
function queue.add(val) end
--- Opens a playlist file from a filepath