@ -8,6 +8,16 @@
* @version 2.0 . 0
* @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' ;
import { DailyNotificationPlugin , NotificationOptions , NotificationResponse , NotificationStatus , NotificationSettings , BatteryStatus , PowerState , PermissionStatus } from '../definitions' ;
export class DailyNotificationWeb implements DailyNotificationPlugin {
export class DailyNotificationWeb implements DailyNotificationPlugin {
@ -247,7 +257,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin {
/ * *
/ * *
* Schedule content fetch ( web implementation )
* 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 ) ;
console . log ( 'Content fetch scheduled (web mock):' , config ) ;
// Mock implementation - in real app would use Service Worker
// Mock implementation - in real app would use Service Worker
}
}
@ -255,7 +265,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin {
/ * *
/ * *
* Schedule user notification ( web implementation )
* 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 ) ;
console . log ( 'User notification scheduled (web mock):' , config ) ;
// Mock implementation - in real app would use browser notifications
// Mock implementation - in real app would use browser notifications
}
}
@ -263,7 +273,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin {
/ * *
/ * *
* Schedule dual notification ( web implementation )
* 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 ) ;
console . log ( 'Dual notification scheduled (web mock):' , config ) ;
// Mock implementation combining content fetch and user notification
// Mock implementation combining content fetch and user notification
}
}
@ -271,7 +281,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin {
/ * *
/ * *
* Get dual schedule status ( web implementation )
* Get dual schedule status ( web implementation )
* /
* /
async getDualScheduleStatus ( ) : Promise < Record < string , unknown > > {
async getDualScheduleStatus ( ) : Promise < DualScheduleStatus > {
return {
return {
contentFetch : {
contentFetch : {
isEnabled : false ,
isEnabled : false ,
@ -299,7 +309,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin {
/ * *
/ * *
* Update dual schedule configuration ( web implementation )
* 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 ) ;
console . log ( 'Dual schedule config updated (web mock):' , config ) ;
}
}
@ -341,14 +351,14 @@ export class DailyNotificationWeb implements DailyNotificationPlugin {
/ * *
/ * *
* Get content history ( web implementation )
* Get content history ( web implementation )
* /
* /
async getContentHistory ( ) : Promise < Record < string , unknown > [ ] > {
async getContentHistory ( ) : Promise < ContentFetchResult [ ] > {
return [ ] ; // Mock empty history
return [ ] ; // Mock empty history
}
}
/ * *
/ * *
* Register callback ( web implementation )
* 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 ) ;
console . log ( 'Callback registered (web mock):' , name ) ;
}
}
@ -491,7 +501,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin {
// Set up event listener for activeDidChanged events
// Set up event listener for activeDidChanged events
document . addEventListener ( 'activeDidChanged' , async ( event : Event ) = > {
document . addEventListener ( 'activeDidChanged' , async ( event : Event ) = > {
try {
try {
const eventDetail = event . detail ;
const eventDetail = ( event as CustomEvent ) . detail ;
if ( eventDetail && eventDetail . activeDid ) {
if ( eventDetail && eventDetail . activeDid ) {
console . log ( 'DNP-WEB-INDEX: ActiveDid changed to:' , 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
// 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 ) ;
console . log ( 'Schedule daily reminder called on web platform:' , options ) ;
// Mock implementation for web
// Mock implementation for web
}
}
@ -575,12 +585,12 @@ export class DailyNotificationWeb implements DailyNotificationPlugin {
// Mock implementation for web
// Mock implementation for web
}
}
async getScheduledReminders ( ) : Promise < Record < string , unknown > [ ] > {
async getScheduledReminders ( ) : Promise < DailyReminderInfo [ ] > {
console . log ( 'Get scheduled reminders called on web platform' ) ;
console . log ( 'Get scheduled reminders called on web platform' ) ;
return [ ] ; // Mock empty array for web
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 ) ;
console . log ( 'Update daily reminder called on web platform:' , reminderId , options ) ;
// Mock implementation for web
// Mock implementation for web
}
}