The type of the entry key, which should extend RegistryEntryKey
.
The type of the entry value.
Creates a new instance of the Registry class.
Optional
options: Partial<RegistryOptions>Optional configuration options for the registry.
Optional
baseRegistry: Registry<TKey, TValue>An optional base registry from which this registry will inherit entries.
Protected
baseThe base registry from which this registry derives entries. If provided, this registry will inherit entries from the base registry. It will also register itself as a derived registry of the base registry. This allows for hierarchical registries where derived registries can extend or override entries from the base registry.
Readonly
entryCallbacks for when an entry is overridden.
Readonly
entryCallbacks for when an entry is registered.
Readonly
entryCallbacks for when an entry is unregistered.
Protected
optionsOptions for configuring the registry.
Iterates over all entries in the registry and calls the provided callback function for each entry.
Retrieves all entries from the registry.
An array of all entry values in the registry.
Retrieves all entries with their keys from the registry.
An array of objects containing both the entry key and the entry value.
Retrieves all entry keys from the registry.
An array of keys for all entries in the registry.
Checks if an entry with the specified key exists in the registry.
The key for the entry to check.
True if the entry exists, otherwise false.
Checks if the registry is case-sensitive.
Registers a new entry in the registry. If the entry key already exists, it throws a RegistryEntryAlreadyRegisteredError.
Protected
registerCore method for registering an entry in the registry.
This method is called by the public register
and registerOrOverride
methods.
It does not check if the entry key already exist.
Registers or overrides an existing entry in the registry. If the entry key does not exist, it will be registered. If the entry key already exists, it will override the existing entry without throwing an error.
Unregisters an entry from the registry. If the entry key does not exist, it throws a RegistryEntryNotRegisteredError.
The key for the entry to unregister.
Protected
unregisterCore method for unregistering an entry from the registry.
This method is called by the public unregister
and unregisterIfRegistered
methods.
The key for the entry to unregister.
Unregisters an entry from the registry if it is registered. If the entry key does not exist, it does nothing.
The key for the entry to unregister if registered.
A generic registry class that allows registering, unregistering, and retrieving entries by their keys.