Lua Class - apps

apps is a class that contains 0 properties, 15 methods and 3 events.

This class cannot be constructed, it is managed by Teverse.

Properties
Methods
string getSource( )

Returns the source code of the loaded app or nil if no app is loaded.

CODE SAMPLE
apps:getSource() --> ""
loadDashboard( )

Resets the environment and loads the default Dashboard app

CODE SAMPLE
apps:loadDashboard() --> 
loadRemote( )

Starts uploading the currently loaded UNPACKAGED app

CODE SAMPLE
apps:loadRemote() --> 
boolean loadScript( string file )

Resets the environment and loads the Lua file at the provided path as an app.

CODE SAMPLE
apps:loadScript("") --> true
boolean loadString( string lua )

Resets the environment and loads the Lua string provided as an app.

CODE SAMPLE
apps:loadString("") --> true
loadWorkshop( )

Resets the environment and loads the default Workshop app

CODE SAMPLE
apps:loadWorkshop() --> 
boolean prompt( )

Prompts the user to select a Lua file, this method then triggers app:loadScript(path)

CODE SAMPLE
apps:prompt() --> true
boolean promptApp( )

Prompts the user to select a .tevapp file

CODE SAMPLE
apps:promptApp() --> true
boolean promptAppDirectory( )

Prompts the user to select a directory containing the manifest.json file

CODE SAMPLE
apps:promptAppDirectory() --> true
table recentDirectories( )

Returns a table of strings

CODE SAMPLE
apps:recentDirectories() --> {}
reload( )

Resets the environment and reloads the loaded app

CODE SAMPLE
apps:reload() --> 
reset( )

Resets the environment

CODE SAMPLE
apps:reset() --> 
boolean runRecent( string path )

Run a app directory returned by recentDirectories

CODE SAMPLE
apps:runRecent("") --> true
test( )

Uploads the unpackaged app and spins up a temporary test server on our cloud

CODE SAMPLE
apps:test() --> 
upload( )

Starts uploading the currently loaded UNPACKAGED app

CODE SAMPLE
apps:upload() --> 
Events
:on("changed", function( string property, variant oldValue, variant newValue ) end)

Fired when a property is changed.

CODE SAMPLE
apps:on("changed", function(property, oldValue, newValue)
  print(property) --> ""  print(oldValue) --> variant  print(newValue) --> variant
end)
:on("download", function( boolean success, string message ) end)

Fired when an download fails or succeeds

CODE SAMPLE
apps:on("download", function(success, message)
  print(success) --> true  print(message) --> ""
end)
:on("upload", function( boolean success, table app ) end)

Fired when an upload fails or succeeds

CODE SAMPLE
apps:on("upload", function(success, app)
  print(success) --> true  print(app) --> {}
end)

Some sections of our docs are maintained on github.