pixso.serverStorage
The pixso.serverStorage API records the user's Settings on the plug-in. As long as the user uses a certain account to open the design file in different files and different projects, when using the plug-in, the value of the preference item is the value set by him.
The data stored by pixso.serverStorage is differentiated according to the plug-in Id, so the current plug-in cannot read the configuration data stored by other plug-ins.
pixso.serverStorage API read and write delete operations are asynchronous, there are getAsync, setAsync, deleteAsync three methods.
getAsync
- Type:
getAsync(key?: string): Promise<any | undefined>
key key is an optional parameter. If no key is passed, all the information configured by the user under the plug-in is retrieved from the serverStorage storage (if the user did not do any configuration of the plug-in, asynchronously return {}); If the key key is passed, the corresponding configuration item content is retrieved according to the key key (if the key does not store any value, the asynchronous return undefined).
setAsync
- Type:
setAsync(key: string, value: string): Promise<void>
Store a value to a key in serverStorage, asynchronously return the plugin's latest configuration when the storage is successful, otherwise reject()
deleteAsync
- Type:
deleteAsync(key?: string): Promise<void>
key key is an optional parameter. If no key is passed, all configuration information of the plug-in is deleted. If passed, key key deletes the key value pair stored in serverStorage according to the key key.