File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ export interface IStorage extends IDisposable {
6464 getInteger ( key : string , fallbackValue : number ) : number ;
6565 getInteger ( key : string , fallbackValue ?: number ) : number | undefined ;
6666
67- set ( key : string , value : any ) : Promise < void > ;
67+ set ( key : string , value : string | boolean | number ) : Promise < void > ;
6868 delete ( key : string ) : Promise < void > ;
6969
7070 close ( ) : Promise < void > ;
@@ -207,7 +207,7 @@ export class Storage extends Disposable implements IStorage {
207207 return parseInt ( value , 10 ) ;
208208 }
209209
210- set ( key : string , value : any ) : Promise < void > {
210+ set ( key : string , value : string | boolean | number ) : Promise < void > {
211211 if ( this . state === StorageState . Closed ) {
212212 return Promise . resolve ( ) ; // Return early if we are already closed
213213 }
Original file line number Diff line number Diff line change @@ -71,13 +71,12 @@ export interface IStorageService {
7171 getInteger < R extends number | undefined > ( key : string , scope : StorageScope , fallbackValue ?: number ) : number | undefined ;
7272
7373 /**
74- * Store a string value under the given key to storage. The value will
75- * be converted to a string.
74+ * Store a value under the given key to storage. The value will be converted to a string.
7675 *
7776 * The scope argument allows to define the scope of the storage
7877 * operation to either the current workspace only or all workspaces.
7978 */
80- store ( key : string , value : any , scope : StorageScope ) : void ;
79+ store ( key : string , value : string | boolean | number , scope : StorageScope ) : void ;
8180
8281 /**
8382 * Delete an element stored under the provided key from storage.
@@ -154,7 +153,7 @@ export class InMemoryStorageService extends Disposable implements IStorageServic
154153 return parseInt ( value , 10 ) ;
155154 }
156155
157- store ( key : string , value : any , scope : StorageScope ) : Promise < void > {
156+ store ( key : string , value : string | boolean | number , scope : StorageScope ) : Promise < void > {
158157
159158 // We remove the key for undefined/null values
160159 if ( isUndefinedOrNull ( value ) ) {
Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ export class StorageService extends Disposable implements IStorageService {
205205 return this . getStorage ( scope ) . getInteger ( key , fallbackValue ) ;
206206 }
207207
208- store ( key : string , value : any , scope : StorageScope ) : void {
208+ store ( key : string , value : string | boolean | number , scope : StorageScope ) : void {
209209 this . getStorage ( scope ) . set ( key , value ) ;
210210 }
211211
You can’t perform that action at this time.
0 commit comments