-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added types for typescript #2022
base: master
Are you sure you want to change the base?
Conversation
If you want get it merged, please update it against the current master. There are 3 new methods and remove the .idea-entry in .gitignore. This have nothing to do with this pr. |
local: { | ||
hasPermission(callback?: Function, scope?: Object): void; | ||
requestPermission(callback?: Function, scope?: Object): void; | ||
schedule(notifications: LocalNotification[], callback?: Function, scope?: Object): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The schedule function allows you to input a single object (with out a list)
cordova.plugins.notification.local.schedule({
title: 'My first notification',
text: 'Thats pretty easy...',
foreground: true
});
Therefor the typing should be something like this
schedule(notifications: LocalNotification | LocalNotification[], callback?: Function, scope?: Object): void;
summary?: string | null; | ||
text?: string; | ||
title?: string; | ||
trigger?: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using trigger like this
cordova.plugins.notification.local.schedule({
title: 'Design team meeting',
trigger: { in: 1, unit: 'hour' }
});
The "at" and "every" property should be optional
I added an
index.d.ts
file so that you can use it in typescript. One really could use it if they are making their interface in angular