From 11ee0535492710382b2aebe01f2295a2f60d0a6a Mon Sep 17 00:00:00 2001 From: opus1269 Date: Thu, 30 May 2019 09:30:46 -0500 Subject: [PATCH] simplify storage api --- docs/gen/assets/js/search.js | 2 +- .../chrome_last_error.chromelasterror.html | 10 +- docs/gen/classes/chrome_time.chrometime.html | 32 +- docs/gen/enums/chrome_time.time_format.html | 6 +- .../chrome_analytics.ieventtype.html | 6 +- docs/gen/interfaces/chrome_http.iconfig.html | 18 +- docs/gen/interfaces/chrome_msg.imsgtype.html | 16 +- docs/gen/modules/chrome_analytics.html | 72 +-- docs/gen/modules/chrome_auth.html | 10 +- docs/gen/modules/chrome_http.html | 46 +- docs/gen/modules/chrome_json.html | 72 ++- docs/gen/modules/chrome_last_error.html | 2 +- docs/gen/modules/chrome_locales.html | 4 +- docs/gen/modules/chrome_log.html | 4 +- docs/gen/modules/chrome_msg.html | 22 +- docs/gen/modules/chrome_storage.html | 433 ++++++++++++++---- docs/gen/modules/chrome_time.html | 2 +- docs/gen/modules/chrome_utils.html | 75 +-- src/analytics.js | 27 +- src/analytics.ts | 25 +- src/json.js | 12 +- src/json.ts | 19 +- src/storage.js | 63 +-- src/storage.ts | 88 ++-- src/utils.js | 45 +- src/utils.ts | 47 +- 26 files changed, 678 insertions(+), 480 deletions(-) diff --git a/docs/gen/assets/js/search.js b/docs/gen/assets/js/search.js index 994dadf..08c8746 100644 --- a/docs/gen/assets/js/search.js +++ b/docs/gen/assets/js/search.js @@ -1,3 +1,3 @@ var typedoc = typedoc || {}; typedoc.search = typedoc.search || {}; - typedoc.search.data = {"kinds":{"1":"External module","4":"Enumeration","16":"Enumeration member","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","262144":"Accessor","2097152":"Object literal","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"chrome/json","url":"modules/chrome_json.html","classes":"tsd-kind-external-module"},{"id":1,"kind":64,"name":"parse","url":"modules/chrome_json.html#parse","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/json"},{"id":2,"kind":64,"name":"stringify","url":"modules/chrome_json.html#stringify","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/json"},{"id":3,"kind":64,"name":"shallowCopy","url":"modules/chrome_json.html#shallowcopy","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/json"},{"id":4,"kind":1,"name":"chrome/locales","url":"modules/chrome_locales.html","classes":"tsd-kind-external-module"},{"id":5,"kind":64,"name":"localize","url":"modules/chrome_locales.html#localize","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/locales"},{"id":6,"kind":64,"name":"getLocale","url":"modules/chrome_locales.html#getlocale","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/locales"},{"id":7,"kind":1,"name":"chrome/msg","url":"modules/chrome_msg.html","classes":"tsd-kind-external-module"},{"id":8,"kind":256,"name":"IMsgType","url":"interfaces/chrome_msg.imsgtype.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"chrome/msg"},{"id":9,"kind":1024,"name":"message","url":"interfaces/chrome_msg.imsgtype.html#message","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":10,"kind":1024,"name":"error","url":"interfaces/chrome_msg.imsgtype.html#error","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":11,"kind":1024,"name":"key","url":"interfaces/chrome_msg.imsgtype.html#key","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":12,"kind":1024,"name":"value","url":"interfaces/chrome_msg.imsgtype.html#value","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":13,"kind":1024,"name":"item","url":"interfaces/chrome_msg.imsgtype.html#item","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":14,"kind":1024,"name":"id","url":"interfaces/chrome_msg.imsgtype.html#id","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":15,"kind":1024,"name":"name","url":"interfaces/chrome_msg.imsgtype.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":16,"kind":1024,"name":"count","url":"interfaces/chrome_msg.imsgtype.html#count","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":17,"kind":32,"name":"chromep","url":"modules/chrome_msg.html#chromep","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/msg"},{"id":18,"kind":2097152,"name":"TYPE","url":"modules/chrome_msg.html#type","classes":"tsd-kind-object-literal tsd-parent-kind-external-module","parent":"chrome/msg"},{"id":19,"kind":32,"name":"HIGHLIGHT","url":"modules/chrome_msg.html#type.highlight","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/msg.TYPE"},{"id":20,"kind":32,"name":"RESTORE_DEFAULTS","url":"modules/chrome_msg.html#type.restore_defaults","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/msg.TYPE"},{"id":21,"kind":32,"name":"STORAGE_EXCEEDED","url":"modules/chrome_msg.html#type.storage_exceeded","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/msg.TYPE"},{"id":22,"kind":32,"name":"STORE","url":"modules/chrome_msg.html#type.store","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/msg.TYPE"},{"id":23,"kind":4194304,"name":"ResponseCB","url":"modules/chrome_msg.html#responsecb","classes":"tsd-kind-type-alias tsd-parent-kind-external-module","parent":"chrome/msg"},{"id":24,"kind":65536,"name":"__type","url":"modules/chrome_msg.html#responsecb.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"chrome/msg.ResponseCB"},{"id":25,"kind":4194304,"name":"Listener","url":"modules/chrome_msg.html#listener","classes":"tsd-kind-type-alias tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/msg"},{"id":26,"kind":65536,"name":"__type","url":"modules/chrome_msg.html#listener.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"chrome/msg.Listener"},{"id":27,"kind":64,"name":"send","url":"modules/chrome_msg.html#send","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/msg"},{"id":28,"kind":64,"name":"addListener","url":"modules/chrome_msg.html#addlistener","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/msg"},{"id":29,"kind":64,"name":"removeListener","url":"modules/chrome_msg.html#removelistener","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/msg"},{"id":30,"kind":1,"name":"chrome/storage","url":"modules/chrome_storage.html","classes":"tsd-kind-external-module"},{"id":31,"kind":32,"name":"chromep","url":"modules/chrome_storage.html#chromep","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/storage"},{"id":32,"kind":64,"name":"get","url":"modules/chrome_storage.html#get","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/storage"},{"id":33,"kind":64,"name":"getInt","url":"modules/chrome_storage.html#getint","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/storage"},{"id":34,"kind":64,"name":"getBool","url":"modules/chrome_storage.html#getbool","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/storage"},{"id":35,"kind":64,"name":"set","url":"modules/chrome_storage.html#set","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/storage"},{"id":36,"kind":64,"name":"safeSet","url":"modules/chrome_storage.html#safeset","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/storage"},{"id":37,"kind":64,"name":"asyncGet","url":"modules/chrome_storage.html#asyncget","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/storage"},{"id":38,"kind":64,"name":"asyncSet","url":"modules/chrome_storage.html#asyncset","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/storage"},{"id":39,"kind":1,"name":"chrome/utils","url":"modules/chrome_utils.html","classes":"tsd-kind-external-module"},{"id":40,"kind":32,"name":"chromep","url":"modules/chrome_utils.html#chromep","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/utils"},{"id":41,"kind":32,"name":"DEBUG","url":"modules/chrome_utils.html#debug","classes":"tsd-kind-variable tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":42,"kind":64,"name":"getExtensionName","url":"modules/chrome_utils.html#getextensionname","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":43,"kind":64,"name":"getVersion","url":"modules/chrome_utils.html#getversion","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":44,"kind":64,"name":"getChromeVersion","url":"modules/chrome_utils.html#getchromeversion","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":45,"kind":64,"name":"getFullChromeVersion","url":"modules/chrome_utils.html#getfullchromeversion","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":46,"kind":64,"name":"getPlatformOS","url":"modules/chrome_utils.html#getplatformos","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":47,"kind":64,"name":"isWindows","url":"modules/chrome_utils.html#iswindows","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":48,"kind":64,"name":"isChromeOS","url":"modules/chrome_utils.html#ischromeos","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":49,"kind":64,"name":"isMac","url":"modules/chrome_utils.html#ismac","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":50,"kind":64,"name":"noop","url":"modules/chrome_utils.html#noop","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":51,"kind":64,"name":"isWhiteSpace","url":"modules/chrome_utils.html#iswhitespace","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":52,"kind":64,"name":"getRandomString","url":"modules/chrome_utils.html#getrandomstring","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":53,"kind":64,"name":"getRandomInt","url":"modules/chrome_utils.html#getrandomint","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":54,"kind":64,"name":"getRandomFloat","url":"modules/chrome_utils.html#getrandomfloat","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":55,"kind":64,"name":"shuffleArray","url":"modules/chrome_utils.html#shufflearray","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":56,"kind":64,"name":"checkNetworkConnection","url":"modules/chrome_utils.html#checknetworkconnection","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":57,"kind":64,"name":"wait","url":"modules/chrome_utils.html#wait","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":58,"kind":64,"name":"isOS","url":"modules/chrome_utils.html#isos","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/utils"},{"id":59,"kind":1,"name":"chrome/analytics","url":"modules/chrome_analytics.html","classes":"tsd-kind-external-module"},{"id":60,"kind":256,"name":"IEventType","url":"interfaces/chrome_analytics.ieventtype.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":61,"kind":1024,"name":"eventCategory","url":"interfaces/chrome_analytics.ieventtype.html#eventcategory","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/analytics.IEventType"},{"id":62,"kind":1024,"name":"eventAction","url":"interfaces/chrome_analytics.ieventtype.html#eventaction","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/analytics.IEventType"},{"id":63,"kind":1024,"name":"eventLabel","url":"interfaces/chrome_analytics.ieventtype.html#eventlabel","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/analytics.IEventType"},{"id":64,"kind":32,"name":"ga","url":"modules/chrome_analytics.html#ga","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/analytics"},{"id":65,"kind":2097152,"name":"EVENT","url":"modules/chrome_analytics.html#event-1","classes":"tsd-kind-object-literal tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":66,"kind":32,"name":"INSTALLED","url":"modules/chrome_analytics.html#event-1.installed","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":67,"kind":32,"name":"UPDATED","url":"modules/chrome_analytics.html#event-1.updated","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":68,"kind":32,"name":"REFRESHED_AUTH_TOKEN","url":"modules/chrome_analytics.html#event-1.refreshed_auth_token","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":69,"kind":32,"name":"ALARM","url":"modules/chrome_analytics.html#event-1.alarm","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":70,"kind":32,"name":"MENU","url":"modules/chrome_analytics.html#event-1.menu","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":71,"kind":32,"name":"TOGGLE","url":"modules/chrome_analytics.html#event-1.toggle","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":72,"kind":32,"name":"LINK","url":"modules/chrome_analytics.html#event-1.link","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":73,"kind":32,"name":"TEXT","url":"modules/chrome_analytics.html#event-1.text","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":74,"kind":32,"name":"SLIDER_VALUE","url":"modules/chrome_analytics.html#event-1.slider_value","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":75,"kind":32,"name":"SLIDER_UNITS","url":"modules/chrome_analytics.html#event-1.slider_units","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":76,"kind":32,"name":"BUTTON","url":"modules/chrome_analytics.html#event-1.button","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":77,"kind":32,"name":"RADIO_BUTTON","url":"modules/chrome_analytics.html#event-1.radio_button","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":78,"kind":32,"name":"ICON","url":"modules/chrome_analytics.html#event-1.icon","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":79,"kind":2097152,"name":"CLICK","url":"modules/chrome_analytics.html#event-1.click","classes":"tsd-kind-object-literal tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":80,"kind":32,"name":"eventCategory","url":"modules/chrome_analytics.html#event-1.click.eventcategory","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.CLICK"},{"id":81,"kind":32,"name":"eventAction","url":"modules/chrome_analytics.html#event-1.click.eventaction","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.CLICK"},{"id":82,"kind":32,"name":"eventLabel","url":"modules/chrome_analytics.html#event-1.click.eventlabel","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.CLICK"},{"id":83,"kind":32,"name":"CHECK","url":"modules/chrome_analytics.html#event-1.check","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":84,"kind":2097152,"name":"IMAGE_BUTTON","url":"modules/chrome_analytics.html#event-1.image_button","classes":"tsd-kind-object-literal tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":85,"kind":32,"name":"eventCategory","url":"modules/chrome_analytics.html#event-1.image_button.eventcategory-2","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.IMAGE_BUTTON"},{"id":86,"kind":32,"name":"eventAction","url":"modules/chrome_analytics.html#event-1.image_button.eventaction-2","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.IMAGE_BUTTON"},{"id":87,"kind":32,"name":"eventLabel","url":"modules/chrome_analytics.html#event-1.image_button.eventlabel-2","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.IMAGE_BUTTON"},{"id":88,"kind":2097152,"name":"FAB_BUTTON","url":"modules/chrome_analytics.html#event-1.fab_button","classes":"tsd-kind-object-literal tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":89,"kind":32,"name":"eventCategory","url":"modules/chrome_analytics.html#event-1.fab_button.eventcategory-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.FAB_BUTTON"},{"id":90,"kind":32,"name":"eventAction","url":"modules/chrome_analytics.html#event-1.fab_button.eventaction-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.FAB_BUTTON"},{"id":91,"kind":32,"name":"eventLabel","url":"modules/chrome_analytics.html#event-1.fab_button.eventlabel-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.FAB_BUTTON"},{"id":92,"kind":32,"name":"KEY_COMMAND","url":"modules/chrome_analytics.html#event-1.key_command","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":93,"kind":64,"name":"initialize","url":"modules/chrome_analytics.html#initialize","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":94,"kind":64,"name":"page","url":"modules/chrome_analytics.html#page","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":95,"kind":64,"name":"event","url":"modules/chrome_analytics.html#event","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":96,"kind":64,"name":"error","url":"modules/chrome_analytics.html#error","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":97,"kind":64,"name":"exception","url":"modules/chrome_analytics.html#exception","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":98,"kind":1,"name":"chrome/auth","url":"modules/chrome_auth.html","classes":"tsd-kind-external-module"},{"id":99,"kind":32,"name":"chromep","url":"modules/chrome_auth.html#chromep","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/auth"},{"id":100,"kind":64,"name":"getToken","url":"modules/chrome_auth.html#gettoken","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/auth"},{"id":101,"kind":64,"name":"removeCachedToken","url":"modules/chrome_auth.html#removecachedtoken","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/auth"},{"id":102,"kind":64,"name":"isSignedIn","url":"modules/chrome_auth.html#issignedin","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/auth"},{"id":103,"kind":64,"name":"isRevoked","url":"modules/chrome_auth.html#isrevoked","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/auth"},{"id":104,"kind":1,"name":"chrome/last_error","url":"modules/chrome_last_error.html","classes":"tsd-kind-external-module"},{"id":105,"kind":128,"name":"ChromeLastError","url":"classes/chrome_last_error.chromelasterror.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"chrome/last_error"},{"id":106,"kind":2048,"name":"load","url":"classes/chrome_last_error.chromelasterror.html#load","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/last_error.ChromeLastError"},{"id":107,"kind":2048,"name":"save","url":"classes/chrome_last_error.chromelasterror.html#save","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/last_error.ChromeLastError"},{"id":108,"kind":2048,"name":"reset","url":"classes/chrome_last_error.chromelasterror.html#reset","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/last_error.ChromeLastError"},{"id":109,"kind":1024,"name":"title","url":"classes/chrome_last_error.chromelasterror.html#title","classes":"tsd-kind-property tsd-parent-kind-class","parent":"chrome/last_error.ChromeLastError"},{"id":110,"kind":512,"name":"constructor","url":"classes/chrome_last_error.chromelasterror.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"chrome/last_error.ChromeLastError"},{"id":111,"kind":1024,"name":"name","url":"classes/chrome_last_error.chromelasterror.html#name","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"chrome/last_error.ChromeLastError"},{"id":112,"kind":1024,"name":"message","url":"classes/chrome_last_error.chromelasterror.html#message","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"chrome/last_error.ChromeLastError"},{"id":113,"kind":1024,"name":"stack","url":"classes/chrome_last_error.chromelasterror.html#stack","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"chrome/last_error.ChromeLastError"},{"id":114,"kind":1024,"name":"Error","url":"classes/chrome_last_error.chromelasterror.html#error","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-static","parent":"chrome/last_error.ChromeLastError"},{"id":115,"kind":32,"name":"chromep","url":"modules/chrome_last_error.html#chromep","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/last_error"},{"id":116,"kind":1,"name":"chrome/log","url":"modules/chrome_log.html","classes":"tsd-kind-external-module"},{"id":117,"kind":64,"name":"error","url":"modules/chrome_log.html#error","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/log"},{"id":118,"kind":64,"name":"exception","url":"modules/chrome_log.html#exception","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/log"},{"id":119,"kind":1,"name":"chrome/ex_handler","url":"modules/chrome_ex_handler.html","classes":"tsd-kind-external-module"},{"id":120,"kind":1,"name":"chrome/http","url":"modules/chrome_http.html","classes":"tsd-kind-external-module"},{"id":121,"kind":256,"name":"IConfig","url":"interfaces/chrome_http.iconfig.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"chrome/http"},{"id":122,"kind":1024,"name":"checkConnection","url":"interfaces/chrome_http.iconfig.html#checkconnection","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":123,"kind":1024,"name":"isAuth","url":"interfaces/chrome_http.iconfig.html#isauth","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":124,"kind":1024,"name":"retryToken","url":"interfaces/chrome_http.iconfig.html#retrytoken","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":125,"kind":1024,"name":"interactive","url":"interfaces/chrome_http.iconfig.html#interactive","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":126,"kind":1024,"name":"token","url":"interfaces/chrome_http.iconfig.html#token","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":127,"kind":1024,"name":"backoff","url":"interfaces/chrome_http.iconfig.html#backoff","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":128,"kind":1024,"name":"maxRetries","url":"interfaces/chrome_http.iconfig.html#maxretries","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":129,"kind":1024,"name":"body","url":"interfaces/chrome_http.iconfig.html#body","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":130,"kind":1024,"name":"json","url":"interfaces/chrome_http.iconfig.html#json","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":131,"kind":32,"name":"AUTH_HEADER","url":"modules/chrome_http.html#auth_header","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":132,"kind":32,"name":"BEARER","url":"modules/chrome_http.html#bearer","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":133,"kind":32,"name":"MAX_RETRIES","url":"modules/chrome_http.html#max_retries","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":134,"kind":32,"name":"DELAY","url":"modules/chrome_http.html#delay","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":135,"kind":2097152,"name":"CONFIG","url":"modules/chrome_http.html#config","classes":"tsd-kind-object-literal tsd-parent-kind-external-module","parent":"chrome/http"},{"id":136,"kind":32,"name":"checkConnection","url":"modules/chrome_http.html#config.checkconnection","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":137,"kind":32,"name":"isAuth","url":"modules/chrome_http.html#config.isauth","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":138,"kind":32,"name":"retryToken","url":"modules/chrome_http.html#config.retrytoken-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":139,"kind":32,"name":"interactive","url":"modules/chrome_http.html#config.interactive","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":140,"kind":32,"name":"token","url":"modules/chrome_http.html#config.token","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":141,"kind":32,"name":"backoff","url":"modules/chrome_http.html#config.backoff","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":142,"kind":32,"name":"maxRetries","url":"modules/chrome_http.html#config.maxretries","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":143,"kind":32,"name":"body","url":"modules/chrome_http.html#config.body","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":144,"kind":32,"name":"json","url":"modules/chrome_http.html#config.json","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":145,"kind":64,"name":"doGet","url":"modules/chrome_http.html#doget","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/http"},{"id":146,"kind":64,"name":"doPost","url":"modules/chrome_http.html#dopost","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/http"},{"id":147,"kind":64,"name":"getError","url":"modules/chrome_http.html#geterror","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/http"},{"id":148,"kind":64,"name":"processResponse","url":"modules/chrome_http.html#processresponse","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":149,"kind":64,"name":"getAuthToken","url":"modules/chrome_http.html#getauthtoken","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":150,"kind":64,"name":"retry","url":"modules/chrome_http.html#retry","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":151,"kind":64,"name":"retryToken","url":"modules/chrome_http.html#retrytoken","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":152,"kind":64,"name":"doFetch","url":"modules/chrome_http.html#dofetch","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":153,"kind":64,"name":"doIt","url":"modules/chrome_http.html#doit","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":154,"kind":1,"name":"chrome/time","url":"modules/chrome_time.html","classes":"tsd-kind-external-module"},{"id":155,"kind":4,"name":"TIME_FORMAT","url":"enums/chrome_time.time_format.html","classes":"tsd-kind-enum tsd-parent-kind-external-module","parent":"chrome/time"},{"id":156,"kind":16,"name":"NONE","url":"enums/chrome_time.time_format.html#none","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"chrome/time.TIME_FORMAT"},{"id":157,"kind":16,"name":"HR_12","url":"enums/chrome_time.time_format.html#hr_12","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"chrome/time.TIME_FORMAT"},{"id":158,"kind":16,"name":"HR_24","url":"enums/chrome_time.time_format.html#hr_24","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"chrome/time.TIME_FORMAT"},{"id":159,"kind":128,"name":"ChromeTime","url":"classes/chrome_time.chrometime.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"chrome/time"},{"id":160,"kind":262144,"name":"MSEC_IN_MIN","url":"classes/chrome_time.chrometime.html#msec_in_min","classes":"tsd-kind-get-signature tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":161,"kind":262144,"name":"MIN_IN_HOUR","url":"classes/chrome_time.chrometime.html#min_in_hour","classes":"tsd-kind-get-signature tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":162,"kind":262144,"name":"MSEC_IN_HOUR","url":"classes/chrome_time.chrometime.html#msec_in_hour","classes":"tsd-kind-get-signature tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":163,"kind":262144,"name":"MIN_IN_DAY","url":"classes/chrome_time.chrometime.html#min_in_day","classes":"tsd-kind-get-signature tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":164,"kind":262144,"name":"MSEC_IN_DAY","url":"classes/chrome_time.chrometime.html#msec_in_day","classes":"tsd-kind-get-signature tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":165,"kind":2048,"name":"getTime","url":"classes/chrome_time.chrometime.html#gettime","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":166,"kind":2048,"name":"getTimeDelta","url":"classes/chrome_time.chrometime.html#gettimedelta","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":167,"kind":2048,"name":"isInRange","url":"classes/chrome_time.chrometime.html#isinrange","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":168,"kind":2048,"name":"getStringFull","url":"classes/chrome_time.chrometime.html#getstringfull","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":169,"kind":2048,"name":"getStringShort","url":"classes/chrome_time.chrometime.html#getstringshort","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":170,"kind":2048,"name":"is24Hr","url":"classes/chrome_time.chrometime.html#is24hr","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":171,"kind":1024,"name":"_hr","url":"classes/chrome_time.chrometime.html#_hr","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"chrome/time.ChromeTime"},{"id":172,"kind":1024,"name":"_min","url":"classes/chrome_time.chrometime.html#_min","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"chrome/time.ChromeTime"},{"id":173,"kind":512,"name":"constructor","url":"classes/chrome_time.chrometime.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"chrome/time.ChromeTime"},{"id":174,"kind":2048,"name":"toString","url":"classes/chrome_time.chrometime.html#tostring","classes":"tsd-kind-method tsd-parent-kind-class","parent":"chrome/time.ChromeTime"},{"id":175,"kind":2048,"name":"parse","url":"classes/chrome_time.chrometime.html#parse","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"chrome/time.ChromeTime"},{"id":176,"kind":32,"name":"DEF_TIME","url":"modules/chrome_time.html#def_time","classes":"tsd-kind-variable tsd-parent-kind-external-module","parent":"chrome/time"}]}; \ No newline at end of file + typedoc.search.data = {"kinds":{"1":"External module","4":"Enumeration","16":"Enumeration member","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","262144":"Accessor","2097152":"Object literal","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"chrome/locales","url":"modules/chrome_locales.html","classes":"tsd-kind-external-module"},{"id":1,"kind":64,"name":"localize","url":"modules/chrome_locales.html#localize","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/locales"},{"id":2,"kind":64,"name":"getLocale","url":"modules/chrome_locales.html#getlocale","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/locales"},{"id":3,"kind":1,"name":"chrome/json","url":"modules/chrome_json.html","classes":"tsd-kind-external-module"},{"id":4,"kind":64,"name":"parse","url":"modules/chrome_json.html#parse","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter","parent":"chrome/json"},{"id":5,"kind":64,"name":"stringify","url":"modules/chrome_json.html#stringify","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter","parent":"chrome/json"},{"id":6,"kind":64,"name":"shallowCopy","url":"modules/chrome_json.html#shallowcopy","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter","parent":"chrome/json"},{"id":7,"kind":1,"name":"chrome/msg","url":"modules/chrome_msg.html","classes":"tsd-kind-external-module"},{"id":8,"kind":256,"name":"IMsgType","url":"interfaces/chrome_msg.imsgtype.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"chrome/msg"},{"id":9,"kind":1024,"name":"message","url":"interfaces/chrome_msg.imsgtype.html#message","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":10,"kind":1024,"name":"error","url":"interfaces/chrome_msg.imsgtype.html#error","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":11,"kind":1024,"name":"key","url":"interfaces/chrome_msg.imsgtype.html#key","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":12,"kind":1024,"name":"value","url":"interfaces/chrome_msg.imsgtype.html#value","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":13,"kind":1024,"name":"item","url":"interfaces/chrome_msg.imsgtype.html#item","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":14,"kind":1024,"name":"id","url":"interfaces/chrome_msg.imsgtype.html#id","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":15,"kind":1024,"name":"name","url":"interfaces/chrome_msg.imsgtype.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":16,"kind":1024,"name":"count","url":"interfaces/chrome_msg.imsgtype.html#count","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/msg.IMsgType"},{"id":17,"kind":32,"name":"chromep","url":"modules/chrome_msg.html#chromep","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/msg"},{"id":18,"kind":2097152,"name":"TYPE","url":"modules/chrome_msg.html#type","classes":"tsd-kind-object-literal tsd-parent-kind-external-module","parent":"chrome/msg"},{"id":19,"kind":32,"name":"HIGHLIGHT","url":"modules/chrome_msg.html#type.highlight","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/msg.TYPE"},{"id":20,"kind":32,"name":"RESTORE_DEFAULTS","url":"modules/chrome_msg.html#type.restore_defaults","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/msg.TYPE"},{"id":21,"kind":32,"name":"STORAGE_EXCEEDED","url":"modules/chrome_msg.html#type.storage_exceeded","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/msg.TYPE"},{"id":22,"kind":32,"name":"STORE","url":"modules/chrome_msg.html#type.store","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/msg.TYPE"},{"id":23,"kind":4194304,"name":"ResponseCB","url":"modules/chrome_msg.html#responsecb","classes":"tsd-kind-type-alias tsd-parent-kind-external-module","parent":"chrome/msg"},{"id":24,"kind":65536,"name":"__type","url":"modules/chrome_msg.html#responsecb.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"chrome/msg.ResponseCB"},{"id":25,"kind":4194304,"name":"Listener","url":"modules/chrome_msg.html#listener","classes":"tsd-kind-type-alias tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/msg"},{"id":26,"kind":65536,"name":"__type","url":"modules/chrome_msg.html#listener.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"chrome/msg.Listener"},{"id":27,"kind":64,"name":"send","url":"modules/chrome_msg.html#send","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/msg"},{"id":28,"kind":64,"name":"addListener","url":"modules/chrome_msg.html#addlistener","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/msg"},{"id":29,"kind":64,"name":"removeListener","url":"modules/chrome_msg.html#removelistener","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/msg"},{"id":30,"kind":1,"name":"chrome/storage","url":"modules/chrome_storage.html","classes":"tsd-kind-external-module"},{"id":31,"kind":32,"name":"chromep","url":"modules/chrome_storage.html#chromep","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/storage"},{"id":32,"kind":64,"name":"get","url":"modules/chrome_storage.html#get","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter","parent":"chrome/storage"},{"id":33,"kind":64,"name":"set","url":"modules/chrome_storage.html#set","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter","parent":"chrome/storage"},{"id":34,"kind":64,"name":"safeSet","url":"modules/chrome_storage.html#safeset","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter","parent":"chrome/storage"},{"id":35,"kind":64,"name":"asyncGet","url":"modules/chrome_storage.html#asyncget","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter","parent":"chrome/storage"},{"id":36,"kind":64,"name":"asyncSet","url":"modules/chrome_storage.html#asyncset","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter","parent":"chrome/storage"},{"id":37,"kind":1,"name":"chrome/utils","url":"modules/chrome_utils.html","classes":"tsd-kind-external-module"},{"id":38,"kind":32,"name":"chromep","url":"modules/chrome_utils.html#chromep","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/utils"},{"id":39,"kind":32,"name":"DEBUG","url":"modules/chrome_utils.html#debug","classes":"tsd-kind-variable tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":40,"kind":64,"name":"getExtensionName","url":"modules/chrome_utils.html#getextensionname","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":41,"kind":64,"name":"getVersion","url":"modules/chrome_utils.html#getversion","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":42,"kind":64,"name":"getChromeVersion","url":"modules/chrome_utils.html#getchromeversion","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":43,"kind":64,"name":"getFullChromeVersion","url":"modules/chrome_utils.html#getfullchromeversion","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":44,"kind":64,"name":"getPlatformOS","url":"modules/chrome_utils.html#getplatformos","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":45,"kind":64,"name":"isWindows","url":"modules/chrome_utils.html#iswindows","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":46,"kind":64,"name":"isChromeOS","url":"modules/chrome_utils.html#ischromeos","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":47,"kind":64,"name":"isMac","url":"modules/chrome_utils.html#ismac","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":48,"kind":64,"name":"noop","url":"modules/chrome_utils.html#noop","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":49,"kind":64,"name":"isWhiteSpace","url":"modules/chrome_utils.html#iswhitespace","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":50,"kind":64,"name":"getRandomString","url":"modules/chrome_utils.html#getrandomstring","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":51,"kind":64,"name":"getRandomInt","url":"modules/chrome_utils.html#getrandomint","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":52,"kind":64,"name":"getRandomFloat","url":"modules/chrome_utils.html#getrandomfloat","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":53,"kind":64,"name":"shuffleArray","url":"modules/chrome_utils.html#shufflearray","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter","parent":"chrome/utils"},{"id":54,"kind":64,"name":"checkNetworkConnection","url":"modules/chrome_utils.html#checknetworkconnection","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":55,"kind":64,"name":"wait","url":"modules/chrome_utils.html#wait","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/utils"},{"id":56,"kind":64,"name":"isOS","url":"modules/chrome_utils.html#isos","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/utils"},{"id":57,"kind":1,"name":"chrome/analytics","url":"modules/chrome_analytics.html","classes":"tsd-kind-external-module"},{"id":58,"kind":256,"name":"IEventType","url":"interfaces/chrome_analytics.ieventtype.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":59,"kind":1024,"name":"eventCategory","url":"interfaces/chrome_analytics.ieventtype.html#eventcategory","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/analytics.IEventType"},{"id":60,"kind":1024,"name":"eventAction","url":"interfaces/chrome_analytics.ieventtype.html#eventaction","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/analytics.IEventType"},{"id":61,"kind":1024,"name":"eventLabel","url":"interfaces/chrome_analytics.ieventtype.html#eventlabel","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/analytics.IEventType"},{"id":62,"kind":32,"name":"ga","url":"modules/chrome_analytics.html#ga","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/analytics"},{"id":63,"kind":2097152,"name":"EVENT","url":"modules/chrome_analytics.html#event-1","classes":"tsd-kind-object-literal tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":64,"kind":32,"name":"INSTALLED","url":"modules/chrome_analytics.html#event-1.installed","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":65,"kind":32,"name":"UPDATED","url":"modules/chrome_analytics.html#event-1.updated","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":66,"kind":32,"name":"REFRESHED_AUTH_TOKEN","url":"modules/chrome_analytics.html#event-1.refreshed_auth_token","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":67,"kind":32,"name":"ALARM","url":"modules/chrome_analytics.html#event-1.alarm","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":68,"kind":32,"name":"MENU","url":"modules/chrome_analytics.html#event-1.menu","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":69,"kind":32,"name":"TOGGLE","url":"modules/chrome_analytics.html#event-1.toggle","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":70,"kind":32,"name":"LINK","url":"modules/chrome_analytics.html#event-1.link","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":71,"kind":32,"name":"TEXT","url":"modules/chrome_analytics.html#event-1.text","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":72,"kind":32,"name":"SLIDER_VALUE","url":"modules/chrome_analytics.html#event-1.slider_value","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":73,"kind":32,"name":"SLIDER_UNITS","url":"modules/chrome_analytics.html#event-1.slider_units","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":74,"kind":32,"name":"BUTTON","url":"modules/chrome_analytics.html#event-1.button","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":75,"kind":32,"name":"RADIO_BUTTON","url":"modules/chrome_analytics.html#event-1.radio_button","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":76,"kind":32,"name":"ICON","url":"modules/chrome_analytics.html#event-1.icon","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":77,"kind":2097152,"name":"CLICK","url":"modules/chrome_analytics.html#event-1.click","classes":"tsd-kind-object-literal tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":78,"kind":32,"name":"eventCategory","url":"modules/chrome_analytics.html#event-1.click.eventcategory","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.CLICK"},{"id":79,"kind":32,"name":"eventAction","url":"modules/chrome_analytics.html#event-1.click.eventaction","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.CLICK"},{"id":80,"kind":32,"name":"eventLabel","url":"modules/chrome_analytics.html#event-1.click.eventlabel","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.CLICK"},{"id":81,"kind":32,"name":"CHECK","url":"modules/chrome_analytics.html#event-1.check","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":82,"kind":2097152,"name":"IMAGE_BUTTON","url":"modules/chrome_analytics.html#event-1.image_button","classes":"tsd-kind-object-literal tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":83,"kind":32,"name":"eventCategory","url":"modules/chrome_analytics.html#event-1.image_button.eventcategory-2","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.IMAGE_BUTTON"},{"id":84,"kind":32,"name":"eventAction","url":"modules/chrome_analytics.html#event-1.image_button.eventaction-2","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.IMAGE_BUTTON"},{"id":85,"kind":32,"name":"eventLabel","url":"modules/chrome_analytics.html#event-1.image_button.eventlabel-2","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.IMAGE_BUTTON"},{"id":86,"kind":2097152,"name":"FAB_BUTTON","url":"modules/chrome_analytics.html#event-1.fab_button","classes":"tsd-kind-object-literal tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":87,"kind":32,"name":"eventCategory","url":"modules/chrome_analytics.html#event-1.fab_button.eventcategory-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.FAB_BUTTON"},{"id":88,"kind":32,"name":"eventAction","url":"modules/chrome_analytics.html#event-1.fab_button.eventaction-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.FAB_BUTTON"},{"id":89,"kind":32,"name":"eventLabel","url":"modules/chrome_analytics.html#event-1.fab_button.eventlabel-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT.FAB_BUTTON"},{"id":90,"kind":32,"name":"KEY_COMMAND","url":"modules/chrome_analytics.html#event-1.key_command","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/analytics.EVENT"},{"id":91,"kind":64,"name":"initialize","url":"modules/chrome_analytics.html#initialize","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":92,"kind":64,"name":"page","url":"modules/chrome_analytics.html#page","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":93,"kind":64,"name":"event","url":"modules/chrome_analytics.html#event","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":94,"kind":64,"name":"error","url":"modules/chrome_analytics.html#error","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":95,"kind":64,"name":"exception","url":"modules/chrome_analytics.html#exception","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/analytics"},{"id":96,"kind":1,"name":"chrome/auth","url":"modules/chrome_auth.html","classes":"tsd-kind-external-module"},{"id":97,"kind":32,"name":"chromep","url":"modules/chrome_auth.html#chromep","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/auth"},{"id":98,"kind":64,"name":"getToken","url":"modules/chrome_auth.html#gettoken","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/auth"},{"id":99,"kind":64,"name":"removeCachedToken","url":"modules/chrome_auth.html#removecachedtoken","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/auth"},{"id":100,"kind":64,"name":"isSignedIn","url":"modules/chrome_auth.html#issignedin","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/auth"},{"id":101,"kind":64,"name":"isRevoked","url":"modules/chrome_auth.html#isrevoked","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/auth"},{"id":102,"kind":1,"name":"chrome/last_error","url":"modules/chrome_last_error.html","classes":"tsd-kind-external-module"},{"id":103,"kind":128,"name":"ChromeLastError","url":"classes/chrome_last_error.chromelasterror.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"chrome/last_error"},{"id":104,"kind":2048,"name":"load","url":"classes/chrome_last_error.chromelasterror.html#load","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/last_error.ChromeLastError"},{"id":105,"kind":2048,"name":"save","url":"classes/chrome_last_error.chromelasterror.html#save","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/last_error.ChromeLastError"},{"id":106,"kind":2048,"name":"reset","url":"classes/chrome_last_error.chromelasterror.html#reset","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/last_error.ChromeLastError"},{"id":107,"kind":1024,"name":"title","url":"classes/chrome_last_error.chromelasterror.html#title","classes":"tsd-kind-property tsd-parent-kind-class","parent":"chrome/last_error.ChromeLastError"},{"id":108,"kind":512,"name":"constructor","url":"classes/chrome_last_error.chromelasterror.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"chrome/last_error.ChromeLastError"},{"id":109,"kind":1024,"name":"name","url":"classes/chrome_last_error.chromelasterror.html#name","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"chrome/last_error.ChromeLastError"},{"id":110,"kind":1024,"name":"message","url":"classes/chrome_last_error.chromelasterror.html#message","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"chrome/last_error.ChromeLastError"},{"id":111,"kind":1024,"name":"stack","url":"classes/chrome_last_error.chromelasterror.html#stack","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"chrome/last_error.ChromeLastError"},{"id":112,"kind":1024,"name":"Error","url":"classes/chrome_last_error.chromelasterror.html#error","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-static","parent":"chrome/last_error.ChromeLastError"},{"id":113,"kind":32,"name":"chromep","url":"modules/chrome_last_error.html#chromep","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/last_error"},{"id":114,"kind":1,"name":"chrome/log","url":"modules/chrome_log.html","classes":"tsd-kind-external-module"},{"id":115,"kind":64,"name":"error","url":"modules/chrome_log.html#error","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/log"},{"id":116,"kind":64,"name":"exception","url":"modules/chrome_log.html#exception","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/log"},{"id":117,"kind":1,"name":"chrome/ex_handler","url":"modules/chrome_ex_handler.html","classes":"tsd-kind-external-module"},{"id":118,"kind":1,"name":"chrome/http","url":"modules/chrome_http.html","classes":"tsd-kind-external-module"},{"id":119,"kind":256,"name":"IConfig","url":"interfaces/chrome_http.iconfig.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"chrome/http"},{"id":120,"kind":1024,"name":"checkConnection","url":"interfaces/chrome_http.iconfig.html#checkconnection","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":121,"kind":1024,"name":"isAuth","url":"interfaces/chrome_http.iconfig.html#isauth","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":122,"kind":1024,"name":"retryToken","url":"interfaces/chrome_http.iconfig.html#retrytoken","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":123,"kind":1024,"name":"interactive","url":"interfaces/chrome_http.iconfig.html#interactive","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":124,"kind":1024,"name":"token","url":"interfaces/chrome_http.iconfig.html#token","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":125,"kind":1024,"name":"backoff","url":"interfaces/chrome_http.iconfig.html#backoff","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":126,"kind":1024,"name":"maxRetries","url":"interfaces/chrome_http.iconfig.html#maxretries","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":127,"kind":1024,"name":"body","url":"interfaces/chrome_http.iconfig.html#body","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":128,"kind":1024,"name":"json","url":"interfaces/chrome_http.iconfig.html#json","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"chrome/http.IConfig"},{"id":129,"kind":32,"name":"AUTH_HEADER","url":"modules/chrome_http.html#auth_header","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":130,"kind":32,"name":"BEARER","url":"modules/chrome_http.html#bearer","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":131,"kind":32,"name":"MAX_RETRIES","url":"modules/chrome_http.html#max_retries","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":132,"kind":32,"name":"DELAY","url":"modules/chrome_http.html#delay","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":133,"kind":2097152,"name":"CONFIG","url":"modules/chrome_http.html#config","classes":"tsd-kind-object-literal tsd-parent-kind-external-module","parent":"chrome/http"},{"id":134,"kind":32,"name":"checkConnection","url":"modules/chrome_http.html#config.checkconnection","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":135,"kind":32,"name":"isAuth","url":"modules/chrome_http.html#config.isauth","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":136,"kind":32,"name":"retryToken","url":"modules/chrome_http.html#config.retrytoken-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":137,"kind":32,"name":"interactive","url":"modules/chrome_http.html#config.interactive","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":138,"kind":32,"name":"token","url":"modules/chrome_http.html#config.token","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":139,"kind":32,"name":"backoff","url":"modules/chrome_http.html#config.backoff","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":140,"kind":32,"name":"maxRetries","url":"modules/chrome_http.html#config.maxretries","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":141,"kind":32,"name":"body","url":"modules/chrome_http.html#config.body","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":142,"kind":32,"name":"json","url":"modules/chrome_http.html#config.json","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"chrome/http.CONFIG"},{"id":143,"kind":64,"name":"doGet","url":"modules/chrome_http.html#doget","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/http"},{"id":144,"kind":64,"name":"doPost","url":"modules/chrome_http.html#dopost","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/http"},{"id":145,"kind":64,"name":"getError","url":"modules/chrome_http.html#geterror","classes":"tsd-kind-function tsd-parent-kind-external-module","parent":"chrome/http"},{"id":146,"kind":64,"name":"processResponse","url":"modules/chrome_http.html#processresponse","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":147,"kind":64,"name":"getAuthToken","url":"modules/chrome_http.html#getauthtoken","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":148,"kind":64,"name":"retry","url":"modules/chrome_http.html#retry","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":149,"kind":64,"name":"retryToken","url":"modules/chrome_http.html#retrytoken","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":150,"kind":64,"name":"doFetch","url":"modules/chrome_http.html#dofetch","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":151,"kind":64,"name":"doIt","url":"modules/chrome_http.html#doit","classes":"tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported","parent":"chrome/http"},{"id":152,"kind":1,"name":"chrome/time","url":"modules/chrome_time.html","classes":"tsd-kind-external-module"},{"id":153,"kind":4,"name":"TIME_FORMAT","url":"enums/chrome_time.time_format.html","classes":"tsd-kind-enum tsd-parent-kind-external-module","parent":"chrome/time"},{"id":154,"kind":16,"name":"NONE","url":"enums/chrome_time.time_format.html#none","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"chrome/time.TIME_FORMAT"},{"id":155,"kind":16,"name":"HR_12","url":"enums/chrome_time.time_format.html#hr_12","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"chrome/time.TIME_FORMAT"},{"id":156,"kind":16,"name":"HR_24","url":"enums/chrome_time.time_format.html#hr_24","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"chrome/time.TIME_FORMAT"},{"id":157,"kind":128,"name":"ChromeTime","url":"classes/chrome_time.chrometime.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"chrome/time"},{"id":158,"kind":262144,"name":"MSEC_IN_MIN","url":"classes/chrome_time.chrometime.html#msec_in_min","classes":"tsd-kind-get-signature tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":159,"kind":262144,"name":"MIN_IN_HOUR","url":"classes/chrome_time.chrometime.html#min_in_hour","classes":"tsd-kind-get-signature tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":160,"kind":262144,"name":"MSEC_IN_HOUR","url":"classes/chrome_time.chrometime.html#msec_in_hour","classes":"tsd-kind-get-signature tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":161,"kind":262144,"name":"MIN_IN_DAY","url":"classes/chrome_time.chrometime.html#min_in_day","classes":"tsd-kind-get-signature tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":162,"kind":262144,"name":"MSEC_IN_DAY","url":"classes/chrome_time.chrometime.html#msec_in_day","classes":"tsd-kind-get-signature tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":163,"kind":2048,"name":"getTime","url":"classes/chrome_time.chrometime.html#gettime","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":164,"kind":2048,"name":"getTimeDelta","url":"classes/chrome_time.chrometime.html#gettimedelta","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":165,"kind":2048,"name":"isInRange","url":"classes/chrome_time.chrometime.html#isinrange","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":166,"kind":2048,"name":"getStringFull","url":"classes/chrome_time.chrometime.html#getstringfull","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":167,"kind":2048,"name":"getStringShort","url":"classes/chrome_time.chrometime.html#getstringshort","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":168,"kind":2048,"name":"is24Hr","url":"classes/chrome_time.chrometime.html#is24hr","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private tsd-is-static","parent":"chrome/time.ChromeTime"},{"id":169,"kind":1024,"name":"_hr","url":"classes/chrome_time.chrometime.html#_hr","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"chrome/time.ChromeTime"},{"id":170,"kind":1024,"name":"_min","url":"classes/chrome_time.chrometime.html#_min","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"chrome/time.ChromeTime"},{"id":171,"kind":512,"name":"constructor","url":"classes/chrome_time.chrometime.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"chrome/time.ChromeTime"},{"id":172,"kind":2048,"name":"toString","url":"classes/chrome_time.chrometime.html#tostring","classes":"tsd-kind-method tsd-parent-kind-class","parent":"chrome/time.ChromeTime"},{"id":173,"kind":2048,"name":"parse","url":"classes/chrome_time.chrometime.html#parse","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"chrome/time.ChromeTime"},{"id":174,"kind":32,"name":"DEF_TIME","url":"modules/chrome_time.html#def_time","classes":"tsd-kind-variable tsd-parent-kind-external-module","parent":"chrome/time"}]}; \ No newline at end of file diff --git a/docs/gen/classes/chrome_last_error.chromelasterror.html b/docs/gen/classes/chrome_last_error.chromelasterror.html index 1e46d10..2806205 100644 --- a/docs/gen/classes/chrome_last_error.chromelasterror.html +++ b/docs/gen/classes/chrome_last_error.chromelasterror.html @@ -138,7 +138,7 @@

constructor

  • @@ -206,7 +206,7 @@

    title

    title: string
    @@ -238,7 +238,7 @@

    Static load

  • @@ -266,7 +266,7 @@

    Static reset

  • @@ -293,7 +293,7 @@

    Static save

  • diff --git a/docs/gen/classes/chrome_time.chrometime.html b/docs/gen/classes/chrome_time.chrometime.html index 19368eb..dc23237 100644 --- a/docs/gen/classes/chrome_time.chrometime.html +++ b/docs/gen/classes/chrome_time.chrometime.html @@ -139,7 +139,7 @@

    constructor

  • @@ -171,7 +171,7 @@

    Private _hr

    _hr: number
    @@ -186,7 +186,7 @@

    Private _min

    _min: number
    @@ -208,7 +208,7 @@

    Static MIN_IN_DAY

  • @@ -230,7 +230,7 @@

    Static MIN_IN_HOUR

    @@ -252,7 +252,7 @@

    Static MSEC_IN_DAY

    @@ -274,7 +274,7 @@

    Static MSEC_IN_HOUR
    @@ -296,7 +296,7 @@

    Static MSEC_IN_MIN

    @@ -321,7 +321,7 @@

    Private parse

  • @@ -352,7 +352,7 @@

    toString

  • @@ -384,7 +384,7 @@

    Static getStringFull
    @@ -422,7 +422,7 @@

    Static getStringShort<
  • @@ -454,7 +454,7 @@

    Static getTime

  • @@ -486,7 +486,7 @@

    Static getTimeDelta
    @@ -518,7 +518,7 @@

    Static
    @@ -550,7 +550,7 @@

    Static isInRange

  • diff --git a/docs/gen/enums/chrome_time.time_format.html b/docs/gen/enums/chrome_time.time_format.html index 0066bc6..b55e7cb 100644 --- a/docs/gen/enums/chrome_time.time_format.html +++ b/docs/gen/enums/chrome_time.time_format.html @@ -99,7 +99,7 @@

    HR_12

    HR_12:
    @@ -109,7 +109,7 @@

    HR_24

    HR_24:
    @@ -119,7 +119,7 @@

    NONE

    NONE: = 0
    diff --git a/docs/gen/interfaces/chrome_analytics.ieventtype.html b/docs/gen/interfaces/chrome_analytics.ieventtype.html index c0b5d32..e53e5ad 100644 --- a/docs/gen/interfaces/chrome_analytics.ieventtype.html +++ b/docs/gen/interfaces/chrome_analytics.ieventtype.html @@ -107,7 +107,7 @@

    eventAction

    eventAction: string
    @@ -117,7 +117,7 @@

    eventCategory

    eventCategory: string
    @@ -127,7 +127,7 @@

    eventLabel

    eventLabel: string
    diff --git a/docs/gen/interfaces/chrome_http.iconfig.html b/docs/gen/interfaces/chrome_http.iconfig.html index 21c1b2f..52ccfc0 100644 --- a/docs/gen/interfaces/chrome_http.iconfig.html +++ b/docs/gen/interfaces/chrome_http.iconfig.html @@ -113,7 +113,7 @@

    backoff

    backoff: boolean
    @@ -128,7 +128,7 @@

    body

    body: any
    @@ -143,7 +143,7 @@

    checkConnection

    checkConnection: boolean
    @@ -158,7 +158,7 @@

    interactive

    interactive: boolean
    @@ -173,7 +173,7 @@

    isAuth

    isAuth: boolean
    @@ -188,7 +188,7 @@

    json

    json: boolean
    @@ -203,7 +203,7 @@

    maxRetries

    maxRetries: number
    @@ -218,7 +218,7 @@

    retryToken

    retryToken: boolean
    @@ -233,7 +233,7 @@

    token

    token: string | null
    diff --git a/docs/gen/interfaces/chrome_msg.imsgtype.html b/docs/gen/interfaces/chrome_msg.imsgtype.html index a51f67c..99f7e60 100644 --- a/docs/gen/interfaces/chrome_msg.imsgtype.html +++ b/docs/gen/interfaces/chrome_msg.imsgtype.html @@ -112,7 +112,7 @@

    Optional count

    count: undefined | number
    @@ -127,7 +127,7 @@

    Optional error

    error: undefined | string
    @@ -142,7 +142,7 @@

    Optional id

    id: undefined | string
    @@ -157,7 +157,7 @@

    Optional item

    item: any
    @@ -172,7 +172,7 @@

    Optional key

    key: undefined | string
    @@ -187,7 +187,7 @@

    message

    message: string
    @@ -202,7 +202,7 @@

    Optional name

    name: undefined | string
    @@ -217,7 +217,7 @@

    Optional value

    value: any
    diff --git a/docs/gen/modules/chrome_analytics.html b/docs/gen/modules/chrome_analytics.html index a421504..e8f6342 100644 --- a/docs/gen/modules/chrome_analytics.html +++ b/docs/gen/modules/chrome_analytics.html @@ -116,7 +116,7 @@

    ga

    ga: any
    @@ -133,7 +133,7 @@

    error

  • @@ -164,13 +164,13 @@

    Returns void

    event

      -
    • event(theEvent: IEventType, label?: undefined | string, action?: undefined | string): void
    • +
    • event(ev: IEventType, label?: undefined | string, action?: undefined | string): void
    -

    Returns any

    +

    Returns null + | + T +

    json object, null on error

  • -
    +

    shallowCopy

    -
      -
    • shallowCopy(jsonifiable: any): any
    • +
        +
      • shallowCopy<T>(jsonifiable: T): T
      • Create a shallow copy of an object

        +
        +
        throws
        +

        An error if copy failed

        +
        +
        +

        Type parameters

        +
          +
        • +

          T

          +
        • +

        Parameters

        • -
          jsonifiable: any
          +
          jsonifiable: T

          object to copy

        -

        Returns any

        -

        shallow copy of input, null on error

        +

        Returns T

        +

        shallow copy of input

    -
    +

    stringify

    -
      -
    • stringify(jsonifiable: any): null | string
    • +
        +
      • stringify<T>(jsonifiable: T): null | string
      • @@ -172,10 +192,16 @@

        stringify

        Stringify json, with exception handling

    +

    Type parameters

    +
      +
    • +

      T

      +
    • +

    Parameters

    • -
      jsonifiable: any
      +
      jsonifiable: T

      object to stringify

      @@ -237,13 +263,13 @@

      Returns null

    -
    +

    asyncSet

    -

    +

    Type parameters

    +
      +
    • +

      T

      +
    • +

    Parameters

    • @@ -180,7 +350,7 @@
      key: string
  • -
    value: object | [] | number
    +
    value: T

    data value

    @@ -197,17 +367,55 @@

    Returns Promise -
    +

    get

    -
      -
    • get(key: string, def?: any): any
    • +
        +
      • get<T>(key: string): null | T
      • +
      • get<T>(key: string, def: boolean): boolean
      • +
      • get<T>(key: string, def: number): number
      • +
      • get<T>(key: string, def: string): string
      • +
      • get<T>(key: string, def: T): T
      • +
        +
        +

        Get a json parsed value from localStorage

        +
        +
        +

        Type parameters

        +
          +
        • +

          T

          +
        • +
        +

        Parameters

        +
          +
        • +
          key: string
          +
          +
          +

          key to get value for

          +
          +
          +
        • +
        +

        Returns null + | + T +

        +

        json object or string, null if key does not exist and no default specified

        +
      • +
      • +
        @@ -215,113 +423,164 @@

        get

        Get a json parsed value from localStorage

  • +

    Type parameters

    +
      +
    • +

      T

      +
    • +

    Parameters

    • key: string
      -

      key to get value for

      +
      +

      key to get value for

      +
    • -
      Optional def: any
      +
      def: boolean
      -

      optional default value if key not found

      +
      +

      optional value if key not found

      +
    -

    Returns any

    -

    json object or string, null if key does not exist

    +

    Returns boolean

    +

    json object or string, null if key does not exist and no default specified

  • - - -
    - -

    getBool

    -
      -
    • getBool(key: string, def?: undefined | false | true): any
    • -
    -
    • -

      Get boolean value from localStorage

      +

      Get a json parsed value from localStorage

      +

      Type parameters

      +
        +
      • +

        T

        +
      • +

      Parameters

      • key: string
        -

        key to get value for

        +
        +

        key to get value for

        +
      • -
        Optional def: undefined | false | true
        +
        def: number
        -

        optional value if key not found

        +
        +

        optional value if key not found

        +
      -

      Returns any

      -

      value as boolean, null if key does not exist

      +

      Returns number

      +

      json object or string, null if key does not exist and no default specified

    • -
    -
    -
    - -

    getInt

    -
      -
    • getInt(key: string, def?: undefined | number): number
    • -
    -
    • -

      Get integer value from localStorage

      +

      Get a json parsed value from localStorage

      +

      Type parameters

      +
        +
      • +

        T

        +
      • +

      Parameters

      • key: string
        -

        key to get value for

        +
        +

        key to get value for

        +
      • -
        Optional def: undefined | number
        +
        def: string
        -

        optional value to return, if key not found or value is NaN

        +
        +

        optional value if key not found

        +
      -

      Returns number

      -

      value as integer, NaN on error

      +

      Returns string

      +

      json object or string, null if key does not exist and no default specified

      +
    • +
    • + +
      +
      +

      Get a json parsed value from localStorage

      +
      +
      +

      Type parameters

      +
        +
      • +

        T

        +
      • +
      +

      Parameters

      +
        +
      • +
        key: string
        +
        +
        +

        key to get value for

        +
        +
        +
      • +
      • +
        def: T
        +
        +
        +

        optional value if key not found

        +
        +
        +
      • +
      +

      Returns T

      +

      json object or string, null if key does not exist and no default specified

    -
    +

    safeSet

    -
      -
    • safeSet(key: string, value: any, keyBool?: undefined | string): boolean
    • +
        +
      • safeSet<T>(key: string, value: T, keyBool?: undefined | string): boolean
      • @@ -329,6 +588,12 @@

        safeSet

        Save a value to localStorage only if there is enough room

    +

    Type parameters

    +
      +
    • +

      T

      +
    • +

    Parameters

    • @@ -338,7 +603,7 @@
      key: string

  • -
    value: any
    +
    value: T

    value to save

    @@ -355,17 +620,17 @@

    Returns boolean -
    +

    set

    -
      -
    • set(key: string, value?: object | [] | string | number | boolean | null): void
    • +
        +
      • set<T>(key: string, value: null | T): void
      • @@ -373,6 +638,12 @@

        set

        JSON stringify and save a value to localStorage

        +

        Type parameters

        +
          +
        • +

          T

          +
        • +

        Parameters

        • @@ -382,7 +653,7 @@
          key: string
        • -
          Default value value: object | [] | string | number | boolean | null = null
          +
          value: null | T

          new value, if null remove item

          @@ -443,25 +714,19 @@

          Returns void chromep

        • -
        • +
        • asyncGet
        • -
        • +
        • asyncSet
        • -
        • +
        • get
        • -
        • - getBool -
        • -
        • - getInt -
        • -
        • +
        • safeSet
        • -
        • +
        • set
        diff --git a/docs/gen/modules/chrome_time.html b/docs/gen/modules/chrome_time.html index 3ec8030..e56768a 100644 --- a/docs/gen/modules/chrome_time.html +++ b/docs/gen/modules/chrome_time.html @@ -106,7 +106,7 @@

        Const DEF_TIME

        DEF_TIME: "00:00" = "00:00"
        diff --git a/docs/gen/modules/chrome_utils.html b/docs/gen/modules/chrome_utils.html index 8677734..fea670f 100644 --- a/docs/gen/modules/chrome_utils.html +++ b/docs/gen/modules/chrome_utils.html @@ -104,7 +104,7 @@

        Functions

      • isWhiteSpace
      • isWindows
      • noop
      • -
      • shuffleArray
      • +
      • shuffleArray
      • wait
    @@ -116,10 +116,10 @@

    Variables

    Const DEBUG

    -
    DEBUG: any = ChromeStorage.getBool('isDevelopmentBuild', false)
    +
    DEBUG: boolean = ChromeStorage.get('isDevelopmentBuild', false)
    @@ -134,7 +134,7 @@

    Const chromep

    chromep: ChromePromise = new ChromePromise()
    @@ -151,7 +151,7 @@

    checkNetworkConnection

  • @@ -160,7 +160,8 @@

    checkNetworkConnection

    remarks
    -

    This will at least ensure the LAN is connected. +

    Throw an error if LAN is not connected

    +

    This will at least ensure the LAN is connected. May get false positives for other errors.

    throws
    @@ -182,7 +183,7 @@

    getChromeVersion

  • @@ -206,7 +207,7 @@

    getExtensionName

  • @@ -215,7 +216,6 @@

    getExtensionName

    Returns string

    -

    Extension name

  • @@ -229,7 +229,7 @@

    getFullChromeVersion

  • @@ -253,7 +253,7 @@

    getPlatformOS

  • @@ -262,7 +262,6 @@

    getPlatformOS

    Returns Promise<string>

    -

    OS name

  • @@ -276,7 +275,7 @@

    getRandomFloat

  • @@ -314,7 +313,7 @@

    getRandomInt

  • @@ -352,7 +351,7 @@

    getRandomString

  • @@ -384,16 +383,15 @@

    getVersion

  • -

    Get the Extension version

    +

    Get the extension's version

    Returns string

    -

    Extension version

  • @@ -407,7 +405,7 @@

    isChromeOS

  • @@ -416,7 +414,6 @@

    isChromeOS

    Returns Promise<boolean>

    -

    true if ChromeOS

  • @@ -430,16 +427,15 @@

    isMac

  • -

    Determine if we are a Mac

    +

    Determine if we are Mac

    Returns Promise<boolean>

    -

    true if Mac

  • @@ -453,7 +449,7 @@

    isOS

  • @@ -485,7 +481,7 @@

    isWhiteSpace

  • @@ -517,7 +513,7 @@

    isWindows

  • @@ -526,7 +522,6 @@

    isWindows

    Returns Promise<boolean>

    -

    true if MS Windows

  • @@ -540,7 +535,7 @@

    noop

  • @@ -552,17 +547,17 @@

    Returns void -
    +

    shuffleArray

    -
      -
    • shuffleArray(array: any[]): void
    • +
        +
      • shuffleArray<T>(array: T[]): void
      • @@ -575,10 +570,16 @@

        shuffleArray

        +

        Type parameters

        +
          +
        • +

          T

          +
        • +

        Parameters

        • -
          array: any[]
          +
          array: T[]

          Array to sort

          @@ -592,13 +593,13 @@

          Returns void

          wait

            -
          • wait(time: number): Promise<Object>
          • +
          • wait(time: number): Promise<void>
          -

          Returns Promise<Object>

          +

          Returns Promise<void>

    @@ -718,7 +719,7 @@

    Returns Promise noop

  • -
  • +
  • shuffleArray
  • diff --git a/src/analytics.js b/src/analytics.js index 31697e3..5213932 100644 --- a/src/analytics.js +++ b/src/analytics.js @@ -10,7 +10,6 @@ * https://opensource.org/licenses/BSD-3-Clause * https://github.com/opus1269/chrome-ext-utils/blob/master/LICENSE */ -import * as ChromeJSON from './json.js'; import * as ChromeUtils from './utils.js'; /** Event types */ export const EVENT = { @@ -180,22 +179,22 @@ export function page(url) { /** * Send an event * - * @param theEvent - the event type + * @param ev - the event type * @param label - override label * @param action - override action */ -export function event(theEvent, label, action) { - if (theEvent) { - const ev = ChromeJSON.shallowCopy(theEvent); - ev.hitType = 'event'; - ev.eventLabel = label ? label : ev.eventLabel; - ev.eventAction = action ? action : ev.eventAction; - if (!ChromeUtils.DEBUG) { - ga('send', ev); - } - else { - console.log(ev); // tslint:disable-line no-console - } +export function event(ev, label, action) { + const theEvent = { + hitType: 'event', + eventCategory: ev.eventCategory, + eventAction: action ? action : ev.eventAction, + eventLabel: label ? label : ev.eventLabel, + }; + if (!ChromeUtils.DEBUG) { + ga('send', theEvent); + } + else { + console.log(theEvent); // tslint:disable-line no-console } } /** diff --git a/src/analytics.ts b/src/analytics.ts index f92fd43..fe1ad3e 100644 --- a/src/analytics.ts +++ b/src/analytics.ts @@ -13,7 +13,6 @@ * https://github.com/opus1269/chrome-ext-utils/blob/master/LICENSE */ -import * as ChromeJSON from './json.js'; import * as ChromeUtils from './utils.js'; declare var ga: any; @@ -198,21 +197,21 @@ export function page(url: string) { /** * Send an event * - * @param theEvent - the event type + * @param ev - the event type * @param label - override label * @param action - override action */ -export function event(theEvent: IEventType, label?: string, action?: string) { - if (theEvent) { - const ev = ChromeJSON.shallowCopy(theEvent); - ev.hitType = 'event'; - ev.eventLabel = label ? label : ev.eventLabel; - ev.eventAction = action ? action : ev.eventAction; - if (!ChromeUtils.DEBUG) { - ga('send', ev); - } else { - console.log(ev); // tslint:disable-line no-console - } +export function event(ev: IEventType, label?: string, action?: string) { + const theEvent = { + hitType: 'event', + eventCategory: ev.eventCategory, + eventAction: action ? action : ev.eventAction, + eventLabel: label ? label : ev.eventLabel, + }; + if (!ChromeUtils.DEBUG) { + ga('send', theEvent); + } else { + console.log(theEvent); // tslint:disable-line no-console } } diff --git a/src/json.js b/src/json.js index 8823d48..33427cf 100644 --- a/src/json.js +++ b/src/json.js @@ -47,13 +47,17 @@ export function stringify(jsonifiable) { * Create a shallow copy of an object * * @param jsonifiable - object to copy - * @returns shallow copy of input, null on error + * @throws An error if copy failed + * @returns shallow copy of input */ export function shallowCopy(jsonifiable) { - let ret = null; const jsonString = stringify(jsonifiable); if (jsonString !== null) { - ret = parse(jsonString); + return JSON.parse(jsonString); + } + else { + const msg = `Failed to copy: ${jsonifiable}`; + ChromeGA.error(msg, 'ChromeJSON.shallowCopy'); + throw new Error(msg); } - return ret; } diff --git a/src/json.ts b/src/json.ts index 991bac8..6fada1b 100644 --- a/src/json.ts +++ b/src/json.ts @@ -21,8 +21,8 @@ import * as ChromeGA from './analytics.js'; * @param jsonString - string to parse * @returns json object, null on error */ -export function parse(jsonString: string) { - let ret = null; +export function parse(jsonString: string): null | T { + let ret: T | null = null; try { ret = JSON.parse(jsonString); } catch (err) { @@ -37,7 +37,7 @@ export function parse(jsonString: string) { * @param jsonifiable - object to stringify * @returns string, null on error */ -export function stringify(jsonifiable: any) { +export function stringify(jsonifiable: T) { let ret = null; try { ret = JSON.stringify(jsonifiable); @@ -51,13 +51,16 @@ export function stringify(jsonifiable: any) { * Create a shallow copy of an object * * @param jsonifiable - object to copy - * @returns shallow copy of input, null on error + * @throws An error if copy failed + * @returns shallow copy of input */ -export function shallowCopy(jsonifiable: any) { - let ret = null; +export function shallowCopy(jsonifiable: T) { const jsonString = stringify(jsonifiable); if (jsonString !== null) { - ret = parse(jsonString); + return JSON.parse(jsonString) as T; + } else { + const msg = `Failed to copy: ${jsonifiable}`; + ChromeGA.error(msg, 'ChromeJSON.shallowCopy'); + throw new Error(msg); } - return ret; } diff --git a/src/storage.js b/src/storage.js index 4c9f7a0..daf33cc 100644 --- a/src/storage.js +++ b/src/storage.js @@ -18,55 +18,20 @@ const chromep = new ChromePromise(); * Get a json parsed value from localStorage * * @param key - key to get value for - * @param def - optional default value if key not found - * @returns json object or string, null if key does not exist + * @param def - optional value if key not found + * @returns json object or string, null if key does not exist and no default specified */ export function get(key, def) { - let value = null; const item = localStorage.getItem(key); if (item !== null) { - value = ChromeJSON.parse(item); + return ChromeJSON.parse(item); } else if (def !== undefined) { - value = def; + return def; } - return value; -} -/** - * Get integer value from localStorage - * - * @param key - key to get value for - * @param def - optional value to return, if key not found or value is NaN - * @returns value as integer, NaN on error - */ -export function getInt(key, def) { - let value = Number.NaN; - const item = localStorage.getItem(key); - if (item != null) { - value = parseInt(item, 10); - if (Number.isNaN(value)) { - if (def !== undefined) { - value = def; - } - else { - ChromeGA.error(`NaN value for: ${key} equals ${item}`, 'ChromeStorage.getInt'); - } - } - } - else if (def !== undefined) { - value = def; + else { + return null; } - return value; -} -/** - * Get boolean value from localStorage - * - * @param key - key to get value for - * @param def - optional value if key not found - * @returns value as boolean, null if key does not exist - */ -export function getBool(key, def) { - return get(key, def); } /** * JSON stringify and save a value to localStorage @@ -74,13 +39,15 @@ export function getBool(key, def) { * @param key - key to set value for * @param value - new value, if null remove item */ -export function set(key, value = null) { +export function set(key, value) { if (value === null) { localStorage.removeItem(key); } else { - const val = JSON.stringify(value); - localStorage.setItem(key, val); + const val = ChromeJSON.stringify(value); + if (val !== null) { + localStorage.setItem(key, val); + } } } /** @@ -97,15 +64,15 @@ export function safeSet(key, value, keyBool) { try { set(key, value); } - catch (e) { + catch (err) { ret = false; - if (oldValue) { + if (oldValue !== null) { // revert to old value set(key, oldValue); } if (keyBool) { // revert to old value - if (oldValue && oldValue.length) { + if (oldValue !== null) { set(keyBool, true); } else { @@ -124,7 +91,7 @@ export function safeSet(key, value, keyBool) { * * @param key - data key * @param def - optional default value if not found - * @returns Object or Array from storage, def or null if not found + * @returns value from storage, null if not found unless default is provided */ export async function asyncGet(key, def) { let value = null; diff --git a/src/storage.ts b/src/storage.ts index 0a0eab3..d19f624 100644 --- a/src/storage.ts +++ b/src/storage.ts @@ -22,58 +22,27 @@ import ChromePromise from 'chrome-promise/chrome-promise'; // endRemoveIf(always) const chromep = new ChromePromise(); +export function get(key: string): null | T; +export function get(key: string, def: boolean): boolean; +export function get(key: string, def: number): number; +export function get(key: string, def: string): string; +export function get(key: string, def: T): T; /** * Get a json parsed value from localStorage * * @param key - key to get value for - * @param def - optional default value if key not found - * @returns json object or string, null if key does not exist + * @param def - optional value if key not found + * @returns json object or string, null if key does not exist and no default specified */ -export function get(key: string, def?: any) { - let value = null; +export function get(key: string, def?: T): null | T { const item = localStorage.getItem(key); if (item !== null) { - value = ChromeJSON.parse(item); + return ChromeJSON.parse(item) as T; } else if (def !== undefined) { - value = def; - } - return value; -} - -/** - * Get integer value from localStorage - * - * @param key - key to get value for - * @param def - optional value to return, if key not found or value is NaN - * @returns value as integer, NaN on error - */ -export function getInt(key: string, def?: number) { - let value: number = Number.NaN; - const item = localStorage.getItem(key); - if (item != null) { - value = parseInt(item, 10); - if (Number.isNaN(value)) { - if (def !== undefined) { - value = def; - } else { - ChromeGA.error(`NaN value for: ${key} equals ${item}`, 'ChromeStorage.getInt'); - } - } - } else if (def !== undefined) { - value = def; + return def; + } else { + return null; } - return value; -} - -/** - * Get boolean value from localStorage - * - * @param key - key to get value for - * @param def - optional value if key not found - * @returns value as boolean, null if key does not exist - */ -export function getBool(key: string, def?: boolean) { - return get(key, def); } /** @@ -82,12 +51,14 @@ export function getBool(key: string, def?: boolean) { * @param key - key to set value for * @param value - new value, if null remove item */ -export function set(key: string, value: object | [] | string | number | boolean | null = null) { +export function set(key: string, value: null | T) { if (value === null) { localStorage.removeItem(key); } else { - const val = JSON.stringify(value); - localStorage.setItem(key, val); + const val = ChromeJSON.stringify(value); + if (val !== null) { + localStorage.setItem(key, val); + } } } @@ -99,20 +70,20 @@ export function set(key: string, value: object | [] | string | number | boolean * @param keyBool - optional key to a boolean value that is true if the primary key has non-empty value * @returns true if value was set successfully */ -export function safeSet(key: string, value: any, keyBool?: string) { +export function safeSet(key: string, value: T, keyBool?: string) { let ret = true; - const oldValue = get(key); + const oldValue = get(key); try { set(key, value); - } catch (e) { + } catch (err) { ret = false; - if (oldValue) { + if (oldValue !== null) { // revert to old value set(key, oldValue); } if (keyBool) { // revert to old value - if (oldValue && oldValue.length) { + if (oldValue !== null) { set(keyBool, true); } else { set(keyBool, false); @@ -124,6 +95,11 @@ export function safeSet(key: string, value: any, keyBool?: string) { return ret; } +export async function asyncGet(key: string): Promise; +export async function asyncGet(key: string, def: boolean): Promise; +export async function asyncGet(key: string, def: number): Promise; +export async function asyncGet(key: string, def: string): Promise; +export async function asyncGet(key: string, def: T): Promise; /** * Get a value from chrome.storage.local * @@ -131,13 +107,13 @@ export function safeSet(key: string, value: any, keyBool?: string) { * * @param key - data key * @param def - optional default value if not found - * @returns Object or Array from storage, def or null if not found + * @returns value from storage, null if not found unless default is provided */ -export async function asyncGet(key: string, def?: object | []) { - let value = null; +export async function asyncGet(key: string, def?: T): Promise { + let value: null | T = null; try { const res = await chromep.storage.local.get([key]); - value = res[key]; + value = res[key] as T; } catch (err) { ChromeGA.error(err.message, 'ChromeStorage.asyncGet'); if (def !== undefined) { @@ -165,7 +141,7 @@ export async function asyncGet(key: string, def?: object | []) { * @param keyBool - optional key to a boolean value that is true if the primary key has non-empty value * @returns true if value was set successfully */ -export async function asyncSet(key: string, value: object | [] | number, keyBool?: string) { +export async function asyncSet(key: string, value: T, keyBool?: string) { // TODO what about keyBool? let ret = true; const obj = { diff --git a/src/utils.js b/src/utils.js index e7ec438..9140dc4 100644 --- a/src/utils.js +++ b/src/utils.js @@ -17,19 +17,12 @@ import * as ChromeLocale from './locales.js'; import * as ChromeStorage from './storage.js'; const chromep = new ChromePromise(); /** True if development build */ -export const DEBUG = ChromeStorage.getBool('isDevelopmentBuild', false); -/** Get the extension's name - * - * @returns Extension name - */ +export const DEBUG = ChromeStorage.get('isDevelopmentBuild', false); +/** Get the extension's name */ export function getExtensionName() { return `chrome-extension://${chrome.runtime.id}`; } -/** - * Get the Extension version - * - * @returns Extension version - */ +/** Get the extension's version */ export function getVersion() { const manifest = chrome.runtime.getManifest(); return manifest.version; @@ -54,11 +47,7 @@ export function getFullChromeVersion() { const raw = navigator.userAgent; return raw ? raw : 'Unknown'; } -/** - * Get the OS as a human readable string - * - * @returns OS name - */ +/** Get the OS as a human readable string */ export async function getPlatformOS() { let output = 'Unknown'; try { @@ -87,32 +76,20 @@ export async function getPlatformOS() { break; } } - catch (e) { + catch (err) { // something went wrong - linux seems to fail this call sometimes } return output; } -/** - * Determine if we are MS windows - * - * @returns true if MS Windows - */ +/** Determine if we are MS windows */ export function isWindows() { return isOS('win'); } -/** - * Determine if we are Chrome OS - * - * @returns true if ChromeOS - */ +/** Determine if we are Chrome OS */ export function isChromeOS() { return isOS('cros'); } -/** - * Determine if we are a Mac - * - * @returns true if Mac - */ +/** Determine if we are Mac */ export function isMac() { return isOS('mac'); } @@ -185,6 +162,8 @@ export function shuffleArray(array) { * * @remarks * + * Throw an error if LAN is not connected + * * This will at least ensure the LAN is connected. * May get false positives for other errors. * @@ -202,7 +181,7 @@ export function checkNetworkConnection() { */ export async function wait(time) { const waiter = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); - return await waiter(time); + await waiter(time); } /** * Determine if we are a given operating system @@ -215,7 +194,7 @@ async function isOS(os) { const info = await chromep.runtime.getPlatformInfo(); return (info.os === os); } - catch (e) { + catch (err) { // something went wrong - linux seems to fail this call sometimes return false; } diff --git a/src/utils.ts b/src/utils.ts index 4287288..7650ef0 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -25,21 +25,14 @@ import ChromePromise from 'chrome-promise/chrome-promise'; const chromep = new ChromePromise(); /** True if development build */ -export const DEBUG = ChromeStorage.getBool('isDevelopmentBuild', false); +export const DEBUG = ChromeStorage.get('isDevelopmentBuild', false); -/** Get the extension's name - * - * @returns Extension name - */ +/** Get the extension's name */ export function getExtensionName() { return `chrome-extension://${chrome.runtime.id}`; } -/** - * Get the Extension version - * - * @returns Extension version - */ +/** Get the extension's version */ export function getVersion() { const manifest = chrome.runtime.getManifest(); return manifest.version; @@ -67,11 +60,7 @@ export function getFullChromeVersion() { return raw ? raw : 'Unknown'; } -/** - * Get the OS as a human readable string - * - * @returns OS name - */ +/** Get the OS as a human readable string */ export async function getPlatformOS() { let output = 'Unknown'; try { @@ -100,36 +89,24 @@ export async function getPlatformOS() { default: break; } - } catch (e) { + } catch (err) { // something went wrong - linux seems to fail this call sometimes } return output; } -/** - * Determine if we are MS windows - * - * @returns true if MS Windows - */ +/** Determine if we are MS windows */ export function isWindows() { return isOS('win'); } -/** - * Determine if we are Chrome OS - * - * @returns true if ChromeOS - */ +/** Determine if we are Chrome OS */ export function isChromeOS() { return isOS('cros'); } -/** - * Determine if we are a Mac - * - * @returns true if Mac - */ +/** Determine if we are Mac */ export function isMac() { return isOS('mac'); } @@ -194,7 +171,7 @@ export function getRandomFloat(min: number, max: number) { * * @param array - Array to sort */ -export function shuffleArray(array: any[]) { +export function shuffleArray(array: T[]) { const len = array ? array.length : 0; for (let i = len - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); @@ -209,6 +186,8 @@ export function shuffleArray(array: any[]) { * * @remarks * + * Throw an error if LAN is not connected + * * This will at least ensure the LAN is connected. * May get false positives for other errors. * @@ -227,7 +206,7 @@ export function checkNetworkConnection() { */ export async function wait(time: number) { const waiter = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); - return await waiter(time); + await waiter(time); } /** @@ -240,7 +219,7 @@ async function isOS(os: string) { try { const info = await chromep.runtime.getPlatformInfo(); return (info.os === os); - } catch (e) { + } catch (err) { // something went wrong - linux seems to fail this call sometimes return false; }