Skip to content

angularjs - better granularity for filter service parameter types - #5814

Merged
vvakame merged 1 commit into
DefinitelyTyped:masterfrom
use-strict:angularjs-filter-service
Sep 20, 2015
Merged

vvakame merged 1 commit into
DefinitelyTyped:masterfrom
use-strict:angularjs-filter-service

Conversation

@use-strict

Copy link
Copy Markdown
Contributor

No description provided.

vvakame added a commit that referenced this pull request Sep 20, 2015
angularjs - better granularity for filter service parameter types
@vvakame
vvakame merged commit 062cd11 into DefinitelyTyped:master Sep 20, 2015
@vvakame

vvakame commented Sep 20, 2015

Copy link
Copy Markdown
Member

@use-strict thanks mate!

@albv

albv commented Sep 21, 2015

Copy link
Copy Markdown

@vvakame this commit broke support for all filters except 'filter' (https://code.angularjs.org/1.4.2/docs/api/ng/filter/filter), consider https://code.angularjs.org/1.4.2/docs/api/ng/filter/date for example. I think there is no way to establish a strict interface for IFilterFunc, it could be anything.

@use-strict

Copy link
Copy Markdown
Contributor Author

@albv , I'll have a fix for this tomorrow. Can be solved with overloads to cover all filter types.

@btesser

btesser commented Sep 22, 2015

Copy link
Copy Markdown
Contributor

Please revert this. It breaks string filters

@albv

albv commented Sep 23, 2015

Copy link
Copy Markdown

wasn't aware that TypeScript allows overloads by argument values, nice trick @use-strict, thanks

@btesser

btesser commented Sep 23, 2015

Copy link
Copy Markdown
Contributor

@albv @use-strict from the typescript docs regarding how overload call signatures work:

Functions with specialized overload signatures (those that use string literals in their overloads) do not use their specialized signatures when checking for compatibility.

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.

5 participants