ember-cli-typescript
ember-cli-typescript copied to clipboard
Missing overloads for some computed property macros
Which package(s) does this problem pertain to?
- [x] @types/ember__object
Ember, I think since 3.9 or something, accepts an intermediate argument for the computed property macros sort, filter, etc, which is an array of dependencies. Used like so:
foo: sort('bar', ['[email protected]'], function(bar1, bar2) {
return ...
})
But translating this to use decorators:
@sort('bar', ['[email protected]'], function(bar1, bar2) {
return ...
})
foo;
Causes Expected 2 arguments, but got 3.. This is the type definition:
export function sort(
itemsKey: string,
sortDefinition: string | ((itemA: any, itemB: any) => number)
): ComputedProperty<any[]>;
Interesting! Can you link to the docs with it? That'd be super helpful!
@chriskrycho - do you mean this? Check out the additionalDependentKeys part.
Thanks for the link! If you open a PR to DefinitelyTyped, we'll definitely get them merged. Otherwise, one of us will try to hit it Soon™.
@chriskrycho - I'll probably leave that to you, thanks. :smiley: There is no hurry. :)
I believe this issue is no longer relevant with the new Ember preview types.