add a meta server Please note that setting a server with the same id again will replace the existing one with that id and setting it to undefined removes it
returns a promise that resolves once the ui has been displayed. This is useful if you have a callback that may be triggered before the ui is displayed but may require the UI to be processed. Specifically events can only be sent once this event has been triggered
clear the stylesheet cache to ensure it gets rebuilt even if the list of files hasn't changed
Optionalcloseclose a dialog
deregister an uri protocol currently being handled by us
OptionaldismissOptionaldismisshides a notification by its id
emit an event and allow every receiver to return a Promise. This call will only return after all these Promises are resolved. If the event handlers return a value, this returns an array of results
event emitter
functions made available from extension to extension. Callers have to make sure they handle gracefully the case where a function doesn't exist
Optionalextensionname of the extension to use this api with
generate an md5 hash for the specified file
Either a string containing the file path or a Buffer containing the data to hash
OptionalprogressFunc: (progress: number, total: number) => voidoptional function to report progress
a promise resolving to the md5 hash result
get direct access to the i18next object managing localisation. This is only needed to influence how localisation works in general, to just translate a text, use "translate"
get a list of extensions currently loaded into Vortex
retrieve path for a known directory location.
Note: This uses electrons ids for known folder locations. Please write your extensions to always use the appropriate folder location returned from this function, especially 'userData' should be used for all settings/state/temporary data if you don't want to/can't use the store. If Vortex introduces a way for users to customise storage locations then getPath will return the customised path so you don't have to adjust your extension.
wrapper for api.store.getState() with the benefit that it automatically assigns a type
highlight a control for a short time to direct the users attention to it. The control (or controls) is identified by a css selector. A text can be added, but no promise that it actually looks good in practice
Usually the css style used to draw the outline contains a bit of hackery to offset the padding and border width it adds so that the contents doesn't get moved around. If altStyle is set we use absolute positioning to get the same effect. This requires us to make the target item "position: relative" though which is more intrusive and can break the styling of the contents more severely.
returns true if the running version of Vortex is considered outdated. This is mostly used to determine if feedback should be sent to Nexus Mods.
prepare a string to be translated further down the line.
active locale
find meta information about a mod this will calculate a hash and the file size of the specified file for the lookup unless those details are already provided. Please note that it's still possible for the file to get multiple matches, i.e. if it has been re-uploaded, potentially for a different game.
find meta information about a mod
handle an event emitted with emitAndAwait. The listener can return a promise and the emitter will only return after all promises from handlers are returned. Note that listeners should report all errors themselves, it is considered a bug if the listener returns a rejected promise. If errors do need to be reported they have to be part of the resolved valued
Optionalonregister a callback for changes to the state
path in the state-tree to watch for changes, i.e. ['settings', 'interface', 'language'] would call the callback for all changes to the interface language
opens an archive
registers an uri protocol to be handled by this application. If the "def"ault parameter is set to true, this application will also be inserted as the system wide default handler for the protocol. Use with caution, as this will overwrite the previous value, which can't be undone automatically
registers a lookup mechanism that can be used to look up information about a mod based on ids. This will either work as a fallback or as a replacement to the md5 based lookup for applicable mods. The "repositoryId" should be the same as the "source" used. It's possible to return multiple results if the input data doesn't definitively identify a single item but this might be a bit of a mess to figure out later.
run an executable. This is comparable to node.js child_process.spawn but it allows us to add extensions, like support interpreters and hooks. It will also automatically ask the user to authorize elevation if the executable requires it The returned promise is resolved when the started process has run to completion. IRunOptions.onSpawned can be used to react to when the process has been started.
show a system dialog to save a single file
save meta information about a mod
show a system dialog to open a single directory
show a system dialog to select an executable file
show a system dialog to open a single file
Optionalsendshow a notification to the user. This is not available in the call to registerReducer
the notification id
insert or replace a sass-stylesheet. It gets integrated into the existing sheets based on the key: By default, the sheets "variables", "details" and "style" are intended to customize the look of the application.
If your extension sets a sheet that didn't exist before then that sheet will be inserted before the "style" sheet but after everything else. This allows themes to affect extension styles.
identify the key to set. If this is an existing sheet, that sheet will be replaced
path of the corresponding stylesheet file
Important: As usual with css, rules you add affect the entire application, without severely restricting themes and extensions we can not automatically restrict your stylesheets to the controls added by your extension. This means it's your responsibility to make sure your stylesheet doesn't modify foreign controls.
Optionalshowshow a dialog
Optionalshowshow an error message to the user. This is a convenience wrapper for sendNotification. This is not available in the call to registerReducer
Optionalstorethe redux store containing all application state & data
Please note: this store object will remain valid for the whole application runtime so you can store it, bind it to functions and so on. The state object (store.getState()) is immutable and will be a different object whenever the state is changed. Thus you should not store/bind the state directly unless you actually want a "snapshot" of the state.
Optionalsuppresshides a notification and don't show it again if this is called with the second parameter set to false, it re-enables the notification instead
translation function
wraps a function such that it will emitAndAwait will-eventName and did-eventName events before and after invoking the actual callback. both these events receive the arguments passed to the callback, the did-event also receives the result of the callback if any (the result is the first argument because the number of arguments may be variable)
interface for convenience functions made available to extensions
Export
IExtensionApi