Class: RegistryOverlay

core.RegistryOverlay

Class representing a registry overlay. The overlay stores overlaid modifications without applying them immediately. This makes it easy to support configuration editing with Apply and Cancel functionality.

new core.RegistryOverlay ()

Properties:
Name Type Description
modified bool

[readonly] true while the overlay has un-applied modifications.

registry object

(default: null) The registry to work on. The object must implement the registry interface.

Extends

Methods

apply () async

Applies all overlaid modifications to the underlying registry.

cancel () async

Cancels and forgets about all overlaid modifications.

info (key)object async

Returns information about the given key, or null if the key does not exist.

Name Type Description
key string

The key to retrieve the information from.

Returns:
Type Description
object The information object { type, description }.

list (folderKey)Array.<string> async

Lists the contents of the given folder key.

Name Type Description
folderKey string

The key to list the contents of.

Returns:
Type Description
Array.<string> The names of the content items.

read (key, defaultValue)any async

Reads the given key. Returns the defaultValue if the key was not found.

Name Type Description
key string

The key to read.

defaultValue any

The default value to return if the key was not found.

Returns:
Type Description
any The key's value.

remove (key) async

Removes the given key.

Name Type Description
key string

The key to remove.

write (key, value, description) async

Writes the given key. If the key does not yet exist, it will be created.

Name Type Description
key string

The key.

value any

The value to write.

description string optional

An optional description text.

Events

core.RegistryOverlay.event:changeValue

Is triggered when the value of a key has changed.

Name Type Description
key string

The key that was changed.