Skip to content

Commit

Permalink
[FIX] : type of storages function
Browse files Browse the repository at this point in the history
  • Loading branch information
masoud-shahpoori committed Nov 1, 2024
1 parent 015b5d3 commit a41bd65
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redux-persist-x",
"version": "1.1.1",
"version": "1.1.2",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/persistor/persistStorage/DBStorageSingleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class DBStorageSingleton {
return DBStorageSingleton.instance;
}

private async initPersistDb(): Promise<void | unknown> {
private async initPersistDb(): Promise<void> {
return new Promise((resolve, reject) => {
const request = indexedDB.open(PERSIST_STORAGE_NAME, 1);

Expand Down
12 changes: 7 additions & 5 deletions src/persistor/persistStorage/storageInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ export interface StorageSetDataType {
value: any;
}

export const PERSIST_STORAGE_NAME = "root:persistStorage";
export const PERSIST_STORAGE_OBJECT_KEY = "persistStorage-cache-store";
export const PERSIST_STORAGE_NAME = 'root:persistStorage';
export const PERSIST_STORAGE_OBJECT_KEY = 'persistStorage-cache-store';

export abstract class StorageInterface {
abstract setItem(
Expand All @@ -21,11 +21,13 @@ export abstract class StorageInterface {
abstract removeItem(
key: string,
callback?: (error?: Error) => void
): Promise<undefined>;
): Promise<undefined | unknown>;

abstract getAllKeys(
callback?: (error?: Error, keys?: Array<string>) => void
): Promise<string[]> | Promise<undefined>;
): Promise<string[]> | Promise<undefined | unknown>;

abstract clear(callback?: (error?: Error) => void): Promise<boolean>;
abstract clear(
callback?: (error?: Error) => void
): Promise<boolean | unknown>;
}

0 comments on commit a41bd65

Please sign in to comment.