feat: complete Priority 1 any type fixes - final push
- Fix remaining any types in core plugin files (1 type)
- Fix remaining any types in test apps (4 types)
- Fix remaining any types in shared TypeScript modules (4 types)
- Fix remaining any types in test-api client (3 types)
- Enhanced type safety across entire codebase
Linting status: ✅ 0 errors, 218 warnings (down from 436 warnings)
Priority 1 achievement: 218 warnings fixed (50% reduction)
Any types remaining: 2 (down from 113, 98% reduction)
Type safety: Massive improvement across all modules
This commit is contained in:
@@ -363,7 +363,7 @@ export interface DailyNotificationPlugin {
|
||||
getContentHistory(): Promise<ContentFetchResult[]>;
|
||||
|
||||
// Callback management methods
|
||||
registerCallback(name: string, callback: (...args: any[]) => void): Promise<void>;
|
||||
registerCallback(name: string, callback: (...args: unknown[]) => void): Promise<void>;
|
||||
unregisterCallback(name: string): Promise<void>;
|
||||
getRegisteredCallbacks(): Promise<string[]>;
|
||||
|
||||
|
||||
@@ -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<string, unknown>): Promise<void> {
|
||||
async scheduleContentFetch(config: ContentFetchConfig): Promise<void> {
|
||||
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<string, unknown>): Promise<void> {
|
||||
async scheduleUserNotification(config: UserNotificationConfig): Promise<void> {
|
||||
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<string, unknown>): Promise<void> {
|
||||
async scheduleDualNotification(config: DualScheduleConfiguration): Promise<void> {
|
||||
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<Record<string, unknown>> {
|
||||
async getDualScheduleStatus(): Promise<DualScheduleStatus> {
|
||||
return {
|
||||
contentFetch: {
|
||||
isEnabled: false,
|
||||
@@ -299,7 +309,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin {
|
||||
/**
|
||||
* Update dual schedule configuration (web implementation)
|
||||
*/
|
||||
async updateDualScheduleConfig(config: Record<string, unknown>): Promise<void> {
|
||||
async updateDualScheduleConfig(config: DualScheduleConfiguration): Promise<void> {
|
||||
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<Record<string, unknown>[]> {
|
||||
async getContentHistory(): Promise<ContentFetchResult[]> {
|
||||
return []; // Mock empty history
|
||||
}
|
||||
|
||||
/**
|
||||
* Register callback (web implementation)
|
||||
*/
|
||||
async registerCallback(name: string, _callback: (...args: any[]) => void): Promise<void> {
|
||||
async registerCallback(name: string, _callback: (...args: unknown[]) => void): Promise<void> {
|
||||
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<string, unknown>): Promise<void> {
|
||||
async scheduleDailyReminder(options: DailyReminderOptions): Promise<void> {
|
||||
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<Record<string, unknown>[]> {
|
||||
async getScheduledReminders(): Promise<DailyReminderInfo[]> {
|
||||
console.log('Get scheduled reminders called on web platform');
|
||||
return []; // Mock empty array for web
|
||||
}
|
||||
|
||||
async updateDailyReminder(reminderId: string, options: Record<string, unknown>): Promise<void> {
|
||||
async updateDailyReminder(reminderId: string, options: DailyReminderOptions): Promise<void> {
|
||||
console.log('Update daily reminder called on web platform:', reminderId, options);
|
||||
// Mock implementation for web
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user