capacitor-timer-notification
Advanced tools
Comparing version 0.0.30 to 0.0.31
@@ -52,5 +52,5 @@ { | ||
"name": "getButtonClicked", | ||
"signature": "() => Promise<void>", | ||
"signature": "() => Promise<{ observe(callback: (action: string) => void): void; }>", | ||
"parameters": [], | ||
"returns": "Promise<void>", | ||
"returns": "Promise<{ observe(callback: (action: string) => void): void; }>", | ||
"tags": [], | ||
@@ -57,0 +57,0 @@ "docs": "", |
@@ -10,3 +10,5 @@ export interface TimerNotificationPlugin { | ||
stopTimer(): Promise<void>; | ||
getButtonClicked(): Promise<void>; | ||
getButtonClicked(): Promise<{ | ||
observe(callback: (action: string) => void): void; | ||
}>; | ||
} |
@@ -1,4 +0,4 @@ | ||
import { TimerNotificationPlugin } from './definitions'; | ||
import type { TimerNotificationPlugin } from './definitions'; | ||
declare const TimerNotification: TimerNotificationPlugin; | ||
export * from './definitions'; | ||
export { TimerNotification }; |
@@ -12,5 +12,7 @@ import { WebPlugin } from '@capacitor/core'; | ||
stopTimer(): Promise<void>; | ||
getButtonClicked(): Promise<void>; | ||
getButtonClicked(): Promise<{ | ||
observe(callback: (action: string) => void): void; | ||
}>; | ||
} | ||
declare const TimerNotification: TimerNotificationWeb; | ||
export { TimerNotification }; |
import { WebPlugin } from '@capacitor/core'; | ||
export class TimerNotificationWeb extends WebPlugin { | ||
async startTimer(options) { | ||
console.log(`Starting timer for ${options.duration} seconds on web`); | ||
console.log(`Starting timer for ${options.duration} seconds`); | ||
} | ||
async updateNotification(options) { | ||
console.log(`Updating notification on web: ${options.statusText} with ${options.duration} seconds remaining`); | ||
console.log(`Updating notification: ${options.statusText} with ${options.duration} seconds remaining`); | ||
} | ||
async stopTimer() { | ||
console.log('Stopping timer and removing notification on web'); | ||
console.log('Stopping timer and removing notification'); | ||
} | ||
async getButtonClicked() { | ||
console.log('getButtonClicked is not supported on the web platform'); | ||
return; // No-op for web | ||
console.log('getButtonClicked not supported on web'); | ||
return { | ||
observe: (callback) => { | ||
// No-op for web platform | ||
console.log('Simulating button click action on web', callback); | ||
}, | ||
}; | ||
} | ||
@@ -16,0 +21,0 @@ } |
@@ -13,13 +13,18 @@ 'use strict'; | ||
async startTimer(options) { | ||
console.log(`Starting timer for ${options.duration} seconds on web`); | ||
console.log(`Starting timer for ${options.duration} seconds`); | ||
} | ||
async updateNotification(options) { | ||
console.log(`Updating notification on web: ${options.statusText} with ${options.duration} seconds remaining`); | ||
console.log(`Updating notification: ${options.statusText} with ${options.duration} seconds remaining`); | ||
} | ||
async stopTimer() { | ||
console.log('Stopping timer and removing notification on web'); | ||
console.log('Stopping timer and removing notification'); | ||
} | ||
async getButtonClicked() { | ||
console.log('getButtonClicked is not supported on the web platform'); | ||
return; // No-op for web | ||
console.log('getButtonClicked not supported on web'); | ||
return { | ||
observe: (callback) => { | ||
// No-op for web platform | ||
console.log('Simulating button click action on web', callback); | ||
}, | ||
}; | ||
} | ||
@@ -26,0 +31,0 @@ } |
@@ -10,13 +10,18 @@ var capacitorTimerNotification = (function (exports, core) { | ||
async startTimer(options) { | ||
console.log(`Starting timer for ${options.duration} seconds on web`); | ||
console.log(`Starting timer for ${options.duration} seconds`); | ||
} | ||
async updateNotification(options) { | ||
console.log(`Updating notification on web: ${options.statusText} with ${options.duration} seconds remaining`); | ||
console.log(`Updating notification: ${options.statusText} with ${options.duration} seconds remaining`); | ||
} | ||
async stopTimer() { | ||
console.log('Stopping timer and removing notification on web'); | ||
console.log('Stopping timer and removing notification'); | ||
} | ||
async getButtonClicked() { | ||
console.log('getButtonClicked is not supported on the web platform'); | ||
return; // No-op for web | ||
console.log('getButtonClicked not supported on web'); | ||
return { | ||
observe: (callback) => { | ||
// No-op for web platform | ||
console.log('Simulating button click action on web', callback); | ||
}, | ||
}; | ||
} | ||
@@ -23,0 +28,0 @@ } |
{ | ||
"name": "capacitor-timer-notification", | ||
"version": "0.0.30", | ||
"version": "0.0.31", | ||
"description": "timer notifcation", | ||
@@ -5,0 +5,0 @@ "main": "dist/plugin.cjs.js", |
@@ -81,7 +81,9 @@ ## capacitor-timer-notification | ||
```typescript | ||
getButtonClicked() => Promise<void> | ||
getButtonClicked() => Promise<{ observe(callback: (action: string) => void): void; }> | ||
``` | ||
**Returns:** <code>Promise<{ observe(callback: (action: string) => void): void; }></code> | ||
-------------------- | ||
</docgen-api> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
30365
346
89