@skyrim-platform/jcontainers
Version:
TypeScript library for the JContainers Skyrim modding utility
150 lines (143 loc) • 8.94 kB
JavaScript
/*
==============================================
Typescript definitions for v4.2.1
==============================================
This file was automatically generated by Papyrus-2-Typescript.exe
https://github.com/CarlosLeyvaAyala/Papyrus-2-Typescript
The program has no way to know the intention of the humans that made
the scripts, so it's always advisable to manually check all generated
files to make sure everything is declared as it should.
Take note the program assumes this script exists in some subfolder
to the folder where `skyrimPlatform.ts` is found, otherwise you'll get
"Cannot find module..." type of errors.
If you want to have this script in some other place, just change the
relative path of each `import`.
*/
import * as sp from "skyrimPlatform";
/** This way you can even, probably, implement true locks and etc */
var sn = sp.JAtomic;
/** A group of the functions that perform various math on the value at the @path of the container. Returns previos value:
T previousValue = container.path
container.path = someMathFunction(container.path, value)
return previousValue
If the value at the @path is None, then the @initialValue being read and passed into math function instead of None.
If @createMissingKeys is True, the function attemps to create missing @path elements. */
export var fetchAddInt = function (object, path, value, initialValue, createMissingKeys, onErrorReturn) {
if (initialValue === void 0) { initialValue = 0; }
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0; }
return sn.fetchAddInt(object, path, value, initialValue, createMissingKeys, onErrorReturn);
};
export var fetchAddFlt = function (object, path, value, initialValue, createMissingKeys, onErrorReturn) {
if (initialValue === void 0) { initialValue = 0.0; }
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0.0; }
return sn.fetchAddFlt(object, path, value, initialValue, createMissingKeys, onErrorReturn);
};
/** x *= v */
export var fetchMultInt = function (object, path, value, initialValue, createMissingKeys, onErrorReturn) {
if (initialValue === void 0) { initialValue = 0; }
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0; }
return sn.fetchMultInt(object, path, value, initialValue, createMissingKeys, onErrorReturn);
};
export var fetchMultFlt = function (object, path, value, initialValue, createMissingKeys, onErrorReturn) {
if (initialValue === void 0) { initialValue = 0.0; }
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0.0; }
return sn.fetchMultFlt(object, path, value, initialValue, createMissingKeys, onErrorReturn);
};
/** x %= v */
export var fetchModInt = function (object, path, value, initialValue, createMissingKeys, onErrorReturn) {
if (initialValue === void 0) { initialValue = 0; }
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0; }
return sn.fetchModInt(object, path, value, initialValue, createMissingKeys, onErrorReturn);
};
/** x /= v */
export var fetchDivInt = function (object, path, value, initialValue, createMissingKeys, onErrorReturn) {
if (initialValue === void 0) { initialValue = 0; }
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0; }
return sn.fetchDivInt(object, path, value, initialValue, createMissingKeys, onErrorReturn);
};
export var fetchDivFlt = function (object, path, value, initialValue, createMissingKeys, onErrorReturn) {
if (initialValue === void 0) { initialValue = 0.0; }
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0.0; }
return sn.fetchDivFlt(object, path, value, initialValue, createMissingKeys, onErrorReturn);
};
/** x &= v */
export var fetchAndInt = function (object, path, value, initialValue, createMissingKeys, onErrorReturn) {
if (initialValue === void 0) { initialValue = 0; }
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0; }
return sn.fetchAndInt(object, path, value, initialValue, createMissingKeys, onErrorReturn);
};
/** x ^= v */
export var fetchXorInt = function (object, path, value, initialValue, createMissingKeys, onErrorReturn) {
if (initialValue === void 0) { initialValue = 0; }
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0; }
return sn.fetchXorInt(object, path, value, initialValue, createMissingKeys, onErrorReturn);
};
/** x |= v */
export var fetchOrInt = function (object, path, value, initialValue, createMissingKeys, onErrorReturn) {
if (initialValue === void 0) { initialValue = 0; }
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0; }
return sn.fetchOrInt(object, path, value, initialValue, createMissingKeys, onErrorReturn);
};
/** Exchanges the value at the @path with the @value. Returns previous value. */
export var exchangeInt = function (object, path, value, createMissingKeys, onErrorReturn) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0; }
return sn.exchangeInt(object, path, value, createMissingKeys, onErrorReturn);
};
export var exchangeFlt = function (object, path, value, createMissingKeys, onErrorReturn) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0.0; }
return sn.exchangeFlt(object, path, value, createMissingKeys, onErrorReturn);
};
export var exchangeStr = function (object, path, value, createMissingKeys, onErrorReturn) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = ""; }
return sn.exchangeStr(object, path, value, createMissingKeys, onErrorReturn);
};
export var exchangeForm = function (object, path, value, createMissingKeys, onErrorReturn) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = null; }
return sn.exchangeForm(object, path, value, createMissingKeys, onErrorReturn);
};
export var exchangeObj = function (object, path, value, createMissingKeys, onErrorReturn) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0; }
return sn.exchangeObj(object, path, value, createMissingKeys, onErrorReturn);
};
/** Compares the value at the @path with the @expected and, if they are equal, exchanges the value at the @path with the @desired values.
Returns previous value. */
export var compareExchangeInt = function (object, path, desired, expected, createMissingKeys, onErrorReturn) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0; }
return sn.compareExchangeInt(object, path, desired, expected, createMissingKeys, onErrorReturn);
};
export var compareExchangeFlt = function (object, path, desired, expected, createMissingKeys, onErrorReturn) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0.0; }
return sn.compareExchangeFlt(object, path, desired, expected, createMissingKeys, onErrorReturn);
};
export var compareExchangeStr = function (object, path, desired, expected, createMissingKeys, onErrorReturn) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = ""; }
return sn.compareExchangeStr(object, path, desired, expected, createMissingKeys, onErrorReturn);
};
export var compareExchangeForm = function (object, path, desired, expected, createMissingKeys, onErrorReturn) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = null; }
return sn.compareExchangeForm(object, path, desired, expected, createMissingKeys, onErrorReturn);
};
export var compareExchangeObj = function (object, path, desired, expected, createMissingKeys, onErrorReturn) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
if (onErrorReturn === void 0) { onErrorReturn = 0; }
return sn.compareExchangeObj(object, path, desired, expected, createMissingKeys, onErrorReturn);
};