the library repository that persists library somewhere.
gets URLs at which a file in a library can be downloaded. Must be passed through from the implementation.
Optional
alterLibrarySemantics: (library: ILibraryName, semantics: ISemanticsEntry[]) => ISemanticsEntry[]a hook that allows implementations to change the semantics of certain libraries; should be used together with alterLibraryLanguageFile if you plan to use any other language than English! See the documentation of IH5PEditorOptions for more details.
Optional
alterLibraryLanguageFile: (a hook that allows implementations to change the language files of certain libraries; should be used together with alterLibrarySemantics if you plan to use any other language than English! See the documentation of IH5PEditorOptions for more details.
Optional
translationFunction: ITranslationFunction(optional) The translation function to use if you want to localize library metadata (titles). If undefined, no localization will be performed.
Optional
lockProvider: ILockProviderOptional
config: {Returns a readable stream of a library file's contents. Throws an exception if the file does not exist.
library
a readable stream of the file's contents
Returns a readable stream of a library file's contents. Throws an exception if the file does not exist.
library
a readable stream of the file's contents
Gets the language file for the specified language.
the language code
a string with the contents language file; null if the library isn't localized to the language
Returns the information about the library that is contained in library.json.
The library to get (machineName, majorVersion and minorVersion is enough)
Optional
language: string(optional) the language to use for the title, will always fall back to English if it is not possible to localize
the decoded JSON data or undefined if library is not installed
Returns a (relative) URL for a library file that can be used to hard-code URLs of specific files if necessary. Avoid using this method when possible! This method does NOT check if the file exists!
the library for which the URL should be retrieved
the filename inside the library (path)
the URL of the file
Checks which libraries in the list are not installed.
the list of libraries to check
the list of not installed libraries
Returns the content of semantics.json for the specified library.
the content of semantics.json
Returns a URL of the upgrades script in the library
the library whose upgrade script should be accessed
the URL of upgrades.js. Null if there is no upgrades file. (The null value can be passed back to the client.)
Installs or updates a library from a temporary directory. It does not delete the library files in the temporary directory. The method does NOT validate the library! It must be validated before calling this method! Throws an error if something went wrong and deletes the files already installed.
The path to the temporary directory that contains the library files (the root directory that includes library.json)
a structure telling if a library was newly installed, updated or nothing happened (e.g. because there already is a newer patch version installed).
Is the library a patched version of an existing library?
The library the check
the full library name of the already installed version if there is a patched version of an existing library, undefined otherwise
Checks if a library was installed.
the library to check
true if the library has been installed
Check if the library contains a file
The library to check
true if file exists in library, false otherwise
Checks if the given library has a higher version than the highest installed version.
Library to compare against the highest locally installed version.
true if the passed library contains a version that is higher than the highest installed version, false otherwise
Gets a list of files that exist in the library.
the library for which the files should be listed
the files in the library including language files
Get a list of the currently installed libraries.
Optional
machineName: string(optional) only return results for the machine name
An object which has properties with the existing library machine names. The properties' values are arrays of Library objects, which represent the different versions installed of this library.
Gets a list of translations that exist for this library.
the language codes for translations of this library
This class manages library installations, enumerating installed libraries etc. It is storage agnostic and can be re-used in all implementations/plugins.