@skyrim-platform/jcontainers
Version:
TypeScript library for the JContainers Skyrim modding utility
91 lines (84 loc) • 4.61 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";
/** Global entry point to store mod information. Main intent - replace global variables
Manages keys and values associations (like JMap) */
var sn = sp.JDB;
/** Attempts to retrieve the value associated with the @path.
For ex. the following information associated with 'frosfall' key:
"frostfall" : {
"exposureRate" : 0.5,
"arrayC" : ["stringValue", 1.5, 10, 1.14]
}
then JDB.solveFlt(".frostfall.exposureRate") will return 0.5 and
JDB.solveObj(".frostfall.arrayC") will return the array containing ["stringValue", 1.5, 10, 1.14] values */
export var solveFlt = function (path, defaultVal) {
if (defaultVal === void 0) { defaultVal = 0.0; }
return sn.solveFlt(path, defaultVal);
};
export var solveInt = function (path, defaultVal) {
if (defaultVal === void 0) { defaultVal = 0; }
return sn.solveInt(path, defaultVal);
};
export var solveStr = function (path, defaultVal) {
if (defaultVal === void 0) { defaultVal = ""; }
return sn.solveStr(path, defaultVal);
};
export var solveObj = function (path, defaultVal) {
if (defaultVal === void 0) { defaultVal = 0; }
return sn.solveObj(path, defaultVal);
};
export var solveForm = function (path, defaultVal) {
if (defaultVal === void 0) { defaultVal = null; }
return sn.solveForm(path, defaultVal);
};
/** Attempts to assign the @value. Returns false if no such path.
If 'createMissingKeys=true' it creates any missing path elements: JDB.solveIntSetter(".frostfall.keyB", 10, true) creates {frostfall: {keyB: 10}} structure */
export var solveFltSetter = function (path, value, createMissingKeys) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
return sn.solveFltSetter(path, value, createMissingKeys);
};
export var solveIntSetter = function (path, value, createMissingKeys) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
return sn.solveIntSetter(path, value, createMissingKeys);
};
export var solveStrSetter = function (path, value, createMissingKeys) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
return sn.solveStrSetter(path, value, createMissingKeys);
};
export var solveObjSetter = function (path, value, createMissingKeys) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
return sn.solveObjSetter(path, value, createMissingKeys);
};
export var solveFormSetter = function (path, value, createMissingKeys) {
if (createMissingKeys === void 0) { createMissingKeys = false; }
return sn.solveFormSetter(path, value, createMissingKeys);
};
/** Associates(and replaces previous association) container object with a string key.
destroys association if object is zero
for ex. JDB.setObj("frostfall", frostFallInformation) will associate 'frostall' key and frostFallInformation so you can access it later */
export var setObj = function (key, object) { return sn.setObj(key, object); };
/** Returns true, if JDB capable resolve given @path, i.e. if it able to execute solve* or solver*Setter functions successfully */
export var hasPath = function (path) { return sn.hasPath(path); };
/** returns new array containing all JDB keys */
export var allKeys = function () { return sn.allKeys(); };
/** returns new array containing all containers associated with JDB */
export var allValues = function () { return sn.allValues(); };
/** writes storage data into JSON file at given path */
export var writeToFile = function (path) { return sn.writeToFile(path); };
/** Returns underlying JDB's container - an instance of JMap.
The object being owned (retained) internally, so you don't have to (but can) retain or release it. */
export var root = function () { return sn.root(); };