Typescript: Object of T but value is Predicate -
for following function (see http://ramdajs.com/docs/#where)
var spec2 = {x: function(val, obj) { return val + obj.y > 10; }}; r.where(spec2, {x: 2, y: 7}); //=> false r.where(spec2, {x: 3, y: 8}); //=> true
i create typing case object
t
has value of predicate.
i thinking this:
where<t>(spec: {item: (val: any, testobj: t) => boolean}, testobj: t): boolean;
but i'm not sure key.
there isn't way represent in typescript type system.
Comments
Post a Comment