From a7afe03acb2dffb46a336d3a40f85cc93849f508 Mon Sep 17 00:00:00 2001 From: Hraban Luyat Date: Fri, 21 Nov 2014 17:46:05 +0100 Subject: [PATCH] Specify structure $.fn.serializeArray() return val $.fn.serializeArray returns an array of { name: string; value: string; } elements. This patch declares that type explicitly, instead of Object[]. --- jquery/jquery.d.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 8b99642877..ad6140ace8 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -629,6 +629,14 @@ interface JQueryCoordinates { top: number; } +/** + * Elements in the array returned by serializeArray() + */ +interface JQuerySerializeArrayElement { + name: string; + value: string; +} + interface JQueryAnimationOptions { /** * A string or number determining how long the animation will run. @@ -1321,7 +1329,7 @@ interface JQuery { /** * Encode a set of form elements as an array of names and values. */ - serializeArray(): Object[]; + serializeArray(): JQuerySerializeArrayElement[]; /** * Adds the specified class(es) to each of the set of matched elements.