Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Added types for typescript #2022

wants to merge 5 commits into from

Conversation

adamclayd
Copy link

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

@GitToTheHub
Copy link
Collaborator

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;

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?: {

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants