UNPKG

@skyrim-platform/jcontainers

Version:

TypeScript library for the JContainers Skyrim modding utility

39 lines (36 loc) 2.78 kB
import { Form } from "skyrimPlatform"; /** 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 declare const solveFlt: (path: string, defaultVal?: number) => number; export declare const solveInt: (path: string, defaultVal?: number) => number; export declare const solveStr: (path: string, defaultVal?: string) => string; export declare const solveObj: (path: string, defaultVal?: number) => number; export declare const solveForm: (path: string, defaultVal?: Form | null | undefined) => Form | null | undefined; /** 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 declare const solveFltSetter: (path: string, value: number, createMissingKeys?: boolean) => boolean; export declare const solveIntSetter: (path: string, value: number, createMissingKeys?: boolean) => boolean; export declare const solveStrSetter: (path: string, value: string, createMissingKeys?: boolean) => boolean; export declare const solveObjSetter: (path: string, value: number, createMissingKeys?: boolean) => boolean; export declare const solveFormSetter: (path: string, value: Form | null | undefined, createMissingKeys?: boolean) => boolean; /** 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 declare const setObj: (key: string, object: number) => void; /** Returns true, if JDB capable resolve given @path, i.e. if it able to execute solve* or solver*Setter functions successfully */ export declare const hasPath: (path: string) => boolean; /** returns new array containing all JDB keys */ export declare const allKeys: () => number; /** returns new array containing all containers associated with JDB */ export declare const allValues: () => number; /** writes storage data into JSON file at given path */ export declare const writeToFile: (path: string) => void; /** 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 declare const root: () => number;