From e12a68a74d9527d4becde122da4ff1ad6550564e Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 5 Jan 2024 17:15:47 +1100 Subject: split lua stubs into one set for ldoc, and one set for lua-ls --- src/lua/stubs/alerts.lua | 13 ---------- src/lua/stubs/backstack.lua | 13 ---------- src/lua/stubs/bluetooth.lua | 14 ----------- src/lua/stubs/database.lua | 59 --------------------------------------------- src/lua/stubs/playback.lua | 15 ------------ src/lua/stubs/power.lua | 18 -------------- src/lua/stubs/queue.lua | 22 ----------------- src/lua/stubs/types.lua | 27 --------------------- src/lua/stubs/volume.lua | 14 ----------- 9 files changed, 195 deletions(-) delete mode 100644 src/lua/stubs/alerts.lua delete mode 100644 src/lua/stubs/backstack.lua delete mode 100644 src/lua/stubs/bluetooth.lua delete mode 100644 src/lua/stubs/database.lua delete mode 100644 src/lua/stubs/playback.lua delete mode 100644 src/lua/stubs/power.lua delete mode 100644 src/lua/stubs/queue.lua delete mode 100644 src/lua/stubs/types.lua delete mode 100644 src/lua/stubs/volume.lua (limited to 'src/lua') diff --git a/src/lua/stubs/alerts.lua b/src/lua/stubs/alerts.lua deleted file mode 100644 index 9b541d84..00000000 --- a/src/lua/stubs/alerts.lua +++ /dev/null @@ -1,13 +0,0 @@ ---- Module for interacting with playback volume. The Bluetooth and wired outputs store their current volume separately; this API only allows interacting with the volume of the currently used output device. --- @module alerts - -local alerts = {} - ---- Returns the current volume as a percentage of the current volume limit. --- @tparam function constructor Called to create the UI for the alert. A new default root object and group will be set before calling this function.i Alerts are non-interactable; the group created for the constructor will not be granted focus. -function alerts.show(constructor) end - ---- Dismisses any visible alerts, removing them from the screen. -function alerts.hide() end - -return alerts diff --git a/src/lua/stubs/backstack.lua b/src/lua/stubs/backstack.lua deleted file mode 100644 index d4807d37..00000000 --- a/src/lua/stubs/backstack.lua +++ /dev/null @@ -1,13 +0,0 @@ ---- Module for adding and removing screens from the system's backstack. --- @module backstack - -local backstack = {} - ---- Pushes a new screen onto the backstack. --- @tparam function constructor Called to create the UI for the new screen. A new default root object and group will be set before calling this function. The function provided should return a table holding any bindings used by this screen; the returned value is retained so long as this screen is present in the backstack. -function backstack.push(constructor) end - ---- Removes the currently active screen, and instead shows the screen underneath it on the backstack. Does nothing if this is the only existing screen. -function backstack.pop() end - -return backstack diff --git a/src/lua/stubs/bluetooth.lua b/src/lua/stubs/bluetooth.lua deleted file mode 100644 index 2fba1ec6..00000000 --- a/src/lua/stubs/bluetooth.lua +++ /dev/null @@ -1,14 +0,0 @@ ---- Properties and functions for handling Bluetooth connectivity --- @module bluetooth - -local bluetooth = {} - ---- Whether or not the Bluetooth stack is currently enabled. This property is writeable, and can be used to enable or disable Bluetooth. --- @treturn types.Property a boolean property -function bluetooth.enabled() end - ---- Whether or not there is an active connection to another Bluetooth device. --- @treturn types.Property a boolean property -function bluetooth.connected() end - -return bluetooth diff --git a/src/lua/stubs/database.lua b/src/lua/stubs/database.lua deleted file mode 100644 index 97359ab1..00000000 --- a/src/lua/stubs/database.lua +++ /dev/null @@ -1,59 +0,0 @@ ---- Module for accessing and updating data about the user's library of tracks. --- @module database - -local database = {} - ---- Returns a list of all indexes in the database. --- @treturn Array(Index) -function database.indexes() end - ---- An iterator is a userdata type that behaves like an ordinary Lua iterator. --- @type Iterator -local Iterator = {} - ---- A TrackId is a unique identifier, representing a playable track in the ---- user's library. --- @type TrackId -local TrackId = {} - ---- A record is an item within an Index, representing some value at a specific ---- depth. --- @type Record -local Record = {} - ---- Gets the human-readable text representing this record. The `__tostring` ---- metatable function is an alias of this function. --- @treturn string -function Record:title() end - ---- Returns the value that this record represents. This may be either a track ---- id, for records which uniquely identify a track, or it may be a new ---- Iterator representing the next level of depth for the current index. ---- ---- For example, each Record in the "All Albums" index corresponds to an entire ---- album of tracks; the 'contents' of such a Record is an iterator returning ---- each track in the album represented by the Record. The contents of each of ---- the returned 'track' Records would be a full Track, as there is no further ---- disambiguation needed. --- @treturn TrackId|Iterator(Record) -function Record:contents() end - ---- An index is heirarchical, sorted, view of the tracks within the database. ---- For example, the 'All Albums' index contains, first, a sorted list of every ---- album name in the library. Then, at the second level of the index, a sorted ---- list of every track within each album. --- @type Index -local Index = {} - ---- Gets the human-readable name of this index. This is typically something ---- like "All Albums", or "Albums by Artist". The `__tostring` metatable ---- function is an alias of this function. --- @treturn string -function Index:name() end - ---- Returns a new iterator that can be used to access every record within the ---- first level of this index. --- @treturn Iterator(Record) -function Index:iter() end - -return database diff --git a/src/lua/stubs/playback.lua b/src/lua/stubs/playback.lua deleted file mode 100644 index 340da37d..00000000 --- a/src/lua/stubs/playback.lua +++ /dev/null @@ -1,15 +0,0 @@ ---- Properties for interacting with the audio playback system --- @module playback - -local playback = {} - ---- Whether or not any audio is *allowed* to be played. If there is a current track, then this is essentially an indicator of whether playback is paused or unpaused. ---- This value isn't meaningful if there is no current track. --- @treturn types.Property a boolean property -function playback.playing() end - -function playback:track() end - -function playback:position() end - -return playback diff --git a/src/lua/stubs/power.lua b/src/lua/stubs/power.lua deleted file mode 100644 index 30fe7520..00000000 --- a/src/lua/stubs/power.lua +++ /dev/null @@ -1,18 +0,0 @@ ---- Properties and functions that deal with the device's battery and power state --- @module power - -local power = {} - ---- battery_pct returns the battery's current charge as a percentage --- @treturn types.Property an integer property, from 0 to 100 -function power.battery_pct() end - ---- battery_millivolts returns the battery's current voltage in millivolts --- @treturn types.Property an integer property, typically from about 3000 to about 4200. -function power.battery_millivolts() end - ---- plugged_in returns whether or not the device is currently receiving external power --- @treturn types.Property a boolean property -function power.plugged_in() end - -return power \ No newline at end of file diff --git a/src/lua/stubs/queue.lua b/src/lua/stubs/queue.lua deleted file mode 100644 index 000c35d3..00000000 --- a/src/lua/stubs/queue.lua +++ /dev/null @@ -1,22 +0,0 @@ ---- Properties and functions for inspecting and manipulating the track playback queue --- @module queue - -local queue = {} - ---- queue.position returns the index in the queue of the currently playing track. This may be zero if the queue is empty. --- @treturn types.Property a positive integer property, which is a 1-based index -function queue.position() end - ---- queue.size returns the total number of tracks in the queue, including tracks which have already been played. --- @treturn types.Property a positive integer property -function queue.size() end - ---- queue.replay determines whether or not the queue will be restarted after the final track is played. --- @treturn types.Property a writeable boolean property -function queue.replay() end - ---- queue.random 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. --- @treturn types.Property a writeable boolean property -function queue.random() end - -return queue \ No newline at end of file diff --git a/src/lua/stubs/types.lua b/src/lua/stubs/types.lua deleted file mode 100644 index 1f6970bd..00000000 --- a/src/lua/stubs/types.lua +++ /dev/null @@ -1,27 +0,0 @@ ---- Userdata-based types used throughout the rest of the API. These types are ---- not generally constructable within Lua code. --- @module types - ---- A value sourced from the C++ firmware. --- @type Property -local Property = {} - ---- Gets the current value --- @return The property's current value. -function Property:get() end - ---- Sets a new value. Not all properties may be set from within Lua code. For ---- example, it makes little sense to attempt to override the current battery ---- level. --- @param val The new value. This should generally be of the same type as the existing value. --- @return true if the new value was applied, or false if the backing C++ code rejected the new value (e.g. if it was out of range, or the wrong type). -function Property:set(val) end - ---- Invokes the given function once immediately with the current value, and then again whenever the value changes. ---- The function is invoked for *all* changes; both from the underlying C++ data, and from calls to `set` (if this is a Lua-writeable property). ---- The binding will be active **only** so long as the given function remains in scope. --- @param fn callback function to apply property values. Must accept one argument; the updated value. --- @return fn, for more ergonmic use with anonymous closures. -function Property:bind(fn) end - -return Property diff --git a/src/lua/stubs/volume.lua b/src/lua/stubs/volume.lua deleted file mode 100644 index 15499630..00000000 --- a/src/lua/stubs/volume.lua +++ /dev/null @@ -1,14 +0,0 @@ ---- Module for interacting with playback volume. The Bluetooth and wired outputs store their current volume separately; this API only allows interacting with the volume of the currently used output device. --- @module volume - -local volume = {} - ---- Returns the current volume as a percentage of the current volume limit. --- @treturn types.Property an integer property -function volume.current_pct() end - ---- Returns the current volume in terms of dB from line level. --- @treturn types.Property an integer property -function volume.current_db() end - -return volume -- cgit v1.2.3