@@ -458,19 +458,34 @@ interface IClientSideSyncSharedSettings extends IClientSideSharedSettings, ISync
458
458
*/
459
459
declare namespace SplitIO {
460
460
461
- interface StorageWrapper {
461
+ interface SyncStorageWrapper {
462
462
/**
463
- * Returns a promise that resolves to the current value associated with the given key, or null if the given key does not exist.
463
+ * Returns the value associated with the given key, or null if the key does not exist.
464
464
*/
465
- getItem ( key : string ) : Promise < string | null > | string | null ;
465
+ getItem ( key : string ) : string | null ;
466
466
/**
467
- * 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 none existed for key previously .
467
+ * Sets the value for the given key, creating a new key/value pair if key does not exist .
468
468
*/
469
- setItem ( key : string , value : string ) : Promise < void > | void ;
469
+ setItem ( key : string , value : string ) : void ;
470
470
/**
471
- * Returns a promise that resolves when the key/value pair with the given key is removed , if a key/value pair with the given key exists.
471
+ * Removes the key/value pair for the given key, if the key exists.
472
472
*/
473
- removeItem ( key : string ) : Promise < void > | void ;
473
+ removeItem ( key : string ) : void ;
474
+ }
475
+
476
+ interface AsyncStorageWrapper {
477
+ /**
478
+ * Returns a promise that resolves to the value associated with the given key, or null if the key does not exist.
479
+ */
480
+ getItem ( key : string ) : Promise < string | null > ;
481
+ /**
482
+ * 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.
483
+ */
484
+ setItem ( key : string , value : string ) : Promise < void > ;
485
+ /**
486
+ * Returns a promise that resolves when the key/value pair for the given key is removed, if the key exists.
487
+ */
488
+ removeItem ( key : string ) : Promise < void > ;
474
489
}
475
490
476
491
/**
@@ -992,7 +1007,7 @@ declare namespace SplitIO {
992
1007
*
993
1008
* @defaultValue `window.localStorage`
994
1009
*/
995
- wrapper ?: StorageWrapper ;
1010
+ wrapper ?: SyncStorageWrapper | AsyncStorageWrapper ;
996
1011
}
997
1012
/**
998
1013
* Storage for asynchronous (consumer) SDK.
@@ -1338,7 +1353,7 @@ declare namespace SplitIO {
1338
1353
*
1339
1354
* @defaultValue `window.localStorage`
1340
1355
*/
1341
- wrapper ?: StorageWrapper ;
1356
+ wrapper ?: SyncStorageWrapper | AsyncStorageWrapper ;
1342
1357
} ;
1343
1358
}
1344
1359
/**
0 commit comments