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

typings v2 #304

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

typings v2 #304

wants to merge 4 commits into from

Conversation

hisham
Copy link

@hisham hisham commented Aug 23, 2017

Bundling types as discussed in #197.

Description

  • Added typescript definitions in types/index.d.ts
  • Also added typescript definition test files along with necessary files to run the tests
  • Followed instructions at https://github.com/Microsoft/dtslint to do this and using dtslint for testing
  • Added 'types-test' command in package.json to run it, and added it to the grunt tasks

Motivation and Context

So that annyang can be easily used in typescript apps. See #197.

How Has This Been Tested?

  • Added dtslint tests
  • Tested using command line 'npm run types-test'
  • And tested this latest package with my own typescript-based angular project - everything worked

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@hisham hisham mentioned this pull request Aug 23, 2017
9 tasks
@TalAter
Copy link
Owner

TalAter commented Aug 23, 2017

Wow, this is a model pull request. You have thought of everything.

Give me some time to go over it, I am still new to the world of TypeScript.

@hisham
Copy link
Author

hisham commented Aug 23, 2017 via email

types/index.d.ts Outdated
*
* @param {string[]} command
*/
removeCommands(command: string[]): void;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does removeCommands() need to be repeated twice?

Could we do something like:
removeCommands(command?: string | string[]): void;

I am unsure of the syntax, so consider my suggestion pseudo code.

types/index.d.ts Outdated
'errorPermissionBlocked' |
'errorPermissionDenied';

export interface Annyang {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is export interface the correct way to do this?
Looking at this example, and at the footnote Preventing Name Conflicts, it looks like we might actually want to define a namespace annyang.

Am I understanding this wrong?

- fix typo in contributing file
@hisham
Copy link
Author

hisham commented Aug 24, 2017

good points on both. now fixed.

@hisham
Copy link
Author

hisham commented Sep 18, 2017

So will this be merged? Would hate to have my pull request go to waste...

@TalAter
Copy link
Owner

TalAter commented Sep 22, 2017

Definitely! I am just not very experienced with TypeScript, and so asking for help with making sure I don't miss anything.

My apologies for it taking so long!

@anoblet
Copy link

anoblet commented Apr 4, 2019

This would be useful for me.

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.

None yet

3 participants