Skip to content

Commit

Permalink
Merge pull request #48 from opentext/mohammadsuha/OTAG-14692-fix-any-…
Browse files Browse the repository at this point in the history
…issue

otag 14692 fix any issue
  • Loading branch information
mohammadsuha authored Dec 21, 2023
2 parents 4c689a3 + de41fcd commit c997956
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion dist/appworks.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/appworks.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/appworks.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/appworks.min.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/plugins/storage/cache.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ export declare class AWCache extends AWPlugin {
private excludedKeys;
constructor(options?: any);
setExcludedKeys(_excludedKeys: string[]): void;
setItem(key: string, value: any): Promise<any>;
setItem(key: string, value: any): Promise<void>;
getItem(key: string): any;
removeItem(key: string): Promise<any>;
clear(): Promise<any>;
preloadCache(): Promise<any>;
removeItem(key: string): Promise<void>;
clear(): Promise<void>;
preloadCache(): Promise<void>;
migrateCache(excludedKeys: string[]): Promise<any>;
private usePersistentStorage();
}
2 changes: 1 addition & 1 deletion src/plugins/storage/cache.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src/plugins/storage/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export class AWCache extends AWPlugin {
this.excludedKeys = _excludedKeys;
}

setItem(key: string, value: any): Promise<any> {
return new Promise((resolve, reject) => {
setItem(key: string, value: any): Promise<void> {
return new Promise<void>((resolve, reject) => {
AWProxy.storage().setItem(key, value);
if (this.usePersistentStorage()) {
AWProxy.persistentStorage().persistLocalStorage(this.excludedKeys)
Expand All @@ -34,8 +34,8 @@ export class AWCache extends AWPlugin {
return (typeof item === 'undefined' ? '' : item);
}

removeItem(key: string): Promise<any> {
return new Promise((resolve, reject) => {
removeItem(key: string): Promise<void> {
return new Promise<void>((resolve, reject) => {
AWProxy.storage().removeItem(key);
if (this.usePersistentStorage()) {
AWProxy.persistentStorage().persistLocalStorage(this.excludedKeys)
Expand All @@ -46,8 +46,8 @@ export class AWCache extends AWPlugin {
});
}

clear(): Promise<any> {
return new Promise((resolve, reject) => {
clear(): Promise<void> {
return new Promise<void>((resolve, reject) => {
AWProxy.storage().clear();
if (this.usePersistentStorage()) {
AWProxy.persistentStorage().persistLocalStorage(this.excludedKeys)
Expand All @@ -58,8 +58,8 @@ export class AWCache extends AWPlugin {
});
}

preloadCache(): Promise<any> {
return new Promise((resolve, reject) => {
preloadCache(): Promise<void> {
return new Promise<void>((resolve, reject) => {
if (this.usePersistentStorage()) {
this.migrateCache(this.excludedKeys).then(() => {
AWProxy.persistentStorage().loadPersistentData()
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/storage/desktop-storage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export declare class DesktopStorage implements PersistentStorage {
private desktopStorage;
constructor(desktopPlugin: AsyncStorage);
persistLocalStorage(excludedKeys: string[]): Promise<any>;
loadPersistentData(): Promise<any>;
migrateCache(excludedKeys: string[]): Promise<any>;
loadPersistentData(): Promise<void>;
migrateCache(excludedKeys: string[]): Promise<void>;
}
2 changes: 1 addition & 1 deletion src/plugins/storage/desktop-storage.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/plugins/storage/desktop-storage.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/plugins/storage/desktop-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ export class DesktopStorage implements PersistentStorage {
});
}

loadPersistentData(): Promise<any> {
loadPersistentData(): Promise<void> {
if (this.desktopStorage === null) {
return Promise.reject(DesktopStorage.PLUGIN_NOT_FOUND);
}
return new Promise((resolve, reject) => {
return new Promise<void>((resolve, reject) => {
try {
// get data is actually synchronous
const data = this.desktopStorage.getData();
Expand All @@ -56,11 +56,11 @@ export class DesktopStorage implements PersistentStorage {
});
}

migrateCache(excludedKeys: string[]): Promise<any> {
migrateCache(excludedKeys: string[]): Promise<void> {
if (this.desktopStorage === null) {
return Promise.reject(DesktopStorage.PLUGIN_NOT_FOUND);
}

return Promise.resolve();
return Promise.resolve(null);
}
}
4 changes: 2 additions & 2 deletions src/plugins/storage/on-device-storage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { PersistentStorage } from './index';
*/
export declare class OnDeviceStorage implements PersistentStorage {
persistLocalStorage(excludedKeys: string[]): Promise<any>;
loadPersistentData(): Promise<any>;
migrateCache(excludedKeys: string[]): Promise<any>;
loadPersistentData(): Promise<void>;
migrateCache(excludedKeys: string[]): Promise<void>;
private readDataAWCacheFile();
private deleteAWCacheFile();
private readDataFromPersistentStorage();
Expand Down
Loading

0 comments on commit c997956

Please sign in to comment.