diff --git a/client/absolute.ts b/client/absolute.ts index 324b831b..76081d77 100644 --- a/client/absolute.ts +++ b/client/absolute.ts @@ -15,13 +15,13 @@ */ import CacheManager from './cache/cache_manager'; -import PushManager from './push/push_manager'; -import Notification from './notification/notification_manager'; import IndexedDB from './indexeddb/indexeddb'; +import Notification from './notification/notification_manager'; +import PushManager from './push/push_manager'; export default class absolute { - static cache: CacheManager = new CacheManager(); - static push: PushManager = new PushManager(); - static notification: Notification = new Notification(); - static indexeddb: IndexedDB = new IndexedDB(); + public static cache: CacheManager = new CacheManager(); + public static push: PushManager = new PushManager(); + public static notification: Notification = new Notification(); + public static indexeddb: IndexedDB = new IndexedDB(); } diff --git a/client/cache/cache_manager.ts b/client/cache/cache_manager.ts index 695540d4..8164aed9 100644 --- a/client/cache/cache_manager.ts +++ b/client/cache/cache_manager.ts @@ -23,7 +23,7 @@ export default class CacheManager { this.register('cache_service_worker.js'); } - async register(worker: string): Promise { + public async register(worker: string): Promise { if (navigator.serviceWorker) { navigator.serviceWorker.register(worker).then((registration: ServiceWorkerRegistration) => { // registration worked diff --git a/client/indexeddb/indexeddb.test.ts b/client/indexeddb/indexeddb.test.ts index 19012bf0..ffdfbb33 100644 --- a/client/indexeddb/indexeddb.test.ts +++ b/client/indexeddb/indexeddb.test.ts @@ -27,4 +27,4 @@ test('absolute.indexeddb.get()', async () => { test('absolute.indexeddb.remove()', async () => { expect(await absolute.indexeddb.remove('test_key')).toBe(null); -}); \ No newline at end of file +}); diff --git a/client/indexeddb/indexeddb.ts b/client/indexeddb/indexeddb.ts index 2ebca2e8..8ec1e1d5 100644 --- a/client/indexeddb/indexeddb.ts +++ b/client/indexeddb/indexeddb.ts @@ -14,21 +14,21 @@ * limitations under the License. */ -export default class IndexedDB{ +export default class IndexedDB { constructor() {} - async set(key: string, value: object): Promise { + public async set(key: string, value: object): Promise { // Not implemented yet return false; } - async get(key: string): Promise { + public async get(key: string): Promise { // Not implemented yet return null; } - async remove(key: string): Promise { + public async remove(key: string): Promise { // Not implemented yet return null; } diff --git a/client/notification/notification.test.ts b/client/notification/notification.test.ts index 1374e6d4..5359ba88 100644 --- a/client/notification/notification.test.ts +++ b/client/notification/notification.test.ts @@ -18,14 +18,14 @@ import { } from 'jest'; import absolute from '../absolute'; test('absolute.notification.create()', async () => { - let NotificationEvent = new Event("click"); + const NotificationEvent = new Event('click'); expect(await absolute.notification.create(NotificationEvent)).toBe(false); }); test('absolute.notification.close()', async () => { - let NotificationEvent = new Event("click"); + const NotificationEvent = new Event('click'); expect(await absolute.notification.close(NotificationEvent)).toBe(false); }); test('absolute.notification.processClickEvent()', async () => { - let NotificationEvent = new Event("click"); + const NotificationEvent = new Event('click'); expect(await absolute.notification.processClickEvent(NotificationEvent)).toBe(false); -}); \ No newline at end of file +}); diff --git a/client/notification/notification_manager.ts b/client/notification/notification_manager.ts index ec1e648b..aa44991f 100644 --- a/client/notification/notification_manager.ts +++ b/client/notification/notification_manager.ts @@ -20,16 +20,16 @@ export default class Notification { constructor() { } - async create(NotificationEvent: Event): Promise { + public async create(NotificationEvent: Event): Promise { // Not implemented yet return false; } - async close(NotificationEvent: Event): Promise { + public async close(NotificationEvent: Event): Promise { // Not implemented yet return false; } - async processClickEvent(NotificationEvent: Event): Promise { + public async processClickEvent(NotificationEvent: Event): Promise { // Not implemented yet return false; } -} \ No newline at end of file +} diff --git a/client/push/push_manager.test.ts b/client/push/push_manager.test.ts index 147a7255..d28b031d 100644 --- a/client/push/push_manager.test.ts +++ b/client/push/push_manager.test.ts @@ -22,7 +22,7 @@ test('absolute.push.isRegistered()', async() => { }); test('absolute.push.register()', async() => { - const registered: Promise = await absolute.push.register('test_key') + const registered: Promise<{}> = await absolute.push.register('test_key'); expect(registered).rejects.toBe(null); }); diff --git a/client/push/push_manager.ts b/client/push/push_manager.ts index 84b659e0..b99059c2 100644 --- a/client/push/push_manager.ts +++ b/client/push/push_manager.ts @@ -20,7 +20,7 @@ export default class PushManager { constructor() {} - async isRegistered(): Promise { + public async isRegistered(): Promise { if (!navigator.serviceWorker) { return false; } @@ -32,21 +32,21 @@ export default class PushManager { if (subscription) { return true; } - + return false; }) .catch((error: Error) => { // Not implemented yet - }) + }); }) .catch((error: Error) => { // Not implemented yet - }) + }); return false; } - async register(key: string): Promise { + public async register(key: string): Promise { if (navigator.serviceWorker) { navigator.serviceWorker.register('/push_service_worker.js') .then((registration: ServiceWorkerRegistration) => { @@ -72,8 +72,8 @@ export default class PushManager { }) .catch((error: Error) => { // Not implemented yet - }) - }) + }); + }); }) .catch((error: Error) => { @@ -84,7 +84,7 @@ export default class PushManager { return null; } - async unregister(): Promise { + public async unregister(): Promise { if (!navigator.serviceWorker) { return false; } @@ -96,16 +96,16 @@ export default class PushManager { if (subscription) { subscription.unsubscribe(); return true; - } + } return false; }) .catch((error: Error) => { // Not implemented yet - }) + }); }) .catch((error: Error) => { // Not implemented yet - }) + }); return false; }