@skyrim-platform/jcontainers
Version:
TypeScript library for the JContainers Skyrim modding utility
41 lines (39 loc) • 3.77 kB
TypeScript
import { Form } from "skyrimPlatform";
/** associates given form key and entry (container). set entry to zero to destroy association */
export declare const setEntry: (storageName: string, fKey: Form | null | undefined, entry: number) => void;
/** returns (or creates new if not found) JMap entry for given storage and form */
export declare const makeEntry: (storageName: string, fKey: Form | null | undefined) => number;
/** search for entry for given storage and form */
export declare const findEntry: (storageName: string, fKey: Form | null | undefined) => number;
/** attempts to get value associated with path. */
export declare const solveFlt: (fKey: Form | null | undefined, path: string, defaultVal?: number) => number;
export declare const solveInt: (fKey: Form | null | undefined, path: string, defaultVal?: number) => number;
export declare const solveStr: (fKey: Form | null | undefined, path: string, defaultVal?: string) => string;
export declare const solveObj: (fKey: Form | null | undefined, path: string, defaultVal?: number) => number;
export declare const solveForm: (fKey: Form | null | undefined, path: string, defaultVal?: Form | null | undefined) => Form | null | undefined;
/** Attempts to assign value. Returns false if no such path
With 'createMissingKeys=true' it creates any missing path elements: JFormDB.solveIntSetter(formKey, ".frostfall.keyB", 10, true) creates {frostfall: {keyB: 10}} structure */
export declare const solveFltSetter: (fKey: Form | null | undefined, path: string, value: number, createMissingKeys?: boolean) => boolean;
export declare const solveIntSetter: (fKey: Form | null | undefined, path: string, value: number, createMissingKeys?: boolean) => boolean;
export declare const solveStrSetter: (fKey: Form | null | undefined, path: string, value: string, createMissingKeys?: boolean) => boolean;
export declare const solveObjSetter: (fKey: Form | null | undefined, path: string, value: number, createMissingKeys?: boolean) => boolean;
export declare const solveFormSetter: (fKey: Form | null | undefined, path: string, value: Form | null | undefined, createMissingKeys?: boolean) => boolean;
/** returns true, if capable resolve given path, e.g. it able to execute solve* or solver*Setter functions successfully */
export declare const hasPath: (fKey: Form | null | undefined, path: string) => boolean;
/** JMap-like interface functions:
returns new array containing all keys */
export declare const allKeys: (fKey: Form | null | undefined, key: string) => number;
/** returns new array containing all values */
export declare const allValues: (fKey: Form | null | undefined, key: string) => number;
/** returns value associated with key */
export declare const getInt: (fKey: Form | null | undefined, key: string) => number;
export declare const getFlt: (fKey: Form | null | undefined, key: string) => number;
export declare const getStr: (fKey: Form | null | undefined, key: string) => string;
export declare const getObj: (fKey: Form | null | undefined, key: string) => number;
export declare const getForm: (fKey: Form | null | undefined, key: string) => Form | null | undefined;
/** creates key-value association. replaces existing value if any */
export declare const setInt: (fKey: Form | null | undefined, key: string, value: number) => void;
export declare const setFlt: (fKey: Form | null | undefined, key: string, value: number) => void;
export declare const setStr: (fKey: Form | null | undefined, key: string, value: string) => void;
export declare const setObj: (fKey: Form | null | undefined, key: string, container: number) => void;
export declare const setForm: (fKey: Form | null | undefined, key: string, value: Form | null | undefined) => void;