Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

itemsholdr

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

itemsholdr - npm Package Compare versions

Comparing version 0.7.5 to 0.7.6

19

dist/ItemsHoldr.js

@@ -178,4 +178,5 @@ define(function() { return /******/ (function(modules) { // webpackBootstrap

/**
* A versatile container to store and manipulate values in localStorage, and
* optionally keep an updated HTML container showing these values.
* Cache-based wrapper around localStorage.
*
* @template TItems Items names linked to their types.
*/

@@ -250,2 +251,3 @@ var ItemsHoldr = /** @class */ (function () {

*
* @template TKey Key name of an item.
* @param key Unique key to store the item under.

@@ -255,3 +257,2 @@ * @param settings Any additional settings for the item.

ItemsHoldr.prototype.addItem = function (key, settings) {
if (settings === void 0) { settings = {}; }
this.items[key] = new ItemContainer_1.ItemContainer(this.containerSettings, key, settings);

@@ -263,2 +264,3 @@ this.itemKeys.push(key);

*
* @template TKey Key name of an item.
* @param key The key for a known value.

@@ -275,2 +277,3 @@ * @returns The known value of a key, assuming that key exists.

*
* @template TKey Key name of an item.
* @param key The key of the element to remove.

@@ -284,3 +287,3 @@ */

delete this.items[key];
this.storage.removeItem(this.prefix + key);
this.storage.removeItem("" + this.prefix + key);
if ({}.hasOwnProperty.call(this.values, key)) {

@@ -293,2 +296,3 @@ this.addItem(key, this.values[key]);

*
* @template TKey Key name of an item.
* @param key Key of an item.

@@ -304,2 +308,3 @@ * @param value The new value for the item.

*
* @template TKey Key name of an item.
* @param key Key of an item.

@@ -318,2 +323,3 @@ * @param amount Amount to increase by (by default, 1).

*
* @template TKey Key name of an item.
* @param key Key of an item.

@@ -331,2 +337,3 @@ * @param amount Amount to decrease by (by default, 1).

*
* @template TKey Key name of an item.
* @param key Key of an item.

@@ -342,2 +349,3 @@ */

*
* @template TKey Key name of an item.
* @param key Key of an item.

@@ -368,3 +376,3 @@ * @returns Whether there is a value under that key.

var key = _a[_i];
this.storage.removeItem(this.prefix + key);
this.storage.removeItem("" + this.prefix + key);
}

@@ -382,2 +390,3 @@ this.items = {};

*
* @template TKey Key name of an item.
* @param key The key of the item to save.

@@ -384,0 +393,0 @@ */

var typedoc = typedoc || {};
typedoc.search = typedoc.search || {};
typedoc.search.data = {"kinds":{"1":"External module","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","262144":"Accessor","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"\"createStorage\"","url":"modules/_createstorage_.html","classes":"tsd-kind-external-module"},{"id":1,"kind":64,"name":"createStorage","url":"modules/_createstorage_.html#createstorage","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"\"createStorage\""},{"id":2,"kind":1,"name":"\"IItemsHoldr\"","url":"modules/_iitemsholdr_.html","classes":"tsd-kind-external-module"},{"id":3,"kind":256,"name":"ITriggers","url":"interfaces/_iitemsholdr_.itriggers.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"IItemsHoldr\""},{"id":4,"kind":256,"name":"IItemValues","url":"interfaces/_iitemsholdr_.iitemvalues.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"IItemsHoldr\""},{"id":5,"kind":256,"name":"IItemSettings","url":"interfaces/_iitemsholdr_.iitemsettings.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"IItemsHoldr\""},{"id":6,"kind":1024,"name":"maximum","url":"interfaces/_iitemsholdr_.iitemsettings.html#maximum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":7,"kind":1024,"name":"onMaximum","url":"interfaces/_iitemsholdr_.iitemsettings.html#onmaximum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":8,"kind":1024,"name":"minimum","url":"interfaces/_iitemsholdr_.iitemsettings.html#minimum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":9,"kind":1024,"name":"onMinimum","url":"interfaces/_iitemsholdr_.iitemsettings.html#onminimum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":10,"kind":1024,"name":"modularity","url":"interfaces/_iitemsholdr_.iitemsettings.html#modularity","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":11,"kind":1024,"name":"onModular","url":"interfaces/_iitemsholdr_.iitemsettings.html#onmodular","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":12,"kind":1024,"name":"triggers","url":"interfaces/_iitemsholdr_.iitemsettings.html#triggers","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":13,"kind":1024,"name":"valueDefault","url":"interfaces/_iitemsholdr_.iitemsettings.html#valuedefault","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":14,"kind":256,"name":"IExportedItems","url":"interfaces/_iitemsholdr_.iexporteditems.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"IItemsHoldr\""},{"id":15,"kind":256,"name":"IItemsHoldrSettings","url":"interfaces/_iitemsholdr_.iitemsholdrsettings.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"IItemsHoldr\""},{"id":16,"kind":1024,"name":"autoSave","url":"interfaces/_iitemsholdr_.iitemsholdrsettings.html#autosave","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldrSettings"},{"id":17,"kind":1024,"name":"defaults","url":"interfaces/_iitemsholdr_.iitemsholdrsettings.html#defaults","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldrSettings"},{"id":18,"kind":1024,"name":"prefix","url":"interfaces/_iitemsholdr_.iitemsholdrsettings.html#prefix","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldrSettings"},{"id":19,"kind":1024,"name":"storage","url":"interfaces/_iitemsholdr_.iitemsholdrsettings.html#storage","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldrSettings"},{"id":20,"kind":1024,"name":"values","url":"interfaces/_iitemsholdr_.iitemsholdrsettings.html#values","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldrSettings"},{"id":21,"kind":256,"name":"IItemsHoldr","url":"interfaces/_iitemsholdr_.iitemsholdr.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"IItemsHoldr\""},{"id":22,"kind":1024,"name":"length","url":"interfaces/_iitemsholdr_.iitemsholdr.html#length","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":23,"kind":2048,"name":"key","url":"interfaces/_iitemsholdr_.iitemsholdr.html#key","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":24,"kind":2048,"name":"getAutoSave","url":"interfaces/_iitemsholdr_.iitemsholdr.html#getautosave","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":25,"kind":2048,"name":"setAutoSave","url":"interfaces/_iitemsholdr_.iitemsholdr.html#setautosave","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":26,"kind":2048,"name":"addItem","url":"interfaces/_iitemsholdr_.iitemsholdr.html#additem","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":27,"kind":2048,"name":"getItem","url":"interfaces/_iitemsholdr_.iitemsholdr.html#getitem","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":28,"kind":2048,"name":"removeItem","url":"interfaces/_iitemsholdr_.iitemsholdr.html#removeitem","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":29,"kind":2048,"name":"setItem","url":"interfaces/_iitemsholdr_.iitemsholdr.html#setitem","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":30,"kind":2048,"name":"increase","url":"interfaces/_iitemsholdr_.iitemsholdr.html#increase","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":31,"kind":2048,"name":"decrease","url":"interfaces/_iitemsholdr_.iitemsholdr.html#decrease","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":32,"kind":2048,"name":"toggle","url":"interfaces/_iitemsholdr_.iitemsholdr.html#toggle","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":33,"kind":2048,"name":"hasKey","url":"interfaces/_iitemsholdr_.iitemsholdr.html#haskey","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":34,"kind":2048,"name":"exportItems","url":"interfaces/_iitemsholdr_.iitemsholdr.html#exportitems","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":35,"kind":2048,"name":"clear","url":"interfaces/_iitemsholdr_.iitemsholdr.html#clear","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":36,"kind":2048,"name":"saveItem","url":"interfaces/_iitemsholdr_.iitemsholdr.html#saveitem","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":37,"kind":2048,"name":"saveAll","url":"interfaces/_iitemsholdr_.iitemsholdr.html#saveall","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":38,"kind":4194304,"name":"IValueCallback","url":"modules/_iitemsholdr_.html#ivaluecallback","classes":"tsd-kind-type-alias tsd-parent-kind-external-module","parent":"\"IItemsHoldr\""},{"id":39,"kind":65536,"name":"__type","url":"modules/_iitemsholdr_.html#ivaluecallback.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"\"IItemsHoldr\".IValueCallback"},{"id":40,"kind":4194304,"name":"IValueTransform","url":"modules/_iitemsholdr_.html#ivaluetransform","classes":"tsd-kind-type-alias tsd-parent-kind-external-module","parent":"\"IItemsHoldr\""},{"id":41,"kind":65536,"name":"__type","url":"modules/_iitemsholdr_.html#ivaluetransform.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-has-type-parameter tsd-is-not-exported","parent":"\"IItemsHoldr\".IValueTransform"},{"id":42,"kind":1,"name":"\"proliferate\"","url":"modules/_proliferate_.html","classes":"tsd-kind-external-module"},{"id":43,"kind":64,"name":"proliferate","url":"modules/_proliferate_.html#proliferate","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"\"proliferate\""},{"id":44,"kind":1,"name":"\"ItemContainer\"","url":"modules/_itemcontainer_.html","classes":"tsd-kind-external-module"},{"id":45,"kind":256,"name":"IItemContainerSettings","url":"interfaces/_itemcontainer_.iitemcontainersettings.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"ItemContainer\""},{"id":46,"kind":1024,"name":"autoSave","url":"interfaces/_itemcontainer_.iitemcontainersettings.html#autosave","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"ItemContainer\".IItemContainerSettings"},{"id":47,"kind":1024,"name":"defaults","url":"interfaces/_itemcontainer_.iitemcontainersettings.html#defaults","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"ItemContainer\".IItemContainerSettings"},{"id":48,"kind":1024,"name":"prefix","url":"interfaces/_itemcontainer_.iitemcontainersettings.html#prefix","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"ItemContainer\".IItemContainerSettings"},{"id":49,"kind":1024,"name":"storage","url":"interfaces/_itemcontainer_.iitemcontainersettings.html#storage","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"ItemContainer\".IItemContainerSettings"},{"id":50,"kind":128,"name":"ItemContainer","url":"classes/_itemcontainer_.itemcontainer.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"ItemContainer\""},{"id":51,"kind":1024,"name":"settings","url":"classes/_itemcontainer_.itemcontainer.html#settings","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":52,"kind":1024,"name":"key","url":"classes/_itemcontainer_.itemcontainer.html#key","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":53,"kind":1024,"name":"valueDefault","url":"classes/_itemcontainer_.itemcontainer.html#valuedefault","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":54,"kind":1024,"name":"triggers","url":"classes/_itemcontainer_.itemcontainer.html#triggers","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":55,"kind":1024,"name":"minimum","url":"classes/_itemcontainer_.itemcontainer.html#minimum","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":56,"kind":1024,"name":"onMinimum","url":"classes/_itemcontainer_.itemcontainer.html#onminimum","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":57,"kind":1024,"name":"maximum","url":"classes/_itemcontainer_.itemcontainer.html#maximum","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":58,"kind":1024,"name":"onMaximum","url":"classes/_itemcontainer_.itemcontainer.html#onmaximum","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":59,"kind":1024,"name":"modularity","url":"classes/_itemcontainer_.itemcontainer.html#modularity","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":60,"kind":1024,"name":"onModular","url":"classes/_itemcontainer_.itemcontainer.html#onmodular","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":61,"kind":1024,"name":"value","url":"classes/_itemcontainer_.itemcontainer.html#value","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":62,"kind":512,"name":"constructor","url":"classes/_itemcontainer_.itemcontainer.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"ItemContainer\".ItemContainer"},{"id":63,"kind":2048,"name":"getValue","url":"classes/_itemcontainer_.itemcontainer.html#getvalue","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemContainer\".ItemContainer"},{"id":64,"kind":2048,"name":"setValue","url":"classes/_itemcontainer_.itemcontainer.html#setvalue","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemContainer\".ItemContainer"},{"id":65,"kind":2048,"name":"update","url":"classes/_itemcontainer_.itemcontainer.html#update","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemContainer\".ItemContainer"},{"id":66,"kind":2048,"name":"updateStorage","url":"classes/_itemcontainer_.itemcontainer.html#updatestorage","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemContainer\".ItemContainer"},{"id":67,"kind":2048,"name":"checkTriggers","url":"classes/_itemcontainer_.itemcontainer.html#checktriggers","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":68,"kind":2048,"name":"checkModularity","url":"classes/_itemcontainer_.itemcontainer.html#checkmodularity","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":69,"kind":2048,"name":"retrieveLocalStorage","url":"classes/_itemcontainer_.itemcontainer.html#retrievelocalstorage","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":70,"kind":1,"name":"\"ItemsHoldr\"","url":"modules/_itemsholdr_.html","classes":"tsd-kind-external-module"},{"id":71,"kind":256,"name":"IItems","url":"interfaces/_itemsholdr_.iitems.html","classes":"tsd-kind-interface tsd-parent-kind-external-module tsd-is-not-exported","parent":"\"ItemsHoldr\""},{"id":72,"kind":128,"name":"ItemsHoldr","url":"classes/_itemsholdr_.itemsholdr.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"ItemsHoldr\""},{"id":73,"kind":1024,"name":"settings","url":"classes/_itemsholdr_.itemsholdr.html#settings","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":74,"kind":1024,"name":"prefix","url":"classes/_itemsholdr_.itemsholdr.html#prefix","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":75,"kind":1024,"name":"storage","url":"classes/_itemsholdr_.itemsholdr.html#storage","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":76,"kind":1024,"name":"values","url":"classes/_itemsholdr_.itemsholdr.html#values","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":77,"kind":1024,"name":"containerSettings","url":"classes/_itemsholdr_.itemsholdr.html#containersettings","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":78,"kind":1024,"name":"autoSave","url":"classes/_itemsholdr_.itemsholdr.html#autosave","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":79,"kind":1024,"name":"itemKeys","url":"classes/_itemsholdr_.itemsholdr.html#itemkeys","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":80,"kind":1024,"name":"items","url":"classes/_itemsholdr_.itemsholdr.html#items","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":81,"kind":512,"name":"constructor","url":"classes/_itemsholdr_.itemsholdr.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":82,"kind":262144,"name":"length","url":"classes/_itemsholdr_.itemsholdr.html#length","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":83,"kind":2048,"name":"key","url":"classes/_itemsholdr_.itemsholdr.html#key","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":84,"kind":2048,"name":"getAutoSave","url":"classes/_itemsholdr_.itemsholdr.html#getautosave","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":85,"kind":2048,"name":"setAutoSave","url":"classes/_itemsholdr_.itemsholdr.html#setautosave","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":86,"kind":2048,"name":"addItem","url":"classes/_itemsholdr_.itemsholdr.html#additem","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":87,"kind":2048,"name":"getItem","url":"classes/_itemsholdr_.itemsholdr.html#getitem","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":88,"kind":2048,"name":"removeItem","url":"classes/_itemsholdr_.itemsholdr.html#removeitem","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":89,"kind":2048,"name":"setItem","url":"classes/_itemsholdr_.itemsholdr.html#setitem","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":90,"kind":2048,"name":"increase","url":"classes/_itemsholdr_.itemsholdr.html#increase","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":91,"kind":2048,"name":"decrease","url":"classes/_itemsholdr_.itemsholdr.html#decrease","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":92,"kind":2048,"name":"toggle","url":"classes/_itemsholdr_.itemsholdr.html#toggle","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":93,"kind":2048,"name":"hasKey","url":"classes/_itemsholdr_.itemsholdr.html#haskey","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":94,"kind":2048,"name":"exportItems","url":"classes/_itemsholdr_.itemsholdr.html#exportitems","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":95,"kind":2048,"name":"clear","url":"classes/_itemsholdr_.itemsholdr.html#clear","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":96,"kind":2048,"name":"saveItem","url":"classes/_itemsholdr_.itemsholdr.html#saveitem","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":97,"kind":2048,"name":"saveAll","url":"classes/_itemsholdr_.itemsholdr.html#saveall","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":98,"kind":2048,"name":"checkExistence","url":"classes/_itemsholdr_.itemsholdr.html#checkexistence","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":99,"kind":1,"name":"\"fakes\"","url":"modules/_fakes_.html","classes":"tsd-kind-external-module"},{"id":100,"kind":64,"name":"stubItemsHoldr","url":"modules/_fakes_.html#stubitemsholdr","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"\"fakes\""},{"id":101,"kind":64,"name":"stubItemValueSettings","url":"modules/_fakes_.html#stubitemvaluesettings","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"\"fakes\""},{"id":102,"kind":1,"name":"\"index\"","url":"modules/_index_.html","classes":"tsd-kind-external-module"},{"id":103,"kind":1,"name":"\"ItemsHoldr.test\"","url":"modules/_itemsholdr_test_.html","classes":"tsd-kind-external-module"},{"id":104,"kind":1,"name":"\"proliferate.test\"","url":"modules/_proliferate_test_.html","classes":"tsd-kind-external-module"}]};
typedoc.search.data = {"kinds":{"1":"External module","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","262144":"Accessor","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"\"createStorage\"","url":"modules/_createstorage_.html","classes":"tsd-kind-external-module"},{"id":1,"kind":64,"name":"createStorage","url":"modules/_createstorage_.html#createstorage","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"\"createStorage\""},{"id":2,"kind":1,"name":"\"IItemsHoldr\"","url":"modules/_iitemsholdr_.html","classes":"tsd-kind-external-module"},{"id":3,"kind":256,"name":"ITriggers","url":"interfaces/_iitemsholdr_.itriggers.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"IItemsHoldr\""},{"id":4,"kind":256,"name":"IItemValues","url":"interfaces/_iitemsholdr_.iitemvalues.html","classes":"tsd-kind-interface tsd-parent-kind-external-module tsd-has-type-parameter","parent":"\"IItemsHoldr\""},{"id":5,"kind":256,"name":"IItemSettings","url":"interfaces/_iitemsholdr_.iitemsettings.html","classes":"tsd-kind-interface tsd-parent-kind-external-module tsd-has-type-parameter","parent":"\"IItemsHoldr\""},{"id":6,"kind":1024,"name":"maximum","url":"interfaces/_iitemsholdr_.iitemsettings.html#maximum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":7,"kind":1024,"name":"onMaximum","url":"interfaces/_iitemsholdr_.iitemsettings.html#onmaximum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":8,"kind":1024,"name":"minimum","url":"interfaces/_iitemsholdr_.iitemsettings.html#minimum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":9,"kind":1024,"name":"onMinimum","url":"interfaces/_iitemsholdr_.iitemsettings.html#onminimum","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":10,"kind":1024,"name":"modularity","url":"interfaces/_iitemsholdr_.iitemsettings.html#modularity","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":11,"kind":1024,"name":"onModular","url":"interfaces/_iitemsholdr_.iitemsettings.html#onmodular","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":12,"kind":1024,"name":"triggers","url":"interfaces/_iitemsholdr_.iitemsettings.html#triggers","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":13,"kind":1024,"name":"valueDefault","url":"interfaces/_iitemsholdr_.iitemsettings.html#valuedefault","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemSettings"},{"id":14,"kind":256,"name":"IItemsHoldrSettings","url":"interfaces/_iitemsholdr_.iitemsholdrsettings.html","classes":"tsd-kind-interface tsd-parent-kind-external-module tsd-has-type-parameter","parent":"\"IItemsHoldr\""},{"id":15,"kind":1024,"name":"autoSave","url":"interfaces/_iitemsholdr_.iitemsholdrsettings.html#autosave","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldrSettings"},{"id":16,"kind":1024,"name":"defaults","url":"interfaces/_iitemsholdr_.iitemsholdrsettings.html#defaults","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldrSettings"},{"id":17,"kind":1024,"name":"prefix","url":"interfaces/_iitemsholdr_.iitemsholdrsettings.html#prefix","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldrSettings"},{"id":18,"kind":1024,"name":"storage","url":"interfaces/_iitemsholdr_.iitemsholdrsettings.html#storage","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldrSettings"},{"id":19,"kind":1024,"name":"values","url":"interfaces/_iitemsholdr_.iitemsholdrsettings.html#values","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldrSettings"},{"id":20,"kind":256,"name":"IItemsHoldr","url":"interfaces/_iitemsholdr_.iitemsholdr.html","classes":"tsd-kind-interface tsd-parent-kind-external-module tsd-has-type-parameter","parent":"\"IItemsHoldr\""},{"id":21,"kind":1024,"name":"length","url":"interfaces/_iitemsholdr_.iitemsholdr.html#length","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":22,"kind":2048,"name":"key","url":"interfaces/_iitemsholdr_.iitemsholdr.html#key","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":23,"kind":2048,"name":"getAutoSave","url":"interfaces/_iitemsholdr_.iitemsholdr.html#getautosave","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":24,"kind":2048,"name":"setAutoSave","url":"interfaces/_iitemsholdr_.iitemsholdr.html#setautosave","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":25,"kind":2048,"name":"addItem","url":"interfaces/_iitemsholdr_.iitemsholdr.html#additem","classes":"tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":26,"kind":2048,"name":"getItem","url":"interfaces/_iitemsholdr_.iitemsholdr.html#getitem","classes":"tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":27,"kind":2048,"name":"removeItem","url":"interfaces/_iitemsholdr_.iitemsholdr.html#removeitem","classes":"tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":28,"kind":2048,"name":"setItem","url":"interfaces/_iitemsholdr_.iitemsholdr.html#setitem","classes":"tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":29,"kind":2048,"name":"increase","url":"interfaces/_iitemsholdr_.iitemsholdr.html#increase","classes":"tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":30,"kind":2048,"name":"decrease","url":"interfaces/_iitemsholdr_.iitemsholdr.html#decrease","classes":"tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":31,"kind":2048,"name":"toggle","url":"interfaces/_iitemsholdr_.iitemsholdr.html#toggle","classes":"tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":32,"kind":2048,"name":"hasKey","url":"interfaces/_iitemsholdr_.iitemsholdr.html#haskey","classes":"tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":33,"kind":2048,"name":"exportItems","url":"interfaces/_iitemsholdr_.iitemsholdr.html#exportitems","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":34,"kind":2048,"name":"clear","url":"interfaces/_iitemsholdr_.iitemsholdr.html#clear","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":35,"kind":2048,"name":"saveItem","url":"interfaces/_iitemsholdr_.iitemsholdr.html#saveitem","classes":"tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":36,"kind":2048,"name":"saveAll","url":"interfaces/_iitemsholdr_.iitemsholdr.html#saveall","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IItemsHoldr\".IItemsHoldr"},{"id":37,"kind":4194304,"name":"IValueCallback","url":"modules/_iitemsholdr_.html#ivaluecallback","classes":"tsd-kind-type-alias tsd-parent-kind-external-module","parent":"\"IItemsHoldr\""},{"id":38,"kind":65536,"name":"__type","url":"modules/_iitemsholdr_.html#ivaluecallback.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"\"IItemsHoldr\".IValueCallback"},{"id":39,"kind":4194304,"name":"IValueTransform","url":"modules/_iitemsholdr_.html#ivaluetransform","classes":"tsd-kind-type-alias tsd-parent-kind-external-module","parent":"\"IItemsHoldr\""},{"id":40,"kind":65536,"name":"__type","url":"modules/_iitemsholdr_.html#ivaluetransform.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-has-type-parameter tsd-is-not-exported","parent":"\"IItemsHoldr\".IValueTransform"},{"id":41,"kind":1,"name":"\"proliferate\"","url":"modules/_proliferate_.html","classes":"tsd-kind-external-module"},{"id":42,"kind":64,"name":"proliferate","url":"modules/_proliferate_.html#proliferate","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"\"proliferate\""},{"id":43,"kind":1,"name":"\"ItemContainer\"","url":"modules/_itemcontainer_.html","classes":"tsd-kind-external-module"},{"id":44,"kind":256,"name":"IItemContainerSettings","url":"interfaces/_itemcontainer_.iitemcontainersettings.html","classes":"tsd-kind-interface tsd-parent-kind-external-module tsd-has-type-parameter","parent":"\"ItemContainer\""},{"id":45,"kind":1024,"name":"autoSave","url":"interfaces/_itemcontainer_.iitemcontainersettings.html#autosave","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"ItemContainer\".IItemContainerSettings"},{"id":46,"kind":1024,"name":"defaults","url":"interfaces/_itemcontainer_.iitemcontainersettings.html#defaults","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"ItemContainer\".IItemContainerSettings"},{"id":47,"kind":1024,"name":"prefix","url":"interfaces/_itemcontainer_.iitemcontainersettings.html#prefix","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"ItemContainer\".IItemContainerSettings"},{"id":48,"kind":1024,"name":"storage","url":"interfaces/_itemcontainer_.iitemcontainersettings.html#storage","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"ItemContainer\".IItemContainerSettings"},{"id":49,"kind":128,"name":"ItemContainer","url":"classes/_itemcontainer_.itemcontainer.html","classes":"tsd-kind-class tsd-parent-kind-external-module tsd-has-type-parameter","parent":"\"ItemContainer\""},{"id":50,"kind":1024,"name":"settings","url":"classes/_itemcontainer_.itemcontainer.html#settings","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":51,"kind":1024,"name":"key","url":"classes/_itemcontainer_.itemcontainer.html#key","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":52,"kind":1024,"name":"valueDefault","url":"classes/_itemcontainer_.itemcontainer.html#valuedefault","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":53,"kind":1024,"name":"triggers","url":"classes/_itemcontainer_.itemcontainer.html#triggers","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":54,"kind":1024,"name":"minimum","url":"classes/_itemcontainer_.itemcontainer.html#minimum","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":55,"kind":1024,"name":"onMinimum","url":"classes/_itemcontainer_.itemcontainer.html#onminimum","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":56,"kind":1024,"name":"maximum","url":"classes/_itemcontainer_.itemcontainer.html#maximum","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":57,"kind":1024,"name":"onMaximum","url":"classes/_itemcontainer_.itemcontainer.html#onmaximum","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":58,"kind":1024,"name":"modularity","url":"classes/_itemcontainer_.itemcontainer.html#modularity","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":59,"kind":1024,"name":"onModular","url":"classes/_itemcontainer_.itemcontainer.html#onmodular","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":60,"kind":1024,"name":"value","url":"classes/_itemcontainer_.itemcontainer.html#value","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":61,"kind":512,"name":"constructor","url":"classes/_itemcontainer_.itemcontainer.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"ItemContainer\".ItemContainer"},{"id":62,"kind":2048,"name":"getValue","url":"classes/_itemcontainer_.itemcontainer.html#getvalue","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemContainer\".ItemContainer"},{"id":63,"kind":2048,"name":"setValue","url":"classes/_itemcontainer_.itemcontainer.html#setvalue","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemContainer\".ItemContainer"},{"id":64,"kind":2048,"name":"update","url":"classes/_itemcontainer_.itemcontainer.html#update","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemContainer\".ItemContainer"},{"id":65,"kind":2048,"name":"updateStorage","url":"classes/_itemcontainer_.itemcontainer.html#updatestorage","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemContainer\".ItemContainer"},{"id":66,"kind":2048,"name":"checkTriggers","url":"classes/_itemcontainer_.itemcontainer.html#checktriggers","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":67,"kind":2048,"name":"checkModularity","url":"classes/_itemcontainer_.itemcontainer.html#checkmodularity","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":68,"kind":2048,"name":"retrieveLocalStorage","url":"classes/_itemcontainer_.itemcontainer.html#retrievelocalstorage","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"ItemContainer\".ItemContainer"},{"id":69,"kind":1,"name":"\"ItemsHoldr\"","url":"modules/_itemsholdr_.html","classes":"tsd-kind-external-module"},{"id":70,"kind":256,"name":"IItems","url":"interfaces/_itemsholdr_.iitems.html","classes":"tsd-kind-interface tsd-parent-kind-external-module tsd-is-not-exported","parent":"\"ItemsHoldr\""},{"id":71,"kind":128,"name":"ItemsHoldr","url":"classes/_itemsholdr_.itemsholdr.html","classes":"tsd-kind-class tsd-parent-kind-external-module tsd-has-type-parameter","parent":"\"ItemsHoldr\""},{"id":72,"kind":1024,"name":"settings","url":"classes/_itemsholdr_.itemsholdr.html#settings","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":73,"kind":1024,"name":"prefix","url":"classes/_itemsholdr_.itemsholdr.html#prefix","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":74,"kind":1024,"name":"storage","url":"classes/_itemsholdr_.itemsholdr.html#storage","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":75,"kind":1024,"name":"values","url":"classes/_itemsholdr_.itemsholdr.html#values","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":76,"kind":1024,"name":"containerSettings","url":"classes/_itemsholdr_.itemsholdr.html#containersettings","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":77,"kind":1024,"name":"autoSave","url":"classes/_itemsholdr_.itemsholdr.html#autosave","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":78,"kind":1024,"name":"itemKeys","url":"classes/_itemsholdr_.itemsholdr.html#itemkeys","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":79,"kind":1024,"name":"items","url":"classes/_itemsholdr_.itemsholdr.html#items","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":80,"kind":512,"name":"constructor","url":"classes/_itemsholdr_.itemsholdr.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":81,"kind":262144,"name":"length","url":"classes/_itemsholdr_.itemsholdr.html#length","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":82,"kind":2048,"name":"key","url":"classes/_itemsholdr_.itemsholdr.html#key","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":83,"kind":2048,"name":"getAutoSave","url":"classes/_itemsholdr_.itemsholdr.html#getautosave","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":84,"kind":2048,"name":"setAutoSave","url":"classes/_itemsholdr_.itemsholdr.html#setautosave","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":85,"kind":2048,"name":"addItem","url":"classes/_itemsholdr_.itemsholdr.html#additem","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":86,"kind":2048,"name":"getItem","url":"classes/_itemsholdr_.itemsholdr.html#getitem","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":87,"kind":2048,"name":"removeItem","url":"classes/_itemsholdr_.itemsholdr.html#removeitem","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":88,"kind":2048,"name":"setItem","url":"classes/_itemsholdr_.itemsholdr.html#setitem","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":89,"kind":2048,"name":"increase","url":"classes/_itemsholdr_.itemsholdr.html#increase","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":90,"kind":2048,"name":"decrease","url":"classes/_itemsholdr_.itemsholdr.html#decrease","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":91,"kind":2048,"name":"toggle","url":"classes/_itemsholdr_.itemsholdr.html#toggle","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":92,"kind":2048,"name":"hasKey","url":"classes/_itemsholdr_.itemsholdr.html#haskey","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":93,"kind":2048,"name":"exportItems","url":"classes/_itemsholdr_.itemsholdr.html#exportitems","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":94,"kind":2048,"name":"clear","url":"classes/_itemsholdr_.itemsholdr.html#clear","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":95,"kind":2048,"name":"saveItem","url":"classes/_itemsholdr_.itemsholdr.html#saveitem","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":96,"kind":2048,"name":"saveAll","url":"classes/_itemsholdr_.itemsholdr.html#saveall","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":97,"kind":2048,"name":"checkExistence","url":"classes/_itemsholdr_.itemsholdr.html#checkexistence","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"ItemsHoldr\".ItemsHoldr"},{"id":98,"kind":1,"name":"\"fakes\"","url":"modules/_fakes_.html","classes":"tsd-kind-external-module"},{"id":99,"kind":64,"name":"stubItemsHoldr","url":"modules/_fakes_.html#stubitemsholdr","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"\"fakes\""},{"id":100,"kind":64,"name":"stubItemValueSettings","url":"modules/_fakes_.html#stubitemvaluesettings","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"\"fakes\""},{"id":101,"kind":1,"name":"\"index\"","url":"modules/_index_.html","classes":"tsd-kind-external-module"},{"id":102,"kind":1,"name":"\"ItemsHoldr.test\"","url":"modules/_itemsholdr_test_.html","classes":"tsd-kind-external-module"},{"id":103,"kind":1,"name":"\"proliferate.test\"","url":"modules/_proliferate_test_.html","classes":"tsd-kind-external-module"}]};

@@ -14,22 +14,25 @@ {

"devDependencies": {
"@types/chai": "^4.0.4",
"@types/chai": "^4.1.2",
"@types/lodash": "^4.14.99",
"@types/lolex": "^2.1.1",
"@types/mocha": "^2.2.46",
"@types/mocha": "^2.2.48",
"@types/sinon": "^4.1.3",
"@types/sinon-chai": "^2.7.29",
"chai": "^4.1.2",
"concurrently": "^3.5.1",
"glob": "^7.1.2",
"lolex": "^2.3.0",
"lolex": "^2.3.2",
"mkdirp": "^0.5.1",
"mocha": "^4.0.1",
"mocha-headless-chrome": "^1.8.1",
"mocha": "^5.0.0",
"mocha-headless-chrome": "^1.8.2",
"requirejs": "^2.3.5",
"run-for-every-file": "^1.1.0",
"shenanigans-manager": "^0.2.20",
"sinon": "^4.1.5",
"shenanigans-manager": "^0.2.23",
"sinon": "^4.2.2",
"sinon-chai": "^2.14.0",
"tslint": "5.9.1",
"tsutils": "^2.17.0",
"typedoc": "^0.9.0",
"typescript": "^2.6.2",
"tsutils": "^2.21.0",
"typedoc": "^0.10.0",
"typescript": "^2.7.1",
"watch": "^1.0.2",
"webpack": "^3.10.0"

@@ -66,3 +69,3 @@ },

"verify": "npm run src && npm run test && npm run dist && npm run docs",
"watch": "tsc -p . -w"
"watch": "concurrently \"tsc -p . -w\" --raw \"chokidar src/**/*.test.t* --command \"\"npm run test:setup:html\"\" --silent\" --raw"
},

@@ -73,3 +76,3 @@ "shenanigans": {

"types": "./src/index.d.ts",
"version": "0.7.5"
"version": "0.7.6"
}

@@ -552,5 +552,5 @@ <!-- {{Top}} -->

Test files are alongside source files under `src/` and named `*.test.ts?`.
Whenever you add, remove, or rename a `*.test.ts?` file under `src/`, re-run `npm run test:setup` to regenerate the list of static test files in `test/index.html`.
Whenever you add, remove, or rename a `*.test.t*` file under `src/`, `watch` will re-run `npm run test:setup` to regenerate the list of static test files in `test/index.html`.
You can open that file in a browser to debug through the tests.
`npm run test` will run that setup and execute tests using [Puppeteer](https://github.com/GoogleChrome/puppeteer).
`npm run test:run` will run that setup and execute tests using [Puppeteer](https://github.com/GoogleChrome/puppeteer).
<!-- {{/Development}} -->

@@ -9,4 +9,4 @@ import { IItemsHoldrSettings } from "./IItemsHoldr";

*/
export declare const stubItemsHoldr: (settings?: IItemsHoldrSettings | undefined) => {
itemsHolder: ItemsHoldr;
export declare const stubItemsHoldr: (settings?: IItemsHoldrSettings<any> | undefined) => {
itemsHolder: ItemsHoldr<any>;
storage: Storage;

@@ -13,0 +13,0 @@ };

@@ -26,11 +26,13 @@ /**

*/
export interface IItemValues {
[i: string]: IItemSettings;
export interface IItemValues<TItems> {
[i: string]: IItemSettings<TItems[any]>;
}
/**
* Additional settings for storing an item.
*
* @type TItem Type of the stored item.
*/
export interface IItemSettings {
export interface IItemSettings<TItem = any> {
/**
* Maximum value the item may equal if a number.
* Maximum value the item may equal.
*/

@@ -43,3 +45,3 @@ maximum?: number;

/**
* Minimum value the item may equal if a number.
* Minimum value the item may equal.
*/

@@ -52,3 +54,3 @@ minimum?: number;

/**
* Maximum number to modulo the value against if a number.
* Maximum number to modulo the value against.
*/

@@ -68,14 +70,10 @@ modularity?: number;

*/
valueDefault?: any;
valueDefault?: TItem;
}
/**
* Full export of stored items.
*/
export interface IExportedItems {
[i: string]: string;
}
/**
* Settings to initialize a new instance of the IItemsHoldr interface.
*
* @template TItems Items names linked to their types.
*/
export interface IItemsHoldrSettings {
export interface IItemsHoldrSettings<TItems = any> {
/**

@@ -88,3 +86,3 @@ * Whether values should be saved immediately upon being set.

*/
defaults?: IItemSettings;
defaults?: IItemSettings<TItems>;
/**

@@ -101,8 +99,10 @@ * Prefix to add before keys in storage.

*/
values?: IItemValues;
values?: IItemValues<TItems>;
}
/**
* A versatile container to store and manipulate values in localStorage.
* Cache-based wrapper around localStorage.
*
* @template TItems Items names linked to their types.
*/
export interface IItemsHoldr {
export interface IItemsHoldr<TItems = any> {
/**

@@ -118,3 +118,3 @@ * How many items are being stored.

*/
key(index: number): string;
key(index: number): keyof TItems;
/**

@@ -135,53 +135,61 @@ * Gets whether autoSave is enabled.

*
* @template TKey Key name of an item.
* @param key Unique key to store the item under.
* @param settings Any additional settings for the item.
*/
addItem(key: string, settings?: IItemSettings): void;
addItem<TKey extends keyof TItems>(key: TKey, settings?: IItemSettings<TItems[TKey]>): void;
/**
* Gets a value under a key.
*
* @template TKey Key name of an item.
* @param key Key of an item.
* @returns The known value of a key, assuming that key exists.
*/
getItem(key: string): any;
getItem<TKey extends keyof TItems>(key: TKey): TItems[TKey];
/**
* Clears a value from the listing.
*
* @template TKey Key name of an item.
* @param key The key of the value to remove.
*/
removeItem(key: string): void;
removeItem<TKey extends keyof TItems>(key: TKey): void;
/**
* Sets the value for an item under the given key.
*
* @template TKey Key name of an item.
* @param key Key of an item.
* @param value The new value for the item.
*/
setItem(key: string, value: any): void;
setItem<TKey extends keyof TItems>(key: TKey, value: TItems[TKey]): void;
/**
* Increases the value of an item as a number or string.
*
* @template TKey Key name of an item.
* @param key Key of an item.
* @param amount Amount to increase by (by default, 1).
*/
increase(key: string, amount?: number | string): void;
increase<TKey extends keyof TItems>(key: TKey, amount?: number | string): void;
/**
* Decreases the value of an item as a number.
*
* @template TKey Key name of an item.
* @param key Key of an item.
* @param amount Amount to increase by (by default, 1).
*/
decrease(key: string, amount?: number): void;
decrease<TKey extends keyof TItems>(key: TKey, amount?: number): void;
/**
* Toggles whether an item is true or false.
*
* @template TKey Key name of an item.
* @param key Key of an item.
*/
toggle(key: string): void;
toggle<TKey extends keyof TItems>(key: TKey): void;
/**
* Gets whether an item exists under the key.
*
* @template TKey Key name of an item.
* @param key The key for a potentially known value.
* @returns Whether there is a value under that key.
*/
hasKey(key: string): boolean;
hasKey<TKey extends keyof TItems>(key: TKey): boolean;
/**

@@ -192,3 +200,3 @@ * Gets a summary of keys and their values.

*/
exportItems(): IExportedItems;
exportItems(): TItems;
/**

@@ -201,5 +209,6 @@ * Completely clears all items.

*
* @template TKey Key name of an item.
* @param key Key of an item to save.
*/
saveItem(key: string): void;
saveItem<TKey extends keyof TItems>(key: TKey): void;
/**

@@ -206,0 +215,0 @@ * Manually saves all items to storage, ignoring autoSave settings.

@@ -29,4 +29,4 @@ /**

*/
export interface IItemValues {
[i: string]: IItemSettings;
export interface IItemValues<TItems> {
[i: string]: IItemSettings<TItems[any]>;
}

@@ -36,6 +36,8 @@

* Additional settings for storing an item.
*
* @type TItem Type of the stored item.
*/
export interface IItemSettings {
export interface IItemSettings<TItem = any> {
/**
* Maximum value the item may equal if a number.
* Maximum value the item may equal.
*/

@@ -50,3 +52,3 @@ maximum?: number;

/**
* Minimum value the item may equal if a number.
* Minimum value the item may equal.
*/

@@ -61,3 +63,3 @@ minimum?: number;

/**
* Maximum number to modulo the value against if a number.
* Maximum number to modulo the value against.
*/

@@ -80,16 +82,11 @@ modularity?: number;

*/
valueDefault?: any;
valueDefault?: TItem;
}
/**
* Full export of stored items.
*/
export interface IExportedItems {
[i: string]: string;
}
/**
* Settings to initialize a new instance of the IItemsHoldr interface.
*
* @template TItems Items names linked to their types.
*/
export interface IItemsHoldrSettings {
export interface IItemsHoldrSettings<TItems = any> {
/**

@@ -103,3 +100,3 @@ * Whether values should be saved immediately upon being set.

*/
defaults?: IItemSettings;
defaults?: IItemSettings<TItems>;

@@ -119,9 +116,11 @@ /**

*/
values?: IItemValues;
values?: IItemValues<TItems>;
}
/**
* A versatile container to store and manipulate values in localStorage.
* Cache-based wrapper around localStorage.
*
* @template TItems Items names linked to their types.
*/
export interface IItemsHoldr {
export interface IItemsHoldr<TItems = any> {
/**

@@ -138,3 +137,3 @@ * How many items are being stored.

*/
key(index: number): string;
key(index: number): keyof TItems;

@@ -158,6 +157,7 @@ /**

*
* @template TKey Key name of an item.
* @param key Unique key to store the item under.
* @param settings Any additional settings for the item.
*/
addItem(key: string, settings?: IItemSettings): void;
addItem<TKey extends keyof TItems>(key: TKey, settings?: IItemSettings<TItems[TKey]>): void;

@@ -167,6 +167,7 @@ /**

*
* @template TKey Key name of an item.
* @param key Key of an item.
* @returns The known value of a key, assuming that key exists.
*/
getItem(key: string): any;
getItem<TKey extends keyof TItems>(key: TKey): TItems[TKey];

@@ -176,5 +177,6 @@ /**

*
* @template TKey Key name of an item.
* @param key The key of the value to remove.
*/
removeItem(key: string): void;
removeItem<TKey extends keyof TItems>(key: TKey): void;

@@ -184,6 +186,7 @@ /**

*
* @template TKey Key name of an item.
* @param key Key of an item.
* @param value The new value for the item.
*/
setItem(key: string, value: any): void;
setItem<TKey extends keyof TItems>(key: TKey, value: TItems[TKey]): void;

@@ -193,6 +196,7 @@ /**

*
* @template TKey Key name of an item.
* @param key Key of an item.
* @param amount Amount to increase by (by default, 1).
*/
increase(key: string, amount?: number | string): void;
increase<TKey extends keyof TItems>(key: TKey, amount?: number | string): void;

@@ -202,6 +206,7 @@ /**

*
* @template TKey Key name of an item.
* @param key Key of an item.
* @param amount Amount to increase by (by default, 1).
*/
decrease(key: string, amount?: number): void;
decrease<TKey extends keyof TItems>(key: TKey, amount?: number): void;

@@ -211,5 +216,6 @@ /**

*
* @template TKey Key name of an item.
* @param key Key of an item.
*/
toggle(key: string): void;
toggle<TKey extends keyof TItems>(key: TKey): void;

@@ -219,6 +225,7 @@ /**

*
* @template TKey Key name of an item.
* @param key The key for a potentially known value.
* @returns Whether there is a value under that key.
*/
hasKey(key: string): boolean;
hasKey<TKey extends keyof TItems>(key: TKey): boolean;

@@ -230,3 +237,3 @@ /**

*/
exportItems(): IExportedItems;
exportItems(): TItems;

@@ -241,5 +248,6 @@ /**

*
* @template TKey Key name of an item.
* @param key Key of an item to save.
*/
saveItem(key: string): void;
saveItem<TKey extends keyof TItems>(key: TKey): void;

@@ -246,0 +254,0 @@ /**

@@ -5,3 +5,3 @@ import { IItemSettings } from "./IItemsHoldr";

*/
export interface IItemContainerSettings {
export interface IItemContainerSettings<TItem = any> {
/**

@@ -14,3 +14,3 @@ * Whether this should save changes to localStorage automatically.

*/
defaults: IItemSettings;
defaults: IItemSettings<TItem>;
/**

@@ -28,3 +28,3 @@ * A prefix to store things under in localStorage.

*/
export declare class ItemContainer {
export declare class ItemContainer<TItem = any> {
/**

@@ -83,3 +83,3 @@ * Settings used for initialization.

*/
constructor(settings: IItemContainerSettings, key: string, item?: IItemSettings);
constructor(settings: IItemContainerSettings, key: string, item?: IItemSettings<TItem>);
/**

@@ -86,0 +86,0 @@ * Gets the stored value.

@@ -7,3 +7,3 @@ import { IItemSettings, ITriggers } from "./IItemsHoldr";

*/
export interface IItemContainerSettings {
export interface IItemContainerSettings<TItem = any> {
/**

@@ -17,3 +17,3 @@ * Whether this should save changes to localStorage automatically.

*/
defaults: IItemSettings;
defaults: IItemSettings<TItem>;

@@ -34,3 +34,3 @@ /**

*/
export class ItemContainer {
export class ItemContainer<TItem = any> {
/**

@@ -49,3 +49,3 @@ * Settings used for initialization.

*/
private readonly valueDefault: any;
private readonly valueDefault: TItem;

@@ -101,3 +101,3 @@ /**

*/
public constructor(settings: IItemContainerSettings, key: string, item: IItemSettings = {}) {
public constructor(settings: IItemContainerSettings, key: string, item: IItemSettings<TItem> = {}) {
this.settings = settings;

@@ -104,0 +104,0 @@

@@ -1,7 +0,8 @@

import { IExportedItems, IItemSettings, IItemsHoldr, IItemsHoldrSettings } from "./IItemsHoldr";
import { IItemSettings, IItemsHoldr, IItemsHoldrSettings } from "./IItemsHoldr";
/**
* A versatile container to store and manipulate values in localStorage, and
* optionally keep an updated HTML container showing these values.
* Cache-based wrapper around localStorage.
*
* @template TItems Items names linked to their types.
*/
export declare class ItemsHoldr implements IItemsHoldr {
export declare class ItemsHoldr<TItems = any> implements IItemsHoldr<TItems> {
/**

@@ -55,3 +56,3 @@ * Settings used to construct this ItemsHoldr.

*/
key(index: number): string;
key(index: number): keyof TItems;
/**

@@ -72,13 +73,15 @@ * Gets whether autoSave is enabled.

*
* @template TKey Key name of an item.
* @param key Unique key to store the item under.
* @param settings Any additional settings for the item.
*/
addItem(key: string, settings?: IItemSettings): void;
addItem<TKey extends keyof TItems>(key: TKey, settings?: IItemSettings<TItems[TKey]>): void;
/**
* Gets the value under a key.
*
* @template TKey Key name of an item.
* @param key The key for a known value.
* @returns The known value of a key, assuming that key exists.
*/
getItem(key: string): any;
getItem<TKey extends keyof TItems>(key: TKey): TItems[TKey];
/**

@@ -88,39 +91,45 @@ * Clears a value from the listing, and removes its element from the

*
* @template TKey Key name of an item.
* @param key The key of the element to remove.
*/
removeItem(key: string): void;
removeItem<TKey extends keyof TItems>(key: TKey): void;
/**
* Sets the value for an item under the given key.
*
* @template TKey Key name of an item.
* @param key Key of an item.
* @param value The new value for the item.
*/
setItem(key: string, value: any): void;
setItem<TKey extends keyof TItems>(key: TKey, value: TItems[TKey]): void;
/**
* Increases the value of an item as a number or string.
*
* @template TKey Key name of an item.
* @param key Key of an item.
* @param amount Amount to increase by (by default, 1).
*/
increase(key: string, amount?: number | string): void;
increase<TKey extends keyof TItems>(key: TKey, amount?: number | string): void;
/**
* Decreases the value of an item as a number
*
* @template TKey Key name of an item.
* @param key Key of an item.
* @param amount Amount to decrease by (by default, 1).
*/
decrease(key: string, amount?: number): void;
decrease<TKey extends keyof TItems>(key: TKey, amount?: number): void;
/**
* Toggles whether an item is true or false.
*
* @template TKey Key name of an item.
* @param key Key of an item.
*/
toggle(key: string): void;
toggle<TKey extends keyof TItems>(key: TKey): void;
/**
* Gets whether an item exists under the key.
*
* @template TKey Key name of an item.
* @param key Key of an item.
* @returns Whether there is a value under that key.
*/
hasKey(key: string): boolean;
hasKey<TKey extends keyof TItems>(key: TKey): boolean;
/**

@@ -131,3 +140,3 @@ * Gets a summary of keys and their values.

*/
exportItems(): IExportedItems;
exportItems(): TItems;
/**

@@ -140,5 +149,6 @@ * Completely clears all items.

*
* @template TKey Key name of an item.
* @param key The key of the item to save.
*/
saveItem(key: string): void;
saveItem<TKey extends keyof TItems>(key: TKey): void;
/**

@@ -145,0 +155,0 @@ * Manually saves all items to storage, ignoring autoSave settings.

@@ -5,4 +5,5 @@ define(["require", "exports", "./createStorage", "./ItemContainer"], function (require, exports, createStorage_1, ItemContainer_1) {

/**
* A versatile container to store and manipulate values in localStorage, and
* optionally keep an updated HTML container showing these values.
* Cache-based wrapper around localStorage.
*
* @template TItems Items names linked to their types.
*/

@@ -77,2 +78,3 @@ var ItemsHoldr = /** @class */ (function () {

*
* @template TKey Key name of an item.
* @param key Unique key to store the item under.

@@ -82,3 +84,2 @@ * @param settings Any additional settings for the item.

ItemsHoldr.prototype.addItem = function (key, settings) {
if (settings === void 0) { settings = {}; }
this.items[key] = new ItemContainer_1.ItemContainer(this.containerSettings, key, settings);

@@ -90,2 +91,3 @@ this.itemKeys.push(key);

*
* @template TKey Key name of an item.
* @param key The key for a known value.

@@ -102,2 +104,3 @@ * @returns The known value of a key, assuming that key exists.

*
* @template TKey Key name of an item.
* @param key The key of the element to remove.

@@ -111,3 +114,3 @@ */

delete this.items[key];
this.storage.removeItem(this.prefix + key);
this.storage.removeItem("" + this.prefix + key);
if ({}.hasOwnProperty.call(this.values, key)) {

@@ -120,2 +123,3 @@ this.addItem(key, this.values[key]);

*
* @template TKey Key name of an item.
* @param key Key of an item.

@@ -131,2 +135,3 @@ * @param value The new value for the item.

*
* @template TKey Key name of an item.
* @param key Key of an item.

@@ -145,2 +150,3 @@ * @param amount Amount to increase by (by default, 1).

*
* @template TKey Key name of an item.
* @param key Key of an item.

@@ -158,2 +164,3 @@ * @param amount Amount to decrease by (by default, 1).

*
* @template TKey Key name of an item.
* @param key Key of an item.

@@ -169,2 +176,3 @@ */

*
* @template TKey Key name of an item.
* @param key Key of an item.

@@ -195,3 +203,3 @@ * @returns Whether there is a value under that key.

var key = _a[_i];
this.storage.removeItem(this.prefix + key);
this.storage.removeItem("" + this.prefix + key);
}

@@ -209,2 +217,3 @@ this.items = {};

*
* @template TKey Key name of an item.
* @param key The key of the item to save.

@@ -211,0 +220,0 @@ */

import { createStorage } from "./createStorage";
import { IExportedItems, IItemSettings, IItemsHoldr, IItemsHoldrSettings, IItemValues } from "./IItemsHoldr";
import { IItemSettings, IItemsHoldr, IItemsHoldrSettings, IItemValues } from "./IItemsHoldr";
import { IItemContainerSettings, ItemContainer } from "./ItemContainer";

@@ -13,6 +13,7 @@

/**
* A versatile container to store and manipulate values in localStorage, and
* optionally keep an updated HTML container showing these values.
* Cache-based wrapper around localStorage.
*
* @template TItems Items names linked to their types.
*/
export class ItemsHoldr implements IItemsHoldr {
export class ItemsHoldr<TItems = any> implements IItemsHoldr<TItems> {
/**

@@ -36,3 +37,3 @@ * Settings used to construct this ItemsHoldr.

*/
private readonly values: IItemValues;
private readonly values: IItemValues<TItems>;

@@ -52,3 +53,3 @@ /**

*/
private itemKeys: string[];
private itemKeys: (keyof TItems)[];

@@ -102,3 +103,3 @@ /**

*/
public key(index: number): string {
public key(index: number): keyof TItems {
return this.itemKeys[index];

@@ -128,6 +129,7 @@ }

*
* @template TKey Key name of an item.
* @param key Unique key to store the item under.
* @param settings Any additional settings for the item.
*/
public addItem(key: string, settings: IItemSettings = {}): void {
public addItem<TKey extends keyof TItems>(key: TKey, settings?: IItemSettings<TItems[TKey]>): void {
this.items[key] = new ItemContainer(this.containerSettings, key, settings);

@@ -140,6 +142,7 @@ this.itemKeys.push(key);

*
* @template TKey Key name of an item.
* @param key The key for a known value.
* @returns The known value of a key, assuming that key exists.
*/
public getItem(key: string): any {
public getItem<TKey extends keyof TItems>(key: TKey): TItems[TKey] {
this.checkExistence(key);

@@ -154,5 +157,6 @@

*
* @template TKey Key name of an item.
* @param key The key of the element to remove.
*/
public removeItem(key: string): void {
public removeItem<TKey extends keyof TItems>(key: TKey): void {
if (!{}.hasOwnProperty.call(this.items, key)) {

@@ -165,3 +169,3 @@ return;

delete this.items[key];
this.storage.removeItem(this.prefix + key);
this.storage.removeItem(`${this.prefix}${key}`);

@@ -176,6 +180,7 @@ if ({}.hasOwnProperty.call(this.values, key)) {

*
* @template TKey Key name of an item.
* @param key Key of an item.
* @param value The new value for the item.
*/
public setItem(key: string, value: any): void {
public setItem<TKey extends keyof TItems>(key: TKey, value: TItems[TKey]): void {
this.checkExistence(key);

@@ -189,6 +194,7 @@

*
* @template TKey Key name of an item.
* @param key Key of an item.
* @param amount Amount to increase by (by default, 1).
*/
public increase(key: string, amount: number | string = 1): void {
public increase<TKey extends keyof TItems>(key: TKey, amount: number | string = 1): void {
this.checkExistence(key);

@@ -205,9 +211,10 @@

*
* @template TKey Key name of an item.
* @param key Key of an item.
* @param amount Amount to decrease by (by default, 1).
*/
public decrease(key: string, amount: number = 1): void {
public decrease<TKey extends keyof TItems>(key: TKey, amount: number = 1): void {
this.checkExistence(key);
const value: number = this.items[key].getValue() - amount;
const value: number = (this.items[key].getValue() as number) - amount;

@@ -220,5 +227,6 @@ this.items[key].setValue(value);

*
* @template TKey Key name of an item.
* @param key Key of an item.
*/
public toggle(key: string): void {
public toggle<TKey extends keyof TItems>(key: TKey): void {
this.checkExistence(key);

@@ -234,6 +242,7 @@

*
* @template TKey Key name of an item.
* @param key Key of an item.
* @returns Whether there is a value under that key.
*/
public hasKey(key: string): boolean {
public hasKey<TKey extends keyof TItems>(key: TKey): boolean {
return {}.hasOwnProperty.call(this.items, key);

@@ -247,3 +256,3 @@ }

*/
public exportItems(): IExportedItems {
public exportItems(): TItems {
const output: any = {};

@@ -263,3 +272,3 @@

for (const key of this.itemKeys) {
this.storage.removeItem(this.prefix + key);
this.storage.removeItem(`${this.prefix}${key}`);
}

@@ -280,5 +289,6 @@

*
* @template TKey Key name of an item.
* @param key The key of the item to save.
*/
public saveItem(key: string): void {
public saveItem<TKey extends keyof TItems>(key: TKey): void {
if (!{}.hasOwnProperty.call(this.items, key)) {

@@ -285,0 +295,0 @@ throw new Error(`Unknown key given to ItemsHoldr: '${key}'.`);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc