@@ -463,34 +463,22 @@ interface IClientSideSyncSharedSettings extends IClientSideSharedSettings, ISync
463463 */
464464declare namespace SplitIO {
465465
466- interface SyncStorageWrapper {
466+ interface StorageWrapper {
467467 /**
468468 * Returns the value associated with the given key, or null if the key does not exist.
469+ * If the operation is asynchronous, returns a Promise.
469470 */
470- getItem ( key : string ) : string | null ;
471+ getItem ( key : string ) : string | null | Promise < string | null > ;
471472 /**
472473 * Sets the value for the given key, creating a new key/value pair if key does not exist.
474+ * If the operation is asynchronous, returns a Promise.
473475 */
474- setItem ( key : string , value : string ) : void ;
476+ setItem ( key : string , value : string ) : void | Promise < void > ;
475477 /**
476478 * Removes the key/value pair for the given key, if the key exists.
479+ * If the operation is asynchronous, returns a Promise.
477480 */
478- removeItem ( key : string ) : void ;
479- }
480-
481- interface AsyncStorageWrapper {
482- /**
483- * Returns a promise that resolves to the value associated with the given key, or null if the key does not exist.
484- */
485- getItem ( key : string ) : Promise < string | null > ;
486- /**
487- * Returns a promise that resolves when the value of the pair identified by key is set to value, creating a new key/value pair if key does not exist.
488- */
489- setItem ( key : string , value : string ) : Promise < void > ;
490- /**
491- * Returns a promise that resolves when the key/value pair for the given key is removed, if the key exists.
492- */
493- removeItem ( key : string ) : Promise < void > ;
481+ removeItem ( key : string ) : void | Promise < void > ;
494482 }
495483
496484 /**
@@ -1013,7 +1001,7 @@ declare namespace SplitIO {
10131001 *
10141002 * @defaultValue `window.localStorage`
10151003 */
1016- wrapper ?: SyncStorageWrapper | AsyncStorageWrapper ;
1004+ wrapper ?: StorageWrapper ;
10171005 }
10181006 /**
10191007 * Storage for asynchronous (consumer) SDK.
@@ -1380,7 +1368,7 @@ declare namespace SplitIO {
13801368 *
13811369 * @defaultValue `window.localStorage`
13821370 */
1383- wrapper ?: SyncStorageWrapper | AsyncStorageWrapper ;
1371+ wrapper ?: StorageWrapper ;
13841372 } ;
13851373 }
13861374 /**
0 commit comments