Skip to content

Latest commit

 

History

History
202 lines (91 loc) · 2.62 KB

zotero-plugin-toolkit.largeprefhelper.md

File metadata and controls

202 lines (91 loc) · 2.62 KB

Home > zotero-plugin-toolkit > LargePrefHelper

LargePrefHelper class

Helper class for storing large amounts of data in Zotero preferences.

Signature:

export declare class LargePrefHelper extends BasicTool 

Extends: BasicTool

Remarks

The allowed data length for a single preference is at least 100k, but if this can grow infinitely, like an Array or an Object, there will be significant performance problems.

This class stores the keys of data in a single preference as a JSON string of Array, and stores the values of data in separate preferences.

You can either use the class as a normal object with asObject(), or use the methods to access the data.

Constructors

Constructor

Modifiers

Description

(constructor)(keyPref, valuePrefPrefix, hooks)

Constructs a new instance of the LargePrefHelper class

Methods

Method

Modifiers

Description

asMapLike()

Get the Map that stores the data.

asObject()

Get the object that stores the data.

deleteKey(key)

Delete a key.

getKeys()

Get the keys of the data.

getValue(key)

Get the value of a key.

hasKey(key)

Check if a key exists.

setKey(key)

Add a key.

setKeys(keys)

Set the keys of the data.

setValue(key, value)

Set the value of a key.