Matthias Hild 00c2478e98 Transition.styleTween has incorrect signature
The signature of Transition.styleTween is currently:

styleTween(name: string, tween: (datum: Datum, index: number, attr: string) => Primitive, priority?: string): Transition<Datum>; (line 833)

Note that the tween is said to return a Primitive. This seems incorrect, both in terms of D3 intent and implementation.

The *correct* version appears to be:

styleTween(name: string, tween: (datum: Datum, index: number, attr: string) => (t: number) => Primitive, priority?: string): Transition<Datum>;

(This is similar to  similar to Transition.attrTween.)

First, the documentation states:

>>> The return value of tween must be an interpolator: a function that maps a parametric value t in the domain [0,1] 
>>>  to a color, number or arbitrary value.

Second, the source code of d3 3.5.5 has:

d3_transitionPrototype.styleTween = function(name, tween, priority) {
    if (arguments.length < 3) priority = "";
    function styleTween(d, i) {
      var f = tween.call(this, d, i, d3_window(this).getComputedStyle(this, null).getPropertyValue(name));
      return f && function(t) {
        this.style.setProperty(name, f(t), priority);
      };
    }
    return this.tween("style." + name, styleTween);
  };

Note the line "this.style.setProperty(name, f(t), priority);" where the result f of applying the tween is passed a parameter t. 

The only point of discussion might be the type of the return value of the tween's interpolator output. Is it Primitive or any? The documentation quoted above (incidentally the same for attrTween and styleTween) explicitly allows for an arbitrary value. I don't have enough D3 experience to know if this is a practically relevant possibility.

Many thanks for your great work on d3.d.ts!!! Especially the use of tweens and interpolators perfectly illustrates the benefits of Typescript.

Best wishes,

Matthias
2015-08-06 19:02:28 -04:00
2015-07-22 10:07:55 +10:00
2014-01-09 16:39:18 +04:00
2015-06-25 01:48:44 +02:00
2015-07-30 12:00:56 -07:00
2014-06-22 12:23:03 +10:00
2015-07-31 10:30:57 -07:00
2015-03-12 11:37:30 +11:00
2015-05-27 16:32:52 +02:00
2015-07-31 09:49:57 +02:00
2015-03-12 11:36:33 +11:00
2015-04-21 22:41:07 +02:00
2015-07-27 17:17:55 -04:00
2015-04-27 15:23:44 -05:00
2014-06-18 23:31:11 +02:00
2014-09-22 17:57:21 +02:00
2013-10-03 22:23:35 +09:00
2015-02-22 23:25:14 +09:00
2014-09-02 14:53:39 -07:00
2014-11-13 23:46:14 +09:00
2014-12-26 16:25:50 +09:00
2014-05-18 21:37:47 +02:00
2015-07-07 20:38:17 +05:00
2014-06-18 23:31:11 +02:00
2015-08-02 17:20:26 -04:00
2015-07-24 17:12:55 +03:00
2015-07-20 16:16:29 -04:00
2014-09-29 18:19:55 +10:00
2014-01-24 00:22:06 +01:00
2014-09-30 03:06:45 +03:00
2015-02-20 19:37:23 -06:00
2015-02-23 09:02:23 +01:00
2014-07-11 07:37:05 +02:00
2015-05-12 11:08:38 +02:00
2015-03-15 23:36:05 +09:00
2014-08-01 20:11:18 +02:00
2015-03-13 12:54:54 +01:00
2015-05-22 17:05:12 -04:00
2014-01-24 00:22:06 +01:00
2015-04-10 23:19:04 -07:00
2015-07-04 13:11:44 +02:00
2014-08-07 15:50:27 +09:00
2014-11-05 14:39:42 +09:00
2015-04-21 19:39:07 -04:00
2015-03-05 23:03:57 +01:00
2015-04-12 14:04:47 +02:00
2015-07-30 12:51:55 -07:00
2014-11-05 14:39:42 +09:00
2015-04-28 16:21:00 -05:00
2015-04-28 16:21:00 -05:00
2015-04-28 16:21:00 -05:00
2015-02-25 08:13:09 +08:00
2014-11-05 16:29:12 -08:00
2014-10-22 10:21:24 +02:00
2015-07-30 13:21:42 -07:00
2015-06-10 12:38:53 +05:30
2014-08-19 16:41:08 -04:00
2015-07-30 13:14:11 -07:00
2015-07-19 17:01:21 +09:00
2015-06-26 16:08:39 +02:00
2014-11-27 19:23:54 -06:00
2014-11-18 20:34:21 +09:00
2014-01-24 00:22:06 +01:00
2014-07-17 19:20:44 +01:00
2015-07-20 17:49:23 +08:00
2014-11-13 06:36:43 +09:00
2015-08-04 13:25:23 -07:00
2014-10-30 01:33:59 +09:00
2014-07-17 19:20:44 +01:00
2015-05-11 08:18:16 -07:00
2014-06-18 23:31:11 +02:00
2015-07-30 13:19:16 -07:00
2015-03-23 19:23:47 +01:00
2014-02-26 14:13:17 +09:00
2014-08-20 00:27:36 +09:00
2015-06-26 15:50:26 +02:00
2015-03-31 11:06:14 -04:00
2015-03-30 15:26:22 -04:00
2015-06-01 12:39:06 +09:00
2015-08-03 16:42:37 -05:00
2015-06-19 16:08:14 -04:00
2015-07-03 19:15:56 +02:00
2015-03-15 23:36:05 +09:00
2015-07-21 14:23:59 +03:00
2014-04-10 19:07:43 +09:00
2015-06-20 12:24:40 -07:00
2015-07-19 16:42:32 +09:00
2014-09-02 14:53:39 -07:00
2015-04-19 10:52:15 +09:00
2014-11-13 00:21:12 +01:00
2014-12-26 07:03:39 +09:00
2015-07-19 16:59:01 +09:00
2015-08-04 08:55:15 -04:00
2015-04-21 09:28:01 -07:00
2015-07-22 12:00:35 +02:00
2015-08-04 13:27:32 -07:00
2015-01-18 11:11:23 +00:00
2015-07-15 16:59:26 +03:00
2015-07-16 20:58:44 +03:00
2015-04-14 18:41:55 +03:00
2015-07-16 22:45:02 +03:00
2015-07-16 13:07:49 +03:00
2015-04-30 19:53:48 +02:00
2014-05-28 13:16:20 +02:00
2015-07-19 16:41:54 +09:00
2014-11-14 00:22:32 +09:00
2015-05-06 16:17:02 -07:00
2015-05-11 11:34:57 -07:00
2015-02-13 09:09:00 +01:00
2014-04-01 00:36:35 +02:00
2015-02-28 13:46:30 +05:00
2014-06-18 23:31:11 +02:00
2014-11-21 20:52:56 +09:00
2014-08-24 00:11:05 +09:00
2014-09-02 14:53:39 -07:00
2015-06-21 06:23:41 -05:00
2014-12-23 21:09:37 +01:00
2014-09-22 12:58:36 +09:00
2015-07-28 11:31:14 -04:00
2015-03-15 23:36:05 +09:00
2014-06-18 23:31:11 +02:00
2014-06-18 23:31:11 +02:00
2014-06-26 05:43:00 +02:00
2015-03-15 23:36:05 +09:00
2015-07-19 17:55:03 +09:00
2013-05-25 18:08:56 +03:00
2014-05-26 14:31:30 +02:00
2015-03-22 18:09:35 +01:00
2015-03-24 11:53:04 +01:00
2015-03-25 15:02:21 +01:00
2014-06-12 11:36:40 -05:00
2015-05-22 17:23:41 +01:00
2014-01-24 18:51:21 +01:00
2014-05-13 23:20:07 -07:00
2014-09-02 14:53:39 -07:00
2014-06-18 23:31:11 +02:00
2015-06-24 15:32:49 +09:00
2014-11-24 19:44:06 -06:00
2015-07-08 16:57:04 -04:00
2014-12-27 23:49:14 +09:00
2015-02-26 19:28:51 +09:00
2014-06-18 23:31:11 +02:00
2013-12-19 15:33:09 +04:00
2015-04-13 15:35:24 +02:00
2015-03-02 17:29:31 +08:00
2015-08-03 09:44:45 -07:00
2015-01-29 14:39:09 -08:00
2015-03-08 10:39:42 -07:00
2015-01-29 14:39:09 -08:00
2015-03-14 12:01:00 +09:00
2015-03-16 12:31:54 -06:00
2015-05-26 16:44:06 -03:00
2014-01-09 12:29:17 +04:00
2014-01-09 12:29:17 +04:00
2014-11-03 13:39:36 +01:00
2014-11-06 10:23:22 -08:00
2015-07-06 18:35:14 -05:00
2014-09-02 14:53:39 -07:00
2014-09-02 21:02:39 +02:00
2015-07-03 13:12:35 +10:00
2015-03-23 18:47:59 +01:00
2014-10-15 20:16:45 +09:00
2014-09-02 14:53:39 -07:00
2014-09-15 20:09:20 +02:00
2015-02-09 13:32:33 +01:00
2014-01-25 01:08:33 +01:00
2014-12-14 16:56:46 +00:00
2014-10-09 21:13:39 +09:00
2015-03-05 16:31:17 +01:00
2014-10-07 15:20:55 +09:00
2015-05-24 13:18:15 -04:00
2015-03-19 12:15:45 +11:00
2015-05-19 09:43:30 -06:00
2015-07-28 12:59:10 +01:00
2014-06-18 23:31:11 +02:00
2014-09-02 14:53:39 -07:00
2015-05-21 11:18:08 +02:00
2015-03-15 23:36:05 +09:00
2015-03-18 21:39:14 +01:00
2014-12-15 19:10:38 +13:00
2014-12-15 19:25:19 +13:00
2015-06-22 17:32:51 +01:00
2015-05-19 15:14:55 -04:00
2015-03-15 23:36:05 +09:00
2015-07-19 16:02:02 +02:00
2013-11-08 23:36:00 +09:00
2014-07-18 14:45:24 +09:00
2013-11-04 14:25:14 -08:00
2014-05-15 16:47:49 -05:00
2015-01-13 12:48:13 +02:00
2014-09-05 17:13:53 +09:00
2014-06-18 23:31:11 +02:00
2015-01-30 20:10:32 +01:00
2015-02-20 10:13:06 +00:00
2015-07-10 10:19:13 +02:00
2015-01-27 10:28:44 +01:00
2014-11-05 15:18:14 +05:30
2013-12-06 22:36:06 +00:00
2014-01-24 00:55:00 +01:00
2014-06-18 23:31:11 +02:00
2015-01-09 14:47:20 -06:00
2015-06-18 10:36:02 -06:00
2015-06-17 05:24:12 -04:00
2014-06-18 23:31:11 +02:00
2014-08-07 15:50:27 +09:00
2014-08-24 09:57:53 +03:00
2014-08-01 17:26:03 +09:00
2015-01-02 20:48:15 +09:00
2015-07-19 16:47:20 +09:00
2014-04-01 00:37:42 +02:00
2014-09-02 14:53:39 -07:00
2015-05-03 07:25:37 +02:00
2015-04-21 09:28:01 -07:00
2015-04-23 00:42:20 +09:00
2015-03-23 17:18:33 +09:00
2014-06-18 23:31:11 +02:00
2015-03-07 01:05:04 -05:00
2014-01-02 16:34:52 +09:00
2015-05-19 12:42:18 +09:00
2015-03-12 13:03:45 -07:00
2014-01-24 01:19:01 +01:00
2015-06-15 10:52:38 -07:00
2015-01-08 09:51:45 -07:00
2014-06-18 23:31:11 +02:00
2014-06-18 23:31:11 +02:00
2015-07-16 09:48:03 -04:00
2014-12-26 16:06:25 +09:00
2015-06-29 17:07:07 -07:00
2014-01-25 01:08:33 +01:00
2015-07-21 21:36:09 -07:00
2014-09-02 14:53:39 -07:00
2015-01-02 20:48:15 +09:00
2015-05-17 11:08:11 +00:00
2015-06-21 14:28:30 -04:00
2014-11-22 17:54:43 +01:00
2015-03-17 19:54:04 +09:00
2014-01-24 01:19:01 +01:00
2015-03-25 13:14:20 -04:00
2015-06-22 16:01:44 +02:00
2015-03-16 10:15:20 +13:00
2014-04-28 23:55:46 +02:00
2014-11-11 12:33:12 -05:00
2014-07-20 12:13:28 +02:00
2014-05-11 11:45:26 +02:00
2015-07-23 14:17:13 +01:00
2015-05-27 19:43:27 -03:00
2015-04-20 02:16:35 -03:00
2015-08-02 15:16:29 -07:00
2015-04-02 14:45:34 -03:00
2014-06-18 23:31:11 +02:00
2015-04-30 13:20:57 +04:00
2014-08-30 10:22:37 +09:00
2015-02-26 15:52:44 +02:00
2015-02-24 11:23:28 +13:00
2014-01-27 21:40:20 -05:00
2015-05-07 18:19:36 +02:00
2014-07-17 19:20:44 +01:00
2015-07-20 19:45:21 +03:00
2015-01-02 20:48:15 +09:00
2014-11-12 20:53:16 +01:00
2015-06-24 22:58:03 +09:00
2015-01-26 22:59:00 -06:00
2014-04-01 00:36:47 +02:00
2015-02-16 17:23:00 +13:00
2015-05-29 13:10:45 +01:00
2014-12-18 07:46:43 -05:00
2015-08-03 10:41:58 +02:00
2015-08-02 19:35:27 -03:00
2014-08-03 04:47:28 +08:00
2015-05-27 20:56:08 +09:00
2013-11-11 22:31:21 +09:00
2014-09-16 00:20:51 +02:00
2015-07-25 18:17:40 -04:00
2014-04-28 22:00:50 +02:00
2014-12-13 22:09:05 +09:00
2014-06-19 16:56:50 +02:00
2015-02-02 11:29:48 +01:00
2014-08-05 11:06:19 +08:00
2015-01-17 00:08:09 +09:00
2015-07-26 20:15:28 +02:00
2015-07-28 18:21:50 +01:00
2014-12-16 10:54:37 +00:00
2014-06-18 23:31:11 +02:00
2014-08-01 06:49:29 +02:00
2014-11-23 22:12:48 +00:00
2015-06-11 20:39:38 -03:00
2014-11-08 01:52:05 +01:00
2015-07-21 19:58:02 +02:00
2014-05-11 21:10:43 +02:00
2015-02-16 10:46:08 -05:00
2014-11-13 16:45:45 -05:00
2014-09-02 14:53:39 -07:00
2014-09-16 04:11:30 +02:00
2015-06-08 10:12:00 -07:00
2015-06-08 11:15:26 -07:00
2015-04-21 14:46:57 +09:00
2015-03-22 18:58:43 +01:00
2015-04-18 02:16:32 -03:00
2015-07-21 08:06:31 +03:00
2015-04-07 14:46:59 +09:00
2014-04-01 00:36:25 +02:00
2014-09-10 17:12:57 +09:00
2015-07-02 14:51:59 +02:00
2015-03-15 23:36:05 +09:00
2015-04-16 14:54:00 -07:00
2015-06-13 22:45:59 +09:00
2014-06-16 04:25:18 +02:00
2014-08-23 23:23:49 +09:00
2015-07-19 21:56:28 +09:00
2015-07-30 09:54:07 +01:00
2015-03-23 01:32:25 +09:00
2015-03-17 10:15:54 +08:00
2015-08-05 01:22:34 -07:00
2015-07-06 00:33:04 +09:00
2014-04-04 12:26:32 +09:00
2014-09-02 14:53:39 -07:00
2014-05-30 12:34:46 -07:00
2014-10-14 07:49:02 +09:00
2014-12-01 22:06:23 +09:00
2015-07-19 17:15:30 +09:00
2015-04-01 17:26:39 -07:00
2014-11-02 21:13:02 +09:00
2015-06-15 11:42:23 +02:00
2014-09-02 14:53:39 -07:00
2013-08-07 18:02:05 +03:00
2014-11-23 23:41:33 -05:00
2014-12-06 12:09:45 +09:00
2015-06-12 18:02:29 +09:00
2015-03-03 07:03:28 +09:00
2014-09-20 10:10:07 +02:00
2015-01-07 14:02:42 -02:00
2015-06-23 18:36:36 +03:00
2014-09-02 14:53:39 -07:00
2015-07-28 15:09:44 +01:00
2014-11-23 14:09:46 +01:00
2014-09-29 18:18:00 +10:00
2015-01-18 11:11:23 +00:00
2015-06-15 00:25:15 -03:00
2014-07-17 21:21:02 +09:00
2014-08-24 09:57:53 +03:00
2015-08-05 13:27:04 +01:00
2014-12-17 15:29:34 -05:00
2015-05-29 15:47:07 +07:00
2014-06-18 23:31:11 +02:00
2014-06-18 23:31:11 +02:00
2014-08-24 09:57:53 +03:00
2014-10-29 12:09:38 -04:00
2015-06-12 14:00:31 +03:00
2015-03-30 16:24:42 -04:00
2014-12-11 23:22:37 +09:00
2015-03-21 16:18:45 +01:00
2014-09-27 17:25:03 +01:00
2013-09-02 20:07:31 +01:00
2015-05-24 12:12:10 -04:00
2015-08-03 09:56:49 -07:00
2015-07-19 17:51:13 +09:00
2015-03-22 20:39:45 +00:00
2014-11-05 14:39:41 +09:00
2014-06-18 23:31:11 +02:00
2014-11-05 14:39:41 +09:00
2014-06-18 23:31:11 +02:00
2015-08-04 11:33:59 +01:00
2015-03-19 16:59:53 +01:00
2015-03-31 20:54:00 +02:00
2014-08-07 15:50:27 +09:00
2015-06-05 20:41:14 -04:00
2015-05-27 15:16:53 +01:00
2014-05-22 14:41:57 -07:00
2015-03-23 13:46:51 -05:00
2015-01-02 17:49:35 +02:00
2015-01-05 09:58:05 -05:00
2015-06-02 10:35:36 -07:00
2015-03-19 16:59:53 +01:00
2015-07-20 19:37:28 +03:00
2014-11-13 16:13:35 +09:00
2015-04-28 16:21:00 -05:00
2014-11-18 17:26:33 +01:00
2015-07-16 19:48:28 +09:00
2015-07-21 00:10:40 +02:00
2015-07-21 00:10:40 +02:00
2014-06-18 23:31:11 +02:00
2015-02-26 10:46:05 +01:00
2015-04-16 13:47:44 -07:00
2014-05-25 16:50:42 -04:00
2015-06-30 00:25:14 +10:00
2014-06-18 23:31:11 +02:00
2015-02-15 18:42:50 -05:00
2015-07-05 15:56:44 +06:00
2014-01-24 01:56:27 +01:00
2014-06-18 23:31:11 +02:00
2015-07-03 16:05:38 -07:00
2014-10-29 20:07:27 +08:00
2015-06-03 10:31:30 +09:00
2015-05-07 10:28:05 +02:00
2014-06-18 23:31:11 +02:00
2014-12-25 09:29:28 +09:00
2014-09-25 01:40:38 +01:00
2015-05-07 11:29:14 +06:00
2014-09-02 14:53:39 -07:00
2015-07-23 11:13:45 -07:00
2014-04-28 23:48:34 +02:00
2015-05-16 08:07:10 -06:00
2014-12-08 15:23:50 +01:00
2015-01-16 11:29:11 +01:00
2014-08-02 21:59:16 +09:00
2015-07-07 14:38:02 +09:00
2014-09-02 14:53:39 -07:00
2015-01-16 21:13:44 +13:00
2015-05-31 11:05:24 +10:00
2013-08-07 16:59:39 +03:00
2015-06-19 18:37:18 +02:00
2014-08-24 09:57:53 +03:00
2014-11-08 12:45:12 -05:00
2015-01-18 11:11:23 +00:00
2015-05-19 16:40:08 -06:00
2015-04-21 23:27:50 +09:00
2015-04-20 17:30:50 -06:00
2014-04-03 09:31:52 +09:00
2013-09-11 16:47:31 +03:00
2014-08-29 14:34:33 +01:00
2014-11-13 11:47:03 +09:00
2014-02-25 16:32:43 -08:00
2015-03-29 12:44:31 -04:00
2015-04-29 23:39:43 +04:00
2014-09-02 14:53:39 -07:00
2015-01-14 11:22:52 +09:00
2014-11-20 22:13:48 +01:00
2015-02-20 14:12:02 -05:00
2015-07-19 15:48:05 +02:00
2014-12-01 14:29:32 +09:00
2015-07-06 00:44:30 +09:00
2015-04-17 00:57:15 +00:00
2015-07-16 19:23:42 +09:00
2015-05-11 11:29:10 -04:00
2015-01-12 11:24:20 +09:00
2014-09-24 14:32:25 -07:00
2015-06-09 11:06:18 +02:00
2015-06-02 20:12:44 +02:00
2014-08-07 15:01:57 +09:00
2014-10-07 15:04:23 +09:00
2014-12-30 00:32:11 +08:00
2015-04-07 11:54:15 -06:00
2015-04-10 11:08:40 +01:00
2015-03-30 16:41:03 +02:00
2014-11-06 01:04:01 +09:00
2015-06-02 11:24:36 +02:00
2014-06-18 23:31:11 +02:00
2015-01-02 20:48:15 +09:00
2014-06-18 23:31:11 +02:00
2015-02-25 00:28:03 +01:00
2015-05-23 01:24:25 -03:00
2015-04-28 23:48:03 -05:00
2015-07-19 17:58:22 +09:00
2015-08-04 00:34:00 +09:00
2015-07-21 00:20:50 +09:00
2015-07-21 00:20:50 +09:00
2015-07-20 00:57:57 +03:00

DefinitelyTyped Build Status

Join the chat at https://gitter.im/borisyankov/DefinitelyTyped

The repository for high quality TypeScript type definitions.

For more information see the definitelytyped.org website.

Usage

Include a line like this:

/// <reference path="jquery.d.ts" />

Contributions

DefinitelyTyped only works because of contributions by users like you!

Please see the contribution guide on how to contribute to DefinitelyTyped.

How to get the definitions

List of definitions

Requested definitions

Here is are the currently requested definitions.

Licence

This project is licensed under the MIT license.

Copyrights on the definition files are respective of each contributor listed at the beginning of each definition file.

Analytics

S
Description
The repository for high quality TypeScript type definitions.
Readme MIT
98 MiB
Languages
TypeScript 100%