Members
#
(constant) broadcast :BroadcastChannel
The primary Broadcast Channel for web3os
#
(constant) createIcon
#
(constant) events :CustomEvent
The main kernel event bus
Properties
Name |
Type |
Description |
dispatch |
function
|
Dispatch an event
Properties
Name |
Type |
Description |
eventName |
string
|
The name of the event |
detail |
Object
|
The event detail payload |
|
on |
function
|
Subscribe to event
Properties
Name |
Type |
Description |
eventName |
string
|
The name of the event |
callback |
function
|
Execute when this event is triggered |
|
off |
function
|
Unsubscribe from event
Properties
Name |
Type |
Description |
eventName |
string
|
The name of the event |
callback |
function
|
Execute when this event is triggered |
|
#
fs :Object
Gives access to the BrowserFS API
#
(constant) i18n :Object
References the initialized i18next instance
#
(constant) icons
References the @iconify/iconify library
#
(constant) intervals :Object
Contains all registered kernel intervals
#
(constant) KernelEvents
The list of kernel events
#
keyboard :SimpleKeyboard
Gives access to the virtual keyboard
This gives us more control and consistency over mobile input
#
(constant) modules :Object
Contains all registered kernel modules
#
(constant) notify :AwesomeNotifications
Send an awesome-notification
- To Do:
-
- awesome-notifications will likely eventually replace sweetalert
#
(constant) utils :Object
Contains miscellaneous utilities
#
(constant) windows :Object
Manages interactions with the windowing system
Properties
Name |
Type |
Description |
_collection |
Set
|
The collection of windows |
create |
function
|
Create a new window
Properties
Name |
Type |
Description |
options |
Object
|
Options to pass to WinBox |
|
find |
function
|
Find a window by ID
Properties
Name |
Type |
Description |
id |
string
|
The ID of the window (usually winbox-#; stored on app.window.id) |
|
Methods
#
analyticsEvent()
Send an analytics event to the analytics endpoint
#
(async) autostart(defaultAutoStartopt)
Execute the /config/autostart.sh script
Parameters:
Name |
Type |
Attributes |
Description |
defaultAutoStart |
string
|
<optional>
|
Write autostart script with this content if it doesn't exist |
#
(async) boot()
Boot the kernel
This kicks off the process of initializing the filesystem, modules, and other components
#
createSpecialLink(uri, text)
Create a special hyperlink introduced in xterm.js v5
Parameters:
Name |
Type |
Description |
uri |
String
|
|
text |
String
|
|
#
deleteKey(namespacenon-null, keynon-null)
Delete the specified key from the kernel memory object
Parameters:
Name |
Type |
Description |
namespace |
string
|
The namespace containing the key |
key |
key
|
The key to delete |
#
deleteNamespace(namespacenon-null)
Delete the specified namespace from the kernel memory object
Parameters:
Name |
Type |
Description |
namespace |
namespace
|
The namespace to delete |
#
(async) dialog(options) → {SweetAlertDialog}
Parameters:
Name |
Type |
Description |
options |
Object
|
SweetAlert2 options |
Returns:
-
Type
-
SweetAlertDialog
#
dump() → {string}
Dump the kernel memory to a JSON object
#
(async) execute(cmd) → {CommandResult}
Parameters:
Name |
Type |
Description |
cmd |
string
|
The command to execute |
Returns:
-
Type
-
CommandResult
#
(async) executeScript(path) → {SweetAlertDialog}
Parameters:
Name |
Type |
Description |
path |
string
|
The path of the script |
Returns:
-
Type
-
SweetAlertDialog
#
get(namespacenon-null, keynullable)
Get a value from the kernel memory object
Parameters:
Name |
Type |
Attributes |
Description |
namespace |
string
|
|
The namespace from which to get the value |
key |
string
|
<nullable>
|
The key to retrieve, or undefined to get entire namespace |
#
(async) importModuleUrl(url) → {Module}
Directly import an ES module from a URL
Parameters:
Name |
Type |
Description |
url |
string
|
The URL of the module to import |
#
(async) importUMDModule(url) → {Module}
Directly import a UMD module from a URL
Parameters:
Name |
Type |
Description |
url |
string
|
The URL of the module to import |
#
loadLocalStorage()
Restore the kernel memory from localStorage
#
(async) loadModule(modnon-null, optionsopt)
Load a module into the kernel
Parameters:
Name |
Type |
Attributes |
Description |
mod |
ModInfo
|
|
The mod to load |
options |
Object
|
<optional>
|
Options for loading the module |
#
(async) loadPackages()
Load or install the packages defined in /config/packages
#
log(messagenon-null, optionsnullable)
Log a message to the terminal
Parameters:
Name |
Type |
Attributes |
Description |
message |
any
|
|
The message or object to log |
options |
Object
|
<nullable>
|
Logging options
Properties
Name |
Type |
Attributes |
Default |
Description |
console |
Boolean
|
<optional>
|
true
|
Enable logging to both browser console and Terminal |
terminal |
Web3osTerminal
|
<nullable>
|
|
The terminal to attach to, or undefined for global Terminal |
|
#
printBootIntro()
Output the boot introduction
#
printSystemInfo()
Output system information
#
(async) registerBuiltinModules()
Load the kernel's core external modules
#
(async) registerKernelBins()
Load the kernel's core internal commands
- To Do:
-
- These are here because they're relatively simple, but many of them should be
moved to their own respective external modules.
#
restore(jsonnon-null)
Restore the kernel memory from a JSON object
Parameters:
Name |
Type |
Description |
json |
string
|
The JSON object generated from dump() |
#
set(namespacenon-null, keynon-null, valuenon-null)
Set a value in the kernel memory object
Parameters:
Name |
Type |
Description |
namespace |
string
|
The namespace in which to set the value |
key |
string
|
The key in which to set the value |
value |
any
|
The value to set |
#
(async) setupFilesystem(initfsUrlopt, mountableFilesystemConfigopt)
Sets up the filesystem
These parameters can also be provided as a query parameter:
https://web3os.sh/?initfsUrl=https://my.place.com/initfs.zip
Bare minimum, temporary, fs:
https://web3os.sh/?mountableFilesystemConfig={ "/": { "fs": "InMemory" }, "/bin": { "fs": "InMemory" } }
Parameters:
Name |
Type |
Attributes |
Description |
initfsUrl |
string
|
<optional>
|
URL to a zipped filesystem snapshot |
mountableFilesystemConfig |
MountableFileSystemOptions
|
<optional>
|
Filesystem configuration object for BrowserFS |
#
(async) showSplash(msg, optionsopt)
Show the boot splash screen
Parameters:
Name |
Type |
Attributes |
Description |
msg |
string
|
|
The message to display |
options |
Object
|
<optional>
|
The splash screen options |
- To Do:
-
- Make this more customizable
#
(async) snackbar(optionsopt)
Show a snackbar notification
Parameters:
Name |
Type |
Attributes |
Description |
options |
Object
|
<optional>
|
The snackbar options |
- Deprecated:
- This can still be useful I think, but it's being deprecated
in favor of awesome-notifications. Should this be removed?
#
specialLinkHandler()
Handle special hyperlinks introduced in xterm.js v5
#
(async) systemNotify(optionsopt)
Send a browser/platform notification
Parameters:
Name |
Type |
Attributes |
Description |
options |
Object
|
<optional>
|
The notification options (Notification API) |
#
updateLocalStorage()
Write the kernel memory to localStorage
#
(async) wait(ms) → {Module}
Wait for the specified number of milliseconds
Parameters:
Name |
Type |
Description |
ms |
number
|
The number of milliseconds to wait |