summaryrefslogtreecommitdiff
path: root/luals-stubs/backstack.lua
blob: 43c5869fba27fc9f107903419c373192364ac7b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
-- SPDX-FileCopyrightText: 2023 jacqueline <me@jacqueline.id.au>
--
-- SPDX-License-Identifier: GPL-3.0-only

--- @meta

--- The `backstack` module contains functions that can be used to implement a
--- basic stack-based navigation hierarchy. See also the `screen` module, which
--- provides a class prototype meant for use with this module.
--- @class backstack
local backstack = {}

--- Displays the given screen to the user. If there was already a screen being
--- displayed, then the current screen is removed from the display, and added
--- to the backstack.
--- @param screen screen The screen to display.
function backstack.push(screen) end

--- Removes the current screen from the display, then replaces it with the
--- screen that is at the top of the backstack. This function does nothing if
--- 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