ZEPETO.Multiplay.DataStorage
8 min
type description datastorageerror /#datastorageerror the error code specifies the reason for the failure of data storage related requests datastorage /#datastorage represents a data storage abstraction providing methods to store, retrieve, and remove data this interface defines asynchronous operations for single and multiple data manipulations datastorageerror enum the error code specifies the reason for the failure of data storage related requests name value description unknown 1 error unknown error networkerror 0 error errors related to network issues, including disconnections or unstable connections keyconstraintviolated 103 error key error valueconstraintviolated 104 error value error datastorage interface represents a data storage abstraction providing methods to store, retrieve, and remove data this interface defines asynchronous operations for single and multiple data manipulations methods set set(key string, value t) → promise\<boolean> stores a value with a specified key throws datastorageerror parameter type description key string the key for storage value t data to store returns promise\<boolean> — promise resolved upon completion, indicating success ( true ) or failure ( false ) get get(key string) → promise\<t> retrieves a value by its key throws datastorageerror parameter type description key string the key to search for returns promise\<t> — promise resolved upon completion with a value of type t remove remove(key string) → promise\<boolean> removes a value with a specified key throws datastorageerror parameter type description key string the key to search for returns promise\<boolean> — promise resolved upon completion, indicating success ( true ) or failure ( false ) mget mget(keys string\[]) → promise<{ \[key string] t }> retrieves values by multiple keys throws datastorageerror parameter type description keys string\[] array of keys to search for returns promise<{ \[key string] t }> — promise resolved upon completion with a key value object mset mset(keyvalueset { key string; value t }\[]) → promise\<boolean> stores multiple values with specified keys throws datastorageerror parameter type description keyvalueset { key string; value t }\[] array of key value objects to store returns promise\<boolean> — promise resolved upon completion, indicating success ( true ) or failure ( false )
