1
1

jquery.d.ts 182 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782
  1. // Type definitions for jQuery 1.10.x / 2.0.x
  2. // Project: http://jquery.com/
  3. // Definitions by: Boris Yankov <https://github.com/borisyankov/>, Christian Hoffmeister <https://github.com/choffmeister>, Steve Fenton <https://github.com/Steve-Fenton>, Diullei Gomes <https://github.com/Diullei>, Tass Iliopoulos <https://github.com/tasoili>, Jason Swearingen <https://github.com/jasons-novaleaf>, Sean Hill <https://github.com/seanski>, Guus Goossens <https://github.com/Guuz>, Kelly Summerlin <https://github.com/ksummerlin>, Basarat Ali Syed <https://github.com/basarat>, Nicholas Wolverson <https://github.com/nwolverson>, Derek Cicerone <https://github.com/derekcicerone>, Andrew Gaspar <https://github.com/AndrewGaspar>, James Harrison Fisher <https://github.com/jameshfisher>, Seikichi Kondo <https://github.com/seikichi>, Benjamin Jackman <https://github.com/benjaminjackman>, Poul Sorensen <https://github.com/s093294>, Josh Strobl <https://github.com/JoshStrobl>, John Reilly <https://github.com/johnnyreilly/>, Dick van den Brink <https://github.com/DickvdBrink>, Thomas Schulz <https://github.com/King2500>
  4. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
  5. /* *****************************************************************************
  6. Copyright (c) Microsoft Corporation. All rights reserved.
  7. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  8. this file except in compliance with the License. You may obtain a copy of the
  9. License at http://www.apache.org/licenses/LICENSE-2.0
  10. THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  11. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  12. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  13. MERCHANTABLITY OR NON-INFRINGEMENT.
  14. See the Apache Version 2.0 License for specific language governing permissions
  15. and limitations under the License.
  16. ***************************************************************************** */
  17. /**
  18. * Interface for the AJAX setting that will configure the AJAX request
  19. * @see {@link https://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings}
  20. */
  21. interface JQueryAjaxSettings {
  22. /**
  23. * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method.
  24. */
  25. accepts?: any;
  26. /**
  27. * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success().
  28. */
  29. async?: boolean;
  30. /**
  31. * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request.
  32. */
  33. beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any;
  34. /**
  35. * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET.
  36. */
  37. cache?: boolean;
  38. /**
  39. * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
  40. */
  41. complete? (jqXHR: JQueryXHR, textStatus: string): any;
  42. /**
  43. * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5)
  44. */
  45. contents?: { [key: string]: any; };
  46. //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false"
  47. // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/742
  48. /**
  49. * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding.
  50. */
  51. contentType?: any;
  52. /**
  53. * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax).
  54. */
  55. context?: any;
  56. /**
  57. * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5)
  58. */
  59. converters?: { [key: string]: any; };
  60. /**
  61. * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5)
  62. */
  63. crossDomain?: boolean;
  64. /**
  65. * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be key-value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below).
  66. */
  67. data?: any;
  68. /**
  69. * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter.
  70. */
  71. dataFilter? (data: any, ty: any): any;
  72. /**
  73. * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string).
  74. */
  75. dataType?: string;
  76. /**
  77. * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event.
  78. */
  79. error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any;
  80. /**
  81. * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events.
  82. */
  83. global?: boolean;
  84. /**
  85. * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5)
  86. */
  87. headers?: { [key: string]: any; };
  88. /**
  89. * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data.
  90. */
  91. ifModified?: boolean;
  92. /**
  93. * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1)
  94. */
  95. isLocal?: boolean;
  96. /**
  97. * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" }
  98. */
  99. jsonp?: any;
  100. /**
  101. * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function.
  102. */
  103. jsonpCallback?: any;
  104. /**
  105. * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0)
  106. */
  107. method?: string;
  108. /**
  109. * A MIME type to override the XHR MIME type. (version added: 1.5.1)
  110. */
  111. mimeType?: string;
  112. /**
  113. * A password to be used with XMLHttpRequest in response to an HTTP access authentication request.
  114. */
  115. password?: string;
  116. /**
  117. * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false.
  118. */
  119. processData?: boolean;
  120. /**
  121. * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script.
  122. */
  123. scriptCharset?: string;
  124. /**
  125. * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5)
  126. */
  127. statusCode?: { [key: string]: any; };
  128. /**
  129. * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
  130. */
  131. success? (data: any, textStatus: string, jqXHR: JQueryXHR): any;
  132. /**
  133. * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period.
  134. */
  135. timeout?: number;
  136. /**
  137. * Set this to true if you wish to use the traditional style of parameter serialization.
  138. */
  139. traditional?: boolean;
  140. /**
  141. * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.
  142. */
  143. type?: string;
  144. /**
  145. * A string containing the URL to which the request is sent.
  146. */
  147. url?: string;
  148. /**
  149. * A username to be used with XMLHttpRequest in response to an HTTP access authentication request.
  150. */
  151. username?: string;
  152. /**
  153. * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory.
  154. */
  155. xhr?: any;
  156. /**
  157. * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1)
  158. */
  159. xhrFields?: { [key: string]: any; };
  160. }
  161. /**
  162. * Interface for the jqXHR object
  163. * @see {@link https://api.jquery.com/jQuery.ajax/#jqXHR}
  164. */
  165. interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> {
  166. /**
  167. * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5).
  168. */
  169. overrideMimeType(mimeType: string): any;
  170. /**
  171. * Cancel the request.
  172. *
  173. * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled"
  174. */
  175. abort(statusText?: string): void;
  176. /**
  177. * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details.
  178. */
  179. then<R>(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => R|JQueryPromise<R>, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise<R>;
  180. /**
  181. * Property containing the parsed response if the response content type is json
  182. */
  183. responseJSON?: any;
  184. /**
  185. * A function to be called if the request fails.
  186. */
  187. error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void;
  188. }
  189. /**
  190. * Interface for the JQuery callback
  191. * @see {@link https://api.jquery.com/category/callbacks-object/}
  192. */
  193. interface JQueryCallback {
  194. /**
  195. * Add a callback or a collection of callbacks to a callback list.
  196. *
  197. * @param callbacks A function, or array of functions, that are to be added to the callback list.
  198. * @see {@link https://api.jquery.com/callbacks.add/}
  199. */
  200. add(callbacks: Function): JQueryCallback;
  201. /**
  202. * Add a callback or a collection of callbacks to a callback list.
  203. *
  204. * @param callbacks A function, or array of functions, that are to be added to the callback list.
  205. * @see {@link https://api.jquery.com/callbacks.add/}
  206. */
  207. add(callbacks: Function[]): JQueryCallback;
  208. /**
  209. * Disable a callback list from doing anything more.
  210. * @see {@link https://api.jquery.com/callbacks.disable/}
  211. */
  212. disable(): JQueryCallback;
  213. /**
  214. * Determine if the callbacks list has been disabled.
  215. * @see {@link https://api.jquery.com/callbacks.disabled/}
  216. */
  217. disabled(): boolean;
  218. /**
  219. * Remove all of the callbacks from a list.
  220. * @see {@link https://api.jquery.com/callbacks.empty/}
  221. */
  222. empty(): JQueryCallback;
  223. /**
  224. * Call all of the callbacks with the given arguments
  225. *
  226. * @param arguments The argument or list of arguments to pass back to the callback list.
  227. * @see {@link https://api.jquery.com/callbacks.fire/}
  228. */
  229. fire(...arguments: any[]): JQueryCallback;
  230. /**
  231. * Determine if the callbacks have already been called at least once.
  232. * @see {@link https://api.jquery.com/callbacks.fired/}
  233. */
  234. fired(): boolean;
  235. /**
  236. * Call all callbacks in a list with the given context and arguments.
  237. *
  238. * @param context A reference to the context in which the callbacks in the list should be fired.
  239. * @param arguments An argument, or array of arguments, to pass to the callbacks in the list.
  240. * @see {@link https://api.jquery.com/callbacks.fireWith/}
  241. */
  242. fireWith(context?: any, args?: any[]): JQueryCallback;
  243. /**
  244. * Determine whether a supplied callback is in a list
  245. *
  246. * @param callback The callback to search for.
  247. * @see {@link https://api.jquery.com/callbacks.has/}
  248. */
  249. has(callback: Function): boolean;
  250. /**
  251. * Lock a callback list in its current state.
  252. * @see {@link https://api.jquery.com/callbacks.lock/}
  253. */
  254. lock(): JQueryCallback;
  255. /**
  256. * Determine if the callbacks list has been locked.
  257. * @see {@link https://api.jquery.com/callbacks.locked/}
  258. */
  259. locked(): boolean;
  260. /**
  261. * Remove a callback or a collection of callbacks from a callback list.
  262. *
  263. * @param callbacks A function, or array of functions, that are to be removed from the callback list.
  264. * @see {@link https://api.jquery.com/callbacks.remove/}
  265. */
  266. remove(callbacks: Function): JQueryCallback;
  267. /**
  268. * Remove a callback or a collection of callbacks from a callback list.
  269. *
  270. * @param callbacks A function, or array of functions, that are to be removed from the callback list.
  271. * @see {@link https://api.jquery.com/callbacks.remove/}
  272. */
  273. remove(callbacks: Function[]): JQueryCallback;
  274. }
  275. /**
  276. * Allows jQuery Promises to interop with non-jQuery promises
  277. */
  278. interface JQueryGenericPromise<T> {
  279. /**
  280. * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
  281. *
  282. * @param doneFilter A function that is called when the Deferred is resolved.
  283. * @param failFilter An optional function that is called when the Deferred is rejected.
  284. * @see {@link https://api.jquery.com/deferred.then/#deferred-then-doneFilter-failFilter-progressFilter}
  285. */
  286. then<U>(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise<U>, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
  287. /**
  288. * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
  289. *
  290. * @param doneFilter A function that is called when the Deferred is resolved.
  291. * @param failFilter An optional function that is called when the Deferred is rejected.
  292. * @see {@link https://api.jquery.com/deferred.then/#deferred-then-doneFilter-failFilter-progressFilter}
  293. */
  294. then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<void>;
  295. }
  296. /**
  297. * Interface for the JQuery promise/deferred callbacks
  298. */
  299. interface JQueryPromiseCallback<T> {
  300. (value?: T, ...args: any[]): void;
  301. }
  302. interface JQueryPromiseOperator<T, U> {
  303. (callback1: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...callbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<U>;
  304. }
  305. /**
  306. * Interface for the JQuery promise, part of callbacks
  307. * @see {@link https://api.jquery.com/category/deferred-object/}
  308. */
  309. interface JQueryPromise<T> extends JQueryGenericPromise<T> {
  310. /**
  311. * Determine the current state of a Deferred object.
  312. * @see {@link https://api.jquery.com/deferred.state/}
  313. */
  314. state(): string;
  315. /**
  316. * Add handlers to be called when the Deferred object is either resolved or rejected.
  317. *
  318. * @param alwaysCallback1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
  319. * @param alwaysCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
  320. * @see {@link https://api.jquery.com/deferred.always/}
  321. */
  322. always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
  323. /**
  324. * Add handlers to be called when the Deferred object is resolved.
  325. *
  326. * @param doneCallback1 A function, or array of functions, that are called when the Deferred is resolved.
  327. * @param doneCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
  328. * @see {@link https://api.jquery.com/deferred.done/}
  329. */
  330. done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryPromise<T>;
  331. /**
  332. * Add handlers to be called when the Deferred object is rejected.
  333. *
  334. * @param failCallback1 A function, or array of functions, that are called when the Deferred is rejected.
  335. * @param failCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
  336. * @see {@link https://api.jquery.com/deferred.fail/}
  337. */
  338. fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
  339. /**
  340. * Add handlers to be called when the Deferred object generates progress notifications.
  341. *
  342. * @param progressCallback1 A function, or array of functions, to be called when the Deferred generates progress notifications.
  343. * @param progressCallbackN Optional additional functions, or arrays of functions, to be called when the Deferred generates progress notifications.
  344. * @see {@link https://api.jquery.com/deferred.progress/}
  345. */
  346. progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
  347. // Deprecated - given no typings
  348. pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
  349. /**
  350. * Return a Deferred's Promise object.
  351. *
  352. * @param target Object onto which the promise methods have to be attached
  353. * @see {@link https://api.jquery.com/deferred.promise/}
  354. */
  355. promise(target?: any): JQueryPromise<T>;
  356. }
  357. /**
  358. * Interface for the JQuery deferred, part of callbacks
  359. * @see {@link https://api.jquery.com/category/deferred-object/}
  360. */
  361. interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
  362. /**
  363. * Determine the current state of a Deferred object.
  364. * @see {@link https://api.jquery.com/deferred.state/}
  365. */
  366. state(): string;
  367. /**
  368. * Add handlers to be called when the Deferred object is either resolved or rejected.
  369. *
  370. * @param alwaysCallback1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
  371. * @param alwaysCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
  372. * @see {@link https://api.jquery.com/deferred.always/}
  373. */
  374. always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
  375. /**
  376. * Add handlers to be called when the Deferred object is resolved.
  377. *
  378. * @param doneCallback1 A function, or array of functions, that are called when the Deferred is resolved.
  379. * @param doneCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
  380. * @see {@link https://api.jquery.com/deferred.done/}
  381. */
  382. done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryDeferred<T>;
  383. /**
  384. * Add handlers to be called when the Deferred object is rejected.
  385. *
  386. * @param failCallback1 A function, or array of functions, that are called when the Deferred is rejected.
  387. * @param failCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
  388. * @see {@link https://api.jquery.com/deferred.fail/}
  389. */
  390. fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
  391. /**
  392. * Add handlers to be called when the Deferred object generates progress notifications.
  393. *
  394. * @param progressCallback1 A function, or array of functions, to be called when the Deferred generates progress notifications.
  395. * @param progressCallbackN Optional additional functions, or arrays of functions, to be called when the Deferred generates progress notifications.
  396. * @see {@link https://api.jquery.com/deferred.progress/}
  397. */
  398. progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
  399. /**
  400. * Call the progressCallbacks on a Deferred object with the given args.
  401. *
  402. * @param args Optional arguments that are passed to the progressCallbacks.
  403. * @see {@link https://api.jquery.com/deferred.notify/}
  404. */
  405. notify(value?: any, ...args: any[]): JQueryDeferred<T>;
  406. /**
  407. * Call the progressCallbacks on a Deferred object with the given context and args.
  408. *
  409. * @param context Context passed to the progressCallbacks as the this object.
  410. * @param args Optional arguments that are passed to the progressCallbacks.
  411. * @see {@link https://api.jquery.com/deferred.notifyWith/}
  412. */
  413. notifyWith(context: any, args?: any[]): JQueryDeferred<T>;
  414. /**
  415. * Reject a Deferred object and call any failCallbacks with the given args.
  416. *
  417. * @param args Optional arguments that are passed to the failCallbacks.
  418. * @see {@link https://api.jquery.com/deferred.reject/}
  419. */
  420. reject(value?: any, ...args: any[]): JQueryDeferred<T>;
  421. /**
  422. * Reject a Deferred object and call any failCallbacks with the given context and args.
  423. *
  424. * @param context Context passed to the failCallbacks as the this object.
  425. * @param args An optional array of arguments that are passed to the failCallbacks.
  426. * @see {@link https://api.jquery.com/deferred.rejectWith/}
  427. */
  428. rejectWith(context: any, args?: any[]): JQueryDeferred<T>;
  429. /**
  430. * Resolve a Deferred object and call any doneCallbacks with the given args.
  431. *
  432. * @param value First argument passed to doneCallbacks.
  433. * @param args Optional subsequent arguments that are passed to the doneCallbacks.
  434. * @see {@link https://api.jquery.com/deferred.resolve/}
  435. */
  436. resolve(value?: T, ...args: any[]): JQueryDeferred<T>;
  437. /**
  438. * Resolve a Deferred object and call any doneCallbacks with the given context and args.
  439. *
  440. * @param context Context passed to the doneCallbacks as the this object.
  441. * @param args An optional array of arguments that are passed to the doneCallbacks.
  442. * @see {@link https://api.jquery.com/deferred.resolveWith/}
  443. */
  444. resolveWith(context: any, args?: T[]): JQueryDeferred<T>;
  445. /**
  446. * Return a Deferred's Promise object.
  447. *
  448. * @param target Object onto which the promise methods have to be attached
  449. * @see {@link https://api.jquery.com/deferred.promise/}
  450. */
  451. promise(target?: any): JQueryPromise<T>;
  452. // Deprecated - given no typings
  453. pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
  454. }
  455. /**
  456. * Interface of the JQuery extension of the W3C event object
  457. * @see {@link https://api.jquery.com/category/events/event-object/}
  458. */
  459. interface BaseJQueryEventObject extends Event {
  460. /**
  461. * The current DOM element within the event bubbling phase.
  462. * @see {@link https://api.jquery.com/event.currentTarget/}
  463. */
  464. currentTarget: Element;
  465. /**
  466. * An optional object of data passed to an event method when the current executing handler is bound.
  467. * @see {@link https://api.jquery.com/event.data/}
  468. */
  469. data: any;
  470. /**
  471. * The element where the currently-called jQuery event handler was attached.
  472. * @see {@link https://api.jquery.com/event.delegateTarget/}
  473. */
  474. delegateTarget: Element;
  475. /**
  476. * Returns whether event.preventDefault() was ever called on this event object.
  477. * @see {@link https://api.jquery.com/event.isDefaultPrevented/}
  478. */
  479. isDefaultPrevented(): boolean;
  480. /**
  481. * Returns whether event.stopImmediatePropagation() was ever called on this event object.
  482. * @see {@link https://api.jquery.com/event.isImmediatePropagationStopped/}
  483. */
  484. isImmediatePropagationStopped(): boolean;
  485. /**
  486. * Returns whether event.stopPropagation() was ever called on this event object.
  487. * @see {@link https://api.jquery.com/event.isPropagationStopped/}
  488. */
  489. isPropagationStopped(): boolean;
  490. /**
  491. * The module specified when the event was triggered.
  492. * @see {@link https://api.jquery.com/event.module/}
  493. */
  494. module: string;
  495. /**
  496. * The browser's original Event object.
  497. * @see {@link https://api.jquery.com/category/events/event-object/}
  498. */
  499. originalEvent: Event;
  500. /**
  501. * If this method is called, the default action of the event will not be triggered.
  502. * @see {@link https://api.jquery.com/event.preventDefault/}
  503. */
  504. preventDefault(): any;
  505. /**
  506. * The other DOM element involved in the event, if any.
  507. * @see {@link https://api.jquery.com/event.relatedTarget/}
  508. */
  509. relatedTarget: Element;
  510. /**
  511. * The last value returned by an event handler that was triggered by this event, unless the value was undefined.
  512. * @see {@link https://api.jquery.com/event.result/}
  513. */
  514. result: any;
  515. /**
  516. * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree.
  517. * @see {@link https://api.jquery.com/event.stopImmediatePropagation/}
  518. */
  519. stopImmediatePropagation(): void;
  520. /**
  521. * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
  522. * @see {@link https://api.jquery.com/event.stopPropagation/}
  523. */
  524. stopPropagation(): void;
  525. /**
  526. * The DOM element that initiated the event.
  527. * @see {@link https://api.jquery.com/event.target/}
  528. */
  529. target: Element;
  530. /**
  531. * The mouse position relative to the left edge of the document.
  532. * @see {@link https://api.jquery.com/event.pageX/}
  533. */
  534. pageX: number;
  535. /**
  536. * The mouse position relative to the top edge of the document.
  537. * @see {@link https://api.jquery.com/event.pageY/}
  538. */
  539. pageY: number;
  540. /**
  541. * For key or mouse events, this property indicates the specific key or button that was pressed.
  542. * @see {@link https://api.jquery.com/event.which/}
  543. */
  544. which: number;
  545. /**
  546. * Indicates whether the META key was pressed when the event fired.
  547. * @see {@link https://api.jquery.com/event.metaKey/}
  548. */
  549. metaKey: boolean;
  550. }
  551. interface JQueryInputEventObject extends BaseJQueryEventObject {
  552. altKey: boolean;
  553. ctrlKey: boolean;
  554. metaKey: boolean;
  555. shiftKey: boolean;
  556. }
  557. interface JQueryMouseEventObject extends JQueryInputEventObject {
  558. button: number;
  559. clientX: number;
  560. clientY: number;
  561. offsetX: number;
  562. offsetY: number;
  563. pageX: number;
  564. pageY: number;
  565. screenX: number;
  566. screenY: number;
  567. }
  568. interface JQueryKeyEventObject extends JQueryInputEventObject {
  569. char: any;
  570. charCode: number;
  571. key: any;
  572. keyCode: number;
  573. }
  574. interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{
  575. }
  576. /**
  577. * A collection of properties that represent the presence of different browser features or bugs.
  578. *
  579. * Intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally
  580. * to improve page startup performance. For your own project's feature-detection needs, we strongly recommend the
  581. * use of an external library such as {@link http://modernizr.com/|Modernizr} instead of dependency on properties
  582. * in jQuery.support.
  583. *
  584. * @deprecated since version 1.9
  585. */
  586. interface JQuerySupport {
  587. ajax?: boolean;
  588. boxModel?: boolean;
  589. changeBubbles?: boolean;
  590. checkClone?: boolean;
  591. checkOn?: boolean;
  592. cors?: boolean;
  593. cssFloat?: boolean;
  594. hrefNormalized?: boolean;
  595. htmlSerialize?: boolean;
  596. leadingWhitespace?: boolean;
  597. noCloneChecked?: boolean;
  598. noCloneEvent?: boolean;
  599. opacity?: boolean;
  600. optDisabled?: boolean;
  601. optSelected?: boolean;
  602. scriptEval? (): boolean;
  603. style?: boolean;
  604. submitBubbles?: boolean;
  605. tbody?: boolean;
  606. }
  607. interface JQueryParam {
  608. /**
  609. * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
  610. *
  611. * @param obj An array or object to serialize.
  612. */
  613. (obj: any): string;
  614. /**
  615. * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
  616. *
  617. * @param obj An array or object to serialize.
  618. * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
  619. */
  620. (obj: any, traditional: boolean): string;
  621. }
  622. /**
  623. * The interface used to construct jQuery events (with $.Event). It is
  624. * defined separately instead of inline in JQueryStatic to allow
  625. * overriding the construction function with specific strings
  626. * returning specific event objects.
  627. */
  628. interface JQueryEventConstructor {
  629. (name: string, eventProperties?: any): JQueryEventObject;
  630. new (name: string, eventProperties?: any): JQueryEventObject;
  631. }
  632. /**
  633. * The interface used to specify coordinates.
  634. */
  635. interface JQueryCoordinates {
  636. left: number;
  637. top: number;
  638. }
  639. /**
  640. * Elements in the array returned by serializeArray()
  641. */
  642. interface JQuerySerializeArrayElement {
  643. name: string;
  644. value: string;
  645. }
  646. /**
  647. * @see {@link https://api.jquery.com/animate/}
  648. */
  649. interface JQueryAnimationOptions {
  650. /**
  651. * A string or number determining how long the animation will run.
  652. */
  653. duration?: any;
  654. /**
  655. * A string indicating which easing function to use for the transition.
  656. */
  657. easing?: string;
  658. /**
  659. * A function to call once the animation is complete.
  660. */
  661. complete?: Function;
  662. /**
  663. * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set.
  664. */
  665. step?: (now: number, tween: any) => any;
  666. /**
  667. * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8)
  668. */
  669. progress?: (animation: JQueryPromise<any>, progress: number, remainingMs: number) => any;
  670. /**
  671. * A function to call when the animation begins. (version added: 1.8)
  672. */
  673. start?: (animation: JQueryPromise<any>) => any;
  674. /**
  675. * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8)
  676. */
  677. done?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
  678. /**
  679. * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8)
  680. */
  681. fail?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
  682. /**
  683. * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8)
  684. */
  685. always?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
  686. /**
  687. * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it.
  688. */
  689. queue?: any;
  690. /**
  691. * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4)
  692. */
  693. specialEasing?: Object;
  694. }
  695. interface JQueryEasingFunction {
  696. ( percent: number ): number;
  697. }
  698. interface JQueryEasingFunctions {
  699. [ name: string ]: JQueryEasingFunction;
  700. linear: JQueryEasingFunction;
  701. swing: JQueryEasingFunction;
  702. }
  703. /**
  704. * Static members of jQuery (those on $ and jQuery themselves)
  705. *
  706. * @see {@link https://api.jquery.com/Types/#jQuery}
  707. */
  708. interface JQueryStatic {
  709. /**
  710. * Perform an asynchronous HTTP (Ajax) request.
  711. *
  712. * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
  713. * @see {@link https://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings}
  714. */
  715. ajax(settings: JQueryAjaxSettings): JQueryXHR;
  716. /**
  717. * Perform an asynchronous HTTP (Ajax) request.
  718. *
  719. * @param url A string containing the URL to which the request is sent.
  720. * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
  721. * @see {@link https://api.jquery.com/jQuery.ajax/#jQuery-ajax-url-settings}
  722. */
  723. ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR;
  724. /**
  725. * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
  726. *
  727. * @param dataTypes An optional string containing one or more space-separated dataTypes
  728. * @param handler A handler to set default values for future Ajax requests.
  729. * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/}
  730. */
  731. ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
  732. /**
  733. * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
  734. *
  735. * @param handler A handler to set default values for future Ajax requests.
  736. * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/}
  737. */
  738. ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
  739. /**
  740. * Creates an object that handles the actual transmission of Ajax data.
  741. *
  742. * @param dataType A string identifying the data type to use.
  743. * @param handler A handler to return the new transport object to use with the data type provided in the first argument.
  744. * @see {@link https://api.jquery.com/jQuery.ajaxTransport/}
  745. */
  746. ajaxTransport(dataType: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
  747. ajaxSettings: JQueryAjaxSettings;
  748. /**
  749. * Set default values for future Ajax requests. Its use is not recommended.
  750. *
  751. * @param options A set of key/value pairs that configure the default Ajax request. All options are optional.
  752. * @see {@link https://api.jquery.com/jQuery.ajaxSetup/}
  753. */
  754. ajaxSetup(options: JQueryAjaxSettings): void;
  755. /**
  756. * Load data from the server using a HTTP GET request.
  757. *
  758. * @param url A string containing the URL to which the request is sent.
  759. * @param success A callback function that is executed if the request succeeds.
  760. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
  761. * @see {@link https://api.jquery.com/jQuery.get/#jQuery-get-url-data-success-dataType}
  762. */
  763. get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
  764. /**
  765. * Load data from the server using a HTTP GET request.
  766. *
  767. * @param url A string containing the URL to which the request is sent.
  768. * @param data A plain object or string that is sent to the server with the request.
  769. * @param success A callback function that is executed if the request succeeds.
  770. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
  771. * @see {@link https://api.jquery.com/jQuery.get/#jQuery-get-url-data-success-dataType}
  772. */
  773. get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
  774. /**
  775. * Load data from the server using a HTTP GET request.
  776. *
  777. * @param settings The JQueryAjaxSettings to be used for the request
  778. * @see {@link https://api.jquery.com/jQuery.get/#jQuery-get-settings}
  779. */
  780. get(settings : JQueryAjaxSettings): JQueryXHR;
  781. /**
  782. * Load JSON-encoded data from the server using a GET HTTP request.
  783. *
  784. * @param url A string containing the URL to which the request is sent.
  785. * @param success A callback function that is executed if the request succeeds.
  786. * @see {@link https://api.jquery.com/jQuery.getJSON/}
  787. */
  788. getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
  789. /**
  790. * Load JSON-encoded data from the server using a GET HTTP request.
  791. *
  792. * @param url A string containing the URL to which the request is sent.
  793. * @param data A plain object or string that is sent to the server with the request.
  794. * @param success A callback function that is executed if the request succeeds.
  795. * @see {@link https://api.jquery.com/jQuery.getJSON/}
  796. */
  797. getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
  798. /**
  799. * Load a JavaScript file from the server using a GET HTTP request, then execute it.
  800. *
  801. * @param url A string containing the URL to which the request is sent.
  802. * @param success A callback function that is executed if the request succeeds.
  803. * @see {@link https://api.jquery.com/jQuery.getScript/}
  804. */
  805. getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
  806. /**
  807. * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
  808. *
  809. * @see {@link https://api.jquery.com/jQuery.param/}
  810. */
  811. param: JQueryParam;
  812. /**
  813. * Load data from the server using a HTTP POST request.
  814. *
  815. * @param url A string containing the URL to which the request is sent.
  816. * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
  817. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
  818. * @see {@link https://api.jquery.com/jQuery.post/#jQuery-post-url-data-success-dataType}
  819. */
  820. post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
  821. /**
  822. * Load data from the server using a HTTP POST request.
  823. *
  824. * @param url A string containing the URL to which the request is sent.
  825. * @param data A plain object or string that is sent to the server with the request.
  826. * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
  827. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
  828. * @see {@link https://api.jquery.com/jQuery.post/#jQuery-post-url-data-success-dataType}
  829. */
  830. post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
  831. /**
  832. * Load data from the server using a HTTP POST request.
  833. *
  834. * @param settings The JQueryAjaxSettings to be used for the request
  835. * @see {@link https://api.jquery.com/jQuery.post/#jQuery-post-settings}
  836. */
  837. post(settings : JQueryAjaxSettings): JQueryXHR;
  838. /**
  839. * A multi-purpose callbacks list object that provides a powerful way to manage callback lists.
  840. *
  841. * @param flags An optional list of space-separated flags that change how the callback list behaves.
  842. * @see {@link https://api.jquery.com/jQuery.Callbacks/}
  843. */
  844. Callbacks(flags?: string): JQueryCallback;
  845. /**
  846. * Holds or releases the execution of jQuery's ready event.
  847. *
  848. * @param hold Indicates whether the ready hold is being requested or released
  849. * @see {@link https://api.jquery.com/jQuery.holdReady/}
  850. */
  851. holdReady(hold: boolean): void;
  852. /**
  853. * Accepts a string containing a CSS selector which is then used to match a set of elements.
  854. *
  855. * @param selector A string containing a selector expression
  856. * @param context A DOM Element, Document, or jQuery to use as context
  857. * @see {@link https://api.jquery.com/jQuery/#jQuery-selector-context}
  858. */
  859. (selector: string, context?: Element|JQuery): JQuery;
  860. /**
  861. * Accepts a string containing a CSS selector which is then used to match a set of elements.
  862. *
  863. * @param element A DOM element to wrap in a jQuery object.
  864. * @see {@link https://api.jquery.com/jQuery/#jQuery-element}
  865. */
  866. (element: Element): JQuery;
  867. /**
  868. * Accepts a string containing a CSS selector which is then used to match a set of elements.
  869. *
  870. * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object.
  871. * @see {@link https://api.jquery.com/jQuery/#jQuery-elementArray}
  872. */
  873. (elementArray: Element[]): JQuery;
  874. /**
  875. * Binds a function to be executed when the DOM has finished loading.
  876. *
  877. * @param callback A function to execute after the DOM is ready.
  878. * @see {@link https://api.jquery.com/jQuery/#jQuery-callback}
  879. */
  880. (callback: (jQueryAlias?: JQueryStatic) => any): JQuery;
  881. /**
  882. * Accepts a string containing a CSS selector which is then used to match a set of elements.
  883. *
  884. * @param object A plain object to wrap in a jQuery object.
  885. * @see {@link https://api.jquery.com/jQuery/#jQuery-object}
  886. */
  887. (object: {}): JQuery;
  888. /**
  889. * Accepts a string containing a CSS selector which is then used to match a set of elements.
  890. *
  891. * @param object An existing jQuery object to clone.
  892. * @see {@link https://api.jquery.com/jQuery/#jQuery-object}
  893. */
  894. (object: JQuery): JQuery;
  895. /**
  896. * Specify a function to execute when the DOM is fully loaded.
  897. * @see {@link https://api.jquery.com/jQuery/#jQuery}
  898. */
  899. (): JQuery;
  900. /**
  901. * Creates DOM elements on the fly from the provided string of raw HTML.
  902. *
  903. * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML.
  904. * @param ownerDocument A document in which the new elements will be created.
  905. * @see {@link https://api.jquery.com/jQuery/#jQuery-html-ownerDocument}
  906. */
  907. (html: string, ownerDocument?: Document): JQuery;
  908. /**
  909. * Creates DOM elements on the fly from the provided string of raw HTML.
  910. *
  911. * @param html A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>).
  912. * @param attributes An object of attributes, events, and methods to call on the newly-created element.
  913. * @see {@link https://api.jquery.com/jQuery/#jQuery-html-attributes}
  914. */
  915. (html: string, attributes: Object): JQuery;
  916. /**
  917. * Relinquish jQuery's control of the $ variable.
  918. *
  919. * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
  920. * @see {@link https://api.jquery.com/jQuery.noConflict/}
  921. */
  922. noConflict(removeAll?: boolean): JQueryStatic;
  923. /**
  924. * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
  925. *
  926. * @param deferreds One or more Deferred objects, or plain JavaScript objects.
  927. * @see {@link https://api.jquery.com/jQuery.when/}
  928. */
  929. when<T>(...deferreds: Array<T|JQueryPromise<T>/* as JQueryDeferred<T> */>): JQueryPromise<T>;
  930. /**
  931. * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties.
  932. * @see {@link https://api.jquery.com/jQuery.cssHooks/}
  933. */
  934. cssHooks: { [key: string]: any; };
  935. /**
  936. * An object containing all CSS properties that may be used without a unit. The .css() method uses this object to see if it may append px to unitless values.
  937. * @see {@link https://api.jquery.com/jQuery.cssNumber/}
  938. */
  939. cssNumber: any;
  940. /**
  941. * Store arbitrary data associated with the specified element. Returns the value that was set.
  942. *
  943. * @param element The DOM element to associate with the data.
  944. * @param key A string naming the piece of data to set.
  945. * @param value The new data value.
  946. * @see {@link https://api.jquery.com/jQuery.data/#jQuery-data-element-key-value}
  947. */
  948. data<T>(element: Element, key: string, value: T): T;
  949. /**
  950. * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
  951. *
  952. * @param element The DOM element to associate with the data.
  953. * @param key A string naming the piece of data to set.
  954. * @see {@link https://api.jquery.com/jQuery.data/#jQuery-data-element-key}
  955. */
  956. data(element: Element, key: string): any;
  957. /**
  958. * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
  959. *
  960. * @param element The DOM element to associate with the data.
  961. * @see {@link https://api.jquery.com/jQuery.data/#jQuery-data-element}
  962. */
  963. data(element: Element): any;
  964. /**
  965. * Execute the next function on the queue for the matched element.
  966. *
  967. * @param element A DOM element from which to remove and execute a queued function.
  968. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
  969. * @see {@link https://api.jquery.com/jQuery.dequeue/}
  970. */
  971. dequeue(element: Element, queueName?: string): void;
  972. /**
  973. * Determine whether an element has any jQuery data associated with it.
  974. *
  975. * @param element A DOM element to be checked for data.
  976. * @see {@link https://api.jquery.com/jQuery.hasData/}
  977. */
  978. hasData(element: Element): boolean;
  979. /**
  980. * Show the queue of functions to be executed on the matched element.
  981. *
  982. * @param element A DOM element to inspect for an attached queue.
  983. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
  984. * @see {@link https://api.jquery.com/jQuery.queue/#jQuery-queue-element-queueName}
  985. */
  986. queue(element: Element, queueName?: string): any[];
  987. /**
  988. * Manipulate the queue of functions to be executed on the matched element.
  989. *
  990. * @param element A DOM element where the array of queued functions is attached.
  991. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
  992. * @param newQueue An array of functions to replace the current queue contents.
  993. * @see {@link https://api.jquery.com/jQuery.queue/#jQuery-queue-element-queueName-newQueue}
  994. */
  995. queue(element: Element, queueName: string, newQueue: Function[]): JQuery;
  996. /**
  997. * Manipulate the queue of functions to be executed on the matched element.
  998. *
  999. * @param element A DOM element on which to add a queued function.
  1000. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
  1001. * @param callback The new function to add to the queue.
  1002. * @see {@link https://api.jquery.com/jQuery.queue/#jQuery-queue-element-queueName-callback}
  1003. */
  1004. queue(element: Element, queueName: string, callback: Function): JQuery;
  1005. /**
  1006. * Remove a previously-stored piece of data.
  1007. *
  1008. * @param element A DOM element from which to remove data.
  1009. * @param name A string naming the piece of data to remove.
  1010. * @see {@link https://api.jquery.com/jQuery.removeData/}
  1011. */
  1012. removeData(element: Element, name?: string): JQuery;
  1013. /**
  1014. * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.
  1015. *
  1016. * @param beforeStart A function that is called just before the constructor returns.
  1017. * @see {@link https://api.jquery.com/jQuery.Deferred/}
  1018. */
  1019. Deferred<T>(beforeStart?: (deferred: JQueryDeferred<T>) => any): JQueryDeferred<T>;
  1020. /**
  1021. * Effects
  1022. */
  1023. easing: JQueryEasingFunctions;
  1024. fx: {
  1025. tick: () => void;
  1026. /**
  1027. * The rate (in milliseconds) at which animations fire.
  1028. * @see {@link https://api.jquery.com/jQuery.fx.interval/}
  1029. */
  1030. interval: number;
  1031. stop: () => void;
  1032. speeds: { slow: number; fast: number; };
  1033. /**
  1034. * Globally disable all animations.
  1035. * @see {@link https://api.jquery.com/jQuery.fx.off/}
  1036. */
  1037. off: boolean;
  1038. step: any;
  1039. };
  1040. /**
  1041. * Takes a function and returns a new one that will always have a particular context.
  1042. *
  1043. * @param func The function whose context will be changed.
  1044. * @param context The object to which the context (this) of the function should be set.
  1045. * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
  1046. * @see {@link https://api.jquery.com/jQuery.proxy/#jQuery-proxy-function-context-additionalArguments}
  1047. */
  1048. proxy(func: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any;
  1049. /**
  1050. * Takes a function and returns a new one that will always have a particular context.
  1051. *
  1052. * @param context The object to which the context (this) of the function should be set.
  1053. * @param name The name of the function whose context will be changed (should be a property of the context object).
  1054. * @param additionalArguments Any number of arguments to be passed to the function named in the name argument.
  1055. * @see {@link https://api.jquery.com/jQuery.proxy/#jQuery-proxy-context-name-additionalArguments}
  1056. */
  1057. proxy(context: Object, name: string, ...additionalArguments: any[]): any;
  1058. Event: JQueryEventConstructor;
  1059. /**
  1060. * Takes a string and throws an exception containing it.
  1061. *
  1062. * @param message The message to send out.
  1063. * @see {@link https://api.jquery.com/jQuery.error/}
  1064. */
  1065. error(message: any): JQuery;
  1066. expr: any;
  1067. fn: any; //TODO: Decide how we want to type this
  1068. isReady: boolean;
  1069. // Properties
  1070. support: JQuerySupport;
  1071. /**
  1072. * Check to see if a DOM element is a descendant of another DOM element.
  1073. *
  1074. * @param container The DOM element that may contain the other element.
  1075. * @param contained The DOM element that may be contained by (a descendant of) the other element.
  1076. * @see {@link https://api.jquery.com/jQuery.contains/}
  1077. */
  1078. contains(container: Element, contained: Element): boolean;
  1079. /**
  1080. * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
  1081. *
  1082. * @param collection The object or array to iterate over.
  1083. * @param callback The function that will be executed on every object. Will break the loop by returning false.
  1084. * @returns the first argument, the object that is iterated.
  1085. * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-array-callback}
  1086. */
  1087. each<T>(
  1088. collection: T[],
  1089. callback: (indexInArray: number, valueOfElement: T) => boolean | void
  1090. ): T[];
  1091. /**
  1092. * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
  1093. *
  1094. * @param collection The object or array to iterate over.
  1095. * @param callback The function that will be executed on every object. Will break the loop by returning false.
  1096. * @returns the first argument, the object that is iterated.
  1097. * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-object-callback}
  1098. */
  1099. each<T extends Object>(
  1100. collection: T,
  1101. // TODO: `(keyInObject: keyof T, valueOfElement: T[keyof T])`, when TypeScript 2.1 allowed in repository
  1102. callback: (keyInObject: string, valueOfElement: any) => boolean | void
  1103. ): T;
  1104. /**
  1105. * Merge the contents of two or more objects together into the first object.
  1106. *
  1107. * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery module if it is the sole argument.
  1108. * @param object1 An object containing additional properties to merge in.
  1109. * @param objectN Additional objects containing properties to merge in.
  1110. * @see {@link https://api.jquery.com/jQuery.extend/#jQuery-extend-target-object1-objectN}
  1111. */
  1112. extend(target: any, object1?: any, ...objectN: any[]): any;
  1113. /**
  1114. * Merge the contents of two or more objects together into the first object.
  1115. *
  1116. * @param deep If true, the merge becomes recursive (aka. deep copy).
  1117. * @param target The object to extend. It will receive the new properties.
  1118. * @param object1 An object containing additional properties to merge in.
  1119. * @param objectN Additional objects containing properties to merge in.
  1120. * @see {@link https://api.jquery.com/jQuery.extend/#jQuery-extend-deep-target-object1-objectN}
  1121. */
  1122. extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any;
  1123. /**
  1124. * Execute some JavaScript code globally.
  1125. *
  1126. * @param code The JavaScript code to execute.
  1127. * @see {@link https://api.jquery.com/jQuery.globalEval/}
  1128. */
  1129. globalEval(code: string): any;
  1130. /**
  1131. * Finds the elements of an array which satisfy a filter function. The original array is not affected.
  1132. *
  1133. * @param array The array to search through.
  1134. * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object.
  1135. * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false.
  1136. * @see {@link https://api.jquery.com/jQuery.grep/}
  1137. */
  1138. grep<T>(array: T[], func: (elementOfArray?: T, indexInArray?: number) => boolean, invert?: boolean): T[];
  1139. /**
  1140. * Search for a specified value within an array and return its index (or -1 if not found).
  1141. *
  1142. * @param value The value to search for.
  1143. * @param array An array through which to search.
  1144. * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array.
  1145. * @see {@link https://api.jquery.com/jQuery.inArray/}
  1146. */
  1147. inArray<T>(value: T, array: T[], fromIndex?: number): number;
  1148. /**
  1149. * Determine whether the argument is an array.
  1150. *
  1151. * @param obj Object to test whether or not it is an array.
  1152. * @see {@link https://api.jquery.com/jQuery.isArray/}
  1153. */
  1154. isArray(obj: any): obj is Array<any>;
  1155. /**
  1156. * Check to see if an object is empty (contains no enumerable properties).
  1157. *
  1158. * @param obj The object that will be checked to see if it's empty.
  1159. * @see {@link https://api.jquery.com/jQuery.isEmptyObject/}
  1160. */
  1161. isEmptyObject(obj: any): boolean;
  1162. /**
  1163. * Determine if the argument passed is a JavaScript function object.
  1164. *
  1165. * @param obj Object to test whether or not it is a function.
  1166. * @see {@link https://api.jquery.com/jQuery.isFunction/}
  1167. */
  1168. isFunction(obj: any): obj is Function;
  1169. /**
  1170. * Determines whether its argument is a number.
  1171. *
  1172. * @param value The value to be tested.
  1173. * @see {@link https://api.jquery.com/jQuery.isNumeric/}
  1174. */
  1175. isNumeric(value: any): boolean;
  1176. /**
  1177. * Check to see if an object is a plain object (created using "{}" or "new Object").
  1178. *
  1179. * @param obj The object that will be checked to see if it's a plain object.
  1180. * @see {@link https://api.jquery.com/jQuery.isPlainObject/}
  1181. */
  1182. isPlainObject(obj: any): boolean;
  1183. /**
  1184. * Determine whether the argument is a window.
  1185. *
  1186. * @param obj Object to test whether or not it is a window.
  1187. * @see {@link https://api.jquery.com/jQuery.isWindow/}
  1188. */
  1189. isWindow(obj: any): obj is Window;
  1190. /**
  1191. * Check to see if a DOM node is within an XML document (or is an XML document).
  1192. *
  1193. * @param node The DOM node that will be checked to see if it's in an XML document.
  1194. * @see {@link https://api.jquery.com/jQuery.isXMLDoc/}
  1195. */
  1196. isXMLDoc(node: Node): boolean;
  1197. /**
  1198. * Convert an array-like object into a true JavaScript array.
  1199. *
  1200. * @param obj Any object to turn into a native Array.
  1201. * @see {@link https://api.jquery.com/jQuery.makeArray/}
  1202. */
  1203. makeArray(obj: any): any[];
  1204. /**
  1205. * Translate all items in an array or object to new array of items.
  1206. *
  1207. * @param array The Array to translate.
  1208. * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object.
  1209. * @see {@link https://api.jquery.com/jQuery.map/#jQuery-map-array-callback}
  1210. */
  1211. map<T, U>(array: T[], callback: (elementOfArray?: T, indexInArray?: number) => U): U[];
  1212. /**
  1213. * Translate all items in an array or object to new array of items.
  1214. *
  1215. * @param arrayOrObject The Array or Object to translate.
  1216. * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object.
  1217. * @see {@link https://api.jquery.com/jQuery.map/#jQuery-map-object-callback}
  1218. */
  1219. map(arrayOrObject: any, callback: (value?: any, indexOrKey?: any) => any): any;
  1220. /**
  1221. * Merge the contents of two arrays together into the first array.
  1222. *
  1223. * @param first The first array to merge, the elements of second added.
  1224. * @param second The second array to merge into the first, unaltered.
  1225. * @see {@link https://api.jquery.com/jQuery.merge/}
  1226. */
  1227. merge<T>(first: T[], second: T[]): T[];
  1228. /**
  1229. * An empty function.
  1230. * @see {@link https://api.jquery.com/jQuery.noop/}
  1231. */
  1232. noop(): any;
  1233. /**
  1234. * Return a number representing the current time.
  1235. * @see {@link https://api.jquery.com/jQuery.now/}
  1236. */
  1237. now(): number;
  1238. /**
  1239. * Takes a well-formed JSON string and returns the resulting JavaScript object.
  1240. *
  1241. * @param json The JSON string to parse.
  1242. * @see {@link https://api.jquery.com/jQuery.parseJSON/}
  1243. */
  1244. parseJSON(json: string): any;
  1245. /**
  1246. * Parses a string into an XML document.
  1247. *
  1248. * @param data a well-formed XML string to be parsed
  1249. * @see {@link https://api.jquery.com/jQuery.parseXML/}
  1250. */
  1251. parseXML(data: string): XMLDocument;
  1252. /**
  1253. * Remove the whitespace from the beginning and end of a string.
  1254. *
  1255. * @param str Remove the whitespace from the beginning and end of a string.
  1256. * @see {@link https://api.jquery.com/jQuery.trim/}
  1257. */
  1258. trim(str: string): string;
  1259. /**
  1260. * Determine the internal JavaScript [[Class]] of an object.
  1261. *
  1262. * @param obj Object to get the internal JavaScript [[Class]] of.
  1263. * @see {@link https://api.jquery.com/jQuery.type/}
  1264. */
  1265. type(obj: any): "array" | "boolean" | "date" | "error" | "function" | "null" | "number" | "object" | "regexp" | "string" | "symbol" | "undefined";
  1266. /**
  1267. * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers.
  1268. *
  1269. * @param array The Array of DOM elements.
  1270. * @see {@link https://api.jquery.com/jQuery.unique/}
  1271. */
  1272. unique<T extends Element>(array: T[]): T[];
  1273. /**
  1274. * Parses a string into an array of DOM nodes.
  1275. *
  1276. * @param data HTML string to be parsed
  1277. * @param context DOM element to serve as the context in which the HTML fragment will be created
  1278. * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
  1279. * @see {@link https://api.jquery.com/jQuery.parseHTML/}
  1280. */
  1281. parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[];
  1282. /**
  1283. * Parses a string into an array of DOM nodes.
  1284. *
  1285. * @param data HTML string to be parsed
  1286. * @param context DOM element to serve as the context in which the HTML fragment will be created
  1287. * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
  1288. * @see {@link https://api.jquery.com/jQuery.parseHTML/}
  1289. */
  1290. parseHTML(data: string, context?: Document, keepScripts?: boolean): any[];
  1291. }
  1292. /**
  1293. * The jQuery instance members
  1294. *
  1295. * @see {@link https://api.jquery.com/Types/#jQuery}
  1296. */
  1297. interface JQuery {
  1298. /**
  1299. * Register a handler to be called when Ajax requests complete. This is an AjaxEvent.
  1300. *
  1301. * @param handler The function to be invoked.
  1302. * @see {@link https://api.jquery.com/ajaxComplete/}
  1303. */
  1304. ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery;
  1305. /**
  1306. * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event.
  1307. *
  1308. * @param handler The function to be invoked.
  1309. * @see {@link https://api.jquery.com/ajaxError/}
  1310. */
  1311. ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery;
  1312. /**
  1313. * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.
  1314. *
  1315. * @param handler The function to be invoked.
  1316. * @see {@link https://api.jquery.com/ajaxSend/}
  1317. */
  1318. ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
  1319. /**
  1320. * Register a handler to be called when the first Ajax request begins. This is an Ajax Event.
  1321. *
  1322. * @param handler The function to be invoked.
  1323. * @see {@link https://api.jquery.com/ajaxStart/}
  1324. */
  1325. ajaxStart(handler: () => any): JQuery;
  1326. /**
  1327. * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.
  1328. *
  1329. * @param handler The function to be invoked.
  1330. * @see {@link https://api.jquery.com/ajaxStop/}
  1331. */
  1332. ajaxStop(handler: () => any): JQuery;
  1333. /**
  1334. * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.
  1335. *
  1336. * @param handler The function to be invoked.
  1337. * @see {@link https://api.jquery.com/ajaxSuccess/}
  1338. */
  1339. ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
  1340. /**
  1341. * Load data from the server and place the returned HTML into the matched element.
  1342. *
  1343. * @param url A string containing the URL to which the request is sent.
  1344. * @param data A plain object or string that is sent to the server with the request.
  1345. * @param complete A callback function that is executed when the request completes.
  1346. * @see {@link https://api.jquery.com/load/}
  1347. */
  1348. load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery;
  1349. /**
  1350. * Encode a set of form elements as a string for submission.
  1351. * @see {@link https://api.jquery.com/serialize/}
  1352. */
  1353. serialize(): string;
  1354. /**
  1355. * Encode a set of form elements as an array of names and values.
  1356. * @see {@link https://api.jquery.com/serializeArray/}
  1357. */
  1358. serializeArray(): JQuerySerializeArrayElement[];
  1359. /**
  1360. * Adds the specified class(es) to each of the set of matched elements.
  1361. *
  1362. * @param className One or more space-separated classes to be added to the class attribute of each matched element.
  1363. * @see {@link https://api.jquery.com/addClass/#addClass-className}
  1364. */
  1365. addClass(className: string): JQuery;
  1366. /**
  1367. * Adds the specified class(es) to each of the set of matched elements.
  1368. *
  1369. * @param func A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set.
  1370. * @see {@link https://api.jquery.com/addClass/#addClass-function}
  1371. */
  1372. addClass(func: (index: number, className: string) => string): JQuery;
  1373. /**
  1374. * Add the previous set of elements on the stack to the current set, optionally filtered by a selector.
  1375. * @see {@link https://api.jquery.com/addBack/}
  1376. */
  1377. addBack(selector?: string): JQuery;
  1378. /**
  1379. * Get the value of an attribute for the first element in the set of matched elements.
  1380. *
  1381. * @param attributeName The name of the attribute to get.
  1382. * @see {@link https://api.jquery.com/attr/#attr-attributeName}
  1383. */
  1384. attr(attributeName: string): string;
  1385. /**
  1386. * Set one or more attributes for the set of matched elements.
  1387. *
  1388. * @param attributeName The name of the attribute to set.
  1389. * @param value A value to set for the attribute. If this is `null`, the attribute will be deleted.
  1390. * @see {@link https://api.jquery.com/attr/#attr-attributeName-value}
  1391. */
  1392. attr(attributeName: string, value: string|number|null): JQuery;
  1393. /**
  1394. * Set one or more attributes for the set of matched elements.
  1395. *
  1396. * @param attributeName The name of the attribute to set.
  1397. * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments.
  1398. * @see {@link https://api.jquery.com/attr/#attr-attributeName-function}
  1399. */
  1400. attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery;
  1401. /**
  1402. * Set one or more attributes for the set of matched elements.
  1403. *
  1404. * @param attributes An object of attribute-value pairs to set.
  1405. * @see {@link https://api.jquery.com/attr/#attr-attributes}
  1406. */
  1407. attr(attributes: Object): JQuery;
  1408. /**
  1409. * Determine whether any of the matched elements are assigned the given class.
  1410. *
  1411. * @param className The class name to search for.
  1412. * @see {@link https://api.jquery.com/hasClass/}
  1413. */
  1414. hasClass(className: string): boolean;
  1415. /**
  1416. * Get the HTML contents of the first element in the set of matched elements.
  1417. * @see {@link https://api.jquery.com/html/#html}
  1418. */
  1419. html(): string;
  1420. /**
  1421. * Set the HTML contents of each element in the set of matched elements.
  1422. *
  1423. * @param htmlString A string of HTML to set as the content of each matched element.
  1424. * @see {@link https://api.jquery.com/html/#html-htmlString}
  1425. */
  1426. html(htmlString: string): JQuery;
  1427. /**
  1428. * Set the HTML contents of each element in the set of matched elements.
  1429. *
  1430. * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
  1431. * @see {@link https://api.jquery.com/html/#html-function}
  1432. */
  1433. html(func: (index: number, oldhtml: string) => string): JQuery;
  1434. /**
  1435. * Get the value of a property for the first element in the set of matched elements.
  1436. *
  1437. * @param propertyName The name of the property to get.
  1438. * @see {@link https://api.jquery.com/prop/#prop-propertyName}
  1439. */
  1440. prop(propertyName: string): any;
  1441. /**
  1442. * Set one or more properties for the set of matched elements.
  1443. *
  1444. * @param propertyName The name of the property to set.
  1445. * @param value A value to set for the property.
  1446. * @see {@link https://api.jquery.com/prop/#prop-propertyName-value}
  1447. */
  1448. prop(propertyName: string, value: string|number|boolean): JQuery;
  1449. /**
  1450. * Set one or more properties for the set of matched elements.
  1451. *
  1452. * @param properties An object of property-value pairs to set.
  1453. * @see {@link https://api.jquery.com/prop/#prop-properties}
  1454. */
  1455. prop(properties: Object): JQuery;
  1456. /**
  1457. * Set one or more properties for the set of matched elements.
  1458. *
  1459. * @param propertyName The name of the property to set.
  1460. * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element.
  1461. * @see {@link https://api.jquery.com/prop/#prop-propertyName-function}
  1462. */
  1463. prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery;
  1464. /**
  1465. * Remove an attribute from each element in the set of matched elements.
  1466. *
  1467. * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
  1468. * @see {@link https://api.jquery.com/removeAttr/}
  1469. */
  1470. removeAttr(attributeName: string): JQuery;
  1471. /**
  1472. * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
  1473. *
  1474. * @param className One or more space-separated classes to be removed from the class attribute of each matched element.
  1475. * @see {@link https://api.jquery.com/removeClass/#removeClass-className}
  1476. */
  1477. removeClass(className?: string): JQuery;
  1478. /**
  1479. * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
  1480. *
  1481. * @param func A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments.
  1482. * @see {@link https://api.jquery.com/removeClass/#removeClass-function}
  1483. */
  1484. removeClass(func: (index: number, className: string) => string): JQuery;
  1485. /**
  1486. * Remove a property for the set of matched elements.
  1487. *
  1488. * @param propertyName The name of the property to remove.
  1489. * @see {@link https://api.jquery.com/removeProp/}
  1490. */
  1491. removeProp(propertyName: string): JQuery;
  1492. /**
  1493. * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
  1494. *
  1495. * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set.
  1496. * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
  1497. * @see {@link https://api.jquery.com/toggleClass/#toggleClass-className}
  1498. */
  1499. toggleClass(className: string, swtch?: boolean): JQuery;
  1500. /**
  1501. * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
  1502. *
  1503. * @param swtch A boolean value to determine whether the class should be added or removed.
  1504. * @see {@link https://api.jquery.com/toggleClass/#toggleClass-state}
  1505. */
  1506. toggleClass(swtch?: boolean): JQuery;
  1507. /**
  1508. * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
  1509. *
  1510. * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments.
  1511. * @param swtch A boolean value to determine whether the class should be added or removed.
  1512. * @see {@link https://api.jquery.com/toggleClass/#toggleClass-function-state}
  1513. */
  1514. toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery;
  1515. /**
  1516. * Get the current value of the first element in the set of matched elements.
  1517. * @see {@link https://api.jquery.com/val/#val}
  1518. */
  1519. val(): any;
  1520. /**
  1521. * Set the value of each element in the set of matched elements.
  1522. *
  1523. * @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked.
  1524. * @see {@link https://api.jquery.com/val/#val-value}
  1525. */
  1526. val(value: string|string[]|number): JQuery;
  1527. /**
  1528. * Set the value of each element in the set of matched elements.
  1529. *
  1530. * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
  1531. * @see {@link https://api.jquery.com/val/#val-function}
  1532. */
  1533. val(func: (index: number, value: string) => string): JQuery;
  1534. /**
  1535. * Get the value of style properties for the first element in the set of matched elements.
  1536. *
  1537. * @param propertyName A CSS property.
  1538. * @see {@link https://api.jquery.com/css/#css-propertyName}
  1539. */
  1540. css(propertyName: string): string;
  1541. /**
  1542. * Set one or more CSS properties for the set of matched elements.
  1543. *
  1544. * @param propertyName A CSS property name.
  1545. * @param value A value to set for the property.
  1546. * @see {@link https://api.jquery.com/css/#css-propertyName-value}
  1547. */
  1548. css(propertyName: string, value: string|number): JQuery;
  1549. /**
  1550. * Set one or more CSS properties for the set of matched elements.
  1551. *
  1552. * @param propertyName A CSS property name.
  1553. * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
  1554. * @see {@link https://api.jquery.com/css/#css-propertyName-function}
  1555. */
  1556. css(propertyName: string, value: (index: number, value: string) => string|number): JQuery;
  1557. /**
  1558. * Set one or more CSS properties for the set of matched elements.
  1559. *
  1560. * @param properties An object of property-value pairs to set.
  1561. * @see {@link https://api.jquery.com/css/#css-properties}
  1562. */
  1563. css(properties: Object): JQuery;
  1564. /**
  1565. * Get the current computed height for the first element in the set of matched elements.
  1566. * @see {@link https://api.jquery.com/height/#height}
  1567. */
  1568. height(): number;
  1569. /**
  1570. * Set the CSS height of every matched element.
  1571. *
  1572. * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
  1573. * @see {@link https://api.jquery.com/height/#height-value}
  1574. */
  1575. height(value: number|string): JQuery;
  1576. /**
  1577. * Set the CSS height of every matched element.
  1578. *
  1579. * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set.
  1580. * @see {@link https://api.jquery.com/height/#height-function}
  1581. */
  1582. height(func: (index: number, height: number) => number|string): JQuery;
  1583. /**
  1584. * Get the current computed height for the first element in the set of matched elements, including padding but not border.
  1585. * @see {@link https://api.jquery.com/innerHeight/#innerHeight}
  1586. */
  1587. innerHeight(): number;
  1588. /**
  1589. * Sets the inner height on elements in the set of matched elements, including padding but not border.
  1590. *
  1591. * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
  1592. * @see {@link https://api.jquery.com/innerHeight/#innerHeight-value}
  1593. */
  1594. innerHeight(value: number|string): JQuery;
  1595. /**
  1596. * Get the current computed width for the first element in the set of matched elements, including padding but not border.
  1597. * @see {@link https://api.jquery.com/innerWidth/#innerWidth}
  1598. */
  1599. innerWidth(): number;
  1600. /**
  1601. * Sets the inner width on elements in the set of matched elements, including padding but not border.
  1602. *
  1603. * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
  1604. * @see {@link https://api.jquery.com/innerWidth/#innerWidth-value}
  1605. */
  1606. innerWidth(value: number|string): JQuery;
  1607. /**
  1608. * Get the current coordinates of the first element in the set of matched elements, relative to the document.
  1609. * @see {@link https://api.jquery.com/offset/#offset}
  1610. */
  1611. offset(): JQueryCoordinates;
  1612. /**
  1613. * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
  1614. *
  1615. * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
  1616. * @see {@link https://api.jquery.com/offset/#offset-coordinates}
  1617. */
  1618. offset(coordinates: JQueryCoordinates): JQuery;
  1619. /**
  1620. * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
  1621. *
  1622. * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties.
  1623. * @see {@link https://api.jquery.com/offset/#offset-function}
  1624. */
  1625. offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery;
  1626. /**
  1627. * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements.
  1628. *
  1629. * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
  1630. * @see {@link https://api.jquery.com/outerHeight/#outerHeight-includeMargin}
  1631. */
  1632. outerHeight(includeMargin?: boolean): number;
  1633. /**
  1634. * Sets the outer height on elements in the set of matched elements, including padding and border.
  1635. *
  1636. * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
  1637. * @see {@link https://api.jquery.com/outerHeight/#outerHeight-value}
  1638. */
  1639. outerHeight(value: number|string): JQuery;
  1640. /**
  1641. * Get the current computed width for the first element in the set of matched elements, including padding and border.
  1642. *
  1643. * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
  1644. * @see {@link https://api.jquery.com/outerWidth/#outerWidth-includeMargin}
  1645. */
  1646. outerWidth(includeMargin?: boolean): number;
  1647. /**
  1648. * Sets the outer width on elements in the set of matched elements, including padding and border.
  1649. *
  1650. * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
  1651. * @see {@link https://api.jquery.com/outerWidth/#outerWidth-value}
  1652. */
  1653. outerWidth(value: number|string): JQuery;
  1654. /**
  1655. * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
  1656. * @see {@link https://api.jquery.com/position/}
  1657. */
  1658. position(): JQueryCoordinates;
  1659. /**
  1660. * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element.
  1661. * @see {@link https://api.jquery.com/scrollLeft/#scrollLeft}
  1662. */
  1663. scrollLeft(): number;
  1664. /**
  1665. * Set the current horizontal position of the scroll bar for each of the set of matched elements.
  1666. *
  1667. * @param value An integer indicating the new position to set the scroll bar to.
  1668. * @see {@link https://api.jquery.com/scrollLeft/#scrollLeft-value}
  1669. */
  1670. scrollLeft(value: number): JQuery;
  1671. /**
  1672. * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element.
  1673. * @see {@link https://api.jquery.com/scrollTop/#scrollTop}
  1674. */
  1675. scrollTop(): number;
  1676. /**
  1677. * Set the current vertical position of the scroll bar for each of the set of matched elements.
  1678. *
  1679. * @param value An integer indicating the new position to set the scroll bar to.
  1680. * @see {@link https://api.jquery.com/scrollTop/#scrollTop-value}
  1681. */
  1682. scrollTop(value: number): JQuery;
  1683. /**
  1684. * Get the current computed width for the first element in the set of matched elements.
  1685. * @see {@link https://api.jquery.com/width/#width}
  1686. */
  1687. width(): number;
  1688. /**
  1689. * Set the CSS width of each element in the set of matched elements.
  1690. *
  1691. * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
  1692. * @see {@link https://api.jquery.com/width/#width-value}
  1693. */
  1694. width(value: number|string): JQuery;
  1695. /**
  1696. * Set the CSS width of each element in the set of matched elements.
  1697. *
  1698. * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set.
  1699. * @see {@link https://api.jquery.com/width/#width-function}
  1700. */
  1701. width(func: (index: number, width: number) => number|string): JQuery;
  1702. /**
  1703. * Remove from the queue all items that have not yet been run.
  1704. *
  1705. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
  1706. * @see {@link https://api.jquery.com/clearQueue/}
  1707. */
  1708. clearQueue(queueName?: string): JQuery;
  1709. /**
  1710. * Store arbitrary data associated with the matched elements.
  1711. *
  1712. * @param key A string naming the piece of data to set.
  1713. * @param value The new data value; it can be any JavaScript type including Array or Object.
  1714. * @see {@link https://api.jquery.com/data/#data-key-value}
  1715. */
  1716. data(key: string, value: any): JQuery;
  1717. /**
  1718. * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
  1719. *
  1720. * @param key Name of the data stored.
  1721. * @see {@link https://api.jquery.com/data/#data-key}
  1722. */
  1723. data(key: string): any;
  1724. /**
  1725. * Store arbitrary data associated with the matched elements.
  1726. *
  1727. * @param obj An object of key-value pairs of data to update.
  1728. * @see {@link https://api.jquery.com/data/#data-obj}
  1729. */
  1730. data(obj: { [key: string]: any; }): JQuery;
  1731. /**
  1732. * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
  1733. * @see {@link https://api.jquery.com/data/#data}
  1734. */
  1735. data(): any;
  1736. /**
  1737. * Execute the next function on the queue for the matched elements.
  1738. *
  1739. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
  1740. * @see {@link https://api.jquery.com/dequeue/}
  1741. */
  1742. dequeue(queueName?: string): JQuery;
  1743. /**
  1744. * Remove a previously-stored piece of data.
  1745. *
  1746. * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete.
  1747. * @see {@link https://api.jquery.com/removeData/#removeData-name}
  1748. */
  1749. removeData(name: string): JQuery;
  1750. /**
  1751. * Remove a previously-stored piece of data.
  1752. *
  1753. * @param list An array of strings naming the pieces of data to delete.
  1754. * @see {@link https://api.jquery.com/removeData/#removeData-list}
  1755. */
  1756. removeData(list: string[]): JQuery;
  1757. /**
  1758. * Remove all previously-stored piece of data.
  1759. * @see {@link https://api.jquery.com/removeData/}
  1760. */
  1761. removeData(): JQuery;
  1762. /**
  1763. * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
  1764. *
  1765. * @param type The type of queue that needs to be observed. (default: fx)
  1766. * @param target Object onto which the promise methods have to be attached
  1767. * @see {@link https://api.jquery.com/promise/}
  1768. */
  1769. promise(type?: string, target?: Object): JQueryPromise<any>;
  1770. /**
  1771. * Perform a custom animation of a set of CSS properties.
  1772. *
  1773. * @param properties An object of CSS properties and values that the animation will move toward.
  1774. * @param duration A string or number determining how long the animation will run.
  1775. * @param complete A function to call once the animation is complete.
  1776. * @see {@link https://api.jquery.com/animate/#animate-properties-duration-easing-complete}
  1777. */
  1778. animate(properties: Object, duration?: string|number, complete?: Function): JQuery;
  1779. /**
  1780. * Perform a custom animation of a set of CSS properties.
  1781. *
  1782. * @param properties An object of CSS properties and values that the animation will move toward.
  1783. * @param duration A string or number determining how long the animation will run.
  1784. * @param easing A string indicating which easing function to use for the transition. (default: swing)
  1785. * @param complete A function to call once the animation is complete.
  1786. * @see {@link https://api.jquery.com/animate/#animate-properties-duration-easing-complete}
  1787. */
  1788. animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery;
  1789. /**
  1790. * Perform a custom animation of a set of CSS properties.
  1791. *
  1792. * @param properties An object of CSS properties and values that the animation will move toward.
  1793. * @param options A map of additional options to pass to the method.
  1794. * @see {@link https://api.jquery.com/animate/#animate-properties-options}
  1795. */
  1796. animate(properties: Object, options: JQueryAnimationOptions): JQuery;
  1797. /**
  1798. * Set a timer to delay execution of subsequent items in the queue.
  1799. *
  1800. * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue.
  1801. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
  1802. * @see {@link https://api.jquery.com/delay/}
  1803. */
  1804. delay(duration: number, queueName?: string): JQuery;
  1805. /**
  1806. * Display the matched elements by fading them to opaque.
  1807. *
  1808. * @param duration A string or number determining how long the animation will run.
  1809. * @param complete A function to call once the animation is complete.
  1810. * @see {@link https://api.jquery.com/fadeIn/#fadeIn-duration-complete}
  1811. */
  1812. fadeIn(duration?: number|string, complete?: Function): JQuery;
  1813. /**
  1814. * Display the matched elements by fading them to opaque.
  1815. *
  1816. * @param duration A string or number determining how long the animation will run.
  1817. * @param easing A string indicating which easing function to use for the transition.
  1818. * @param complete A function to call once the animation is complete.
  1819. * @see {@link https://api.jquery.com/fadeIn/#fadeIn-duration-easing-complete}
  1820. */
  1821. fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery;
  1822. /**
  1823. * Display the matched elements by fading them to opaque.
  1824. *
  1825. * @param options A map of additional options to pass to the method.
  1826. * @see {@link https://api.jquery.com/fadeIn/#fadeIn-options}
  1827. */
  1828. fadeIn(options: JQueryAnimationOptions): JQuery;
  1829. /**
  1830. * Hide the matched elements by fading them to transparent.
  1831. *
  1832. * @param duration A string or number determining how long the animation will run.
  1833. * @param complete A function to call once the animation is complete.
  1834. * @see {@link https://api.jquery.com/fadeOut/#fadeOut-duration-complete}
  1835. */
  1836. fadeOut(duration?: number|string, complete?: Function): JQuery;
  1837. /**
  1838. * Hide the matched elements by fading them to transparent.
  1839. *
  1840. * @param duration A string or number determining how long the animation will run.
  1841. * @param easing A string indicating which easing function to use for the transition.
  1842. * @param complete A function to call once the animation is complete.
  1843. * @see {@link https://api.jquery.com/fadeOut/#fadeOut-duration-easing-complete}
  1844. */
  1845. fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery;
  1846. /**
  1847. * Hide the matched elements by fading them to transparent.
  1848. *
  1849. * @param options A map of additional options to pass to the method.
  1850. * @see {@link https://api.jquery.com/fadeOut/#fadeOut-options}
  1851. */
  1852. fadeOut(options: JQueryAnimationOptions): JQuery;
  1853. /**
  1854. * Adjust the opacity of the matched elements.
  1855. *
  1856. * @param duration A string or number determining how long the animation will run.
  1857. * @param opacity A number between 0 and 1 denoting the target opacity.
  1858. * @param complete A function to call once the animation is complete.
  1859. * @see {@link https://api.jquery.com/fadeTo/#fadeTo-duration-opacity-complete}
  1860. */
  1861. fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery;
  1862. /**
  1863. * Adjust the opacity of the matched elements.
  1864. *
  1865. * @param duration A string or number determining how long the animation will run.
  1866. * @param opacity A number between 0 and 1 denoting the target opacity.
  1867. * @param easing A string indicating which easing function to use for the transition.
  1868. * @param complete A function to call once the animation is complete.
  1869. * @see {@link https://api.jquery.com/fadeTo/#fadeTo-duration-opacity-easing-complete}
  1870. */
  1871. fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery;
  1872. /**
  1873. * Display or hide the matched elements by animating their opacity.
  1874. *
  1875. * @param duration A string or number determining how long the animation will run.
  1876. * @param complete A function to call once the animation is complete.
  1877. * @see {@link https://api.jquery.com/fadeToggle/#fadeToggle-duration-easing-complete}
  1878. */
  1879. fadeToggle(duration?: number|string, complete?: Function): JQuery;
  1880. /**
  1881. * Display or hide the matched elements by animating their opacity.
  1882. *
  1883. * @param duration A string or number determining how long the animation will run.
  1884. * @param easing A string indicating which easing function to use for the transition.
  1885. * @param complete A function to call once the animation is complete.
  1886. * @see {@link https://api.jquery.com/fadeToggle/#fadeToggle-duration-easing-complete}
  1887. */
  1888. fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
  1889. /**
  1890. * Display or hide the matched elements by animating their opacity.
  1891. *
  1892. * @param options A map of additional options to pass to the method.
  1893. * @see {@link https://api.jquery.com/fadeToggle/#fadeToggle-options}
  1894. */
  1895. fadeToggle(options: JQueryAnimationOptions): JQuery;
  1896. /**
  1897. * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements.
  1898. *
  1899. * @param queue The name of the queue in which to stop animations.
  1900. * @see {@link https://api.jquery.com/finish/}
  1901. */
  1902. finish(queue?: string): JQuery;
  1903. /**
  1904. * Hide the matched elements.
  1905. *
  1906. * @param duration A string or number determining how long the animation will run.
  1907. * @param complete A function to call once the animation is complete.
  1908. * @see {@link https://api.jquery.com/hide/#hide}
  1909. */
  1910. hide(duration?: number|string, complete?: Function): JQuery;
  1911. /**
  1912. * Hide the matched elements.
  1913. *
  1914. * @param duration A string or number determining how long the animation will run.
  1915. * @param easing A string indicating which easing function to use for the transition.
  1916. * @param complete A function to call once the animation is complete.
  1917. * @see {@link https://api.jquery.com/hide/#hide-duration-easing-complete}
  1918. */
  1919. hide(duration?: number|string, easing?: string, complete?: Function): JQuery;
  1920. /**
  1921. * Hide the matched elements.
  1922. *
  1923. * @param options A map of additional options to pass to the method.
  1924. * @see {@link https://api.jquery.com/hide/#hide-options}
  1925. */
  1926. hide(options: JQueryAnimationOptions): JQuery;
  1927. /**
  1928. * Display the matched elements.
  1929. *
  1930. * @param duration A string or number determining how long the animation will run.
  1931. * @param complete A function to call once the animation is complete.
  1932. * @see {@link https://api.jquery.com/show/#show}
  1933. */
  1934. show(duration?: number|string, complete?: Function): JQuery;
  1935. /**
  1936. * Display the matched elements.
  1937. *
  1938. * @param duration A string or number determining how long the animation will run.
  1939. * @param easing A string indicating which easing function to use for the transition.
  1940. * @param complete A function to call once the animation is complete.
  1941. * @see {@link https://api.jquery.com/show/#show-duration-easing-complete}
  1942. */
  1943. show(duration?: number|string, easing?: string, complete?: Function): JQuery;
  1944. /**
  1945. * Display the matched elements.
  1946. *
  1947. * @param options A map of additional options to pass to the method.
  1948. * @see {@link https://api.jquery.com/show/#show-options}
  1949. */
  1950. show(options: JQueryAnimationOptions): JQuery;
  1951. /**
  1952. * Display the matched elements with a sliding motion.
  1953. *
  1954. * @param duration A string or number determining how long the animation will run.
  1955. * @param complete A function to call once the animation is complete.
  1956. * @see {@link https://api.jquery.com/slideDown/#slideDown-duration-complete}
  1957. */
  1958. slideDown(duration?: number|string, complete?: Function): JQuery;
  1959. /**
  1960. * Display the matched elements with a sliding motion.
  1961. *
  1962. * @param duration A string or number determining how long the animation will run.
  1963. * @param easing A string indicating which easing function to use for the transition.
  1964. * @param complete A function to call once the animation is complete.
  1965. * @see {@link https://api.jquery.com/slideDown/#slideDown-duration-easing-complete}
  1966. */
  1967. slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery;
  1968. /**
  1969. * Display the matched elements with a sliding motion.
  1970. *
  1971. * @param options A map of additional options to pass to the method.
  1972. * @see {@link https://api.jquery.com/slideDown/#slideDown-options}
  1973. */
  1974. slideDown(options: JQueryAnimationOptions): JQuery;
  1975. /**
  1976. * Display or hide the matched elements with a sliding motion.
  1977. *
  1978. * @param duration A string or number determining how long the animation will run.
  1979. * @param complete A function to call once the animation is complete.
  1980. * @see {@link https://api.jquery.com/slideToggle/#slideToggle-duration-complete}
  1981. */
  1982. slideToggle(duration?: number|string, complete?: Function): JQuery;
  1983. /**
  1984. * Display or hide the matched elements with a sliding motion.
  1985. *
  1986. * @param duration A string or number determining how long the animation will run.
  1987. * @param easing A string indicating which easing function to use for the transition.
  1988. * @param complete A function to call once the animation is complete.
  1989. * @see {@link https://api.jquery.com/slideToggle/#slideToggle-duration-easing-complete}
  1990. */
  1991. slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
  1992. /**
  1993. * Display or hide the matched elements with a sliding motion.
  1994. *
  1995. * @param options A map of additional options to pass to the method.
  1996. * @see {@link https://api.jquery.com/slideToggle/#slideToggle-options}
  1997. */
  1998. slideToggle(options: JQueryAnimationOptions): JQuery;
  1999. /**
  2000. * Hide the matched elements with a sliding motion.
  2001. *
  2002. * @param duration A string or number determining how long the animation will run.
  2003. * @param complete A function to call once the animation is complete.
  2004. * @see {@link https://api.jquery.com/slideUp/#slideUp-duration-complete}
  2005. */
  2006. slideUp(duration?: number|string, complete?: Function): JQuery;
  2007. /**
  2008. * Hide the matched elements with a sliding motion.
  2009. *
  2010. * @param duration A string or number determining how long the animation will run.
  2011. * @param easing A string indicating which easing function to use for the transition.
  2012. * @param complete A function to call once the animation is complete.
  2013. * @see {@link https://api.jquery.com/slideUp/#slideUp-duration-easing-complete}
  2014. */
  2015. slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery;
  2016. /**
  2017. * Hide the matched elements with a sliding motion.
  2018. *
  2019. * @param options A map of additional options to pass to the method.
  2020. * @see {@link https://api.jquery.com/slideUp/#slideUp-options}
  2021. */
  2022. slideUp(options: JQueryAnimationOptions): JQuery;
  2023. /**
  2024. * Stop the currently-running animation on the matched elements.
  2025. *
  2026. * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
  2027. * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
  2028. * @see {@link https://api.jquery.com/stop/#stop-clearQueue-jumpToEnd}
  2029. */
  2030. stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
  2031. /**
  2032. * Stop the currently-running animation on the matched elements.
  2033. *
  2034. * @param queue The name of the queue in which to stop animations.
  2035. * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
  2036. * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
  2037. * @see {@link https://api.jquery.com/stop/#stop-queue-clearQueue-jumpToEnd}
  2038. */
  2039. stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
  2040. /**
  2041. * Display or hide the matched elements.
  2042. *
  2043. * @param duration A string or number determining how long the animation will run.
  2044. * @param complete A function to call once the animation is complete.
  2045. * @see {@link https://api.jquery.com/toggle/#toggle-duration-complete}
  2046. */
  2047. toggle(duration?: number|string, complete?: Function): JQuery;
  2048. /**
  2049. * Display or hide the matched elements.
  2050. *
  2051. * @param duration A string or number determining how long the animation will run.
  2052. * @param easing A string indicating which easing function to use for the transition.
  2053. * @param complete A function to call once the animation is complete.
  2054. * @see {@link https://api.jquery.com/toggle/#toggle-duration-easing-complete}
  2055. */
  2056. toggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
  2057. /**
  2058. * Display or hide the matched elements.
  2059. *
  2060. * @param options A map of additional options to pass to the method.
  2061. * @see {@link https://api.jquery.com/toggle/#toggle-options}
  2062. */
  2063. toggle(options: JQueryAnimationOptions): JQuery;
  2064. /**
  2065. * Display or hide the matched elements.
  2066. *
  2067. * @param showOrHide A Boolean indicating whether to show or hide the elements.
  2068. * @see {@link https://api.jquery.com/toggle/#toggle-display}
  2069. */
  2070. toggle(showOrHide: boolean): JQuery;
  2071. /**
  2072. * Attach a handler to an event for the elements.
  2073. *
  2074. * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
  2075. * @param eventData An object containing data that will be passed to the event handler.
  2076. * @param handler A function to execute each time the event is triggered.
  2077. * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler}
  2078. */
  2079. bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2080. /**
  2081. * Attach a handler to an event for the elements.
  2082. *
  2083. * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
  2084. * @param handler A function to execute each time the event is triggered.
  2085. * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler}
  2086. */
  2087. bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2088. /**
  2089. * Attach a handler to an event for the elements.
  2090. *
  2091. * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
  2092. * @param eventData An object containing data that will be passed to the event handler.
  2093. * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.
  2094. * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-preventBubble}
  2095. */
  2096. bind(eventType: string, eventData: any, preventBubble: boolean): JQuery;
  2097. /**
  2098. * Attach a handler to an event for the elements.
  2099. *
  2100. * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
  2101. * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.
  2102. * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-preventBubble}
  2103. */
  2104. bind(eventType: string, preventBubble: boolean): JQuery;
  2105. /**
  2106. * Attach a handler to an event for the elements.
  2107. *
  2108. * @param events An object containing one or more DOM event types and functions to execute for them.
  2109. * @see {@link https://api.jquery.com/bind/#bind-events}
  2110. */
  2111. bind(events: any): JQuery;
  2112. /**
  2113. * Trigger the "blur" event on an element
  2114. * @see {@link https://api.jquery.com/blur/#blur}
  2115. */
  2116. blur(): JQuery;
  2117. /**
  2118. * Bind an event handler to the "blur" JavaScript event
  2119. *
  2120. * @param handler A function to execute each time the event is triggered.
  2121. * @see {@link https://api.jquery.com/blur/#blur-handler}
  2122. */
  2123. blur(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2124. /**
  2125. * Bind an event handler to the "blur" JavaScript event
  2126. *
  2127. * @param eventData An object containing data that will be passed to the event handler.
  2128. * @param handler A function to execute each time the event is triggered.
  2129. * @see {@link https://api.jquery.com/blur/#blur-eventData-handler}
  2130. */
  2131. blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
  2132. /**
  2133. * Trigger the "change" event on an element.
  2134. * @see {@link https://api.jquery.com/change/#change}
  2135. */
  2136. change(): JQuery;
  2137. /**
  2138. * Bind an event handler to the "change" JavaScript event
  2139. *
  2140. * @param handler A function to execute each time the event is triggered.
  2141. * @see {@link https://api.jquery.com/change/#change-handler}
  2142. */
  2143. change(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2144. /**
  2145. * Bind an event handler to the "change" JavaScript event
  2146. *
  2147. * @param eventData An object containing data that will be passed to the event handler.
  2148. * @param handler A function to execute each time the event is triggered.
  2149. * @see {@link https://api.jquery.com/change/#change-eventData-handler}
  2150. */
  2151. change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
  2152. /**
  2153. * Trigger the "click" event on an element.
  2154. * @see {@link https://api.jquery.com/click/#click}
  2155. */
  2156. click(): JQuery;
  2157. /**
  2158. * Bind an event handler to the "click" JavaScript event
  2159. *
  2160. * @param handler A function to execute each time the event is triggered.
  2161. * @see {@link https://api.jquery.com/click/#click-handler}
  2162. */
  2163. click(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2164. /**
  2165. * Bind an event handler to the "click" JavaScript event
  2166. *
  2167. * @param eventData An object containing data that will be passed to the event handler.
  2168. * @param handler A function to execute each time the event is triggered.
  2169. * @see {@link https://api.jquery.com/click/#click-eventData-handler}
  2170. */
  2171. click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
  2172. /**
  2173. * Trigger the "contextmenu" event on an element.
  2174. * @see {@link https://api.jquery.com/contextmenu/#contextmenu}
  2175. */
  2176. contextmenu(): JQuery;
  2177. /**
  2178. * Bind an event handler to the "contextmenu" JavaScript event.
  2179. *
  2180. * @param handler A function to execute when the event is triggered.
  2181. * @see {@link https://api.jquery.com/contextmenu/#contextmenu-handler}
  2182. */
  2183. contextmenu(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2184. /**
  2185. * Bind an event handler to the "contextmenu" JavaScript event.
  2186. *
  2187. * @param eventData An object containing data that will be passed to the event handler.
  2188. * @param handler A function to execute when the event is triggered.
  2189. * @see {@link https://api.jquery.com/contextmenu/#contextmenu-eventData-handler}
  2190. */
  2191. contextmenu(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2192. /**
  2193. * Trigger the "dblclick" event on an element.
  2194. * @see {@link https://api.jquery.com/dblclick/#dblclick}
  2195. */
  2196. dblclick(): JQuery;
  2197. /**
  2198. * Bind an event handler to the "dblclick" JavaScript event
  2199. *
  2200. * @param handler A function to execute each time the event is triggered.
  2201. * @see {@link https://api.jquery.com/dblclick/#dblclick-handler}
  2202. */
  2203. dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2204. /**
  2205. * Bind an event handler to the "dblclick" JavaScript event
  2206. *
  2207. * @param eventData An object containing data that will be passed to the event handler.
  2208. * @param handler A function to execute each time the event is triggered.
  2209. * @see {@link https://api.jquery.com/dblclick/#dblclick-eventData-handler}
  2210. */
  2211. dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
  2212. /**
  2213. * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.
  2214. * @see {@link https://api.jquery.com/delegate/#delegate-selector-eventType-handler}
  2215. */
  2216. delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2217. /**
  2218. * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.
  2219. * @see {@link https://api.jquery.com/delegate/#delegate-selector-eventType-eventData-handler}
  2220. */
  2221. delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2222. /**
  2223. * Trigger the "focus" event on an element.
  2224. * @see {@link https://api.jquery.com/focus/#focus}
  2225. */
  2226. focus(): JQuery;
  2227. /**
  2228. * Bind an event handler to the "focus" JavaScript event
  2229. *
  2230. * @param handler A function to execute each time the event is triggered.
  2231. * @see {@link https://api.jquery.com/focus/#focus-handler}
  2232. */
  2233. focus(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2234. /**
  2235. * Bind an event handler to the "focus" JavaScript event
  2236. *
  2237. * @param eventData An object containing data that will be passed to the event handler.
  2238. * @param handler A function to execute each time the event is triggered.
  2239. * @see {@link https://api.jquery.com/focus/#focus-eventData-handler}
  2240. */
  2241. focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
  2242. /**
  2243. * Trigger the "focusin" event on an element.
  2244. * @see {@link https://api.jquery.com/focusin/#focusin}
  2245. */
  2246. focusin(): JQuery;
  2247. /**
  2248. * Bind an event handler to the "focusin" JavaScript event
  2249. *
  2250. * @param handler A function to execute each time the event is triggered.
  2251. * @see {@link https://api.jquery.com/focusin/#focusin-handler}
  2252. */
  2253. focusin(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2254. /**
  2255. * Bind an event handler to the "focusin" JavaScript event
  2256. *
  2257. * @param eventData An object containing data that will be passed to the event handler.
  2258. * @param handler A function to execute each time the event is triggered.
  2259. * @see {@link https://api.jquery.com/focusin/#focusin-eventData-handler}
  2260. */
  2261. focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2262. /**
  2263. * Trigger the "focusout" event on an element.
  2264. * @see {@link https://api.jquery.com/focusout/#focusout}
  2265. */
  2266. focusout(): JQuery;
  2267. /**
  2268. * Bind an event handler to the "focusout" JavaScript event
  2269. *
  2270. * @param handler A function to execute each time the event is triggered.
  2271. * @see {@link https://api.jquery.com/focusout/#focusout-handler}
  2272. */
  2273. focusout(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2274. /**
  2275. * Bind an event handler to the "focusout" JavaScript event
  2276. *
  2277. * @param eventData An object containing data that will be passed to the event handler.
  2278. * @param handler A function to execute each time the event is triggered.
  2279. * @see {@link https://api.jquery.com/focusout/#focusout-eventData-handler}
  2280. */
  2281. focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2282. /**
  2283. * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
  2284. *
  2285. * @param handlerIn A function to execute when the mouse pointer enters the element.
  2286. * @param handlerOut A function to execute when the mouse pointer leaves the element.
  2287. * @see {@link https://api.jquery.com/hover/#hover-handlerIn-handlerOut}
  2288. */
  2289. hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery;
  2290. /**
  2291. * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements.
  2292. *
  2293. * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element.
  2294. * @see {@link https://api.jquery.com/hover/#hover-handlerInOut}
  2295. */
  2296. hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery;
  2297. /**
  2298. * Trigger the "keydown" event on an element.
  2299. * @see {@link https://api.jquery.com/keydown/#keydown}
  2300. */
  2301. keydown(): JQuery;
  2302. /**
  2303. * Bind an event handler to the "keydown" JavaScript event
  2304. *
  2305. * @param handler A function to execute each time the event is triggered.
  2306. * @see {@link https://api.jquery.com/keydown/#keydown-handler}
  2307. */
  2308. keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
  2309. /**
  2310. * Bind an event handler to the "keydown" JavaScript event
  2311. *
  2312. * @param eventData An object containing data that will be passed to the event handler.
  2313. * @param handler A function to execute each time the event is triggered.
  2314. * @see {@link https://api.jquery.com/keydown/#keydown-eventData-handler}
  2315. */
  2316. keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
  2317. /**
  2318. * Trigger the "keypress" event on an element.
  2319. * @see {@link https://api.jquery.com/keypress/#keypress}
  2320. */
  2321. keypress(): JQuery;
  2322. /**
  2323. * Bind an event handler to the "keypress" JavaScript event
  2324. *
  2325. * @param handler A function to execute each time the event is triggered.
  2326. * @see {@link https://api.jquery.com/keypress/#keypress-handler}
  2327. */
  2328. keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
  2329. /**
  2330. * Bind an event handler to the "keypress" JavaScript event
  2331. *
  2332. * @param eventData An object containing data that will be passed to the event handler.
  2333. * @param handler A function to execute each time the event is triggered.
  2334. * @see {@link https://api.jquery.com/keypress/#keypress-eventData-handler}
  2335. */
  2336. keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
  2337. /**
  2338. * Trigger the "keyup" event on an element.
  2339. * @see {@link https://api.jquery.com/keyup/#keyup}
  2340. */
  2341. keyup(): JQuery;
  2342. /**
  2343. * Bind an event handler to the "keyup" JavaScript event
  2344. *
  2345. * @param handler A function to execute each time the event is triggered.
  2346. * @see {@link https://api.jquery.com/keyup/#keyup-handler}
  2347. */
  2348. keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
  2349. /**
  2350. * Bind an event handler to the "keyup" JavaScript event
  2351. *
  2352. * @param eventData An object containing data that will be passed to the event handler.
  2353. * @param handler A function to execute each time the event is triggered.
  2354. * @see {@link https://api.jquery.com/keyup/#keyup-eventData-handler}
  2355. */
  2356. keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
  2357. /**
  2358. * Bind an event handler to the "load" JavaScript event.
  2359. *
  2360. * @param handler A function to execute when the event is triggered.
  2361. * @see {@link https://api.jquery.com/load/}
  2362. */
  2363. load(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2364. /**
  2365. * Bind an event handler to the "load" JavaScript event.
  2366. *
  2367. * @param eventData An object containing data that will be passed to the event handler.
  2368. * @param handler A function to execute when the event is triggered.
  2369. * @see {@link https://api.jquery.com/load/}
  2370. */
  2371. load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
  2372. /**
  2373. * Trigger the "mousedown" event on an element.
  2374. * @see {@link https://api.jquery.com/mousedown/#mousedown}
  2375. */
  2376. mousedown(): JQuery;
  2377. /**
  2378. * Bind an event handler to the "mousedown" JavaScript event.
  2379. *
  2380. * @param handler A function to execute when the event is triggered.
  2381. * @see {@link https://api.jquery.com/mousedown/#mousedown-handler}
  2382. */
  2383. mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2384. /**
  2385. * Bind an event handler to the "mousedown" JavaScript event.
  2386. *
  2387. * @param eventData An object containing data that will be passed to the event handler.
  2388. * @param handler A function to execute when the event is triggered.
  2389. * @see {@link https://api.jquery.com/mousedown/#mousedown-eventData-handler}
  2390. */
  2391. mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2392. /**
  2393. * Trigger the "mouseenter" event on an element.
  2394. * @see {@link https://api.jquery.com/mouseenter/#mouseenter}
  2395. */
  2396. mouseenter(): JQuery;
  2397. /**
  2398. * Bind an event handler to be fired when the mouse enters an element.
  2399. *
  2400. * @param handler A function to execute when the event is triggered.
  2401. * @see {@link https://api.jquery.com/mouseenter/#mouseenter-handler}
  2402. */
  2403. mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2404. /**
  2405. * Bind an event handler to be fired when the mouse enters an element.
  2406. *
  2407. * @param eventData An object containing data that will be passed to the event handler.
  2408. * @param handler A function to execute when the event is triggered.
  2409. * @see {@link https://api.jquery.com/mouseenter/#mouseenter-eventData-handler}
  2410. */
  2411. mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2412. /**
  2413. * Trigger the "mouseleave" event on an element.
  2414. * @see {@link https://api.jquery.com/mouseleave/#mouseleave}
  2415. */
  2416. mouseleave(): JQuery;
  2417. /**
  2418. * Bind an event handler to be fired when the mouse leaves an element.
  2419. *
  2420. * @param handler A function to execute when the event is triggered.
  2421. * @see {@link https://api.jquery.com/mouseleave/#mouseleave-handler}
  2422. */
  2423. mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2424. /**
  2425. * Bind an event handler to be fired when the mouse leaves an element.
  2426. *
  2427. * @param eventData An object containing data that will be passed to the event handler.
  2428. * @param handler A function to execute when the event is triggered.
  2429. * @see {@link https://api.jquery.com/mouseleave/#mouseleave-eventData-handler}
  2430. */
  2431. mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2432. /**
  2433. * Trigger the "mousemove" event on an element.
  2434. * @see {@link https://api.jquery.com/mousemove/#mousemove}
  2435. */
  2436. mousemove(): JQuery;
  2437. /**
  2438. * Bind an event handler to the "mousemove" JavaScript event.
  2439. *
  2440. * @param handler A function to execute when the event is triggered.
  2441. * @see {@link https://api.jquery.com/mousemove/#mousemove-handler}
  2442. */
  2443. mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2444. /**
  2445. * Bind an event handler to the "mousemove" JavaScript event.
  2446. *
  2447. * @param eventData An object containing data that will be passed to the event handler.
  2448. * @param handler A function to execute when the event is triggered.
  2449. * @see {@link https://api.jquery.com/mousemove/#mousemove-eventData-handler}
  2450. */
  2451. mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2452. /**
  2453. * Trigger the "mouseout" event on an element.
  2454. * @see {@link https://api.jquery.com/mouseout/#mouseout}
  2455. */
  2456. mouseout(): JQuery;
  2457. /**
  2458. * Bind an event handler to the "mouseout" JavaScript event.
  2459. *
  2460. * @param handler A function to execute when the event is triggered.
  2461. * @see {@link https://api.jquery.com/mouseout/#mouseout-handler}
  2462. */
  2463. mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2464. /**
  2465. * Bind an event handler to the "mouseout" JavaScript event.
  2466. *
  2467. * @param eventData An object containing data that will be passed to the event handler.
  2468. * @param handler A function to execute when the event is triggered.
  2469. * @see {@link https://api.jquery.com/mouseout/#mouseout-eventData-handler}
  2470. */
  2471. mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2472. /**
  2473. * Trigger the "mouseover" event on an element.
  2474. * @see {@link https://api.jquery.com/mouseover/#mouseover}
  2475. */
  2476. mouseover(): JQuery;
  2477. /**
  2478. * Bind an event handler to the "mouseover" JavaScript event.
  2479. *
  2480. * @param handler A function to execute when the event is triggered.
  2481. * @see {@link https://api.jquery.com/mouseover/#mouseover-handler}
  2482. */
  2483. mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2484. /**
  2485. * Bind an event handler to the "mouseover" JavaScript event.
  2486. *
  2487. * @param eventData An object containing data that will be passed to the event handler.
  2488. * @param handler A function to execute when the event is triggered.
  2489. * @see {@link https://api.jquery.com/mouseover/#mouseover-eventData-handler}
  2490. */
  2491. mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2492. /**
  2493. * Trigger the "mouseup" event on an element.
  2494. * @see {@link https://api.jquery.com/mouseup/#mouseup}
  2495. */
  2496. mouseup(): JQuery;
  2497. /**
  2498. * Bind an event handler to the "mouseup" JavaScript event.
  2499. *
  2500. * @param handler A function to execute when the event is triggered.
  2501. * @see {@link https://api.jquery.com/mouseup/#mouseup-handler}
  2502. */
  2503. mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2504. /**
  2505. * Bind an event handler to the "mouseup" JavaScript event.
  2506. *
  2507. * @param eventData An object containing data that will be passed to the event handler.
  2508. * @param handler A function to execute when the event is triggered.
  2509. * @see {@link https://api.jquery.com/mouseup/#mouseup-eventData-handler}
  2510. */
  2511. mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
  2512. /**
  2513. * Remove an event handler.
  2514. * @see {@link https://api.jquery.com/off/#off}
  2515. */
  2516. off(): JQuery;
  2517. /**
  2518. * Remove an event handler.
  2519. *
  2520. * @param events One or more space-separated event types and optional modules, or just modules, such as "click", "keydown.myPlugin", or ".myPlugin".
  2521. * @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
  2522. * @param handler A handler function previously attached for the event(s), or the special value false.
  2523. * @see {@link https://api.jquery.com/off/#off-events-selector-handler}
  2524. */
  2525. off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
  2526. /**
  2527. * Remove an event handler.
  2528. *
  2529. * @param events One or more space-separated event types and optional modules, or just modules, such as "click", "keydown.myPlugin", or ".myPlugin".
  2530. * @param handler A handler function previously attached for the event(s), or the special value false. Takes handler with extra args that can be attached with on().
  2531. * @see {@link https://api.jquery.com/off/#off-events-selector-handler}
  2532. */
  2533. off(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
  2534. /**
  2535. * Remove an event handler.
  2536. *
  2537. * @param events One or more space-separated event types and optional modules, or just modules, such as "click", "keydown.myPlugin", or ".myPlugin".
  2538. * @param handler A handler function previously attached for the event(s), or the special value false.
  2539. * @see {@link https://api.jquery.com/off/#off-events-selector-handler}
  2540. */
  2541. off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2542. /**
  2543. * Remove an event handler.
  2544. *
  2545. * @param events An object where the string keys represent one or more space-separated event types and optional modules, and the values represent handler functions previously attached for the event(s).
  2546. * @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
  2547. * @see {@link https://api.jquery.com/off/#off-events-selector}
  2548. */
  2549. off(events: { [key: string]: any; }, selector?: string): JQuery;
  2550. /**
  2551. * Attach an event handler function for one or more events to the selected elements.
  2552. *
  2553. * @param events One or more space-separated event types and optional modules, such as "click" or "keydown.myPlugin".
  2554. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax).
  2555. * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler}
  2556. */
  2557. on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
  2558. /**
  2559. * Attach an event handler function for one or more events to the selected elements.
  2560. *
  2561. * @param events One or more space-separated event types and optional modules, such as "click" or "keydown.myPlugin".
  2562. * @param data Data to be passed to the handler in event.data when an event is triggered.
  2563. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
  2564. * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler}
  2565. */
  2566. on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
  2567. /**
  2568. * Attach an event handler function for one or more events to the selected elements.
  2569. *
  2570. * @param events One or more space-separated event types and optional modules, such as "click" or "keydown.myPlugin".
  2571. * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
  2572. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
  2573. * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler}
  2574. */
  2575. on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery;
  2576. /**
  2577. * Attach an event handler function for one or more events to the selected elements.
  2578. *
  2579. * @param events One or more space-separated event types and optional modules, such as "click" or "keydown.myPlugin".
  2580. * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
  2581. * @param data Data to be passed to the handler in event.data when an event is triggered.
  2582. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
  2583. * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler}
  2584. */
  2585. on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery;
  2586. /**
  2587. * Attach an event handler function for one or more events to the selected elements.
  2588. *
  2589. * @param events An object in which the string keys represent one or more space-separated event types and optional modules, and the values represent a handler function to be called for the event(s).
  2590. * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
  2591. * @param data Data to be passed to the handler in event.data when an event occurs.
  2592. * @see {@link https://api.jquery.com/on/#on-events-selector-data}
  2593. */
  2594. on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery;
  2595. /**
  2596. * Attach an event handler function for one or more events to the selected elements.
  2597. *
  2598. * @param events An object in which the string keys represent one or more space-separated event types and optional modules, and the values represent a handler function to be called for the event(s).
  2599. * @param data Data to be passed to the handler in event.data when an event occurs.
  2600. * @see {@link https://api.jquery.com/on/#on-events-selector-data}
  2601. */
  2602. on(events: { [key: string]: any; }, data?: any): JQuery;
  2603. /**
  2604. * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
  2605. *
  2606. * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
  2607. * @param handler A function to execute at the time the event is triggered.
  2608. * @see {@link https://api.jquery.com/one/#one-events-data-handler}
  2609. */
  2610. one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2611. /**
  2612. * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
  2613. *
  2614. * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
  2615. * @param data An object containing data that will be passed to the event handler.
  2616. * @param handler A function to execute at the time the event is triggered.
  2617. * @see {@link https://api.jquery.com/one/#one-events-data-handler}
  2618. */
  2619. one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2620. /**
  2621. * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
  2622. *
  2623. * @param events One or more space-separated event types and optional modules, such as "click" or "keydown.myPlugin".
  2624. * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
  2625. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
  2626. * @see {@link https://api.jquery.com/one/#one-events-selector-data-handler}
  2627. */
  2628. one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2629. /**
  2630. * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
  2631. *
  2632. * @param events One or more space-separated event types and optional modules, such as "click" or "keydown.myPlugin".
  2633. * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
  2634. * @param data Data to be passed to the handler in event.data when an event is triggered.
  2635. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
  2636. * @see {@link https://api.jquery.com/one/#one-events-selector-data-handler}
  2637. */
  2638. one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2639. /**
  2640. * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
  2641. *
  2642. * @param events An object in which the string keys represent one or more space-separated event types and optional modules, and the values represent a handler function to be called for the event(s).
  2643. * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
  2644. * @param data Data to be passed to the handler in event.data when an event occurs.
  2645. * @see {@link https://api.jquery.com/one/#one-events-selector-data}
  2646. */
  2647. one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery;
  2648. /**
  2649. * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
  2650. *
  2651. * @param events An object in which the string keys represent one or more space-separated event types and optional modules, and the values represent a handler function to be called for the event(s).
  2652. * @param data Data to be passed to the handler in event.data when an event occurs.
  2653. * @see {@link https://api.jquery.com/one/#one-events-selector-data}
  2654. */
  2655. one(events: { [key: string]: any; }, data?: any): JQuery;
  2656. /**
  2657. * Specify a function to execute when the DOM is fully loaded.
  2658. *
  2659. * @param handler A function to execute after the DOM is ready.
  2660. * @see {@link https://api.jquery.com/ready/}
  2661. */
  2662. ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery;
  2663. /**
  2664. * Trigger the "resize" event on an element.
  2665. * @see {@link https://api.jquery.com/resize/#resize}
  2666. */
  2667. resize(): JQuery;
  2668. /**
  2669. * Bind an event handler to the "resize" JavaScript event.
  2670. *
  2671. * @param handler A function to execute each time the event is triggered.
  2672. * @see {@link https://api.jquery.com/resize/#resize-handler}
  2673. */
  2674. resize(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2675. /**
  2676. * Bind an event handler to the "resize" JavaScript event.
  2677. *
  2678. * @param eventData An object containing data that will be passed to the event handler.
  2679. * @param handler A function to execute each time the event is triggered.
  2680. * @see {@link https://api.jquery.com/resize/#resize-eventData-handler}
  2681. */
  2682. resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2683. /**
  2684. * Trigger the "scroll" event on an element.
  2685. * @see {@link https://api.jquery.com/scroll/#scroll}
  2686. */
  2687. scroll(): JQuery;
  2688. /**
  2689. * Bind an event handler to the "scroll" JavaScript event.
  2690. *
  2691. * @param handler A function to execute each time the event is triggered.
  2692. * @see {@link https://api.jquery.com/scroll/#scroll-handler}
  2693. */
  2694. scroll(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2695. /**
  2696. * Bind an event handler to the "scroll" JavaScript event.
  2697. *
  2698. * @param eventData An object containing data that will be passed to the event handler.
  2699. * @param handler A function to execute each time the event is triggered.
  2700. * @see {@link https://api.jquery.com/scroll/#scroll-eventData-handler}
  2701. */
  2702. scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2703. /**
  2704. * Trigger the "select" event on an element.
  2705. * @see {@link https://api.jquery.com/select/#select}
  2706. */
  2707. select(): JQuery;
  2708. /**
  2709. * Bind an event handler to the "select" JavaScript event.
  2710. *
  2711. * @param handler A function to execute each time the event is triggered.
  2712. * @see {@link https://api.jquery.com/select/#select-handler}
  2713. */
  2714. select(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2715. /**
  2716. * Bind an event handler to the "select" JavaScript event.
  2717. *
  2718. * @param eventData An object containing data that will be passed to the event handler.
  2719. * @param handler A function to execute each time the event is triggered.
  2720. * @see {@link https://api.jquery.com/select/#select-eventData-handler}
  2721. */
  2722. select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2723. /**
  2724. * Trigger the "submit" event on an element.
  2725. * @see {@link https://api.jquery.com/submit/#submit}
  2726. */
  2727. submit(): JQuery;
  2728. /**
  2729. * Bind an event handler to the "submit" JavaScript event
  2730. *
  2731. * @param handler A function to execute each time the event is triggered.
  2732. * @see {@link https://api.jquery.com/submit/#submit-handler}
  2733. */
  2734. submit(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2735. /**
  2736. * Bind an event handler to the "submit" JavaScript event
  2737. *
  2738. * @param eventData An object containing data that will be passed to the event handler.
  2739. * @param handler A function to execute each time the event is triggered.
  2740. * @see {@link https://api.jquery.com/submit/#submit-eventData-handler}
  2741. */
  2742. submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
  2743. /**
  2744. * Execute all handlers and behaviors attached to the matched elements for the given event type.
  2745. *
  2746. * @param eventType A string containing a JavaScript event type, such as click or submit.
  2747. * @param extraParameters Additional parameters to pass along to the event handler.
  2748. * @see {@link https://api.jquery.com/trigger/#trigger-eventType-extraParameters}
  2749. */
  2750. trigger(eventType: string, extraParameters?: any[]|Object): JQuery;
  2751. /**
  2752. * Execute all handlers and behaviors attached to the matched elements for the given event type.
  2753. *
  2754. * @param event A jQuery.Event object.
  2755. * @param extraParameters Additional parameters to pass along to the event handler.
  2756. * @see {@link https://api.jquery.com/trigger/#trigger-event-extraParameters}
  2757. */
  2758. trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery;
  2759. /**
  2760. * Execute all handlers attached to an element for an event.
  2761. *
  2762. * @param eventType A string containing a JavaScript event type, such as click or submit.
  2763. * @param extraParameters An array of additional parameters to pass along to the event handler.
  2764. * @see {@link https://api.jquery.com/triggerHandler/#triggerHandler-eventType-extraParameters}
  2765. */
  2766. triggerHandler(eventType: string, ...extraParameters: any[]): Object;
  2767. /**
  2768. * Execute all handlers attached to an element for an event.
  2769. *
  2770. * @param event A jQuery.Event object.
  2771. * @param extraParameters An array of additional parameters to pass along to the event handler.
  2772. * @see {@link https://api.jquery.com/triggerHandler/#triggerHandler-event-extraParameters}
  2773. */
  2774. triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object;
  2775. /**
  2776. * Remove a previously-attached event handler from the elements.
  2777. *
  2778. * @param eventType A string containing a JavaScript event type, such as click or submit.
  2779. * @param handler The function that is to be no longer executed.
  2780. * @see {@link https://api.jquery.com/unbind/#unbind-eventType-handler}
  2781. */
  2782. unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
  2783. /**
  2784. * Remove a previously-attached event handler from the elements.
  2785. *
  2786. * @param eventType A string containing a JavaScript event type, such as click or submit.
  2787. * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ).
  2788. * @see {@link https://api.jquery.com/unbind/#unbind-eventType-false}
  2789. */
  2790. unbind(eventType: string, fls: boolean): JQuery;
  2791. /**
  2792. * Remove a previously-attached event handler from the elements.
  2793. *
  2794. * @param evt A JavaScript event object as passed to an event handler.
  2795. * @see {@link https://api.jquery.com/unbind/#unbind-event}
  2796. */
  2797. unbind(evt: any): JQuery;
  2798. /**
  2799. * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
  2800. * @see {@link https://api.jquery.com/undelegate/#undelegate}
  2801. */
  2802. undelegate(): JQuery;
  2803. /**
  2804. * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
  2805. *
  2806. * @param selector A selector which will be used to filter the event results.
  2807. * @param eventType A string containing a JavaScript event type, such as "click" or "keydown"
  2808. * @param handler A function to execute at the time the event is triggered.
  2809. * @see {@link https://api.jquery.com/undelegate/#undelegate-selector-eventType}
  2810. */
  2811. undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
  2812. /**
  2813. * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
  2814. *
  2815. * @param selector A selector which will be used to filter the event results.
  2816. * @param events An object of one or more event types and previously bound functions to unbind from them.
  2817. * @see {@link https://api.jquery.com/undelegate/#undelegate-selector-events}
  2818. */
  2819. undelegate(selector: string, events: Object): JQuery;
  2820. /**
  2821. * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
  2822. *
  2823. * @param module A string containing a module to unbind all events from.
  2824. * @see {@link https://api.jquery.com/undelegate/#undelegate-module}
  2825. */
  2826. undelegate(module: string): JQuery;
  2827. /**
  2828. * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
  2829. *
  2830. * @param handler A function to execute when the event is triggered.
  2831. * @see {@link https://api.jquery.com/unload/#unload-handler}
  2832. */
  2833. unload(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2834. /**
  2835. * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
  2836. *
  2837. * @param eventData A plain object of data that will be passed to the event handler.
  2838. * @param handler A function to execute when the event is triggered.
  2839. * @see {@link https://api.jquery.com/unload/#unload-eventData-handler}
  2840. */
  2841. unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
  2842. /**
  2843. * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10)
  2844. * @see {@link https://api.jquery.com/context/}
  2845. */
  2846. context: Element;
  2847. jquery: string;
  2848. /**
  2849. * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
  2850. *
  2851. * @param handler A function to execute when the event is triggered.
  2852. * @see {@link https://api.jquery.com/error/#error-handler}
  2853. */
  2854. error(handler: (eventObject: JQueryEventObject) => any): JQuery;
  2855. /**
  2856. * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
  2857. *
  2858. * @param eventData A plain object of data that will be passed to the event handler.
  2859. * @param handler A function to execute when the event is triggered.
  2860. * @see {@link https://api.jquery.com/error/#error-eventData-handler}
  2861. */
  2862. error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
  2863. /**
  2864. * Add a collection of DOM elements onto the jQuery stack.
  2865. *
  2866. * @param elements An array of elements to push onto the stack and make into a new jQuery object.
  2867. * @see {@link https://api.jquery.com/pushStack/#pushStack-elements}
  2868. */
  2869. pushStack(elements: any[]): JQuery;
  2870. /**
  2871. * Add a collection of DOM elements onto the jQuery stack.
  2872. *
  2873. * @param elements An array of elements to push onto the stack and make into a new jQuery object.
  2874. * @param name The name of a jQuery method that generated the array of elements.
  2875. * @param arguments The arguments that were passed in to the jQuery method (for serialization).
  2876. * @see {@link https://api.jquery.com/pushStack/#pushStack-elements-name-arguments}
  2877. */
  2878. pushStack(elements: any[], name: string, arguments: any[]): JQuery;
  2879. /**
  2880. * Insert content, specified by the parameter, after each element in the set of matched elements.
  2881. *
  2882. * @param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert after each element in the set of matched elements.
  2883. * @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements.
  2884. * @see {@link https://api.jquery.com/after/#after-content-content}
  2885. */
  2886. after(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery;
  2887. /**
  2888. * Insert content, specified by the parameter, after each element in the set of matched elements.
  2889. *
  2890. * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
  2891. * @see {@link https://api.jquery.com/after/#after-function}
  2892. */
  2893. after(func: (index: number, html: string) => string|Element|JQuery): JQuery;
  2894. /**
  2895. * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
  2896. *
  2897. * @param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
  2898. * @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements.
  2899. * @see {@link https://api.jquery.com/append/#append-content-content}
  2900. */
  2901. append(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery;
  2902. /**
  2903. * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
  2904. *
  2905. * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
  2906. * @see {@link https://api.jquery.com/append/#append-function}
  2907. */
  2908. append(func: (index: number, html: string) => string|Element|JQuery): JQuery;
  2909. /**
  2910. * Insert every element in the set of matched elements to the end of the target.
  2911. *
  2912. * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter.
  2913. * @see {@link https://api.jquery.com/appendTo/}
  2914. */
  2915. appendTo(target: JQuery|any[]|Element|string): JQuery;
  2916. /**
  2917. * Insert content, specified by the parameter, before each element in the set of matched elements.
  2918. *
  2919. * @param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert before each element in the set of matched elements.
  2920. * @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements.
  2921. * @see {@link https://api.jquery.com/before/#before-content-content}
  2922. */
  2923. before(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery;
  2924. /**
  2925. * Insert content, specified by the parameter, before each element in the set of matched elements.
  2926. *
  2927. * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
  2928. * @see {@link https://api.jquery.com/before/#before-function}
  2929. */
  2930. before(func: (index: number, html: string) => string|Element|JQuery): JQuery;
  2931. /**
  2932. * Create a deep copy of the set of matched elements.
  2933. *
  2934. * @param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false.
  2935. * @param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false).
  2936. * @see {@link https://api.jquery.com/clone/}
  2937. */
  2938. clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery;
  2939. /**
  2940. * Remove the set of matched elements from the DOM.
  2941. *
  2942. * @param selector A selector expression that filters the set of matched elements to be removed.
  2943. * @see {@link https://api.jquery.com/detach/}
  2944. */
  2945. detach(selector?: string): JQuery;
  2946. /**
  2947. * Remove all child nodes of the set of matched elements from the DOM.
  2948. * @see {@link https://api.jquery.com/empty/}
  2949. */
  2950. empty(): JQuery;
  2951. /**
  2952. * Insert every element in the set of matched elements after the target.
  2953. *
  2954. * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter.
  2955. * @see {@link https://api.jquery.com/insertAfter/}
  2956. */
  2957. insertAfter(target: JQuery|any[]|Element|Text|string): JQuery;
  2958. /**
  2959. * Insert every element in the set of matched elements before the target.
  2960. *
  2961. * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter.
  2962. * @see {@link https://api.jquery.com/insertBefore/}
  2963. */
  2964. insertBefore(target: JQuery|any[]|Element|Text|string): JQuery;
  2965. /**
  2966. * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
  2967. *
  2968. * @param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
  2969. * @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.
  2970. * @see {@link https://api.jquery.com/prepend/#prepend-content-content}
  2971. */
  2972. prepend(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery;
  2973. /**
  2974. * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
  2975. *
  2976. * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
  2977. * @see {@link https://api.jquery.com/prepend/#prepend-function}
  2978. */
  2979. prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery;
  2980. /**
  2981. * Insert every element in the set of matched elements to the beginning of the target.
  2982. *
  2983. * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter.
  2984. * @see {@link https://api.jquery.com/prependTo/}
  2985. */
  2986. prependTo(target: JQuery|any[]|Element|string): JQuery;
  2987. /**
  2988. * Remove the set of matched elements from the DOM.
  2989. *
  2990. * @param selector A selector expression that filters the set of matched elements to be removed.
  2991. * @see {@link https://api.jquery.com/remove/}
  2992. */
  2993. remove(selector?: string): JQuery;
  2994. /**
  2995. * Replace each target element with the set of matched elements.
  2996. *
  2997. * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace.
  2998. * @see {@link https://api.jquery.com/replaceAll/}
  2999. */
  3000. replaceAll(target: JQuery|any[]|Element|string): JQuery;
  3001. /**
  3002. * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
  3003. *
  3004. * @param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
  3005. * @see {@link https://api.jquery.com/replaceWith/#replaceWith-newContent}
  3006. */
  3007. replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery;
  3008. /**
  3009. * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
  3010. *
  3011. * @param func A function that returns content with which to replace the set of matched elements.
  3012. * @see {@link https://api.jquery.com/replaceWith/#replaceWith-function}
  3013. */
  3014. replaceWith(func: () => Element|JQuery): JQuery;
  3015. /**
  3016. * Get the combined text contents of each element in the set of matched elements, including their descendants.
  3017. * @see {@link https://api.jquery.com/text/#text}
  3018. */
  3019. text(): string;
  3020. /**
  3021. * Set the content of each element in the set of matched elements to the specified text.
  3022. *
  3023. * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation.
  3024. * @see {@link https://api.jquery.com/text/#text-text}
  3025. */
  3026. text(text: string|number|boolean): JQuery;
  3027. /**
  3028. * Set the content of each element in the set of matched elements to the specified text.
  3029. *
  3030. * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments.
  3031. * @see {@link https://api.jquery.com/text/#text-function}
  3032. */
  3033. text(func: (index: number, text: string) => string): JQuery;
  3034. /**
  3035. * Retrieve all the elements contained in the jQuery set, as an array.
  3036. * @name toArray
  3037. * @see {@link https://api.jquery.com/toArray/}
  3038. */
  3039. toArray(): HTMLElement[];
  3040. /**
  3041. * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
  3042. * @see {@link https://api.jquery.com/unwrap/}
  3043. */
  3044. unwrap(): JQuery;
  3045. /**
  3046. * Wrap an HTML structure around each element in the set of matched elements.
  3047. *
  3048. * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
  3049. * @see {@link https://api.jquery.com/wrap/#wrap-wrappingElement}
  3050. */
  3051. wrap(wrappingElement: JQuery|Element|string): JQuery;
  3052. /**
  3053. * Wrap an HTML structure around each element in the set of matched elements.
  3054. *
  3055. * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
  3056. * @see {@link https://api.jquery.com/wrap/#wrap-function}
  3057. */
  3058. wrap(func: (index: number) => string|JQuery): JQuery;
  3059. /**
  3060. * Wrap an HTML structure around all elements in the set of matched elements.
  3061. *
  3062. * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
  3063. * @see {@link https://api.jquery.com/wrapAll/#wrapAll-wrappingElement}
  3064. */
  3065. wrapAll(wrappingElement: JQuery|Element|string): JQuery;
  3066. /**
  3067. * Wrap an HTML structure around all elements in the set of matched elements.
  3068. *
  3069. * @param func A callback function returning the HTML content or jQuery object to wrap around all the matched elements. Within the function, this refers to the first element in the set.
  3070. * @see {@link https://api.jquery.com/wrapAll/#wrapAll-function}
  3071. */
  3072. wrapAll(func: (index: number) => string): JQuery;
  3073. /**
  3074. * Wrap an HTML structure around the content of each element in the set of matched elements.
  3075. *
  3076. * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements.
  3077. * @see {@link https://api.jquery.com/wrapInner/#wrapInner-wrappingElement}
  3078. */
  3079. wrapInner(wrappingElement: JQuery|Element|string): JQuery;
  3080. /**
  3081. * Wrap an HTML structure around the content of each element in the set of matched elements.
  3082. *
  3083. * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
  3084. * @see {@link https://api.jquery.com/wrapInner/#wrapInner-function}
  3085. */
  3086. wrapInner(func: (index: number) => string): JQuery;
  3087. /**
  3088. * Iterate over a jQuery object, executing a function for each matched element.
  3089. *
  3090. * @param func A function to execute for each matched element. Can stop the loop by returning false.
  3091. * @see {@link https://api.jquery.com/each/}
  3092. */
  3093. each(func: (index: number, elem: Element) => boolean | void): JQuery;
  3094. /**
  3095. * Retrieve one of the elements matched by the jQuery object.
  3096. *
  3097. * @param index A zero-based integer indicating which element to retrieve.
  3098. * @see {@link https://api.jquery.com/get/#get-index}
  3099. */
  3100. get(index: number): HTMLElement;
  3101. /**
  3102. * Retrieve the elements matched by the jQuery object.
  3103. * @alias toArray
  3104. * @see {@link https://api.jquery.com/get/#get}
  3105. */
  3106. get(): HTMLElement[];
  3107. /**
  3108. * Search for a given element from among the matched elements.
  3109. * @see {@link https://api.jquery.com/index/#index}
  3110. */
  3111. index(): number;
  3112. /**
  3113. * Search for a given element from among the matched elements.
  3114. *
  3115. * @param selector A selector representing a jQuery collection in which to look for an element.
  3116. * @see {@link https://api.jquery.com/index/#index-selector}
  3117. */
  3118. index(selector: string|JQuery|Element): number;
  3119. /**
  3120. * The number of elements in the jQuery object.
  3121. * @see {@link https://api.jquery.com/length/}
  3122. */
  3123. length: number;
  3124. /**
  3125. * A selector representing selector passed to jQuery(), if any, when creating the original set.
  3126. * version deprecated: 1.7, removed: 1.9
  3127. * @see {@link https://api.jquery.com/selector/}
  3128. */
  3129. selector: string;
  3130. [index: string]: any;
  3131. [index: number]: HTMLElement;
  3132. /**
  3133. * Add elements to the set of matched elements.
  3134. *
  3135. * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements.
  3136. * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method.
  3137. * @see {@link https://api.jquery.com/add/#add-selector}
  3138. */
  3139. add(selector: string, context?: Element): JQuery;
  3140. /**
  3141. * Add elements to the set of matched elements.
  3142. *
  3143. * @param elements One or more elements to add to the set of matched elements.
  3144. * @see {@link https://api.jquery.com/add/#add-elements}
  3145. */
  3146. add(...elements: Element[]): JQuery;
  3147. /**
  3148. * Add elements to the set of matched elements.
  3149. *
  3150. * @param html An HTML fragment to add to the set of matched elements.
  3151. * @see {@link https://api.jquery.com/add/#add-html}
  3152. */
  3153. add(html: string): JQuery;
  3154. /**
  3155. * Add elements to the set of matched elements.
  3156. *
  3157. * @param obj An existing jQuery object to add to the set of matched elements.
  3158. * @see {@link https://api.jquery.com/add/#add-selection}
  3159. */
  3160. add(obj: JQuery): JQuery;
  3161. /**
  3162. * Get the children of each element in the set of matched elements, optionally filtered by a selector.
  3163. *
  3164. * @param selector A string containing a selector expression to match elements against.
  3165. * @see {@link https://api.jquery.com/children/}
  3166. */
  3167. children(selector?: string): JQuery;
  3168. /**
  3169. * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
  3170. *
  3171. * @param selector A string containing a selector expression to match elements against.
  3172. * @see {@link https://api.jquery.com/closest/#closest-selector}
  3173. */
  3174. closest(selector: string): JQuery;
  3175. /**
  3176. * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
  3177. *
  3178. * @param selector A string containing a selector expression to match elements against.
  3179. * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
  3180. * @see {@link https://api.jquery.com/closest/#closest-selector-context}
  3181. */
  3182. closest(selector: string, context?: Element): JQuery;
  3183. /**
  3184. * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
  3185. *
  3186. * @param obj A jQuery object to match elements against.
  3187. * @see {@link https://api.jquery.com/closest/#closest-selection}
  3188. */
  3189. closest(obj: JQuery): JQuery;
  3190. /**
  3191. * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
  3192. *
  3193. * @param element An element to match elements against.
  3194. * @see {@link https://api.jquery.com/closest/#closest-element}
  3195. */
  3196. closest(element: Element): JQuery;
  3197. /**
  3198. * Get an array of all the elements and selectors matched against the current element up through the DOM tree.
  3199. *
  3200. * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object).
  3201. * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
  3202. * @see {@link https://api.jquery.com/closest/#closest-selectors-context}
  3203. */
  3204. closest(selectors: any, context?: Element): any[];
  3205. /**
  3206. * Get the children of each element in the set of matched elements, including text and comment nodes.
  3207. * @see {@link https://api.jquery.com/contents/}
  3208. */
  3209. contents(): JQuery;
  3210. /**
  3211. * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.
  3212. * @see {@link https://api.jquery.com/end/}
  3213. */
  3214. end(): JQuery;
  3215. /**
  3216. * Reduce the set of matched elements to the one at the specified index.
  3217. *
  3218. * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set.
  3219. * @see {@link https://api.jquery.com/eq/}
  3220. */
  3221. eq(index: number): JQuery;
  3222. /**
  3223. * Reduce the set of matched elements to those that match the selector or pass the function's test.
  3224. *
  3225. * @param selector A string containing a selector expression to match the current set of elements against.
  3226. * @see {@link https://api.jquery.com/filter/#filter-selector}
  3227. */
  3228. filter(selector: string): JQuery;
  3229. /**
  3230. * Reduce the set of matched elements to those that match the selector or pass the function's test.
  3231. *
  3232. * @param func A function used as a test for each element in the set. this is the current DOM element.
  3233. * @see {@link https://api.jquery.com/filter/#filter-function}
  3234. */
  3235. filter(func: (index: number, element: Element) => boolean): JQuery;
  3236. /**
  3237. * Reduce the set of matched elements to those that match the selector or pass the function's test.
  3238. *
  3239. * @param element An element to match the current set of elements against.
  3240. * @see {@link https://api.jquery.com/filter/#filter-elements}
  3241. */
  3242. filter(element: Element): JQuery;
  3243. /**
  3244. * Reduce the set of matched elements to those that match the selector or pass the function's test.
  3245. *
  3246. * @param obj An existing jQuery object to match the current set of elements against.
  3247. * @see {@link https://api.jquery.com/filter/#filter-selection}
  3248. */
  3249. filter(obj: JQuery): JQuery;
  3250. /**
  3251. * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
  3252. *
  3253. * @param selector A string containing a selector expression to match elements against.
  3254. * @see {@link https://api.jquery.com/find/#find-selector}
  3255. */
  3256. find(selector: string): JQuery;
  3257. /**
  3258. * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
  3259. *
  3260. * @param element An element to match elements against.
  3261. * @see {@link https://api.jquery.com/find/#find-element}
  3262. */
  3263. find(element: Element): JQuery;
  3264. /**
  3265. * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
  3266. *
  3267. * @param obj A jQuery object to match elements against.
  3268. * @see {@link https://api.jquery.com/find/#find-element}
  3269. */
  3270. find(obj: JQuery): JQuery;
  3271. /**
  3272. * Reduce the set of matched elements to the first in the set.
  3273. * @see {@link https://api.jquery.com/first/}
  3274. */
  3275. first(): JQuery;
  3276. /**
  3277. * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
  3278. *
  3279. * @param selector A string containing a selector expression to match elements against.
  3280. * @see {@link https://api.jquery.com/has/#has-selector}
  3281. */
  3282. has(selector: string): JQuery;
  3283. /**
  3284. * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
  3285. *
  3286. * @param contained A DOM element to match elements against.
  3287. * @see {@link https://api.jquery.com/has/#has-contained}
  3288. */
  3289. has(contained: Element): JQuery;
  3290. /**
  3291. * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
  3292. *
  3293. * @param selector A string containing a selector expression to match elements against.
  3294. * @see {@link https://api.jquery.com/is/#is-selector}
  3295. */
  3296. is(selector: string): boolean;
  3297. /**
  3298. * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
  3299. *
  3300. * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element.
  3301. * @see {@link https://api.jquery.com/is/#is-function}
  3302. */
  3303. is(func: (index: number, element: Element) => boolean): boolean;
  3304. /**
  3305. * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
  3306. *
  3307. * @param obj An existing jQuery object to match the current set of elements against.
  3308. * @see {@link https://api.jquery.com/is/#is-selection}
  3309. */
  3310. is(obj: JQuery): boolean;
  3311. /**
  3312. * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
  3313. *
  3314. * @param elements One or more elements to match the current set of elements against.
  3315. * @see {@link https://api.jquery.com/is/#is-elements}
  3316. */
  3317. is(elements: any): boolean;
  3318. /**
  3319. * Reduce the set of matched elements to the final one in the set.
  3320. * @see {@link https://api.jquery.com/last/}
  3321. */
  3322. last(): JQuery;
  3323. /**
  3324. * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.
  3325. *
  3326. * @param callback A function object that will be invoked for each element in the current set.
  3327. * @see {@link https://api.jquery.com/map/}
  3328. */
  3329. map(callback: (index: number, domElement: Element) => any): JQuery;
  3330. /**
  3331. * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
  3332. *
  3333. * @param selector A string containing a selector expression to match elements against.
  3334. * @see {@link https://api.jquery.com/next/}
  3335. */
  3336. next(selector?: string): JQuery;
  3337. /**
  3338. * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
  3339. *
  3340. * @param selector A string containing a selector expression to match elements against.
  3341. * @see {@link https://api.jquery.com/nextAll/}
  3342. */
  3343. nextAll(selector?: string): JQuery;
  3344. /**
  3345. * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
  3346. *
  3347. * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements.
  3348. * @param filter A string containing a selector expression to match elements against.
  3349. * @see {@link https://api.jquery.com/nextUntil/#nextUntil-selector-filter}
  3350. */
  3351. nextUntil(selector?: string, filter?: string): JQuery;
  3352. /**
  3353. * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
  3354. *
  3355. * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements.
  3356. * @param filter A string containing a selector expression to match elements against.
  3357. * @see {@link https://api.jquery.com/nextUntil/#nextUntil-element-filter}
  3358. */
  3359. nextUntil(element?: Element, filter?: string): JQuery;
  3360. /**
  3361. * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
  3362. *
  3363. * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements.
  3364. * @param filter A string containing a selector expression to match elements against.
  3365. * @see {@link https://api.jquery.com/nextUntil/#nextUntil-element-filter}
  3366. */
  3367. nextUntil(obj?: JQuery, filter?: string): JQuery;
  3368. /**
  3369. * Remove elements from the set of matched elements.
  3370. *
  3371. * @param selector A string containing a selector expression to match elements against.
  3372. * @see {@link https://api.jquery.com/not/#not-selector}
  3373. */
  3374. not(selector: string): JQuery;
  3375. /**
  3376. * Remove elements from the set of matched elements.
  3377. *
  3378. * @param func A function used as a test for each element in the set. this is the current DOM element.
  3379. * @see {@link https://api.jquery.com/not/#not-function}
  3380. */
  3381. not(func: (index: number, element: Element) => boolean): JQuery;
  3382. /**
  3383. * Remove elements from the set of matched elements.
  3384. *
  3385. * @param elements One or more DOM elements to remove from the matched set.
  3386. * @see {@link https://api.jquery.com/not/#not-selection}
  3387. */
  3388. not(elements: Element|Element[]): JQuery;
  3389. /**
  3390. * Remove elements from the set of matched elements.
  3391. *
  3392. * @param obj An existing jQuery object to match the current set of elements against.
  3393. * @see {@link https://api.jquery.com/not/#not-selection}
  3394. */
  3395. not(obj: JQuery): JQuery;
  3396. /**
  3397. * Get the closest ancestor element that is positioned.
  3398. * @see {@link https://api.jquery.com/offsetParent/}
  3399. */
  3400. offsetParent(): JQuery;
  3401. /**
  3402. * Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
  3403. *
  3404. * @param selector A string containing a selector expression to match elements against.
  3405. * @see {@link https://api.jquery.com/parent/}
  3406. */
  3407. parent(selector?: string): JQuery;
  3408. /**
  3409. * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
  3410. *
  3411. * @param selector A string containing a selector expression to match elements against.
  3412. * @see {@link https://api.jquery.com/parents/}
  3413. */
  3414. parents(selector?: string): JQuery;
  3415. /**
  3416. * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
  3417. *
  3418. * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements.
  3419. * @param filter A string containing a selector expression to match elements against.
  3420. * @see {@link https://api.jquery.com/parentsUntil/#parentsUntil-selector-filter}
  3421. */
  3422. parentsUntil(selector?: string, filter?: string): JQuery;
  3423. /**
  3424. * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
  3425. *
  3426. * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements.
  3427. * @param filter A string containing a selector expression to match elements against.
  3428. * @see {@link https://api.jquery.com/parentsUntil/#parentsUntil-element-filter}
  3429. */
  3430. parentsUntil(element?: Element, filter?: string): JQuery;
  3431. /**
  3432. * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
  3433. *
  3434. * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements.
  3435. * @param filter A string containing a selector expression to match elements against.
  3436. * @see {@link https://api.jquery.com/parentsUntil/#parentsUntil-element-filter}
  3437. */
  3438. parentsUntil(obj?: JQuery, filter?: string): JQuery;
  3439. /**
  3440. * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.
  3441. *
  3442. * @param selector A string containing a selector expression to match elements against.
  3443. * @see {@link https://api.jquery.com/prev/}
  3444. */
  3445. prev(selector?: string): JQuery;
  3446. /**
  3447. * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
  3448. *
  3449. * @param selector A string containing a selector expression to match elements against.
  3450. * @see {@link https://api.jquery.com/prevAll/}
  3451. */
  3452. prevAll(selector?: string): JQuery;
  3453. /**
  3454. * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
  3455. *
  3456. * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements.
  3457. * @param filter A string containing a selector expression to match elements against.
  3458. * @see {@link https://api.jquery.com/prevUntil/#prevUntil-selector-filter}
  3459. */
  3460. prevUntil(selector?: string, filter?: string): JQuery;
  3461. /**
  3462. * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
  3463. *
  3464. * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
  3465. * @param filter A string containing a selector expression to match elements against.
  3466. * @see {@link https://api.jquery.com/prevUntil/#prevUntil-element-filter}
  3467. */
  3468. prevUntil(element?: Element, filter?: string): JQuery;
  3469. /**
  3470. * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
  3471. *
  3472. * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
  3473. * @param filter A string containing a selector expression to match elements against.
  3474. * @see {@link https://api.jquery.com/prevUntil/#prevUntil-element-filter}
  3475. */
  3476. prevUntil(obj?: JQuery, filter?: string): JQuery;
  3477. /**
  3478. * Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
  3479. *
  3480. * @param selector A string containing a selector expression to match elements against.
  3481. * @see {@link https://api.jquery.com/siblings/}
  3482. */
  3483. siblings(selector?: string): JQuery;
  3484. /**
  3485. * Reduce the set of matched elements to a subset specified by a range of indices.
  3486. *
  3487. * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set.
  3488. * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set.
  3489. * @see {@link https://api.jquery.com/slice/}
  3490. */
  3491. slice(start: number, end?: number): JQuery;
  3492. /**
  3493. * Show the queue of functions to be executed on the matched elements.
  3494. *
  3495. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
  3496. * @see {@link https://api.jquery.com/queue/#queue-queueName}
  3497. */
  3498. queue(queueName?: string): any[];
  3499. /**
  3500. * Manipulate the queue of functions to be executed, once for each matched element.
  3501. *
  3502. * @param newQueue An array of functions to replace the current queue contents.
  3503. * @see {@link https://api.jquery.com/queue/#queue-queueName-newQueue}
  3504. */
  3505. queue(newQueue: Function[]): JQuery;
  3506. /**
  3507. * Manipulate the queue of functions to be executed, once for each matched element.
  3508. *
  3509. * @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
  3510. * @see {@link https://api.jquery.com/queue/#queue-queueName-callback}
  3511. */
  3512. queue(callback: Function): JQuery;
  3513. /**
  3514. * Manipulate the queue of functions to be executed, once for each matched element.
  3515. *
  3516. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
  3517. * @param newQueue An array of functions to replace the current queue contents.
  3518. * @see {@link https://api.jquery.com/queue/#queue-queueName-newQueue}
  3519. */
  3520. queue(queueName: string, newQueue: Function[]): JQuery;
  3521. /**
  3522. * Manipulate the queue of functions to be executed, once for each matched element.
  3523. *
  3524. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
  3525. * @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
  3526. * @see {@link https://api.jquery.com/queue/#queue-queueName-callback}
  3527. */
  3528. queue(queueName: string, callback: Function): JQuery;
  3529. }
  3530. declare module "jquery" {
  3531. export = $;
  3532. }
  3533. declare var jQuery: JQueryStatic;
  3534. declare var $: JQueryStatic;