diff --git a/examples/hello-poll.ts b/examples/hello-poll.ts index e0fc6c1..5fecebc 100644 --- a/examples/hello-poll.ts +++ b/examples/hello-poll.ts @@ -16,7 +16,7 @@ import { StarredProjectsResponse } from '@timesafari/polling-contracts'; import { - StarredProjectsRequestSchema, + // StarredProjectsRequestSchema, StarredProjectsResponseSchema, createResponseValidator, generateIdempotencyKey diff --git a/examples/stale-data-ux.ts b/examples/stale-data-ux.ts index d915c09..7330eb7 100644 --- a/examples/stale-data-ux.ts +++ b/examples/stale-data-ux.ts @@ -148,14 +148,14 @@ class iOSStaleDataUX { ] }; - this.viewController.present(alert, animated: true); + this.viewController.present(alert, { animated: true }); } showBannerView(hoursSinceUpdate: number): void { // Create banner view const banner = { title: NSLocalizedString(I18N_KEYS['staleness.banner.title'], ''), - message: String(format: NSLocalizedString(I18N_KEYS['staleness.banner.message'], ''), hoursSinceUpdate), + message: NSLocalizedString(I18N_KEYS['staleness.banner.message'], '').replace('{hours}', hoursSinceUpdate.toString()), backgroundColor: 'systemYellow', textColor: 'label', actions: [ @@ -294,7 +294,7 @@ class WebStaleDataUX { class StaleDataManager { private platform: 'android' | 'ios' | 'web'; private ux: AndroidStaleDataUX | iOSStaleDataUX | WebStaleDataUX; - private lastSuccessfulPoll: number = 0; + private lastSuccessfulPoll = 0; constructor(platform: 'android' | 'ios' | 'web', context?: any) { this.platform = platform; diff --git a/packages/polling-contracts/src/types.ts b/packages/polling-contracts/src/types.ts index 090c1eb..52e552e 100644 --- a/packages/polling-contracts/src/types.ts +++ b/packages/polling-contracts/src/types.ts @@ -2,7 +2,7 @@ * Core TypeScript interfaces for polling system */ -import { z } from 'zod'; +// import { z } from 'zod'; // Core polling interfaces export interface GenericPollingRequest { diff --git a/src/definitions.ts b/src/definitions.ts index 9e276f1..5a08b00 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -363,7 +363,7 @@ export interface DailyNotificationPlugin { getContentHistory(): Promise; // Callback management methods - registerCallback(name: string, callback: Function): Promise; + registerCallback(name: string, callback: (...args: any[]) => void): Promise; unregisterCallback(name: string): Promise; getRegisteredCallbacks(): Promise; diff --git a/src/web/index.ts b/src/web/index.ts index 4891d2c..1c79a1e 100644 --- a/src/web/index.ts +++ b/src/web/index.ts @@ -348,7 +348,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { /** * Register callback (web implementation) */ - async registerCallback(name: string, _callback: Function): Promise { + async registerCallback(name: string, _callback: (...args: any[]) => void): Promise { console.log('Callback registered (web mock):', name); } diff --git a/test-apps/android-test/src/index.ts b/test-apps/android-test/src/index.ts index cb8193f..57d5650 100644 --- a/test-apps/android-test/src/index.ts +++ b/test-apps/android-test/src/index.ts @@ -1,16 +1,16 @@ -import { Capacitor } from '@capacitor/core'; -import { DailyNotificationPlugin } from '@timesafari/daily-notification-plugin'; +// import { Capacitor } from '@capacitor/core'; +// import { DailyNotificationPlugin } from '@timesafari/daily-notification-plugin'; // Phase 4: Import TimeSafari components -import { EndorserAPIClient, TIMESAFARI_ENDSORER_CONFIG } from '../shared/typescript/EndorserAPIClient'; -import { SecurityManager, TIMESAFARI_SECURITY_CONFIG } from '../shared/typescript/SecurityManager'; -import { TimeSafariNotificationManager, DEFAULT_TIMESAFARI_PREFERENCES } from '../shared/typescript/TimeSafariNotificationManager'; -import { - TimeSafariUser, - TimeSafariPreferences, - EnhancedTimeSafariNotification, - TimeSafariNotificationType -} from '../../../src/definitions'; +import { EndorserAPIClient } from '../shared/typescript/EndorserAPIClient'; +import { SecurityManager } from '../shared/typescript/SecurityManager'; +import { TimeSafariNotificationManager } from '../shared/typescript/TimeSafariNotificationManager'; +// import { +// TimeSafariUser, +// TimeSafariPreferences, +// EnhancedTimeSafariNotification, +// TimeSafariNotificationType +// } from '../../../src/definitions'; // Generic Polling Interface import { @@ -144,7 +144,7 @@ class MockDailyNotificationService { console.log('Mock dual notification scheduled:', config); } - async registerCallback(name: string, callback: Function): Promise { + async registerCallback(name: string, _callback: (...args: any[]) => void): Promise { console.log(`Mock callback registered: ${name}`); } @@ -766,7 +766,7 @@ class TimeSafariAndroidTestApp { private async testCallbacks() { try { this.log('Testing TimeSafari notification callbacks...'); - const config = this.configLoader.getConfig(); + // const config = this.configLoader.getConfig(); // Register offers callback await this.notificationService.registerCallback('offers', async (event: any) => { @@ -950,7 +950,7 @@ class TimeSafariAndroidTestApp { try { this.log('🔐 Testing SecurityManager...'); - const timeSafariUser = this.configLoader.getTimeSafariUser(); + // const timeSafariUser = this.configLoader.getTimeSafariUser(); // Test JWT generation const jwt = await this.securityManager.generateJWT({ diff --git a/test-apps/electron-test/src/index.ts b/test-apps/electron-test/src/index.ts index a65b4fa..93fdc17 100644 --- a/test-apps/electron-test/src/index.ts +++ b/test-apps/electron-test/src/index.ts @@ -1,15 +1,15 @@ import { ConfigLoader, MockDailyNotificationService, TestLogger } from '../shared/config-loader'; // Phase 4: Import TimeSafari components -import { EndorserAPIClient, TIMESAFARI_ENDSORER_CONFIG } from '../shared/typescript/EndorserAPIClient'; -import { SecurityManager, TIMESAFARI_SECURITY_CONFIG } from '../shared/typescript/SecurityManager'; -import { TimeSafariNotificationManager, DEFAULT_TIMESAFARI_PREFERENCES } from '../shared/typescript/TimeSafariNotificationManager'; -import { - TimeSafariUser, - TimeSafariPreferences, - EnhancedTimeSafariNotification, - TimeSafariNotificationType -} from '../../../src/definitions'; +import { EndorserAPIClient } from '../shared/typescript/EndorserAPIClient'; +import { SecurityManager } from '../shared/typescript/SecurityManager'; +import { TimeSafariNotificationManager } from '../shared/typescript/TimeSafariNotificationManager'; +// import { +// TimeSafariUser, +// TimeSafariPreferences, +// EnhancedTimeSafariNotification, +// TimeSafariNotificationType +// } from '../../../src/definitions'; // Enhanced UI components for Electron testing class PermissionManager { @@ -588,7 +588,7 @@ class TimeSafariElectronTestApp { private async testCallbacks() { try { this.log('Testing TimeSafari Electron notification callbacks...'); - const config = this.configLoader.getConfig(); + // const config = this.configLoader.getConfig(); // Register offers callback await this.notificationService.registerCallback('offers', async (event: any) => { @@ -781,7 +781,7 @@ class TimeSafariElectronTestApp { try { this.log('🔐 Testing SecurityManager (Electron)...'); - const timeSafariUser = this.configLoader.getTimeSafariUser(); + // const timeSafariUser = this.configLoader.getTimeSafariUser(); // Test JWT generation const jwt = await this.securityManager.generateJWT({ diff --git a/test-apps/ios-test/src/index.ts b/test-apps/ios-test/src/index.ts index 177d010..e8ab7f1 100644 --- a/test-apps/ios-test/src/index.ts +++ b/test-apps/ios-test/src/index.ts @@ -5,12 +5,12 @@ import { ConfigLoader, MockDailyNotificationService, TestLogger } from '../share import { EndorserAPIClient } from '../shared/typescript/EndorserAPIClient'; import { SecurityManager } from '../shared/typescript/SecurityManager'; import { TimeSafariNotificationManager } from '../shared/typescript/TimeSafariNotificationManager'; -import { - TimeSafariUser, - TimeSafariPreferences, - EnhancedTimeSafariNotification, - TimeSafariNotificationType -} from '../../../src/definitions'; +// import { +// TimeSafariUser, +// TimeSafariPreferences, +// EnhancedTimeSafariNotification, +// TimeSafariNotificationType +// } from '../../../src/definitions'; // Generic Polling Interface import { @@ -621,7 +621,7 @@ class TimeSafariIOSTestApp { private async testCallbacks() { try { this.log('Testing TimeSafari iOS notification callbacks...'); - const config = this.configLoader.getConfig(); + // const config = this.configLoader.getConfig(); // Register offers callback await this.notificationService.registerCallback('offers', async (event: any) => { @@ -794,7 +794,7 @@ class TimeSafariIOSTestApp { try { this.log('🔐 Testing SecurityManager (iOS)...'); - const timeSafariUser = this.configLoader.getTimeSafariUser(); + // const timeSafariUser = this.configLoader.getTimeSafariUser(); // Test JWT generation const jwt = await this.securityManager.generateJWT({ diff --git a/test-apps/shared/config-loader.ts b/test-apps/shared/config-loader.ts index b68fc63..a32bd65 100644 --- a/test-apps/shared/config-loader.ts +++ b/test-apps/shared/config-loader.ts @@ -112,7 +112,9 @@ export class ConfigLoader { private static instance: ConfigLoader; private config: TimeSafariConfig | null = null; - private constructor() {} + private constructor() { + // Private constructor for singleton pattern + } /** * Get singleton instance @@ -354,7 +356,7 @@ export class TestLogger { return levels.indexOf(level) <= levels.indexOf(this.logLevel); } - private addToLogs(level: string, message: string, data?: any): void { + private addToLogs(level: string, message: string, _data?: any): void { const timestamp = new Date().toISOString(); const logEntry = `[${timestamp}] [${level.toUpperCase()}] ${message}`; this.logs.push(logEntry); @@ -454,7 +456,7 @@ export class MockDailyNotificationService { /** * Register callback */ - public async registerCallback(name: string, callback: Function): Promise { + public async registerCallback(name: string, _callback: (...args: any[]) => void): Promise { this.logger.info(`Registering callback: ${name}`); // In a real implementation, this would register the callback this.logger.info(`Callback ${name} registered successfully`);