diff --git a/src/definitions.ts b/src/definitions.ts index f6f78c8..6f35b18 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: (...args: any[]) => void): Promise; + registerCallback(name: string, callback: (...args: unknown[]) => void): Promise; unregisterCallback(name: string): Promise; getRegisteredCallbacks(): Promise; diff --git a/src/web/index.ts b/src/web/index.ts index d9ff2b0..eb59359 100644 --- a/src/web/index.ts +++ b/src/web/index.ts @@ -8,6 +8,16 @@ * @version 2.0.0 */ +import { + ContentFetchConfig, + UserNotificationConfig, + DualScheduleConfiguration, + DualScheduleStatus, + ContentFetchResult, + DailyReminderOptions, + DailyReminderInfo +} from '../definitions'; + import { DailyNotificationPlugin, NotificationOptions, NotificationResponse, NotificationStatus, NotificationSettings, BatteryStatus, PowerState, PermissionStatus } from '../definitions'; export class DailyNotificationWeb implements DailyNotificationPlugin { @@ -247,7 +257,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { /** * Schedule content fetch (web implementation) */ - async scheduleContentFetch(config: Record): Promise { + async scheduleContentFetch(config: ContentFetchConfig): Promise { console.log('Content fetch scheduled (web mock):', config); // Mock implementation - in real app would use Service Worker } @@ -255,7 +265,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { /** * Schedule user notification (web implementation) */ - async scheduleUserNotification(config: Record): Promise { + async scheduleUserNotification(config: UserNotificationConfig): Promise { console.log('User notification scheduled (web mock):', config); // Mock implementation - in real app would use browser notifications } @@ -263,7 +273,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { /** * Schedule dual notification (web implementation) */ - async scheduleDualNotification(config: Record): Promise { + async scheduleDualNotification(config: DualScheduleConfiguration): Promise { console.log('Dual notification scheduled (web mock):', config); // Mock implementation combining content fetch and user notification } @@ -271,7 +281,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { /** * Get dual schedule status (web implementation) */ - async getDualScheduleStatus(): Promise> { + async getDualScheduleStatus(): Promise { return { contentFetch: { isEnabled: false, @@ -299,7 +309,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { /** * Update dual schedule configuration (web implementation) */ - async updateDualScheduleConfig(config: Record): Promise { + async updateDualScheduleConfig(config: DualScheduleConfiguration): Promise { console.log('Dual schedule config updated (web mock):', config); } @@ -341,14 +351,14 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { /** * Get content history (web implementation) */ - async getContentHistory(): Promise[]> { + async getContentHistory(): Promise { return []; // Mock empty history } /** * Register callback (web implementation) */ - async registerCallback(name: string, _callback: (...args: any[]) => void): Promise { + async registerCallback(name: string, _callback: (...args: unknown[]) => void): Promise { console.log('Callback registered (web mock):', name); } @@ -491,7 +501,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { // Set up event listener for activeDidChanged events document.addEventListener('activeDidChanged', async (event: Event) => { try { - const eventDetail = event.detail; + const eventDetail = (event as CustomEvent).detail; if (eventDetail && eventDetail.activeDid) { console.log('DNP-WEB-INDEX: ActiveDid changed to:', eventDetail.activeDid); @@ -565,7 +575,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { } // Static Daily Reminder Methods - async scheduleDailyReminder(options: Record): Promise { + async scheduleDailyReminder(options: DailyReminderOptions): Promise { console.log('Schedule daily reminder called on web platform:', options); // Mock implementation for web } @@ -575,12 +585,12 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { // Mock implementation for web } - async getScheduledReminders(): Promise[]> { + async getScheduledReminders(): Promise { console.log('Get scheduled reminders called on web platform'); return []; // Mock empty array for web } - async updateDailyReminder(reminderId: string, options: Record): Promise { + async updateDailyReminder(reminderId: string, options: DailyReminderOptions): Promise { console.log('Update daily reminder called on web platform:', reminderId, options); // Mock implementation for web } diff --git a/test-apps/android-test/src/index.ts b/test-apps/android-test/src/index.ts index 7efe878..bbb7be7 100644 --- a/test-apps/android-test/src/index.ts +++ b/test-apps/android-test/src/index.ts @@ -144,7 +144,7 @@ class MockDailyNotificationService { console.log('Mock dual notification scheduled:', config); } - async registerCallback(name: string, _callback: (...args: any[]) => void): Promise { + async registerCallback(name: string, _callback: (...args: unknown[]) => void): Promise { console.log(`Mock callback registered: ${name}`); } diff --git a/test-apps/shared/config-loader.ts b/test-apps/shared/config-loader.ts index 37c63fc..ae2aa67 100644 --- a/test-apps/shared/config-loader.ts +++ b/test-apps/shared/config-loader.ts @@ -456,7 +456,7 @@ export class MockDailyNotificationService { /** * Register callback */ - public async registerCallback(name: string, _callback: (...args: any[]) => void): Promise { + public async registerCallback(name: string, _callback: (...args: unknown[]) => void): Promise { this.logger.info(`Registering callback: ${name}`); // In a real implementation, this would register the callback this.logger.info(`Callback ${name} registered successfully`); diff --git a/test-apps/shared/typescript/EndorserAPIClient.ts b/test-apps/shared/typescript/EndorserAPIClient.ts index b9394cc..1be4d5b 100644 --- a/test-apps/shared/typescript/EndorserAPIClient.ts +++ b/test-apps/shared/typescript/EndorserAPIClient.ts @@ -28,8 +28,8 @@ export interface EndorserAPIConfig { export interface EndorserAPIRequest { endpoint: string; - params?: Record; - body?: Record; + params?: Record; + body?: Record; method: 'GET' | 'POST'; timeoutMs?: number; authRequired: boolean; @@ -149,7 +149,7 @@ export class EndorserAPIClient { beforeId?: string ): Promise { try { - const params: Record = {}; + const params: Record = {}; if (afterId) params.afterId = afterId; if (beforeId) params.beforeId = beforeId; @@ -178,7 +178,7 @@ export class EndorserAPIClient { beforeId?: string ): Promise { try { - const body: Record = { + const body: Record = { planIds }; if (afterId) body.afterId = afterId; @@ -228,7 +228,7 @@ export class EndorserAPIClient { const token = await this.generateJWTForDID(userConfig.activeDid); this.setAuthToken(token); - const requests: Promise[] = []; + const requests: Promise[] = []; // 1. Offers to Person if (userConfig.fetchOffersToPerson !== false) { @@ -478,7 +478,7 @@ export class EndorserAPIClient { /** * Execute authenticated request with retry logic */ - private async request(requestConfig: EndorserAPIRequest): Promise { + private async request(requestConfig: EndorserAPIRequest): Promise { const url = `${this.config.baseUrl}${requestConfig.endpoint}`; try { @@ -531,7 +531,7 @@ export class EndorserAPIClient { /** * Execute HTTP request with retry logic */ - private async executeRequest(url: string, options: RequestInit, endpoint: string): Promise { + private async executeRequest(url: string, options: RequestInit, endpoint: string): Promise { let lastError: Error | undefined; for (let attempt = 0; attempt <= this.config.maxRetries; attempt++) { diff --git a/test-apps/shared/typescript/TimeSafariNotificationManager.ts b/test-apps/shared/typescript/TimeSafariNotificationManager.ts index 3ea2090..2955a13 100644 --- a/test-apps/shared/typescript/TimeSafariNotificationManager.ts +++ b/test-apps/shared/typescript/TimeSafariNotificationManager.ts @@ -381,13 +381,13 @@ export class TimeSafariNotificationManager { switch (notification.type) { case 'offer': - return (prefs.offerSubtypes as any)[subtype] || false; + return (prefs.offerSubtypes as Record)[subtype] || false; case 'project': - return (prefs.projectSubtypes as any)[subtype] || false; + return (prefs.projectSubtypes as Record)[subtype] || false; case 'person': - return (prefs.peopleSubtypes as any)[subtype] || false; + return (prefs.peopleSubtypes as Record)[subtype] || false; case 'item': - return (prefs.itemsSubtypes as any)[subtype] || false; + return (prefs.itemsSubtypes as Record)[subtype] || false; default: return false; } diff --git a/test-apps/test-api/client.ts b/test-apps/test-api/client.ts index 94c25d0..1279522 100644 --- a/test-apps/test-api/client.ts +++ b/test-apps/test-api/client.ts @@ -108,9 +108,9 @@ export class TestAPIClient { /** * Test error scenarios * @param errorType - Type of error to simulate - * @returns Promise> + * @returns Promise> */ - async testError(errorType: string): Promise> { + async testError(errorType: string): Promise> { const url = `${this.config.baseUrl}/api/error/${errorType}`; try { @@ -138,9 +138,9 @@ export class TestAPIClient { /** * Get API health status - * @returns Promise> + * @returns Promise> */ - async getHealth(): Promise> { + async getHealth(): Promise> { const url = `${this.config.baseUrl}/health`; try { @@ -168,9 +168,9 @@ export class TestAPIClient { /** * Get API metrics - * @returns Promise> + * @returns Promise> */ - async getMetrics(): Promise> { + async getMetrics(): Promise> { const url = `${this.config.baseUrl}/api/metrics`; try {