lib.es5.d.ts 211 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501
  1. /*! *****************************************************************************
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  4. this file except in compliance with the License. You may obtain a copy of the
  5. License at http://www.apache.org/licenses/LICENSE-2.0
  6. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  8. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  9. MERCHANTABLITY OR NON-INFRINGEMENT.
  10. See the Apache Version 2.0 License for specific language governing permissions
  11. and limitations under the License.
  12. ***************************************************************************** */
  13. /// <reference no-default-lib="true"/>
  14. /////////////////////////////
  15. /// ECMAScript APIs
  16. /////////////////////////////
  17. declare var NaN: number;
  18. declare var Infinity: number;
  19. /**
  20. * Evaluates JavaScript code and executes it.
  21. * @param x A String value that contains valid JavaScript code.
  22. */
  23. declare function eval(x: string): any;
  24. /**
  25. * Converts a string to an integer.
  26. * @param string A string to convert into a number.
  27. * @param radix A value between 2 and 36 that specifies the base of the number in `string`.
  28. * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
  29. * All other strings are considered decimal.
  30. */
  31. declare function parseInt(string: string, radix?: number): number;
  32. /**
  33. * Converts a string to a floating-point number.
  34. * @param string A string that contains a floating-point number.
  35. */
  36. declare function parseFloat(string: string): number;
  37. /**
  38. * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).
  39. * @param number A numeric value.
  40. */
  41. declare function isNaN(number: number): boolean;
  42. /**
  43. * Determines whether a supplied number is finite.
  44. * @param number Any numeric value.
  45. */
  46. declare function isFinite(number: number): boolean;
  47. /**
  48. * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).
  49. * @param encodedURI A value representing an encoded URI.
  50. */
  51. declare function decodeURI(encodedURI: string): string;
  52. /**
  53. * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).
  54. * @param encodedURIComponent A value representing an encoded URI component.
  55. */
  56. declare function decodeURIComponent(encodedURIComponent: string): string;
  57. /**
  58. * Encodes a text string as a valid Uniform Resource Identifier (URI)
  59. * @param uri A value representing an unencoded URI.
  60. */
  61. declare function encodeURI(uri: string): string;
  62. /**
  63. * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
  64. * @param uriComponent A value representing an unencoded URI component.
  65. */
  66. declare function encodeURIComponent(uriComponent: string | number | boolean): string;
  67. /**
  68. * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.
  69. * @deprecated A legacy feature for browser compatibility
  70. * @param string A string value
  71. */
  72. declare function escape(string: string): string;
  73. /**
  74. * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.
  75. * @deprecated A legacy feature for browser compatibility
  76. * @param string A string value
  77. */
  78. declare function unescape(string: string): string;
  79. interface Symbol {
  80. /** Returns a string representation of an object. */
  81. toString(): string;
  82. /** Returns the primitive value of the specified object. */
  83. valueOf(): symbol;
  84. }
  85. declare type PropertyKey = string | number | symbol;
  86. interface PropertyDescriptor {
  87. configurable?: boolean;
  88. enumerable?: boolean;
  89. value?: any;
  90. writable?: boolean;
  91. get?(): any;
  92. set?(v: any): void;
  93. }
  94. interface PropertyDescriptorMap {
  95. [key: PropertyKey]: PropertyDescriptor;
  96. }
  97. interface Object {
  98. /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */
  99. constructor: Function;
  100. /** Returns a string representation of an object. */
  101. toString(): string;
  102. /** Returns a date converted to a string using the current locale. */
  103. toLocaleString(): string;
  104. /** Returns the primitive value of the specified object. */
  105. valueOf(): Object;
  106. /**
  107. * Determines whether an object has a property with the specified name.
  108. * @param v A property name.
  109. */
  110. hasOwnProperty(v: PropertyKey): boolean;
  111. /**
  112. * Determines whether an object exists in another object's prototype chain.
  113. * @param v Another object whose prototype chain is to be checked.
  114. */
  115. isPrototypeOf(v: Object): boolean;
  116. /**
  117. * Determines whether a specified property is enumerable.
  118. * @param v A property name.
  119. */
  120. propertyIsEnumerable(v: PropertyKey): boolean;
  121. }
  122. interface ObjectConstructor {
  123. new(value?: any): Object;
  124. (): any;
  125. (value: any): any;
  126. /** A reference to the prototype for a class of objects. */
  127. readonly prototype: Object;
  128. /**
  129. * Returns the prototype of an object.
  130. * @param o The object that references the prototype.
  131. */
  132. getPrototypeOf(o: any): any;
  133. /**
  134. * Gets the own property descriptor of the specified object.
  135. * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.
  136. * @param o Object that contains the property.
  137. * @param p Name of the property.
  138. */
  139. getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
  140. /**
  141. * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly
  142. * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.
  143. * @param o Object that contains the own properties.
  144. */
  145. getOwnPropertyNames(o: any): string[];
  146. /**
  147. * Creates an object that has the specified prototype or that has null prototype.
  148. * @param o Object to use as a prototype. May be null.
  149. */
  150. create(o: object | null): any;
  151. /**
  152. * Creates an object that has the specified prototype, and that optionally contains specified properties.
  153. * @param o Object to use as a prototype. May be null
  154. * @param properties JavaScript object that contains one or more property descriptors.
  155. */
  156. create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
  157. /**
  158. * Adds a property to an object, or modifies attributes of an existing property.
  159. * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.
  160. * @param p The property name.
  161. * @param attributes Descriptor for the property. It can be for a data property or an accessor property.
  162. */
  163. defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
  164. /**
  165. * Adds one or more properties to an object, and/or modifies attributes of existing properties.
  166. * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.
  167. * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.
  168. */
  169. defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
  170. /**
  171. * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.
  172. * @param o Object on which to lock the attributes.
  173. */
  174. seal<T>(o: T): T;
  175. /**
  176. * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
  177. * @param a Object on which to lock the attributes.
  178. */
  179. freeze<T>(a: T[]): readonly T[];
  180. /**
  181. * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
  182. * @param f Object on which to lock the attributes.
  183. */
  184. freeze<T extends Function>(f: T): T;
  185. /**
  186. * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
  187. * @param o Object on which to lock the attributes.
  188. */
  189. freeze<T extends {[idx: string]: U | null | undefined | object}, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
  190. /**
  191. * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
  192. * @param o Object on which to lock the attributes.
  193. */
  194. freeze<T>(o: T): Readonly<T>;
  195. /**
  196. * Prevents the addition of new properties to an object.
  197. * @param o Object to make non-extensible.
  198. */
  199. preventExtensions<T>(o: T): T;
  200. /**
  201. * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.
  202. * @param o Object to test.
  203. */
  204. isSealed(o: any): boolean;
  205. /**
  206. * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.
  207. * @param o Object to test.
  208. */
  209. isFrozen(o: any): boolean;
  210. /**
  211. * Returns a value that indicates whether new properties can be added to an object.
  212. * @param o Object to test.
  213. */
  214. isExtensible(o: any): boolean;
  215. /**
  216. * Returns the names of the enumerable string properties and methods of an object.
  217. * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
  218. */
  219. keys(o: object): string[];
  220. }
  221. /**
  222. * Provides functionality common to all JavaScript objects.
  223. */
  224. declare var Object: ObjectConstructor;
  225. /**
  226. * Creates a new function.
  227. */
  228. interface Function {
  229. /**
  230. * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.
  231. * @param thisArg The object to be used as the this object.
  232. * @param argArray A set of arguments to be passed to the function.
  233. */
  234. apply(this: Function, thisArg: any, argArray?: any): any;
  235. /**
  236. * Calls a method of an object, substituting another object for the current object.
  237. * @param thisArg The object to be used as the current object.
  238. * @param argArray A list of arguments to be passed to the method.
  239. */
  240. call(this: Function, thisArg: any, ...argArray: any[]): any;
  241. /**
  242. * For a given function, creates a bound function that has the same body as the original function.
  243. * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
  244. * @param thisArg An object to which the this keyword can refer inside the new function.
  245. * @param argArray A list of arguments to be passed to the new function.
  246. */
  247. bind(this: Function, thisArg: any, ...argArray: any[]): any;
  248. /** Returns a string representation of a function. */
  249. toString(): string;
  250. prototype: any;
  251. readonly length: number;
  252. // Non-standard extensions
  253. arguments: any;
  254. caller: Function;
  255. }
  256. interface FunctionConstructor {
  257. /**
  258. * Creates a new function.
  259. * @param args A list of arguments the function accepts.
  260. */
  261. new(...args: string[]): Function;
  262. (...args: string[]): Function;
  263. readonly prototype: Function;
  264. }
  265. declare var Function: FunctionConstructor;
  266. /**
  267. * Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter.
  268. */
  269. type ThisParameterType<T> = T extends (this: infer U, ...args: never) => any ? U : unknown;
  270. /**
  271. * Removes the 'this' parameter from a function type.
  272. */
  273. type OmitThisParameter<T> = unknown extends ThisParameterType<T> ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T;
  274. interface CallableFunction extends Function {
  275. /**
  276. * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
  277. * @param thisArg The object to be used as the this object.
  278. * @param args An array of argument values to be passed to the function.
  279. */
  280. apply<T, R>(this: (this: T) => R, thisArg: T): R;
  281. apply<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R;
  282. /**
  283. * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.
  284. * @param thisArg The object to be used as the this object.
  285. * @param args Argument values to be passed to the function.
  286. */
  287. call<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R;
  288. /**
  289. * For a given function, creates a bound function that has the same body as the original function.
  290. * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
  291. * @param thisArg The object to be used as the this object.
  292. * @param args Arguments to bind to the parameters of the function.
  293. */
  294. bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;
  295. bind<T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R;
  296. bind<T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R;
  297. bind<T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R;
  298. bind<T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R;
  299. bind<T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R;
  300. }
  301. interface NewableFunction extends Function {
  302. /**
  303. * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
  304. * @param thisArg The object to be used as the this object.
  305. * @param args An array of argument values to be passed to the function.
  306. */
  307. apply<T>(this: new () => T, thisArg: T): void;
  308. apply<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, args: A): void;
  309. /**
  310. * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.
  311. * @param thisArg The object to be used as the this object.
  312. * @param args Argument values to be passed to the function.
  313. */
  314. call<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, ...args: A): void;
  315. /**
  316. * For a given function, creates a bound function that has the same body as the original function.
  317. * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
  318. * @param thisArg The object to be used as the this object.
  319. * @param args Arguments to bind to the parameters of the function.
  320. */
  321. bind<T>(this: T, thisArg: any): T;
  322. bind<A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R;
  323. bind<A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R;
  324. bind<A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R;
  325. bind<A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R;
  326. bind<AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R;
  327. }
  328. interface IArguments {
  329. [index: number]: any;
  330. length: number;
  331. callee: Function;
  332. }
  333. interface String {
  334. /** Returns a string representation of a string. */
  335. toString(): string;
  336. /**
  337. * Returns the character at the specified index.
  338. * @param pos The zero-based index of the desired character.
  339. */
  340. charAt(pos: number): string;
  341. /**
  342. * Returns the Unicode value of the character at the specified location.
  343. * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.
  344. */
  345. charCodeAt(index: number): number;
  346. /**
  347. * Returns a string that contains the concatenation of two or more strings.
  348. * @param strings The strings to append to the end of the string.
  349. */
  350. concat(...strings: string[]): string;
  351. /**
  352. * Returns the position of the first occurrence of a substring.
  353. * @param searchString The substring to search for in the string
  354. * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.
  355. */
  356. indexOf(searchString: string, position?: number): number;
  357. /**
  358. * Returns the last occurrence of a substring in the string.
  359. * @param searchString The substring to search for.
  360. * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.
  361. */
  362. lastIndexOf(searchString: string, position?: number): number;
  363. /**
  364. * Determines whether two strings are equivalent in the current locale.
  365. * @param that String to compare to target string
  366. */
  367. localeCompare(that: string): number;
  368. /**
  369. * Matches a string with a regular expression, and returns an array containing the results of that search.
  370. * @param regexp A variable name or string literal containing the regular expression pattern and flags.
  371. */
  372. match(regexp: string | RegExp): RegExpMatchArray | null;
  373. /**
  374. * Replaces text in a string, using a regular expression or search string.
  375. * @param searchValue A string to search for.
  376. * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
  377. */
  378. replace(searchValue: string | RegExp, replaceValue: string): string;
  379. /**
  380. * Replaces text in a string, using a regular expression or search string.
  381. * @param searchValue A string to search for.
  382. * @param replacer A function that returns the replacement text.
  383. */
  384. replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
  385. /**
  386. * Finds the first substring match in a regular expression search.
  387. * @param regexp The regular expression pattern and applicable flags.
  388. */
  389. search(regexp: string | RegExp): number;
  390. /**
  391. * Returns a section of a string.
  392. * @param start The index to the beginning of the specified portion of stringObj.
  393. * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.
  394. * If this value is not specified, the substring continues to the end of stringObj.
  395. */
  396. slice(start?: number, end?: number): string;
  397. /**
  398. * Split a string into substrings using the specified separator and return them as an array.
  399. * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
  400. * @param limit A value used to limit the number of elements returned in the array.
  401. */
  402. split(separator: string | RegExp, limit?: number): string[];
  403. /**
  404. * Returns the substring at the specified location within a String object.
  405. * @param start The zero-based index number indicating the beginning of the substring.
  406. * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.
  407. * If end is omitted, the characters from start through the end of the original string are returned.
  408. */
  409. substring(start: number, end?: number): string;
  410. /** Converts all the alphabetic characters in a string to lowercase. */
  411. toLowerCase(): string;
  412. /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */
  413. toLocaleLowerCase(locales?: string | string[]): string;
  414. /** Converts all the alphabetic characters in a string to uppercase. */
  415. toUpperCase(): string;
  416. /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */
  417. toLocaleUpperCase(locales?: string | string[]): string;
  418. /** Removes the leading and trailing white space and line terminator characters from a string. */
  419. trim(): string;
  420. /** Returns the length of a String object. */
  421. readonly length: number;
  422. // IE extensions
  423. /**
  424. * Gets a substring beginning at the specified location and having the specified length.
  425. * @deprecated A legacy feature for browser compatibility
  426. * @param from The starting position of the desired substring. The index of the first character in the string is zero.
  427. * @param length The number of characters to include in the returned substring.
  428. */
  429. substr(from: number, length?: number): string;
  430. /** Returns the primitive value of the specified object. */
  431. valueOf(): string;
  432. readonly [index: number]: string;
  433. }
  434. interface StringConstructor {
  435. new(value?: any): String;
  436. (value?: any): string;
  437. readonly prototype: String;
  438. fromCharCode(...codes: number[]): string;
  439. }
  440. /**
  441. * Allows manipulation and formatting of text strings and determination and location of substrings within strings.
  442. */
  443. declare var String: StringConstructor;
  444. interface Boolean {
  445. /** Returns the primitive value of the specified object. */
  446. valueOf(): boolean;
  447. }
  448. interface BooleanConstructor {
  449. new(value?: any): Boolean;
  450. <T>(value?: T): boolean;
  451. readonly prototype: Boolean;
  452. }
  453. declare var Boolean: BooleanConstructor;
  454. interface Number {
  455. /**
  456. * Returns a string representation of an object.
  457. * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.
  458. */
  459. toString(radix?: number): string;
  460. /**
  461. * Returns a string representing a number in fixed-point notation.
  462. * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
  463. */
  464. toFixed(fractionDigits?: number): string;
  465. /**
  466. * Returns a string containing a number represented in exponential notation.
  467. * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
  468. */
  469. toExponential(fractionDigits?: number): string;
  470. /**
  471. * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.
  472. * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.
  473. */
  474. toPrecision(precision?: number): string;
  475. /** Returns the primitive value of the specified object. */
  476. valueOf(): number;
  477. }
  478. interface NumberConstructor {
  479. new(value?: any): Number;
  480. (value?: any): number;
  481. readonly prototype: Number;
  482. /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */
  483. readonly MAX_VALUE: number;
  484. /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */
  485. readonly MIN_VALUE: number;
  486. /**
  487. * A value that is not a number.
  488. * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.
  489. */
  490. readonly NaN: number;
  491. /**
  492. * A value that is less than the largest negative number that can be represented in JavaScript.
  493. * JavaScript displays NEGATIVE_INFINITY values as -infinity.
  494. */
  495. readonly NEGATIVE_INFINITY: number;
  496. /**
  497. * A value greater than the largest number that can be represented in JavaScript.
  498. * JavaScript displays POSITIVE_INFINITY values as infinity.
  499. */
  500. readonly POSITIVE_INFINITY: number;
  501. }
  502. /** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */
  503. declare var Number: NumberConstructor;
  504. interface TemplateStringsArray extends ReadonlyArray<string> {
  505. readonly raw: readonly string[];
  506. }
  507. /**
  508. * The type of `import.meta`.
  509. *
  510. * If you need to declare that a given property exists on `import.meta`,
  511. * this type may be augmented via interface merging.
  512. */
  513. interface ImportMeta {
  514. }
  515. /**
  516. * The type for the optional second argument to `import()`.
  517. *
  518. * If your host environment supports additional options, this type may be
  519. * augmented via interface merging.
  520. */
  521. interface ImportCallOptions {
  522. assert?: ImportAssertions;
  523. }
  524. /**
  525. * The type for the `assert` property of the optional second argument to `import()`.
  526. */
  527. interface ImportAssertions {
  528. [key: string]: string;
  529. }
  530. interface Math {
  531. /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */
  532. readonly E: number;
  533. /** The natural logarithm of 10. */
  534. readonly LN10: number;
  535. /** The natural logarithm of 2. */
  536. readonly LN2: number;
  537. /** The base-2 logarithm of e. */
  538. readonly LOG2E: number;
  539. /** The base-10 logarithm of e. */
  540. readonly LOG10E: number;
  541. /** Pi. This is the ratio of the circumference of a circle to its diameter. */
  542. readonly PI: number;
  543. /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */
  544. readonly SQRT1_2: number;
  545. /** The square root of 2. */
  546. readonly SQRT2: number;
  547. /**
  548. * Returns the absolute value of a number (the value without regard to whether it is positive or negative).
  549. * For example, the absolute value of -5 is the same as the absolute value of 5.
  550. * @param x A numeric expression for which the absolute value is needed.
  551. */
  552. abs(x: number): number;
  553. /**
  554. * Returns the arc cosine (or inverse cosine) of a number.
  555. * @param x A numeric expression.
  556. */
  557. acos(x: number): number;
  558. /**
  559. * Returns the arcsine of a number.
  560. * @param x A numeric expression.
  561. */
  562. asin(x: number): number;
  563. /**
  564. * Returns the arctangent of a number.
  565. * @param x A numeric expression for which the arctangent is needed.
  566. */
  567. atan(x: number): number;
  568. /**
  569. * Returns the angle (in radians) from the X axis to a point.
  570. * @param y A numeric expression representing the cartesian y-coordinate.
  571. * @param x A numeric expression representing the cartesian x-coordinate.
  572. */
  573. atan2(y: number, x: number): number;
  574. /**
  575. * Returns the smallest integer greater than or equal to its numeric argument.
  576. * @param x A numeric expression.
  577. */
  578. ceil(x: number): number;
  579. /**
  580. * Returns the cosine of a number.
  581. * @param x A numeric expression that contains an angle measured in radians.
  582. */
  583. cos(x: number): number;
  584. /**
  585. * Returns e (the base of natural logarithms) raised to a power.
  586. * @param x A numeric expression representing the power of e.
  587. */
  588. exp(x: number): number;
  589. /**
  590. * Returns the greatest integer less than or equal to its numeric argument.
  591. * @param x A numeric expression.
  592. */
  593. floor(x: number): number;
  594. /**
  595. * Returns the natural logarithm (base e) of a number.
  596. * @param x A numeric expression.
  597. */
  598. log(x: number): number;
  599. /**
  600. * Returns the larger of a set of supplied numeric expressions.
  601. * @param values Numeric expressions to be evaluated.
  602. */
  603. max(...values: number[]): number;
  604. /**
  605. * Returns the smaller of a set of supplied numeric expressions.
  606. * @param values Numeric expressions to be evaluated.
  607. */
  608. min(...values: number[]): number;
  609. /**
  610. * Returns the value of a base expression taken to a specified power.
  611. * @param x The base value of the expression.
  612. * @param y The exponent value of the expression.
  613. */
  614. pow(x: number, y: number): number;
  615. /** Returns a pseudorandom number between 0 and 1. */
  616. random(): number;
  617. /**
  618. * Returns a supplied numeric expression rounded to the nearest integer.
  619. * @param x The value to be rounded to the nearest integer.
  620. */
  621. round(x: number): number;
  622. /**
  623. * Returns the sine of a number.
  624. * @param x A numeric expression that contains an angle measured in radians.
  625. */
  626. sin(x: number): number;
  627. /**
  628. * Returns the square root of a number.
  629. * @param x A numeric expression.
  630. */
  631. sqrt(x: number): number;
  632. /**
  633. * Returns the tangent of a number.
  634. * @param x A numeric expression that contains an angle measured in radians.
  635. */
  636. tan(x: number): number;
  637. }
  638. /** An intrinsic object that provides basic mathematics functionality and constants. */
  639. declare var Math: Math;
  640. /** Enables basic storage and retrieval of dates and times. */
  641. interface Date {
  642. /** Returns a string representation of a date. The format of the string depends on the locale. */
  643. toString(): string;
  644. /** Returns a date as a string value. */
  645. toDateString(): string;
  646. /** Returns a time as a string value. */
  647. toTimeString(): string;
  648. /** Returns a value as a string value appropriate to the host environment's current locale. */
  649. toLocaleString(): string;
  650. /** Returns a date as a string value appropriate to the host environment's current locale. */
  651. toLocaleDateString(): string;
  652. /** Returns a time as a string value appropriate to the host environment's current locale. */
  653. toLocaleTimeString(): string;
  654. /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */
  655. valueOf(): number;
  656. /** Gets the time value in milliseconds. */
  657. getTime(): number;
  658. /** Gets the year, using local time. */
  659. getFullYear(): number;
  660. /** Gets the year using Universal Coordinated Time (UTC). */
  661. getUTCFullYear(): number;
  662. /** Gets the month, using local time. */
  663. getMonth(): number;
  664. /** Gets the month of a Date object using Universal Coordinated Time (UTC). */
  665. getUTCMonth(): number;
  666. /** Gets the day-of-the-month, using local time. */
  667. getDate(): number;
  668. /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */
  669. getUTCDate(): number;
  670. /** Gets the day of the week, using local time. */
  671. getDay(): number;
  672. /** Gets the day of the week using Universal Coordinated Time (UTC). */
  673. getUTCDay(): number;
  674. /** Gets the hours in a date, using local time. */
  675. getHours(): number;
  676. /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */
  677. getUTCHours(): number;
  678. /** Gets the minutes of a Date object, using local time. */
  679. getMinutes(): number;
  680. /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */
  681. getUTCMinutes(): number;
  682. /** Gets the seconds of a Date object, using local time. */
  683. getSeconds(): number;
  684. /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */
  685. getUTCSeconds(): number;
  686. /** Gets the milliseconds of a Date, using local time. */
  687. getMilliseconds(): number;
  688. /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */
  689. getUTCMilliseconds(): number;
  690. /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */
  691. getTimezoneOffset(): number;
  692. /**
  693. * Sets the date and time value in the Date object.
  694. * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.
  695. */
  696. setTime(time: number): number;
  697. /**
  698. * Sets the milliseconds value in the Date object using local time.
  699. * @param ms A numeric value equal to the millisecond value.
  700. */
  701. setMilliseconds(ms: number): number;
  702. /**
  703. * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
  704. * @param ms A numeric value equal to the millisecond value.
  705. */
  706. setUTCMilliseconds(ms: number): number;
  707. /**
  708. * Sets the seconds value in the Date object using local time.
  709. * @param sec A numeric value equal to the seconds value.
  710. * @param ms A numeric value equal to the milliseconds value.
  711. */
  712. setSeconds(sec: number, ms?: number): number;
  713. /**
  714. * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).
  715. * @param sec A numeric value equal to the seconds value.
  716. * @param ms A numeric value equal to the milliseconds value.
  717. */
  718. setUTCSeconds(sec: number, ms?: number): number;
  719. /**
  720. * Sets the minutes value in the Date object using local time.
  721. * @param min A numeric value equal to the minutes value.
  722. * @param sec A numeric value equal to the seconds value.
  723. * @param ms A numeric value equal to the milliseconds value.
  724. */
  725. setMinutes(min: number, sec?: number, ms?: number): number;
  726. /**
  727. * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
  728. * @param min A numeric value equal to the minutes value.
  729. * @param sec A numeric value equal to the seconds value.
  730. * @param ms A numeric value equal to the milliseconds value.
  731. */
  732. setUTCMinutes(min: number, sec?: number, ms?: number): number;
  733. /**
  734. * Sets the hour value in the Date object using local time.
  735. * @param hours A numeric value equal to the hours value.
  736. * @param min A numeric value equal to the minutes value.
  737. * @param sec A numeric value equal to the seconds value.
  738. * @param ms A numeric value equal to the milliseconds value.
  739. */
  740. setHours(hours: number, min?: number, sec?: number, ms?: number): number;
  741. /**
  742. * Sets the hours value in the Date object using Universal Coordinated Time (UTC).
  743. * @param hours A numeric value equal to the hours value.
  744. * @param min A numeric value equal to the minutes value.
  745. * @param sec A numeric value equal to the seconds value.
  746. * @param ms A numeric value equal to the milliseconds value.
  747. */
  748. setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;
  749. /**
  750. * Sets the numeric day-of-the-month value of the Date object using local time.
  751. * @param date A numeric value equal to the day of the month.
  752. */
  753. setDate(date: number): number;
  754. /**
  755. * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
  756. * @param date A numeric value equal to the day of the month.
  757. */
  758. setUTCDate(date: number): number;
  759. /**
  760. * Sets the month value in the Date object using local time.
  761. * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
  762. * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.
  763. */
  764. setMonth(month: number, date?: number): number;
  765. /**
  766. * Sets the month value in the Date object using Universal Coordinated Time (UTC).
  767. * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
  768. * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.
  769. */
  770. setUTCMonth(month: number, date?: number): number;
  771. /**
  772. * Sets the year of the Date object using local time.
  773. * @param year A numeric value for the year.
  774. * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.
  775. * @param date A numeric value equal for the day of the month.
  776. */
  777. setFullYear(year: number, month?: number, date?: number): number;
  778. /**
  779. * Sets the year value in the Date object using Universal Coordinated Time (UTC).
  780. * @param year A numeric value equal to the year.
  781. * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.
  782. * @param date A numeric value equal to the day of the month.
  783. */
  784. setUTCFullYear(year: number, month?: number, date?: number): number;
  785. /** Returns a date converted to a string using Universal Coordinated Time (UTC). */
  786. toUTCString(): string;
  787. /** Returns a date as a string value in ISO format. */
  788. toISOString(): string;
  789. /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */
  790. toJSON(key?: any): string;
  791. }
  792. interface DateConstructor {
  793. new(): Date;
  794. new(value: number | string): Date;
  795. new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
  796. (): string;
  797. readonly prototype: Date;
  798. /**
  799. * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.
  800. * @param s A date string
  801. */
  802. parse(s: string): number;
  803. /**
  804. * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
  805. * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
  806. * @param month The month as a number between 0 and 11 (January to December).
  807. * @param date The date as a number between 1 and 31.
  808. * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
  809. * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
  810. * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
  811. * @param ms A number from 0 to 999 that specifies the milliseconds.
  812. */
  813. UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
  814. now(): number;
  815. }
  816. declare var Date: DateConstructor;
  817. interface RegExpMatchArray extends Array<string> {
  818. index?: number;
  819. input?: string;
  820. }
  821. interface RegExpExecArray extends Array<string> {
  822. index: number;
  823. input: string;
  824. }
  825. interface RegExp {
  826. /**
  827. * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.
  828. * @param string The String object or string literal on which to perform the search.
  829. */
  830. exec(string: string): RegExpExecArray | null;
  831. /**
  832. * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.
  833. * @param string String on which to perform the search.
  834. */
  835. test(string: string): boolean;
  836. /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */
  837. readonly source: string;
  838. /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */
  839. readonly global: boolean;
  840. /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */
  841. readonly ignoreCase: boolean;
  842. /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */
  843. readonly multiline: boolean;
  844. lastIndex: number;
  845. // Non-standard extensions
  846. /** @deprecated A legacy feature for browser compatibility */
  847. compile(pattern: string, flags?: string): this;
  848. }
  849. interface RegExpConstructor {
  850. new(pattern: RegExp | string): RegExp;
  851. new(pattern: string, flags?: string): RegExp;
  852. (pattern: RegExp | string): RegExp;
  853. (pattern: string, flags?: string): RegExp;
  854. readonly prototype: RegExp;
  855. // Non-standard extensions
  856. /** @deprecated A legacy feature for browser compatibility */
  857. $1: string;
  858. /** @deprecated A legacy feature for browser compatibility */
  859. $2: string;
  860. /** @deprecated A legacy feature for browser compatibility */
  861. $3: string;
  862. /** @deprecated A legacy feature for browser compatibility */
  863. $4: string;
  864. /** @deprecated A legacy feature for browser compatibility */
  865. $5: string;
  866. /** @deprecated A legacy feature for browser compatibility */
  867. $6: string;
  868. /** @deprecated A legacy feature for browser compatibility */
  869. $7: string;
  870. /** @deprecated A legacy feature for browser compatibility */
  871. $8: string;
  872. /** @deprecated A legacy feature for browser compatibility */
  873. $9: string;
  874. /** @deprecated A legacy feature for browser compatibility */
  875. input: string;
  876. /** @deprecated A legacy feature for browser compatibility */
  877. $_: string;
  878. /** @deprecated A legacy feature for browser compatibility */
  879. lastMatch: string;
  880. /** @deprecated A legacy feature for browser compatibility */
  881. "$&": string;
  882. /** @deprecated A legacy feature for browser compatibility */
  883. lastParen: string;
  884. /** @deprecated A legacy feature for browser compatibility */
  885. "$+": string;
  886. /** @deprecated A legacy feature for browser compatibility */
  887. leftContext: string;
  888. /** @deprecated A legacy feature for browser compatibility */
  889. "$`": string;
  890. /** @deprecated A legacy feature for browser compatibility */
  891. rightContext: string;
  892. /** @deprecated A legacy feature for browser compatibility */
  893. "$'": string;
  894. }
  895. declare var RegExp: RegExpConstructor;
  896. interface Error {
  897. name: string;
  898. message: string;
  899. stack?: string;
  900. }
  901. interface ErrorConstructor {
  902. new(message?: string): Error;
  903. (message?: string): Error;
  904. readonly prototype: Error;
  905. }
  906. declare var Error: ErrorConstructor;
  907. interface EvalError extends Error {
  908. }
  909. interface EvalErrorConstructor extends ErrorConstructor {
  910. new(message?: string): EvalError;
  911. (message?: string): EvalError;
  912. readonly prototype: EvalError;
  913. }
  914. declare var EvalError: EvalErrorConstructor;
  915. interface RangeError extends Error {
  916. }
  917. interface RangeErrorConstructor extends ErrorConstructor {
  918. new(message?: string): RangeError;
  919. (message?: string): RangeError;
  920. readonly prototype: RangeError;
  921. }
  922. declare var RangeError: RangeErrorConstructor;
  923. interface ReferenceError extends Error {
  924. }
  925. interface ReferenceErrorConstructor extends ErrorConstructor {
  926. new(message?: string): ReferenceError;
  927. (message?: string): ReferenceError;
  928. readonly prototype: ReferenceError;
  929. }
  930. declare var ReferenceError: ReferenceErrorConstructor;
  931. interface SyntaxError extends Error {
  932. }
  933. interface SyntaxErrorConstructor extends ErrorConstructor {
  934. new(message?: string): SyntaxError;
  935. (message?: string): SyntaxError;
  936. readonly prototype: SyntaxError;
  937. }
  938. declare var SyntaxError: SyntaxErrorConstructor;
  939. interface TypeError extends Error {
  940. }
  941. interface TypeErrorConstructor extends ErrorConstructor {
  942. new(message?: string): TypeError;
  943. (message?: string): TypeError;
  944. readonly prototype: TypeError;
  945. }
  946. declare var TypeError: TypeErrorConstructor;
  947. interface URIError extends Error {
  948. }
  949. interface URIErrorConstructor extends ErrorConstructor {
  950. new(message?: string): URIError;
  951. (message?: string): URIError;
  952. readonly prototype: URIError;
  953. }
  954. declare var URIError: URIErrorConstructor;
  955. interface JSON {
  956. /**
  957. * Converts a JavaScript Object Notation (JSON) string into an object.
  958. * @param text A valid JSON string.
  959. * @param reviver A function that transforms the results. This function is called for each member of the object.
  960. * If a member contains nested objects, the nested objects are transformed before the parent object is.
  961. */
  962. parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;
  963. /**
  964. * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
  965. * @param value A JavaScript value, usually an object or array, to be converted.
  966. * @param replacer A function that transforms the results.
  967. * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
  968. */
  969. stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
  970. /**
  971. * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
  972. * @param value A JavaScript value, usually an object or array, to be converted.
  973. * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
  974. * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
  975. */
  976. stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
  977. }
  978. /**
  979. * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
  980. */
  981. declare var JSON: JSON;
  982. /////////////////////////////
  983. /// ECMAScript Array API (specially handled by compiler)
  984. /////////////////////////////
  985. interface ReadonlyArray<T> {
  986. /**
  987. * Gets the length of the array. This is a number one higher than the highest element defined in an array.
  988. */
  989. readonly length: number;
  990. /**
  991. * Returns a string representation of an array.
  992. */
  993. toString(): string;
  994. /**
  995. * Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.
  996. */
  997. toLocaleString(): string;
  998. /**
  999. * Combines two or more arrays.
  1000. * @param items Additional items to add to the end of array1.
  1001. */
  1002. concat(...items: ConcatArray<T>[]): T[];
  1003. /**
  1004. * Combines two or more arrays.
  1005. * @param items Additional items to add to the end of array1.
  1006. */
  1007. concat(...items: (T | ConcatArray<T>)[]): T[];
  1008. /**
  1009. * Adds all the elements of an array separated by the specified separator string.
  1010. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
  1011. */
  1012. join(separator?: string): string;
  1013. /**
  1014. * Returns a section of an array.
  1015. * @param start The beginning of the specified portion of the array.
  1016. * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
  1017. */
  1018. slice(start?: number, end?: number): T[];
  1019. /**
  1020. * Returns the index of the first occurrence of a value in an array.
  1021. * @param searchElement The value to locate in the array.
  1022. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
  1023. */
  1024. indexOf(searchElement: T, fromIndex?: number): number;
  1025. /**
  1026. * Returns the index of the last occurrence of a specified value in an array.
  1027. * @param searchElement The value to locate in the array.
  1028. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.
  1029. */
  1030. lastIndexOf(searchElement: T, fromIndex?: number): number;
  1031. /**
  1032. * Determines whether all the members of an array satisfy the specified test.
  1033. * @param predicate A function that accepts up to three arguments. The every method calls
  1034. * the predicate function for each element in the array until the predicate returns a value
  1035. * which is coercible to the Boolean value false, or until the end of the array.
  1036. * @param thisArg An object to which the this keyword can refer in the predicate function.
  1037. * If thisArg is omitted, undefined is used as the this value.
  1038. */
  1039. every<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): this is readonly S[];
  1040. /**
  1041. * Determines whether all the members of an array satisfy the specified test.
  1042. * @param predicate A function that accepts up to three arguments. The every method calls
  1043. * the predicate function for each element in the array until the predicate returns a value
  1044. * which is coercible to the Boolean value false, or until the end of the array.
  1045. * @param thisArg An object to which the this keyword can refer in the predicate function.
  1046. * If thisArg is omitted, undefined is used as the this value.
  1047. */
  1048. every(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;
  1049. /**
  1050. * Determines whether the specified callback function returns true for any element of an array.
  1051. * @param predicate A function that accepts up to three arguments. The some method calls
  1052. * the predicate function for each element in the array until the predicate returns a value
  1053. * which is coercible to the Boolean value true, or until the end of the array.
  1054. * @param thisArg An object to which the this keyword can refer in the predicate function.
  1055. * If thisArg is omitted, undefined is used as the this value.
  1056. */
  1057. some(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;
  1058. /**
  1059. * Performs the specified action for each element in an array.
  1060. * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
  1061. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
  1062. */
  1063. forEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void;
  1064. /**
  1065. * Calls a defined callback function on each element of an array, and returns an array that contains the results.
  1066. * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
  1067. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
  1068. */
  1069. map<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[];
  1070. /**
  1071. * Returns the elements of an array that meet the condition specified in a callback function.
  1072. * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
  1073. * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
  1074. */
  1075. filter<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): S[];
  1076. /**
  1077. * Returns the elements of an array that meet the condition specified in a callback function.
  1078. * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
  1079. * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
  1080. */
  1081. filter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[];
  1082. /**
  1083. * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
  1084. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
  1085. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
  1086. */
  1087. reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;
  1088. reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;
  1089. /**
  1090. * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
  1091. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
  1092. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
  1093. */
  1094. reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;
  1095. /**
  1096. * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
  1097. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
  1098. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
  1099. */
  1100. reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;
  1101. reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;
  1102. /**
  1103. * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
  1104. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
  1105. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
  1106. */
  1107. reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;
  1108. readonly [n: number]: T;
  1109. }
  1110. interface ConcatArray<T> {
  1111. readonly length: number;
  1112. readonly [n: number]: T;
  1113. join(separator?: string): string;
  1114. slice(start?: number, end?: number): T[];
  1115. }
  1116. interface Array<T> {
  1117. /**
  1118. * Gets or sets the length of the array. This is a number one higher than the highest index in the array.
  1119. */
  1120. length: number;
  1121. /**
  1122. * Returns a string representation of an array.
  1123. */
  1124. toString(): string;
  1125. /**
  1126. * Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.
  1127. */
  1128. toLocaleString(): string;
  1129. /**
  1130. * Removes the last element from an array and returns it.
  1131. * If the array is empty, undefined is returned and the array is not modified.
  1132. */
  1133. pop(): T | undefined;
  1134. /**
  1135. * Appends new elements to the end of an array, and returns the new length of the array.
  1136. * @param items New elements to add to the array.
  1137. */
  1138. push(...items: T[]): number;
  1139. /**
  1140. * Combines two or more arrays.
  1141. * This method returns a new array without modifying any existing arrays.
  1142. * @param items Additional arrays and/or items to add to the end of the array.
  1143. */
  1144. concat(...items: ConcatArray<T>[]): T[];
  1145. /**
  1146. * Combines two or more arrays.
  1147. * This method returns a new array without modifying any existing arrays.
  1148. * @param items Additional arrays and/or items to add to the end of the array.
  1149. */
  1150. concat(...items: (T | ConcatArray<T>)[]): T[];
  1151. /**
  1152. * Adds all the elements of an array into a string, separated by the specified separator string.
  1153. * @param separator A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.
  1154. */
  1155. join(separator?: string): string;
  1156. /**
  1157. * Reverses the elements in an array in place.
  1158. * This method mutates the array and returns a reference to the same array.
  1159. */
  1160. reverse(): T[];
  1161. /**
  1162. * Removes the first element from an array and returns it.
  1163. * If the array is empty, undefined is returned and the array is not modified.
  1164. */
  1165. shift(): T | undefined;
  1166. /**
  1167. * Returns a copy of a section of an array.
  1168. * For both start and end, a negative index can be used to indicate an offset from the end of the array.
  1169. * For example, -2 refers to the second to last element of the array.
  1170. * @param start The beginning index of the specified portion of the array.
  1171. * If start is undefined, then the slice begins at index 0.
  1172. * @param end The end index of the specified portion of the array. This is exclusive of the element at the index 'end'.
  1173. * If end is undefined, then the slice extends to the end of the array.
  1174. */
  1175. slice(start?: number, end?: number): T[];
  1176. /**
  1177. * Sorts an array in place.
  1178. * This method mutates the array and returns a reference to the same array.
  1179. * @param compareFn Function used to determine the order of the elements. It is expected to return
  1180. * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
  1181. * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
  1182. * ```ts
  1183. * [11,2,22,1].sort((a, b) => a - b)
  1184. * ```
  1185. */
  1186. sort(compareFn?: (a: T, b: T) => number): this;
  1187. /**
  1188. * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
  1189. * @param start The zero-based location in the array from which to start removing elements.
  1190. * @param deleteCount The number of elements to remove.
  1191. * @returns An array containing the elements that were deleted.
  1192. */
  1193. splice(start: number, deleteCount?: number): T[];
  1194. /**
  1195. * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
  1196. * @param start The zero-based location in the array from which to start removing elements.
  1197. * @param deleteCount The number of elements to remove.
  1198. * @param items Elements to insert into the array in place of the deleted elements.
  1199. * @returns An array containing the elements that were deleted.
  1200. */
  1201. splice(start: number, deleteCount: number, ...items: T[]): T[];
  1202. /**
  1203. * Inserts new elements at the start of an array, and returns the new length of the array.
  1204. * @param items Elements to insert at the start of the array.
  1205. */
  1206. unshift(...items: T[]): number;
  1207. /**
  1208. * Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
  1209. * @param searchElement The value to locate in the array.
  1210. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
  1211. */
  1212. indexOf(searchElement: T, fromIndex?: number): number;
  1213. /**
  1214. * Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.
  1215. * @param searchElement The value to locate in the array.
  1216. * @param fromIndex The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.
  1217. */
  1218. lastIndexOf(searchElement: T, fromIndex?: number): number;
  1219. /**
  1220. * Determines whether all the members of an array satisfy the specified test.
  1221. * @param predicate A function that accepts up to three arguments. The every method calls
  1222. * the predicate function for each element in the array until the predicate returns a value
  1223. * which is coercible to the Boolean value false, or until the end of the array.
  1224. * @param thisArg An object to which the this keyword can refer in the predicate function.
  1225. * If thisArg is omitted, undefined is used as the this value.
  1226. */
  1227. every<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];
  1228. /**
  1229. * Determines whether all the members of an array satisfy the specified test.
  1230. * @param predicate A function that accepts up to three arguments. The every method calls
  1231. * the predicate function for each element in the array until the predicate returns a value
  1232. * which is coercible to the Boolean value false, or until the end of the array.
  1233. * @param thisArg An object to which the this keyword can refer in the predicate function.
  1234. * If thisArg is omitted, undefined is used as the this value.
  1235. */
  1236. every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
  1237. /**
  1238. * Determines whether the specified callback function returns true for any element of an array.
  1239. * @param predicate A function that accepts up to three arguments. The some method calls
  1240. * the predicate function for each element in the array until the predicate returns a value
  1241. * which is coercible to the Boolean value true, or until the end of the array.
  1242. * @param thisArg An object to which the this keyword can refer in the predicate function.
  1243. * If thisArg is omitted, undefined is used as the this value.
  1244. */
  1245. some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
  1246. /**
  1247. * Performs the specified action for each element in an array.
  1248. * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
  1249. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
  1250. */
  1251. forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
  1252. /**
  1253. * Calls a defined callback function on each element of an array, and returns an array that contains the results.
  1254. * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
  1255. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
  1256. */
  1257. map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
  1258. /**
  1259. * Returns the elements of an array that meet the condition specified in a callback function.
  1260. * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
  1261. * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
  1262. */
  1263. filter<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];
  1264. /**
  1265. * Returns the elements of an array that meet the condition specified in a callback function.
  1266. * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
  1267. * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
  1268. */
  1269. filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];
  1270. /**
  1271. * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
  1272. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
  1273. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
  1274. */
  1275. reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
  1276. reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
  1277. /**
  1278. * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
  1279. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
  1280. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
  1281. */
  1282. reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
  1283. /**
  1284. * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
  1285. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
  1286. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
  1287. */
  1288. reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
  1289. reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
  1290. /**
  1291. * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
  1292. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
  1293. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
  1294. */
  1295. reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
  1296. [n: number]: T;
  1297. }
  1298. interface ArrayConstructor {
  1299. new(arrayLength?: number): any[];
  1300. new <T>(arrayLength: number): T[];
  1301. new <T>(...items: T[]): T[];
  1302. (arrayLength?: number): any[];
  1303. <T>(arrayLength: number): T[];
  1304. <T>(...items: T[]): T[];
  1305. isArray(arg: any): arg is any[];
  1306. readonly prototype: any[];
  1307. }
  1308. declare var Array: ArrayConstructor;
  1309. interface TypedPropertyDescriptor<T> {
  1310. enumerable?: boolean;
  1311. configurable?: boolean;
  1312. writable?: boolean;
  1313. value?: T;
  1314. get?: () => T;
  1315. set?: (value: T) => void;
  1316. }
  1317. declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
  1318. declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
  1319. declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
  1320. declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
  1321. declare type PromiseConstructorLike = new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void) => PromiseLike<T>;
  1322. interface PromiseLike<T> {
  1323. /**
  1324. * Attaches callbacks for the resolution and/or rejection of the Promise.
  1325. * @param onfulfilled The callback to execute when the Promise is resolved.
  1326. * @param onrejected The callback to execute when the Promise is rejected.
  1327. * @returns A Promise for the completion of which ever callback is executed.
  1328. */
  1329. then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
  1330. }
  1331. /**
  1332. * Represents the completion of an asynchronous operation
  1333. */
  1334. interface Promise<T> {
  1335. /**
  1336. * Attaches callbacks for the resolution and/or rejection of the Promise.
  1337. * @param onfulfilled The callback to execute when the Promise is resolved.
  1338. * @param onrejected The callback to execute when the Promise is rejected.
  1339. * @returns A Promise for the completion of which ever callback is executed.
  1340. */
  1341. then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
  1342. /**
  1343. * Attaches a callback for only the rejection of the Promise.
  1344. * @param onrejected The callback to execute when the Promise is rejected.
  1345. * @returns A Promise for the completion of the callback.
  1346. */
  1347. catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
  1348. }
  1349. /**
  1350. * Recursively unwraps the "awaited type" of a type. Non-promise "thenables" should resolve to `never`. This emulates the behavior of `await`.
  1351. */
  1352. type Awaited<T> =
  1353. T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode
  1354. T extends object & { then(onfulfilled: infer F): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
  1355. F extends ((value: infer V, ...args: any) => any) ? // if the argument to `then` is callable, extracts the first argument
  1356. Awaited<V> : // recursively unwrap the value
  1357. never : // the argument to `then` was not callable
  1358. T; // non-object or non-thenable
  1359. interface ArrayLike<T> {
  1360. readonly length: number;
  1361. readonly [n: number]: T;
  1362. }
  1363. /**
  1364. * Make all properties in T optional
  1365. */
  1366. type Partial<T> = {
  1367. [P in keyof T]?: T[P];
  1368. };
  1369. /**
  1370. * Make all properties in T required
  1371. */
  1372. type Required<T> = {
  1373. [P in keyof T]-?: T[P];
  1374. };
  1375. /**
  1376. * Make all properties in T readonly
  1377. */
  1378. type Readonly<T> = {
  1379. readonly [P in keyof T]: T[P];
  1380. };
  1381. /**
  1382. * From T, pick a set of properties whose keys are in the union K
  1383. */
  1384. type Pick<T, K extends keyof T> = {
  1385. [P in K]: T[P];
  1386. };
  1387. /**
  1388. * Construct a type with a set of properties K of type T
  1389. */
  1390. type Record<K extends keyof any, T> = {
  1391. [P in K]: T;
  1392. };
  1393. /**
  1394. * Exclude from T those types that are assignable to U
  1395. */
  1396. type Exclude<T, U> = T extends U ? never : T;
  1397. /**
  1398. * Extract from T those types that are assignable to U
  1399. */
  1400. type Extract<T, U> = T extends U ? T : never;
  1401. /**
  1402. * Construct a type with the properties of T except for those in type K.
  1403. */
  1404. type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
  1405. /**
  1406. * Exclude null and undefined from T
  1407. */
  1408. type NonNullable<T> = T extends null | undefined ? never : T;
  1409. /**
  1410. * Obtain the parameters of a function type in a tuple
  1411. */
  1412. type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;
  1413. /**
  1414. * Obtain the parameters of a constructor function type in a tuple
  1415. */
  1416. type ConstructorParameters<T extends abstract new (...args: any) => any> = T extends abstract new (...args: infer P) => any ? P : never;
  1417. /**
  1418. * Obtain the return type of a function type
  1419. */
  1420. type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any;
  1421. /**
  1422. * Obtain the return type of a constructor function type
  1423. */
  1424. type InstanceType<T extends abstract new (...args: any) => any> = T extends abstract new (...args: any) => infer R ? R : any;
  1425. /**
  1426. * Convert string literal type to uppercase
  1427. */
  1428. type Uppercase<S extends string> = intrinsic;
  1429. /**
  1430. * Convert string literal type to lowercase
  1431. */
  1432. type Lowercase<S extends string> = intrinsic;
  1433. /**
  1434. * Convert first character of string literal type to uppercase
  1435. */
  1436. type Capitalize<S extends string> = intrinsic;
  1437. /**
  1438. * Convert first character of string literal type to lowercase
  1439. */
  1440. type Uncapitalize<S extends string> = intrinsic;
  1441. /**
  1442. * Marker for contextual 'this' type
  1443. */
  1444. interface ThisType<T> { }
  1445. /**
  1446. * Represents a raw buffer of binary data, which is used to store data for the
  1447. * different typed arrays. ArrayBuffers cannot be read from or written to directly,
  1448. * but can be passed to a typed array or DataView Object to interpret the raw
  1449. * buffer as needed.
  1450. */
  1451. interface ArrayBuffer {
  1452. /**
  1453. * Read-only. The length of the ArrayBuffer (in bytes).
  1454. */
  1455. readonly byteLength: number;
  1456. /**
  1457. * Returns a section of an ArrayBuffer.
  1458. */
  1459. slice(begin: number, end?: number): ArrayBuffer;
  1460. }
  1461. /**
  1462. * Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.
  1463. */
  1464. interface ArrayBufferTypes {
  1465. ArrayBuffer: ArrayBuffer;
  1466. }
  1467. type ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];
  1468. interface ArrayBufferConstructor {
  1469. readonly prototype: ArrayBuffer;
  1470. new(byteLength: number): ArrayBuffer;
  1471. isView(arg: any): arg is ArrayBufferView;
  1472. }
  1473. declare var ArrayBuffer: ArrayBufferConstructor;
  1474. interface ArrayBufferView {
  1475. /**
  1476. * The ArrayBuffer instance referenced by the array.
  1477. */
  1478. buffer: ArrayBufferLike;
  1479. /**
  1480. * The length in bytes of the array.
  1481. */
  1482. byteLength: number;
  1483. /**
  1484. * The offset in bytes of the array.
  1485. */
  1486. byteOffset: number;
  1487. }
  1488. interface DataView {
  1489. readonly buffer: ArrayBuffer;
  1490. readonly byteLength: number;
  1491. readonly byteOffset: number;
  1492. /**
  1493. * Gets the Float32 value at the specified byte offset from the start of the view. There is
  1494. * no alignment constraint; multi-byte values may be fetched from any offset.
  1495. * @param byteOffset The place in the buffer at which the value should be retrieved.
  1496. * @param littleEndian If false or undefined, a big-endian value should be read.
  1497. */
  1498. getFloat32(byteOffset: number, littleEndian?: boolean): number;
  1499. /**
  1500. * Gets the Float64 value at the specified byte offset from the start of the view. There is
  1501. * no alignment constraint; multi-byte values may be fetched from any offset.
  1502. * @param byteOffset The place in the buffer at which the value should be retrieved.
  1503. * @param littleEndian If false or undefined, a big-endian value should be read.
  1504. */
  1505. getFloat64(byteOffset: number, littleEndian?: boolean): number;
  1506. /**
  1507. * Gets the Int8 value at the specified byte offset from the start of the view. There is
  1508. * no alignment constraint; multi-byte values may be fetched from any offset.
  1509. * @param byteOffset The place in the buffer at which the value should be retrieved.
  1510. */
  1511. getInt8(byteOffset: number): number;
  1512. /**
  1513. * Gets the Int16 value at the specified byte offset from the start of the view. There is
  1514. * no alignment constraint; multi-byte values may be fetched from any offset.
  1515. * @param byteOffset The place in the buffer at which the value should be retrieved.
  1516. * @param littleEndian If false or undefined, a big-endian value should be read.
  1517. */
  1518. getInt16(byteOffset: number, littleEndian?: boolean): number;
  1519. /**
  1520. * Gets the Int32 value at the specified byte offset from the start of the view. There is
  1521. * no alignment constraint; multi-byte values may be fetched from any offset.
  1522. * @param byteOffset The place in the buffer at which the value should be retrieved.
  1523. * @param littleEndian If false or undefined, a big-endian value should be read.
  1524. */
  1525. getInt32(byteOffset: number, littleEndian?: boolean): number;
  1526. /**
  1527. * Gets the Uint8 value at the specified byte offset from the start of the view. There is
  1528. * no alignment constraint; multi-byte values may be fetched from any offset.
  1529. * @param byteOffset The place in the buffer at which the value should be retrieved.
  1530. */
  1531. getUint8(byteOffset: number): number;
  1532. /**
  1533. * Gets the Uint16 value at the specified byte offset from the start of the view. There is
  1534. * no alignment constraint; multi-byte values may be fetched from any offset.
  1535. * @param byteOffset The place in the buffer at which the value should be retrieved.
  1536. * @param littleEndian If false or undefined, a big-endian value should be read.
  1537. */
  1538. getUint16(byteOffset: number, littleEndian?: boolean): number;
  1539. /**
  1540. * Gets the Uint32 value at the specified byte offset from the start of the view. There is
  1541. * no alignment constraint; multi-byte values may be fetched from any offset.
  1542. * @param byteOffset The place in the buffer at which the value should be retrieved.
  1543. * @param littleEndian If false or undefined, a big-endian value should be read.
  1544. */
  1545. getUint32(byteOffset: number, littleEndian?: boolean): number;
  1546. /**
  1547. * Stores an Float32 value at the specified byte offset from the start of the view.
  1548. * @param byteOffset The place in the buffer at which the value should be set.
  1549. * @param value The value to set.
  1550. * @param littleEndian If false or undefined, a big-endian value should be written.
  1551. */
  1552. setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
  1553. /**
  1554. * Stores an Float64 value at the specified byte offset from the start of the view.
  1555. * @param byteOffset The place in the buffer at which the value should be set.
  1556. * @param value The value to set.
  1557. * @param littleEndian If false or undefined, a big-endian value should be written.
  1558. */
  1559. setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
  1560. /**
  1561. * Stores an Int8 value at the specified byte offset from the start of the view.
  1562. * @param byteOffset The place in the buffer at which the value should be set.
  1563. * @param value The value to set.
  1564. */
  1565. setInt8(byteOffset: number, value: number): void;
  1566. /**
  1567. * Stores an Int16 value at the specified byte offset from the start of the view.
  1568. * @param byteOffset The place in the buffer at which the value should be set.
  1569. * @param value The value to set.
  1570. * @param littleEndian If false or undefined, a big-endian value should be written.
  1571. */
  1572. setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
  1573. /**
  1574. * Stores an Int32 value at the specified byte offset from the start of the view.
  1575. * @param byteOffset The place in the buffer at which the value should be set.
  1576. * @param value The value to set.
  1577. * @param littleEndian If false or undefined, a big-endian value should be written.
  1578. */
  1579. setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
  1580. /**
  1581. * Stores an Uint8 value at the specified byte offset from the start of the view.
  1582. * @param byteOffset The place in the buffer at which the value should be set.
  1583. * @param value The value to set.
  1584. */
  1585. setUint8(byteOffset: number, value: number): void;
  1586. /**
  1587. * Stores an Uint16 value at the specified byte offset from the start of the view.
  1588. * @param byteOffset The place in the buffer at which the value should be set.
  1589. * @param value The value to set.
  1590. * @param littleEndian If false or undefined, a big-endian value should be written.
  1591. */
  1592. setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
  1593. /**
  1594. * Stores an Uint32 value at the specified byte offset from the start of the view.
  1595. * @param byteOffset The place in the buffer at which the value should be set.
  1596. * @param value The value to set.
  1597. * @param littleEndian If false or undefined, a big-endian value should be written.
  1598. */
  1599. setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
  1600. }
  1601. interface DataViewConstructor {
  1602. readonly prototype: DataView;
  1603. new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;
  1604. }
  1605. declare var DataView: DataViewConstructor;
  1606. /**
  1607. * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
  1608. * number of bytes could not be allocated an exception is raised.
  1609. */
  1610. interface Int8Array {
  1611. /**
  1612. * The size in bytes of each element in the array.
  1613. */
  1614. readonly BYTES_PER_ELEMENT: number;
  1615. /**
  1616. * The ArrayBuffer instance referenced by the array.
  1617. */
  1618. readonly buffer: ArrayBufferLike;
  1619. /**
  1620. * The length in bytes of the array.
  1621. */
  1622. readonly byteLength: number;
  1623. /**
  1624. * The offset in bytes of the array.
  1625. */
  1626. readonly byteOffset: number;
  1627. /**
  1628. * Returns the this object after copying a section of the array identified by start and end
  1629. * to the same array starting at position target
  1630. * @param target If target is negative, it is treated as length+target where length is the
  1631. * length of the array.
  1632. * @param start If start is negative, it is treated as length+start. If end is negative, it
  1633. * is treated as length+end.
  1634. * @param end If not specified, length of the this object is used as its default value.
  1635. */
  1636. copyWithin(target: number, start: number, end?: number): this;
  1637. /**
  1638. * Determines whether all the members of an array satisfy the specified test.
  1639. * @param predicate A function that accepts up to three arguments. The every method calls
  1640. * the predicate function for each element in the array until the predicate returns a value
  1641. * which is coercible to the Boolean value false, or until the end of the array.
  1642. * @param thisArg An object to which the this keyword can refer in the predicate function.
  1643. * If thisArg is omitted, undefined is used as the this value.
  1644. */
  1645. every(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;
  1646. /**
  1647. * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
  1648. * @param value value to fill array section with
  1649. * @param start index to start filling the array at. If start is negative, it is treated as
  1650. * length+start where length is the length of the array.
  1651. * @param end index to stop filling the array at. If end is negative, it is treated as
  1652. * length+end.
  1653. */
  1654. fill(value: number, start?: number, end?: number): this;
  1655. /**
  1656. * Returns the elements of an array that meet the condition specified in a callback function.
  1657. * @param predicate A function that accepts up to three arguments. The filter method calls
  1658. * the predicate function one time for each element in the array.
  1659. * @param thisArg An object to which the this keyword can refer in the predicate function.
  1660. * If thisArg is omitted, undefined is used as the this value.
  1661. */
  1662. filter(predicate: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;
  1663. /**
  1664. * Returns the value of the first element in the array where predicate is true, and undefined
  1665. * otherwise.
  1666. * @param predicate find calls predicate once for each element of the array, in ascending
  1667. * order, until it finds one where predicate returns true. If such an element is found, find
  1668. * immediately returns that element value. Otherwise, find returns undefined.
  1669. * @param thisArg If provided, it will be used as the this value for each invocation of
  1670. * predicate. If it is not provided, undefined is used instead.
  1671. */
  1672. find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;
  1673. /**
  1674. * Returns the index of the first element in the array where predicate is true, and -1
  1675. * otherwise.
  1676. * @param predicate find calls predicate once for each element of the array, in ascending
  1677. * order, until it finds one where predicate returns true. If such an element is found,
  1678. * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
  1679. * @param thisArg If provided, it will be used as the this value for each invocation of
  1680. * predicate. If it is not provided, undefined is used instead.
  1681. */
  1682. findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;
  1683. /**
  1684. * Performs the specified action for each element in an array.
  1685. * @param callbackfn A function that accepts up to three arguments. forEach calls the
  1686. * callbackfn function one time for each element in the array.
  1687. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  1688. * If thisArg is omitted, undefined is used as the this value.
  1689. */
  1690. forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;
  1691. /**
  1692. * Returns the index of the first occurrence of a value in an array.
  1693. * @param searchElement The value to locate in the array.
  1694. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  1695. * search starts at index 0.
  1696. */
  1697. indexOf(searchElement: number, fromIndex?: number): number;
  1698. /**
  1699. * Adds all the elements of an array separated by the specified separator string.
  1700. * @param separator A string used to separate one element of an array from the next in the
  1701. * resulting String. If omitted, the array elements are separated with a comma.
  1702. */
  1703. join(separator?: string): string;
  1704. /**
  1705. * Returns the index of the last occurrence of a value in an array.
  1706. * @param searchElement The value to locate in the array.
  1707. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  1708. * search starts at index 0.
  1709. */
  1710. lastIndexOf(searchElement: number, fromIndex?: number): number;
  1711. /**
  1712. * The length of the array.
  1713. */
  1714. readonly length: number;
  1715. /**
  1716. * Calls a defined callback function on each element of an array, and returns an array that
  1717. * contains the results.
  1718. * @param callbackfn A function that accepts up to three arguments. The map method calls the
  1719. * callbackfn function one time for each element in the array.
  1720. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  1721. * If thisArg is omitted, undefined is used as the this value.
  1722. */
  1723. map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;
  1724. /**
  1725. * Calls the specified callback function for all the elements in an array. The return value of
  1726. * the callback function is the accumulated result, and is provided as an argument in the next
  1727. * call to the callback function.
  1728. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  1729. * callbackfn function one time for each element in the array.
  1730. * @param initialValue If initialValue is specified, it is used as the initial value to start
  1731. * the accumulation. The first call to the callbackfn function provides this value as an argument
  1732. * instead of an array value.
  1733. */
  1734. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;
  1735. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;
  1736. /**
  1737. * Calls the specified callback function for all the elements in an array. The return value of
  1738. * the callback function is the accumulated result, and is provided as an argument in the next
  1739. * call to the callback function.
  1740. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  1741. * callbackfn function one time for each element in the array.
  1742. * @param initialValue If initialValue is specified, it is used as the initial value to start
  1743. * the accumulation. The first call to the callbackfn function provides this value as an argument
  1744. * instead of an array value.
  1745. */
  1746. reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
  1747. /**
  1748. * Calls the specified callback function for all the elements in an array, in descending order.
  1749. * The return value of the callback function is the accumulated result, and is provided as an
  1750. * argument in the next call to the callback function.
  1751. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  1752. * the callbackfn function one time for each element in the array.
  1753. * @param initialValue If initialValue is specified, it is used as the initial value to start
  1754. * the accumulation. The first call to the callbackfn function provides this value as an
  1755. * argument instead of an array value.
  1756. */
  1757. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;
  1758. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;
  1759. /**
  1760. * Calls the specified callback function for all the elements in an array, in descending order.
  1761. * The return value of the callback function is the accumulated result, and is provided as an
  1762. * argument in the next call to the callback function.
  1763. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  1764. * the callbackfn function one time for each element in the array.
  1765. * @param initialValue If initialValue is specified, it is used as the initial value to start
  1766. * the accumulation. The first call to the callbackfn function provides this value as an argument
  1767. * instead of an array value.
  1768. */
  1769. reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
  1770. /**
  1771. * Reverses the elements in an Array.
  1772. */
  1773. reverse(): Int8Array;
  1774. /**
  1775. * Sets a value or an array of values.
  1776. * @param array A typed or untyped array of values to set.
  1777. * @param offset The index in the current array at which the values are to be written.
  1778. */
  1779. set(array: ArrayLike<number>, offset?: number): void;
  1780. /**
  1781. * Returns a section of an array.
  1782. * @param start The beginning of the specified portion of the array.
  1783. * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
  1784. */
  1785. slice(start?: number, end?: number): Int8Array;
  1786. /**
  1787. * Determines whether the specified callback function returns true for any element of an array.
  1788. * @param predicate A function that accepts up to three arguments. The some method calls
  1789. * the predicate function for each element in the array until the predicate returns a value
  1790. * which is coercible to the Boolean value true, or until the end of the array.
  1791. * @param thisArg An object to which the this keyword can refer in the predicate function.
  1792. * If thisArg is omitted, undefined is used as the this value.
  1793. */
  1794. some(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;
  1795. /**
  1796. * Sorts an array.
  1797. * @param compareFn Function used to determine the order of the elements. It is expected to return
  1798. * a negative value if first argument is less than second argument, zero if they're equal and a positive
  1799. * value otherwise. If omitted, the elements are sorted in ascending order.
  1800. * ```ts
  1801. * [11,2,22,1].sort((a, b) => a - b)
  1802. * ```
  1803. */
  1804. sort(compareFn?: (a: number, b: number) => number): this;
  1805. /**
  1806. * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements
  1807. * at begin, inclusive, up to end, exclusive.
  1808. * @param begin The index of the beginning of the array.
  1809. * @param end The index of the end of the array.
  1810. */
  1811. subarray(begin?: number, end?: number): Int8Array;
  1812. /**
  1813. * Converts a number to a string by using the current locale.
  1814. */
  1815. toLocaleString(): string;
  1816. /**
  1817. * Returns a string representation of an array.
  1818. */
  1819. toString(): string;
  1820. /** Returns the primitive value of the specified object. */
  1821. valueOf(): Int8Array;
  1822. [index: number]: number;
  1823. }
  1824. interface Int8ArrayConstructor {
  1825. readonly prototype: Int8Array;
  1826. new(length: number): Int8Array;
  1827. new(array: ArrayLike<number> | ArrayBufferLike): Int8Array;
  1828. new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int8Array;
  1829. /**
  1830. * The size in bytes of each element in the array.
  1831. */
  1832. readonly BYTES_PER_ELEMENT: number;
  1833. /**
  1834. * Returns a new array from a set of elements.
  1835. * @param items A set of elements to include in the new array object.
  1836. */
  1837. of(...items: number[]): Int8Array;
  1838. /**
  1839. * Creates an array from an array-like or iterable object.
  1840. * @param arrayLike An array-like or iterable object to convert to an array.
  1841. */
  1842. from(arrayLike: ArrayLike<number>): Int8Array;
  1843. /**
  1844. * Creates an array from an array-like or iterable object.
  1845. * @param arrayLike An array-like or iterable object to convert to an array.
  1846. * @param mapfn A mapping function to call on every element of the array.
  1847. * @param thisArg Value of 'this' used to invoke the mapfn.
  1848. */
  1849. from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array;
  1850. }
  1851. declare var Int8Array: Int8ArrayConstructor;
  1852. /**
  1853. * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
  1854. * requested number of bytes could not be allocated an exception is raised.
  1855. */
  1856. interface Uint8Array {
  1857. /**
  1858. * The size in bytes of each element in the array.
  1859. */
  1860. readonly BYTES_PER_ELEMENT: number;
  1861. /**
  1862. * The ArrayBuffer instance referenced by the array.
  1863. */
  1864. readonly buffer: ArrayBufferLike;
  1865. /**
  1866. * The length in bytes of the array.
  1867. */
  1868. readonly byteLength: number;
  1869. /**
  1870. * The offset in bytes of the array.
  1871. */
  1872. readonly byteOffset: number;
  1873. /**
  1874. * Returns the this object after copying a section of the array identified by start and end
  1875. * to the same array starting at position target
  1876. * @param target If target is negative, it is treated as length+target where length is the
  1877. * length of the array.
  1878. * @param start If start is negative, it is treated as length+start. If end is negative, it
  1879. * is treated as length+end.
  1880. * @param end If not specified, length of the this object is used as its default value.
  1881. */
  1882. copyWithin(target: number, start: number, end?: number): this;
  1883. /**
  1884. * Determines whether all the members of an array satisfy the specified test.
  1885. * @param predicate A function that accepts up to three arguments. The every method calls
  1886. * the predicate function for each element in the array until the predicate returns a value
  1887. * which is coercible to the Boolean value false, or until the end of the array.
  1888. * @param thisArg An object to which the this keyword can refer in the predicate function.
  1889. * If thisArg is omitted, undefined is used as the this value.
  1890. */
  1891. every(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;
  1892. /**
  1893. * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
  1894. * @param value value to fill array section with
  1895. * @param start index to start filling the array at. If start is negative, it is treated as
  1896. * length+start where length is the length of the array.
  1897. * @param end index to stop filling the array at. If end is negative, it is treated as
  1898. * length+end.
  1899. */
  1900. fill(value: number, start?: number, end?: number): this;
  1901. /**
  1902. * Returns the elements of an array that meet the condition specified in a callback function.
  1903. * @param predicate A function that accepts up to three arguments. The filter method calls
  1904. * the predicate function one time for each element in the array.
  1905. * @param thisArg An object to which the this keyword can refer in the predicate function.
  1906. * If thisArg is omitted, undefined is used as the this value.
  1907. */
  1908. filter(predicate: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;
  1909. /**
  1910. * Returns the value of the first element in the array where predicate is true, and undefined
  1911. * otherwise.
  1912. * @param predicate find calls predicate once for each element of the array, in ascending
  1913. * order, until it finds one where predicate returns true. If such an element is found, find
  1914. * immediately returns that element value. Otherwise, find returns undefined.
  1915. * @param thisArg If provided, it will be used as the this value for each invocation of
  1916. * predicate. If it is not provided, undefined is used instead.
  1917. */
  1918. find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;
  1919. /**
  1920. * Returns the index of the first element in the array where predicate is true, and -1
  1921. * otherwise.
  1922. * @param predicate find calls predicate once for each element of the array, in ascending
  1923. * order, until it finds one where predicate returns true. If such an element is found,
  1924. * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
  1925. * @param thisArg If provided, it will be used as the this value for each invocation of
  1926. * predicate. If it is not provided, undefined is used instead.
  1927. */
  1928. findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;
  1929. /**
  1930. * Performs the specified action for each element in an array.
  1931. * @param callbackfn A function that accepts up to three arguments. forEach calls the
  1932. * callbackfn function one time for each element in the array.
  1933. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  1934. * If thisArg is omitted, undefined is used as the this value.
  1935. */
  1936. forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;
  1937. /**
  1938. * Returns the index of the first occurrence of a value in an array.
  1939. * @param searchElement The value to locate in the array.
  1940. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  1941. * search starts at index 0.
  1942. */
  1943. indexOf(searchElement: number, fromIndex?: number): number;
  1944. /**
  1945. * Adds all the elements of an array separated by the specified separator string.
  1946. * @param separator A string used to separate one element of an array from the next in the
  1947. * resulting String. If omitted, the array elements are separated with a comma.
  1948. */
  1949. join(separator?: string): string;
  1950. /**
  1951. * Returns the index of the last occurrence of a value in an array.
  1952. * @param searchElement The value to locate in the array.
  1953. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  1954. * search starts at index 0.
  1955. */
  1956. lastIndexOf(searchElement: number, fromIndex?: number): number;
  1957. /**
  1958. * The length of the array.
  1959. */
  1960. readonly length: number;
  1961. /**
  1962. * Calls a defined callback function on each element of an array, and returns an array that
  1963. * contains the results.
  1964. * @param callbackfn A function that accepts up to three arguments. The map method calls the
  1965. * callbackfn function one time for each element in the array.
  1966. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  1967. * If thisArg is omitted, undefined is used as the this value.
  1968. */
  1969. map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;
  1970. /**
  1971. * Calls the specified callback function for all the elements in an array. The return value of
  1972. * the callback function is the accumulated result, and is provided as an argument in the next
  1973. * call to the callback function.
  1974. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  1975. * callbackfn function one time for each element in the array.
  1976. * @param initialValue If initialValue is specified, it is used as the initial value to start
  1977. * the accumulation. The first call to the callbackfn function provides this value as an argument
  1978. * instead of an array value.
  1979. */
  1980. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;
  1981. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;
  1982. /**
  1983. * Calls the specified callback function for all the elements in an array. The return value of
  1984. * the callback function is the accumulated result, and is provided as an argument in the next
  1985. * call to the callback function.
  1986. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  1987. * callbackfn function one time for each element in the array.
  1988. * @param initialValue If initialValue is specified, it is used as the initial value to start
  1989. * the accumulation. The first call to the callbackfn function provides this value as an argument
  1990. * instead of an array value.
  1991. */
  1992. reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
  1993. /**
  1994. * Calls the specified callback function for all the elements in an array, in descending order.
  1995. * The return value of the callback function is the accumulated result, and is provided as an
  1996. * argument in the next call to the callback function.
  1997. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  1998. * the callbackfn function one time for each element in the array.
  1999. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2000. * the accumulation. The first call to the callbackfn function provides this value as an
  2001. * argument instead of an array value.
  2002. */
  2003. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;
  2004. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;
  2005. /**
  2006. * Calls the specified callback function for all the elements in an array, in descending order.
  2007. * The return value of the callback function is the accumulated result, and is provided as an
  2008. * argument in the next call to the callback function.
  2009. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  2010. * the callbackfn function one time for each element in the array.
  2011. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2012. * the accumulation. The first call to the callbackfn function provides this value as an argument
  2013. * instead of an array value.
  2014. */
  2015. reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
  2016. /**
  2017. * Reverses the elements in an Array.
  2018. */
  2019. reverse(): Uint8Array;
  2020. /**
  2021. * Sets a value or an array of values.
  2022. * @param array A typed or untyped array of values to set.
  2023. * @param offset The index in the current array at which the values are to be written.
  2024. */
  2025. set(array: ArrayLike<number>, offset?: number): void;
  2026. /**
  2027. * Returns a section of an array.
  2028. * @param start The beginning of the specified portion of the array.
  2029. * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
  2030. */
  2031. slice(start?: number, end?: number): Uint8Array;
  2032. /**
  2033. * Determines whether the specified callback function returns true for any element of an array.
  2034. * @param predicate A function that accepts up to three arguments. The some method calls
  2035. * the predicate function for each element in the array until the predicate returns a value
  2036. * which is coercible to the Boolean value true, or until the end of the array.
  2037. * @param thisArg An object to which the this keyword can refer in the predicate function.
  2038. * If thisArg is omitted, undefined is used as the this value.
  2039. */
  2040. some(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;
  2041. /**
  2042. * Sorts an array.
  2043. * @param compareFn Function used to determine the order of the elements. It is expected to return
  2044. * a negative value if first argument is less than second argument, zero if they're equal and a positive
  2045. * value otherwise. If omitted, the elements are sorted in ascending order.
  2046. * ```ts
  2047. * [11,2,22,1].sort((a, b) => a - b)
  2048. * ```
  2049. */
  2050. sort(compareFn?: (a: number, b: number) => number): this;
  2051. /**
  2052. * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements
  2053. * at begin, inclusive, up to end, exclusive.
  2054. * @param begin The index of the beginning of the array.
  2055. * @param end The index of the end of the array.
  2056. */
  2057. subarray(begin?: number, end?: number): Uint8Array;
  2058. /**
  2059. * Converts a number to a string by using the current locale.
  2060. */
  2061. toLocaleString(): string;
  2062. /**
  2063. * Returns a string representation of an array.
  2064. */
  2065. toString(): string;
  2066. /** Returns the primitive value of the specified object. */
  2067. valueOf(): Uint8Array;
  2068. [index: number]: number;
  2069. }
  2070. interface Uint8ArrayConstructor {
  2071. readonly prototype: Uint8Array;
  2072. new(length: number): Uint8Array;
  2073. new(array: ArrayLike<number> | ArrayBufferLike): Uint8Array;
  2074. new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8Array;
  2075. /**
  2076. * The size in bytes of each element in the array.
  2077. */
  2078. readonly BYTES_PER_ELEMENT: number;
  2079. /**
  2080. * Returns a new array from a set of elements.
  2081. * @param items A set of elements to include in the new array object.
  2082. */
  2083. of(...items: number[]): Uint8Array;
  2084. /**
  2085. * Creates an array from an array-like or iterable object.
  2086. * @param arrayLike An array-like or iterable object to convert to an array.
  2087. */
  2088. from(arrayLike: ArrayLike<number>): Uint8Array;
  2089. /**
  2090. * Creates an array from an array-like or iterable object.
  2091. * @param arrayLike An array-like or iterable object to convert to an array.
  2092. * @param mapfn A mapping function to call on every element of the array.
  2093. * @param thisArg Value of 'this' used to invoke the mapfn.
  2094. */
  2095. from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array;
  2096. }
  2097. declare var Uint8Array: Uint8ArrayConstructor;
  2098. /**
  2099. * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
  2100. * If the requested number of bytes could not be allocated an exception is raised.
  2101. */
  2102. interface Uint8ClampedArray {
  2103. /**
  2104. * The size in bytes of each element in the array.
  2105. */
  2106. readonly BYTES_PER_ELEMENT: number;
  2107. /**
  2108. * The ArrayBuffer instance referenced by the array.
  2109. */
  2110. readonly buffer: ArrayBufferLike;
  2111. /**
  2112. * The length in bytes of the array.
  2113. */
  2114. readonly byteLength: number;
  2115. /**
  2116. * The offset in bytes of the array.
  2117. */
  2118. readonly byteOffset: number;
  2119. /**
  2120. * Returns the this object after copying a section of the array identified by start and end
  2121. * to the same array starting at position target
  2122. * @param target If target is negative, it is treated as length+target where length is the
  2123. * length of the array.
  2124. * @param start If start is negative, it is treated as length+start. If end is negative, it
  2125. * is treated as length+end.
  2126. * @param end If not specified, length of the this object is used as its default value.
  2127. */
  2128. copyWithin(target: number, start: number, end?: number): this;
  2129. /**
  2130. * Determines whether all the members of an array satisfy the specified test.
  2131. * @param predicate A function that accepts up to three arguments. The every method calls
  2132. * the predicate function for each element in the array until the predicate returns a value
  2133. * which is coercible to the Boolean value false, or until the end of the array.
  2134. * @param thisArg An object to which the this keyword can refer in the predicate function.
  2135. * If thisArg is omitted, undefined is used as the this value.
  2136. */
  2137. every(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;
  2138. /**
  2139. * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
  2140. * @param value value to fill array section with
  2141. * @param start index to start filling the array at. If start is negative, it is treated as
  2142. * length+start where length is the length of the array.
  2143. * @param end index to stop filling the array at. If end is negative, it is treated as
  2144. * length+end.
  2145. */
  2146. fill(value: number, start?: number, end?: number): this;
  2147. /**
  2148. * Returns the elements of an array that meet the condition specified in a callback function.
  2149. * @param predicate A function that accepts up to three arguments. The filter method calls
  2150. * the predicate function one time for each element in the array.
  2151. * @param thisArg An object to which the this keyword can refer in the predicate function.
  2152. * If thisArg is omitted, undefined is used as the this value.
  2153. */
  2154. filter(predicate: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;
  2155. /**
  2156. * Returns the value of the first element in the array where predicate is true, and undefined
  2157. * otherwise.
  2158. * @param predicate find calls predicate once for each element of the array, in ascending
  2159. * order, until it finds one where predicate returns true. If such an element is found, find
  2160. * immediately returns that element value. Otherwise, find returns undefined.
  2161. * @param thisArg If provided, it will be used as the this value for each invocation of
  2162. * predicate. If it is not provided, undefined is used instead.
  2163. */
  2164. find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;
  2165. /**
  2166. * Returns the index of the first element in the array where predicate is true, and -1
  2167. * otherwise.
  2168. * @param predicate find calls predicate once for each element of the array, in ascending
  2169. * order, until it finds one where predicate returns true. If such an element is found,
  2170. * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
  2171. * @param thisArg If provided, it will be used as the this value for each invocation of
  2172. * predicate. If it is not provided, undefined is used instead.
  2173. */
  2174. findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;
  2175. /**
  2176. * Performs the specified action for each element in an array.
  2177. * @param callbackfn A function that accepts up to three arguments. forEach calls the
  2178. * callbackfn function one time for each element in the array.
  2179. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  2180. * If thisArg is omitted, undefined is used as the this value.
  2181. */
  2182. forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;
  2183. /**
  2184. * Returns the index of the first occurrence of a value in an array.
  2185. * @param searchElement The value to locate in the array.
  2186. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  2187. * search starts at index 0.
  2188. */
  2189. indexOf(searchElement: number, fromIndex?: number): number;
  2190. /**
  2191. * Adds all the elements of an array separated by the specified separator string.
  2192. * @param separator A string used to separate one element of an array from the next in the
  2193. * resulting String. If omitted, the array elements are separated with a comma.
  2194. */
  2195. join(separator?: string): string;
  2196. /**
  2197. * Returns the index of the last occurrence of a value in an array.
  2198. * @param searchElement The value to locate in the array.
  2199. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  2200. * search starts at index 0.
  2201. */
  2202. lastIndexOf(searchElement: number, fromIndex?: number): number;
  2203. /**
  2204. * The length of the array.
  2205. */
  2206. readonly length: number;
  2207. /**
  2208. * Calls a defined callback function on each element of an array, and returns an array that
  2209. * contains the results.
  2210. * @param callbackfn A function that accepts up to three arguments. The map method calls the
  2211. * callbackfn function one time for each element in the array.
  2212. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  2213. * If thisArg is omitted, undefined is used as the this value.
  2214. */
  2215. map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;
  2216. /**
  2217. * Calls the specified callback function for all the elements in an array. The return value of
  2218. * the callback function is the accumulated result, and is provided as an argument in the next
  2219. * call to the callback function.
  2220. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  2221. * callbackfn function one time for each element in the array.
  2222. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2223. * the accumulation. The first call to the callbackfn function provides this value as an argument
  2224. * instead of an array value.
  2225. */
  2226. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;
  2227. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;
  2228. /**
  2229. * Calls the specified callback function for all the elements in an array. The return value of
  2230. * the callback function is the accumulated result, and is provided as an argument in the next
  2231. * call to the callback function.
  2232. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  2233. * callbackfn function one time for each element in the array.
  2234. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2235. * the accumulation. The first call to the callbackfn function provides this value as an argument
  2236. * instead of an array value.
  2237. */
  2238. reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
  2239. /**
  2240. * Calls the specified callback function for all the elements in an array, in descending order.
  2241. * The return value of the callback function is the accumulated result, and is provided as an
  2242. * argument in the next call to the callback function.
  2243. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  2244. * the callbackfn function one time for each element in the array.
  2245. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2246. * the accumulation. The first call to the callbackfn function provides this value as an
  2247. * argument instead of an array value.
  2248. */
  2249. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;
  2250. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;
  2251. /**
  2252. * Calls the specified callback function for all the elements in an array, in descending order.
  2253. * The return value of the callback function is the accumulated result, and is provided as an
  2254. * argument in the next call to the callback function.
  2255. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  2256. * the callbackfn function one time for each element in the array.
  2257. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2258. * the accumulation. The first call to the callbackfn function provides this value as an argument
  2259. * instead of an array value.
  2260. */
  2261. reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
  2262. /**
  2263. * Reverses the elements in an Array.
  2264. */
  2265. reverse(): Uint8ClampedArray;
  2266. /**
  2267. * Sets a value or an array of values.
  2268. * @param array A typed or untyped array of values to set.
  2269. * @param offset The index in the current array at which the values are to be written.
  2270. */
  2271. set(array: ArrayLike<number>, offset?: number): void;
  2272. /**
  2273. * Returns a section of an array.
  2274. * @param start The beginning of the specified portion of the array.
  2275. * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
  2276. */
  2277. slice(start?: number, end?: number): Uint8ClampedArray;
  2278. /**
  2279. * Determines whether the specified callback function returns true for any element of an array.
  2280. * @param predicate A function that accepts up to three arguments. The some method calls
  2281. * the predicate function for each element in the array until the predicate returns a value
  2282. * which is coercible to the Boolean value true, or until the end of the array.
  2283. * @param thisArg An object to which the this keyword can refer in the predicate function.
  2284. * If thisArg is omitted, undefined is used as the this value.
  2285. */
  2286. some(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;
  2287. /**
  2288. * Sorts an array.
  2289. * @param compareFn Function used to determine the order of the elements. It is expected to return
  2290. * a negative value if first argument is less than second argument, zero if they're equal and a positive
  2291. * value otherwise. If omitted, the elements are sorted in ascending order.
  2292. * ```ts
  2293. * [11,2,22,1].sort((a, b) => a - b)
  2294. * ```
  2295. */
  2296. sort(compareFn?: (a: number, b: number) => number): this;
  2297. /**
  2298. * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements
  2299. * at begin, inclusive, up to end, exclusive.
  2300. * @param begin The index of the beginning of the array.
  2301. * @param end The index of the end of the array.
  2302. */
  2303. subarray(begin?: number, end?: number): Uint8ClampedArray;
  2304. /**
  2305. * Converts a number to a string by using the current locale.
  2306. */
  2307. toLocaleString(): string;
  2308. /**
  2309. * Returns a string representation of an array.
  2310. */
  2311. toString(): string;
  2312. /** Returns the primitive value of the specified object. */
  2313. valueOf(): Uint8ClampedArray;
  2314. [index: number]: number;
  2315. }
  2316. interface Uint8ClampedArrayConstructor {
  2317. readonly prototype: Uint8ClampedArray;
  2318. new(length: number): Uint8ClampedArray;
  2319. new(array: ArrayLike<number> | ArrayBufferLike): Uint8ClampedArray;
  2320. new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8ClampedArray;
  2321. /**
  2322. * The size in bytes of each element in the array.
  2323. */
  2324. readonly BYTES_PER_ELEMENT: number;
  2325. /**
  2326. * Returns a new array from a set of elements.
  2327. * @param items A set of elements to include in the new array object.
  2328. */
  2329. of(...items: number[]): Uint8ClampedArray;
  2330. /**
  2331. * Creates an array from an array-like or iterable object.
  2332. * @param arrayLike An array-like or iterable object to convert to an array.
  2333. */
  2334. from(arrayLike: ArrayLike<number>): Uint8ClampedArray;
  2335. /**
  2336. * Creates an array from an array-like or iterable object.
  2337. * @param arrayLike An array-like or iterable object to convert to an array.
  2338. * @param mapfn A mapping function to call on every element of the array.
  2339. * @param thisArg Value of 'this' used to invoke the mapfn.
  2340. */
  2341. from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray;
  2342. }
  2343. declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;
  2344. /**
  2345. * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the
  2346. * requested number of bytes could not be allocated an exception is raised.
  2347. */
  2348. interface Int16Array {
  2349. /**
  2350. * The size in bytes of each element in the array.
  2351. */
  2352. readonly BYTES_PER_ELEMENT: number;
  2353. /**
  2354. * The ArrayBuffer instance referenced by the array.
  2355. */
  2356. readonly buffer: ArrayBufferLike;
  2357. /**
  2358. * The length in bytes of the array.
  2359. */
  2360. readonly byteLength: number;
  2361. /**
  2362. * The offset in bytes of the array.
  2363. */
  2364. readonly byteOffset: number;
  2365. /**
  2366. * Returns the this object after copying a section of the array identified by start and end
  2367. * to the same array starting at position target
  2368. * @param target If target is negative, it is treated as length+target where length is the
  2369. * length of the array.
  2370. * @param start If start is negative, it is treated as length+start. If end is negative, it
  2371. * is treated as length+end.
  2372. * @param end If not specified, length of the this object is used as its default value.
  2373. */
  2374. copyWithin(target: number, start: number, end?: number): this;
  2375. /**
  2376. * Determines whether all the members of an array satisfy the specified test.
  2377. * @param predicate A function that accepts up to three arguments. The every method calls
  2378. * the predicate function for each element in the array until the predicate returns a value
  2379. * which is coercible to the Boolean value false, or until the end of the array.
  2380. * @param thisArg An object to which the this keyword can refer in the predicate function.
  2381. * If thisArg is omitted, undefined is used as the this value.
  2382. */
  2383. every(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;
  2384. /**
  2385. * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
  2386. * @param value value to fill array section with
  2387. * @param start index to start filling the array at. If start is negative, it is treated as
  2388. * length+start where length is the length of the array.
  2389. * @param end index to stop filling the array at. If end is negative, it is treated as
  2390. * length+end.
  2391. */
  2392. fill(value: number, start?: number, end?: number): this;
  2393. /**
  2394. * Returns the elements of an array that meet the condition specified in a callback function.
  2395. * @param predicate A function that accepts up to three arguments. The filter method calls
  2396. * the predicate function one time for each element in the array.
  2397. * @param thisArg An object to which the this keyword can refer in the predicate function.
  2398. * If thisArg is omitted, undefined is used as the this value.
  2399. */
  2400. filter(predicate: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;
  2401. /**
  2402. * Returns the value of the first element in the array where predicate is true, and undefined
  2403. * otherwise.
  2404. * @param predicate find calls predicate once for each element of the array, in ascending
  2405. * order, until it finds one where predicate returns true. If such an element is found, find
  2406. * immediately returns that element value. Otherwise, find returns undefined.
  2407. * @param thisArg If provided, it will be used as the this value for each invocation of
  2408. * predicate. If it is not provided, undefined is used instead.
  2409. */
  2410. find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;
  2411. /**
  2412. * Returns the index of the first element in the array where predicate is true, and -1
  2413. * otherwise.
  2414. * @param predicate find calls predicate once for each element of the array, in ascending
  2415. * order, until it finds one where predicate returns true. If such an element is found,
  2416. * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
  2417. * @param thisArg If provided, it will be used as the this value for each invocation of
  2418. * predicate. If it is not provided, undefined is used instead.
  2419. */
  2420. findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;
  2421. /**
  2422. * Performs the specified action for each element in an array.
  2423. * @param callbackfn A function that accepts up to three arguments. forEach calls the
  2424. * callbackfn function one time for each element in the array.
  2425. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  2426. * If thisArg is omitted, undefined is used as the this value.
  2427. */
  2428. forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;
  2429. /**
  2430. * Returns the index of the first occurrence of a value in an array.
  2431. * @param searchElement The value to locate in the array.
  2432. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  2433. * search starts at index 0.
  2434. */
  2435. indexOf(searchElement: number, fromIndex?: number): number;
  2436. /**
  2437. * Adds all the elements of an array separated by the specified separator string.
  2438. * @param separator A string used to separate one element of an array from the next in the
  2439. * resulting String. If omitted, the array elements are separated with a comma.
  2440. */
  2441. join(separator?: string): string;
  2442. /**
  2443. * Returns the index of the last occurrence of a value in an array.
  2444. * @param searchElement The value to locate in the array.
  2445. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  2446. * search starts at index 0.
  2447. */
  2448. lastIndexOf(searchElement: number, fromIndex?: number): number;
  2449. /**
  2450. * The length of the array.
  2451. */
  2452. readonly length: number;
  2453. /**
  2454. * Calls a defined callback function on each element of an array, and returns an array that
  2455. * contains the results.
  2456. * @param callbackfn A function that accepts up to three arguments. The map method calls the
  2457. * callbackfn function one time for each element in the array.
  2458. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  2459. * If thisArg is omitted, undefined is used as the this value.
  2460. */
  2461. map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;
  2462. /**
  2463. * Calls the specified callback function for all the elements in an array. The return value of
  2464. * the callback function is the accumulated result, and is provided as an argument in the next
  2465. * call to the callback function.
  2466. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  2467. * callbackfn function one time for each element in the array.
  2468. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2469. * the accumulation. The first call to the callbackfn function provides this value as an argument
  2470. * instead of an array value.
  2471. */
  2472. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;
  2473. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;
  2474. /**
  2475. * Calls the specified callback function for all the elements in an array. The return value of
  2476. * the callback function is the accumulated result, and is provided as an argument in the next
  2477. * call to the callback function.
  2478. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  2479. * callbackfn function one time for each element in the array.
  2480. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2481. * the accumulation. The first call to the callbackfn function provides this value as an argument
  2482. * instead of an array value.
  2483. */
  2484. reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
  2485. /**
  2486. * Calls the specified callback function for all the elements in an array, in descending order.
  2487. * The return value of the callback function is the accumulated result, and is provided as an
  2488. * argument in the next call to the callback function.
  2489. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  2490. * the callbackfn function one time for each element in the array.
  2491. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2492. * the accumulation. The first call to the callbackfn function provides this value as an
  2493. * argument instead of an array value.
  2494. */
  2495. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;
  2496. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;
  2497. /**
  2498. * Calls the specified callback function for all the elements in an array, in descending order.
  2499. * The return value of the callback function is the accumulated result, and is provided as an
  2500. * argument in the next call to the callback function.
  2501. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  2502. * the callbackfn function one time for each element in the array.
  2503. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2504. * the accumulation. The first call to the callbackfn function provides this value as an argument
  2505. * instead of an array value.
  2506. */
  2507. reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
  2508. /**
  2509. * Reverses the elements in an Array.
  2510. */
  2511. reverse(): Int16Array;
  2512. /**
  2513. * Sets a value or an array of values.
  2514. * @param array A typed or untyped array of values to set.
  2515. * @param offset The index in the current array at which the values are to be written.
  2516. */
  2517. set(array: ArrayLike<number>, offset?: number): void;
  2518. /**
  2519. * Returns a section of an array.
  2520. * @param start The beginning of the specified portion of the array.
  2521. * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
  2522. */
  2523. slice(start?: number, end?: number): Int16Array;
  2524. /**
  2525. * Determines whether the specified callback function returns true for any element of an array.
  2526. * @param predicate A function that accepts up to three arguments. The some method calls
  2527. * the predicate function for each element in the array until the predicate returns a value
  2528. * which is coercible to the Boolean value true, or until the end of the array.
  2529. * @param thisArg An object to which the this keyword can refer in the predicate function.
  2530. * If thisArg is omitted, undefined is used as the this value.
  2531. */
  2532. some(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;
  2533. /**
  2534. * Sorts an array.
  2535. * @param compareFn Function used to determine the order of the elements. It is expected to return
  2536. * a negative value if first argument is less than second argument, zero if they're equal and a positive
  2537. * value otherwise. If omitted, the elements are sorted in ascending order.
  2538. * ```ts
  2539. * [11,2,22,1].sort((a, b) => a - b)
  2540. * ```
  2541. */
  2542. sort(compareFn?: (a: number, b: number) => number): this;
  2543. /**
  2544. * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements
  2545. * at begin, inclusive, up to end, exclusive.
  2546. * @param begin The index of the beginning of the array.
  2547. * @param end The index of the end of the array.
  2548. */
  2549. subarray(begin?: number, end?: number): Int16Array;
  2550. /**
  2551. * Converts a number to a string by using the current locale.
  2552. */
  2553. toLocaleString(): string;
  2554. /**
  2555. * Returns a string representation of an array.
  2556. */
  2557. toString(): string;
  2558. /** Returns the primitive value of the specified object. */
  2559. valueOf(): Int16Array;
  2560. [index: number]: number;
  2561. }
  2562. interface Int16ArrayConstructor {
  2563. readonly prototype: Int16Array;
  2564. new(length: number): Int16Array;
  2565. new(array: ArrayLike<number> | ArrayBufferLike): Int16Array;
  2566. new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int16Array;
  2567. /**
  2568. * The size in bytes of each element in the array.
  2569. */
  2570. readonly BYTES_PER_ELEMENT: number;
  2571. /**
  2572. * Returns a new array from a set of elements.
  2573. * @param items A set of elements to include in the new array object.
  2574. */
  2575. of(...items: number[]): Int16Array;
  2576. /**
  2577. * Creates an array from an array-like or iterable object.
  2578. * @param arrayLike An array-like or iterable object to convert to an array.
  2579. */
  2580. from(arrayLike: ArrayLike<number>): Int16Array;
  2581. /**
  2582. * Creates an array from an array-like or iterable object.
  2583. * @param arrayLike An array-like or iterable object to convert to an array.
  2584. * @param mapfn A mapping function to call on every element of the array.
  2585. * @param thisArg Value of 'this' used to invoke the mapfn.
  2586. */
  2587. from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array;
  2588. }
  2589. declare var Int16Array: Int16ArrayConstructor;
  2590. /**
  2591. * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the
  2592. * requested number of bytes could not be allocated an exception is raised.
  2593. */
  2594. interface Uint16Array {
  2595. /**
  2596. * The size in bytes of each element in the array.
  2597. */
  2598. readonly BYTES_PER_ELEMENT: number;
  2599. /**
  2600. * The ArrayBuffer instance referenced by the array.
  2601. */
  2602. readonly buffer: ArrayBufferLike;
  2603. /**
  2604. * The length in bytes of the array.
  2605. */
  2606. readonly byteLength: number;
  2607. /**
  2608. * The offset in bytes of the array.
  2609. */
  2610. readonly byteOffset: number;
  2611. /**
  2612. * Returns the this object after copying a section of the array identified by start and end
  2613. * to the same array starting at position target
  2614. * @param target If target is negative, it is treated as length+target where length is the
  2615. * length of the array.
  2616. * @param start If start is negative, it is treated as length+start. If end is negative, it
  2617. * is treated as length+end.
  2618. * @param end If not specified, length of the this object is used as its default value.
  2619. */
  2620. copyWithin(target: number, start: number, end?: number): this;
  2621. /**
  2622. * Determines whether all the members of an array satisfy the specified test.
  2623. * @param predicate A function that accepts up to three arguments. The every method calls
  2624. * the predicate function for each element in the array until the predicate returns a value
  2625. * which is coercible to the Boolean value false, or until the end of the array.
  2626. * @param thisArg An object to which the this keyword can refer in the predicate function.
  2627. * If thisArg is omitted, undefined is used as the this value.
  2628. */
  2629. every(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;
  2630. /**
  2631. * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
  2632. * @param value value to fill array section with
  2633. * @param start index to start filling the array at. If start is negative, it is treated as
  2634. * length+start where length is the length of the array.
  2635. * @param end index to stop filling the array at. If end is negative, it is treated as
  2636. * length+end.
  2637. */
  2638. fill(value: number, start?: number, end?: number): this;
  2639. /**
  2640. * Returns the elements of an array that meet the condition specified in a callback function.
  2641. * @param predicate A function that accepts up to three arguments. The filter method calls
  2642. * the predicate function one time for each element in the array.
  2643. * @param thisArg An object to which the this keyword can refer in the predicate function.
  2644. * If thisArg is omitted, undefined is used as the this value.
  2645. */
  2646. filter(predicate: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;
  2647. /**
  2648. * Returns the value of the first element in the array where predicate is true, and undefined
  2649. * otherwise.
  2650. * @param predicate find calls predicate once for each element of the array, in ascending
  2651. * order, until it finds one where predicate returns true. If such an element is found, find
  2652. * immediately returns that element value. Otherwise, find returns undefined.
  2653. * @param thisArg If provided, it will be used as the this value for each invocation of
  2654. * predicate. If it is not provided, undefined is used instead.
  2655. */
  2656. find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;
  2657. /**
  2658. * Returns the index of the first element in the array where predicate is true, and -1
  2659. * otherwise.
  2660. * @param predicate find calls predicate once for each element of the array, in ascending
  2661. * order, until it finds one where predicate returns true. If such an element is found,
  2662. * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
  2663. * @param thisArg If provided, it will be used as the this value for each invocation of
  2664. * predicate. If it is not provided, undefined is used instead.
  2665. */
  2666. findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;
  2667. /**
  2668. * Performs the specified action for each element in an array.
  2669. * @param callbackfn A function that accepts up to three arguments. forEach calls the
  2670. * callbackfn function one time for each element in the array.
  2671. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  2672. * If thisArg is omitted, undefined is used as the this value.
  2673. */
  2674. forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;
  2675. /**
  2676. * Returns the index of the first occurrence of a value in an array.
  2677. * @param searchElement The value to locate in the array.
  2678. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  2679. * search starts at index 0.
  2680. */
  2681. indexOf(searchElement: number, fromIndex?: number): number;
  2682. /**
  2683. * Adds all the elements of an array separated by the specified separator string.
  2684. * @param separator A string used to separate one element of an array from the next in the
  2685. * resulting String. If omitted, the array elements are separated with a comma.
  2686. */
  2687. join(separator?: string): string;
  2688. /**
  2689. * Returns the index of the last occurrence of a value in an array.
  2690. * @param searchElement The value to locate in the array.
  2691. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  2692. * search starts at index 0.
  2693. */
  2694. lastIndexOf(searchElement: number, fromIndex?: number): number;
  2695. /**
  2696. * The length of the array.
  2697. */
  2698. readonly length: number;
  2699. /**
  2700. * Calls a defined callback function on each element of an array, and returns an array that
  2701. * contains the results.
  2702. * @param callbackfn A function that accepts up to three arguments. The map method calls the
  2703. * callbackfn function one time for each element in the array.
  2704. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  2705. * If thisArg is omitted, undefined is used as the this value.
  2706. */
  2707. map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;
  2708. /**
  2709. * Calls the specified callback function for all the elements in an array. The return value of
  2710. * the callback function is the accumulated result, and is provided as an argument in the next
  2711. * call to the callback function.
  2712. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  2713. * callbackfn function one time for each element in the array.
  2714. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2715. * the accumulation. The first call to the callbackfn function provides this value as an argument
  2716. * instead of an array value.
  2717. */
  2718. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;
  2719. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;
  2720. /**
  2721. * Calls the specified callback function for all the elements in an array. The return value of
  2722. * the callback function is the accumulated result, and is provided as an argument in the next
  2723. * call to the callback function.
  2724. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  2725. * callbackfn function one time for each element in the array.
  2726. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2727. * the accumulation. The first call to the callbackfn function provides this value as an argument
  2728. * instead of an array value.
  2729. */
  2730. reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
  2731. /**
  2732. * Calls the specified callback function for all the elements in an array, in descending order.
  2733. * The return value of the callback function is the accumulated result, and is provided as an
  2734. * argument in the next call to the callback function.
  2735. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  2736. * the callbackfn function one time for each element in the array.
  2737. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2738. * the accumulation. The first call to the callbackfn function provides this value as an
  2739. * argument instead of an array value.
  2740. */
  2741. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;
  2742. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;
  2743. /**
  2744. * Calls the specified callback function for all the elements in an array, in descending order.
  2745. * The return value of the callback function is the accumulated result, and is provided as an
  2746. * argument in the next call to the callback function.
  2747. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  2748. * the callbackfn function one time for each element in the array.
  2749. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2750. * the accumulation. The first call to the callbackfn function provides this value as an argument
  2751. * instead of an array value.
  2752. */
  2753. reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
  2754. /**
  2755. * Reverses the elements in an Array.
  2756. */
  2757. reverse(): Uint16Array;
  2758. /**
  2759. * Sets a value or an array of values.
  2760. * @param array A typed or untyped array of values to set.
  2761. * @param offset The index in the current array at which the values are to be written.
  2762. */
  2763. set(array: ArrayLike<number>, offset?: number): void;
  2764. /**
  2765. * Returns a section of an array.
  2766. * @param start The beginning of the specified portion of the array.
  2767. * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
  2768. */
  2769. slice(start?: number, end?: number): Uint16Array;
  2770. /**
  2771. * Determines whether the specified callback function returns true for any element of an array.
  2772. * @param predicate A function that accepts up to three arguments. The some method calls
  2773. * the predicate function for each element in the array until the predicate returns a value
  2774. * which is coercible to the Boolean value true, or until the end of the array.
  2775. * @param thisArg An object to which the this keyword can refer in the predicate function.
  2776. * If thisArg is omitted, undefined is used as the this value.
  2777. */
  2778. some(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;
  2779. /**
  2780. * Sorts an array.
  2781. * @param compareFn Function used to determine the order of the elements. It is expected to return
  2782. * a negative value if first argument is less than second argument, zero if they're equal and a positive
  2783. * value otherwise. If omitted, the elements are sorted in ascending order.
  2784. * ```ts
  2785. * [11,2,22,1].sort((a, b) => a - b)
  2786. * ```
  2787. */
  2788. sort(compareFn?: (a: number, b: number) => number): this;
  2789. /**
  2790. * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements
  2791. * at begin, inclusive, up to end, exclusive.
  2792. * @param begin The index of the beginning of the array.
  2793. * @param end The index of the end of the array.
  2794. */
  2795. subarray(begin?: number, end?: number): Uint16Array;
  2796. /**
  2797. * Converts a number to a string by using the current locale.
  2798. */
  2799. toLocaleString(): string;
  2800. /**
  2801. * Returns a string representation of an array.
  2802. */
  2803. toString(): string;
  2804. /** Returns the primitive value of the specified object. */
  2805. valueOf(): Uint16Array;
  2806. [index: number]: number;
  2807. }
  2808. interface Uint16ArrayConstructor {
  2809. readonly prototype: Uint16Array;
  2810. new(length: number): Uint16Array;
  2811. new(array: ArrayLike<number> | ArrayBufferLike): Uint16Array;
  2812. new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint16Array;
  2813. /**
  2814. * The size in bytes of each element in the array.
  2815. */
  2816. readonly BYTES_PER_ELEMENT: number;
  2817. /**
  2818. * Returns a new array from a set of elements.
  2819. * @param items A set of elements to include in the new array object.
  2820. */
  2821. of(...items: number[]): Uint16Array;
  2822. /**
  2823. * Creates an array from an array-like or iterable object.
  2824. * @param arrayLike An array-like or iterable object to convert to an array.
  2825. */
  2826. from(arrayLike: ArrayLike<number>): Uint16Array;
  2827. /**
  2828. * Creates an array from an array-like or iterable object.
  2829. * @param arrayLike An array-like or iterable object to convert to an array.
  2830. * @param mapfn A mapping function to call on every element of the array.
  2831. * @param thisArg Value of 'this' used to invoke the mapfn.
  2832. */
  2833. from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array;
  2834. }
  2835. declare var Uint16Array: Uint16ArrayConstructor;
  2836. /**
  2837. * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the
  2838. * requested number of bytes could not be allocated an exception is raised.
  2839. */
  2840. interface Int32Array {
  2841. /**
  2842. * The size in bytes of each element in the array.
  2843. */
  2844. readonly BYTES_PER_ELEMENT: number;
  2845. /**
  2846. * The ArrayBuffer instance referenced by the array.
  2847. */
  2848. readonly buffer: ArrayBufferLike;
  2849. /**
  2850. * The length in bytes of the array.
  2851. */
  2852. readonly byteLength: number;
  2853. /**
  2854. * The offset in bytes of the array.
  2855. */
  2856. readonly byteOffset: number;
  2857. /**
  2858. * Returns the this object after copying a section of the array identified by start and end
  2859. * to the same array starting at position target
  2860. * @param target If target is negative, it is treated as length+target where length is the
  2861. * length of the array.
  2862. * @param start If start is negative, it is treated as length+start. If end is negative, it
  2863. * is treated as length+end.
  2864. * @param end If not specified, length of the this object is used as its default value.
  2865. */
  2866. copyWithin(target: number, start: number, end?: number): this;
  2867. /**
  2868. * Determines whether all the members of an array satisfy the specified test.
  2869. * @param predicate A function that accepts up to three arguments. The every method calls
  2870. * the predicate function for each element in the array until the predicate returns a value
  2871. * which is coercible to the Boolean value false, or until the end of the array.
  2872. * @param thisArg An object to which the this keyword can refer in the predicate function.
  2873. * If thisArg is omitted, undefined is used as the this value.
  2874. */
  2875. every(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;
  2876. /**
  2877. * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
  2878. * @param value value to fill array section with
  2879. * @param start index to start filling the array at. If start is negative, it is treated as
  2880. * length+start where length is the length of the array.
  2881. * @param end index to stop filling the array at. If end is negative, it is treated as
  2882. * length+end.
  2883. */
  2884. fill(value: number, start?: number, end?: number): this;
  2885. /**
  2886. * Returns the elements of an array that meet the condition specified in a callback function.
  2887. * @param predicate A function that accepts up to three arguments. The filter method calls
  2888. * the predicate function one time for each element in the array.
  2889. * @param thisArg An object to which the this keyword can refer in the predicate function.
  2890. * If thisArg is omitted, undefined is used as the this value.
  2891. */
  2892. filter(predicate: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;
  2893. /**
  2894. * Returns the value of the first element in the array where predicate is true, and undefined
  2895. * otherwise.
  2896. * @param predicate find calls predicate once for each element of the array, in ascending
  2897. * order, until it finds one where predicate returns true. If such an element is found, find
  2898. * immediately returns that element value. Otherwise, find returns undefined.
  2899. * @param thisArg If provided, it will be used as the this value for each invocation of
  2900. * predicate. If it is not provided, undefined is used instead.
  2901. */
  2902. find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;
  2903. /**
  2904. * Returns the index of the first element in the array where predicate is true, and -1
  2905. * otherwise.
  2906. * @param predicate find calls predicate once for each element of the array, in ascending
  2907. * order, until it finds one where predicate returns true. If such an element is found,
  2908. * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
  2909. * @param thisArg If provided, it will be used as the this value for each invocation of
  2910. * predicate. If it is not provided, undefined is used instead.
  2911. */
  2912. findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;
  2913. /**
  2914. * Performs the specified action for each element in an array.
  2915. * @param callbackfn A function that accepts up to three arguments. forEach calls the
  2916. * callbackfn function one time for each element in the array.
  2917. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  2918. * If thisArg is omitted, undefined is used as the this value.
  2919. */
  2920. forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;
  2921. /**
  2922. * Returns the index of the first occurrence of a value in an array.
  2923. * @param searchElement The value to locate in the array.
  2924. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  2925. * search starts at index 0.
  2926. */
  2927. indexOf(searchElement: number, fromIndex?: number): number;
  2928. /**
  2929. * Adds all the elements of an array separated by the specified separator string.
  2930. * @param separator A string used to separate one element of an array from the next in the
  2931. * resulting String. If omitted, the array elements are separated with a comma.
  2932. */
  2933. join(separator?: string): string;
  2934. /**
  2935. * Returns the index of the last occurrence of a value in an array.
  2936. * @param searchElement The value to locate in the array.
  2937. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  2938. * search starts at index 0.
  2939. */
  2940. lastIndexOf(searchElement: number, fromIndex?: number): number;
  2941. /**
  2942. * The length of the array.
  2943. */
  2944. readonly length: number;
  2945. /**
  2946. * Calls a defined callback function on each element of an array, and returns an array that
  2947. * contains the results.
  2948. * @param callbackfn A function that accepts up to three arguments. The map method calls the
  2949. * callbackfn function one time for each element in the array.
  2950. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  2951. * If thisArg is omitted, undefined is used as the this value.
  2952. */
  2953. map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;
  2954. /**
  2955. * Calls the specified callback function for all the elements in an array. The return value of
  2956. * the callback function is the accumulated result, and is provided as an argument in the next
  2957. * call to the callback function.
  2958. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  2959. * callbackfn function one time for each element in the array.
  2960. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2961. * the accumulation. The first call to the callbackfn function provides this value as an argument
  2962. * instead of an array value.
  2963. */
  2964. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;
  2965. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;
  2966. /**
  2967. * Calls the specified callback function for all the elements in an array. The return value of
  2968. * the callback function is the accumulated result, and is provided as an argument in the next
  2969. * call to the callback function.
  2970. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  2971. * callbackfn function one time for each element in the array.
  2972. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2973. * the accumulation. The first call to the callbackfn function provides this value as an argument
  2974. * instead of an array value.
  2975. */
  2976. reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
  2977. /**
  2978. * Calls the specified callback function for all the elements in an array, in descending order.
  2979. * The return value of the callback function is the accumulated result, and is provided as an
  2980. * argument in the next call to the callback function.
  2981. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  2982. * the callbackfn function one time for each element in the array.
  2983. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2984. * the accumulation. The first call to the callbackfn function provides this value as an
  2985. * argument instead of an array value.
  2986. */
  2987. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;
  2988. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;
  2989. /**
  2990. * Calls the specified callback function for all the elements in an array, in descending order.
  2991. * The return value of the callback function is the accumulated result, and is provided as an
  2992. * argument in the next call to the callback function.
  2993. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  2994. * the callbackfn function one time for each element in the array.
  2995. * @param initialValue If initialValue is specified, it is used as the initial value to start
  2996. * the accumulation. The first call to the callbackfn function provides this value as an argument
  2997. * instead of an array value.
  2998. */
  2999. reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
  3000. /**
  3001. * Reverses the elements in an Array.
  3002. */
  3003. reverse(): Int32Array;
  3004. /**
  3005. * Sets a value or an array of values.
  3006. * @param array A typed or untyped array of values to set.
  3007. * @param offset The index in the current array at which the values are to be written.
  3008. */
  3009. set(array: ArrayLike<number>, offset?: number): void;
  3010. /**
  3011. * Returns a section of an array.
  3012. * @param start The beginning of the specified portion of the array.
  3013. * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
  3014. */
  3015. slice(start?: number, end?: number): Int32Array;
  3016. /**
  3017. * Determines whether the specified callback function returns true for any element of an array.
  3018. * @param predicate A function that accepts up to three arguments. The some method calls
  3019. * the predicate function for each element in the array until the predicate returns a value
  3020. * which is coercible to the Boolean value true, or until the end of the array.
  3021. * @param thisArg An object to which the this keyword can refer in the predicate function.
  3022. * If thisArg is omitted, undefined is used as the this value.
  3023. */
  3024. some(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;
  3025. /**
  3026. * Sorts an array.
  3027. * @param compareFn Function used to determine the order of the elements. It is expected to return
  3028. * a negative value if first argument is less than second argument, zero if they're equal and a positive
  3029. * value otherwise. If omitted, the elements are sorted in ascending order.
  3030. * ```ts
  3031. * [11,2,22,1].sort((a, b) => a - b)
  3032. * ```
  3033. */
  3034. sort(compareFn?: (a: number, b: number) => number): this;
  3035. /**
  3036. * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements
  3037. * at begin, inclusive, up to end, exclusive.
  3038. * @param begin The index of the beginning of the array.
  3039. * @param end The index of the end of the array.
  3040. */
  3041. subarray(begin?: number, end?: number): Int32Array;
  3042. /**
  3043. * Converts a number to a string by using the current locale.
  3044. */
  3045. toLocaleString(): string;
  3046. /**
  3047. * Returns a string representation of an array.
  3048. */
  3049. toString(): string;
  3050. /** Returns the primitive value of the specified object. */
  3051. valueOf(): Int32Array;
  3052. [index: number]: number;
  3053. }
  3054. interface Int32ArrayConstructor {
  3055. readonly prototype: Int32Array;
  3056. new(length: number): Int32Array;
  3057. new(array: ArrayLike<number> | ArrayBufferLike): Int32Array;
  3058. new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int32Array;
  3059. /**
  3060. * The size in bytes of each element in the array.
  3061. */
  3062. readonly BYTES_PER_ELEMENT: number;
  3063. /**
  3064. * Returns a new array from a set of elements.
  3065. * @param items A set of elements to include in the new array object.
  3066. */
  3067. of(...items: number[]): Int32Array;
  3068. /**
  3069. * Creates an array from an array-like or iterable object.
  3070. * @param arrayLike An array-like or iterable object to convert to an array.
  3071. */
  3072. from(arrayLike: ArrayLike<number>): Int32Array;
  3073. /**
  3074. * Creates an array from an array-like or iterable object.
  3075. * @param arrayLike An array-like or iterable object to convert to an array.
  3076. * @param mapfn A mapping function to call on every element of the array.
  3077. * @param thisArg Value of 'this' used to invoke the mapfn.
  3078. */
  3079. from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array;
  3080. }
  3081. declare var Int32Array: Int32ArrayConstructor;
  3082. /**
  3083. * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the
  3084. * requested number of bytes could not be allocated an exception is raised.
  3085. */
  3086. interface Uint32Array {
  3087. /**
  3088. * The size in bytes of each element in the array.
  3089. */
  3090. readonly BYTES_PER_ELEMENT: number;
  3091. /**
  3092. * The ArrayBuffer instance referenced by the array.
  3093. */
  3094. readonly buffer: ArrayBufferLike;
  3095. /**
  3096. * The length in bytes of the array.
  3097. */
  3098. readonly byteLength: number;
  3099. /**
  3100. * The offset in bytes of the array.
  3101. */
  3102. readonly byteOffset: number;
  3103. /**
  3104. * Returns the this object after copying a section of the array identified by start and end
  3105. * to the same array starting at position target
  3106. * @param target If target is negative, it is treated as length+target where length is the
  3107. * length of the array.
  3108. * @param start If start is negative, it is treated as length+start. If end is negative, it
  3109. * is treated as length+end.
  3110. * @param end If not specified, length of the this object is used as its default value.
  3111. */
  3112. copyWithin(target: number, start: number, end?: number): this;
  3113. /**
  3114. * Determines whether all the members of an array satisfy the specified test.
  3115. * @param predicate A function that accepts up to three arguments. The every method calls
  3116. * the predicate function for each element in the array until the predicate returns a value
  3117. * which is coercible to the Boolean value false, or until the end of the array.
  3118. * @param thisArg An object to which the this keyword can refer in the predicate function.
  3119. * If thisArg is omitted, undefined is used as the this value.
  3120. */
  3121. every(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;
  3122. /**
  3123. * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
  3124. * @param value value to fill array section with
  3125. * @param start index to start filling the array at. If start is negative, it is treated as
  3126. * length+start where length is the length of the array.
  3127. * @param end index to stop filling the array at. If end is negative, it is treated as
  3128. * length+end.
  3129. */
  3130. fill(value: number, start?: number, end?: number): this;
  3131. /**
  3132. * Returns the elements of an array that meet the condition specified in a callback function.
  3133. * @param predicate A function that accepts up to three arguments. The filter method calls
  3134. * the predicate function one time for each element in the array.
  3135. * @param thisArg An object to which the this keyword can refer in the predicate function.
  3136. * If thisArg is omitted, undefined is used as the this value.
  3137. */
  3138. filter(predicate: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;
  3139. /**
  3140. * Returns the value of the first element in the array where predicate is true, and undefined
  3141. * otherwise.
  3142. * @param predicate find calls predicate once for each element of the array, in ascending
  3143. * order, until it finds one where predicate returns true. If such an element is found, find
  3144. * immediately returns that element value. Otherwise, find returns undefined.
  3145. * @param thisArg If provided, it will be used as the this value for each invocation of
  3146. * predicate. If it is not provided, undefined is used instead.
  3147. */
  3148. find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;
  3149. /**
  3150. * Returns the index of the first element in the array where predicate is true, and -1
  3151. * otherwise.
  3152. * @param predicate find calls predicate once for each element of the array, in ascending
  3153. * order, until it finds one where predicate returns true. If such an element is found,
  3154. * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
  3155. * @param thisArg If provided, it will be used as the this value for each invocation of
  3156. * predicate. If it is not provided, undefined is used instead.
  3157. */
  3158. findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;
  3159. /**
  3160. * Performs the specified action for each element in an array.
  3161. * @param callbackfn A function that accepts up to three arguments. forEach calls the
  3162. * callbackfn function one time for each element in the array.
  3163. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  3164. * If thisArg is omitted, undefined is used as the this value.
  3165. */
  3166. forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;
  3167. /**
  3168. * Returns the index of the first occurrence of a value in an array.
  3169. * @param searchElement The value to locate in the array.
  3170. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  3171. * search starts at index 0.
  3172. */
  3173. indexOf(searchElement: number, fromIndex?: number): number;
  3174. /**
  3175. * Adds all the elements of an array separated by the specified separator string.
  3176. * @param separator A string used to separate one element of an array from the next in the
  3177. * resulting String. If omitted, the array elements are separated with a comma.
  3178. */
  3179. join(separator?: string): string;
  3180. /**
  3181. * Returns the index of the last occurrence of a value in an array.
  3182. * @param searchElement The value to locate in the array.
  3183. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  3184. * search starts at index 0.
  3185. */
  3186. lastIndexOf(searchElement: number, fromIndex?: number): number;
  3187. /**
  3188. * The length of the array.
  3189. */
  3190. readonly length: number;
  3191. /**
  3192. * Calls a defined callback function on each element of an array, and returns an array that
  3193. * contains the results.
  3194. * @param callbackfn A function that accepts up to three arguments. The map method calls the
  3195. * callbackfn function one time for each element in the array.
  3196. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  3197. * If thisArg is omitted, undefined is used as the this value.
  3198. */
  3199. map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;
  3200. /**
  3201. * Calls the specified callback function for all the elements in an array. The return value of
  3202. * the callback function is the accumulated result, and is provided as an argument in the next
  3203. * call to the callback function.
  3204. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  3205. * callbackfn function one time for each element in the array.
  3206. * @param initialValue If initialValue is specified, it is used as the initial value to start
  3207. * the accumulation. The first call to the callbackfn function provides this value as an argument
  3208. * instead of an array value.
  3209. */
  3210. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;
  3211. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;
  3212. /**
  3213. * Calls the specified callback function for all the elements in an array. The return value of
  3214. * the callback function is the accumulated result, and is provided as an argument in the next
  3215. * call to the callback function.
  3216. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  3217. * callbackfn function one time for each element in the array.
  3218. * @param initialValue If initialValue is specified, it is used as the initial value to start
  3219. * the accumulation. The first call to the callbackfn function provides this value as an argument
  3220. * instead of an array value.
  3221. */
  3222. reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
  3223. /**
  3224. * Calls the specified callback function for all the elements in an array, in descending order.
  3225. * The return value of the callback function is the accumulated result, and is provided as an
  3226. * argument in the next call to the callback function.
  3227. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  3228. * the callbackfn function one time for each element in the array.
  3229. * @param initialValue If initialValue is specified, it is used as the initial value to start
  3230. * the accumulation. The first call to the callbackfn function provides this value as an
  3231. * argument instead of an array value.
  3232. */
  3233. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;
  3234. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;
  3235. /**
  3236. * Calls the specified callback function for all the elements in an array, in descending order.
  3237. * The return value of the callback function is the accumulated result, and is provided as an
  3238. * argument in the next call to the callback function.
  3239. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  3240. * the callbackfn function one time for each element in the array.
  3241. * @param initialValue If initialValue is specified, it is used as the initial value to start
  3242. * the accumulation. The first call to the callbackfn function provides this value as an argument
  3243. * instead of an array value.
  3244. */
  3245. reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
  3246. /**
  3247. * Reverses the elements in an Array.
  3248. */
  3249. reverse(): Uint32Array;
  3250. /**
  3251. * Sets a value or an array of values.
  3252. * @param array A typed or untyped array of values to set.
  3253. * @param offset The index in the current array at which the values are to be written.
  3254. */
  3255. set(array: ArrayLike<number>, offset?: number): void;
  3256. /**
  3257. * Returns a section of an array.
  3258. * @param start The beginning of the specified portion of the array.
  3259. * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
  3260. */
  3261. slice(start?: number, end?: number): Uint32Array;
  3262. /**
  3263. * Determines whether the specified callback function returns true for any element of an array.
  3264. * @param predicate A function that accepts up to three arguments. The some method calls
  3265. * the predicate function for each element in the array until the predicate returns a value
  3266. * which is coercible to the Boolean value true, or until the end of the array.
  3267. * @param thisArg An object to which the this keyword can refer in the predicate function.
  3268. * If thisArg is omitted, undefined is used as the this value.
  3269. */
  3270. some(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;
  3271. /**
  3272. * Sorts an array.
  3273. * @param compareFn Function used to determine the order of the elements. It is expected to return
  3274. * a negative value if first argument is less than second argument, zero if they're equal and a positive
  3275. * value otherwise. If omitted, the elements are sorted in ascending order.
  3276. * ```ts
  3277. * [11,2,22,1].sort((a, b) => a - b)
  3278. * ```
  3279. */
  3280. sort(compareFn?: (a: number, b: number) => number): this;
  3281. /**
  3282. * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements
  3283. * at begin, inclusive, up to end, exclusive.
  3284. * @param begin The index of the beginning of the array.
  3285. * @param end The index of the end of the array.
  3286. */
  3287. subarray(begin?: number, end?: number): Uint32Array;
  3288. /**
  3289. * Converts a number to a string by using the current locale.
  3290. */
  3291. toLocaleString(): string;
  3292. /**
  3293. * Returns a string representation of an array.
  3294. */
  3295. toString(): string;
  3296. /** Returns the primitive value of the specified object. */
  3297. valueOf(): Uint32Array;
  3298. [index: number]: number;
  3299. }
  3300. interface Uint32ArrayConstructor {
  3301. readonly prototype: Uint32Array;
  3302. new(length: number): Uint32Array;
  3303. new(array: ArrayLike<number> | ArrayBufferLike): Uint32Array;
  3304. new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint32Array;
  3305. /**
  3306. * The size in bytes of each element in the array.
  3307. */
  3308. readonly BYTES_PER_ELEMENT: number;
  3309. /**
  3310. * Returns a new array from a set of elements.
  3311. * @param items A set of elements to include in the new array object.
  3312. */
  3313. of(...items: number[]): Uint32Array;
  3314. /**
  3315. * Creates an array from an array-like or iterable object.
  3316. * @param arrayLike An array-like or iterable object to convert to an array.
  3317. */
  3318. from(arrayLike: ArrayLike<number>): Uint32Array;
  3319. /**
  3320. * Creates an array from an array-like or iterable object.
  3321. * @param arrayLike An array-like or iterable object to convert to an array.
  3322. * @param mapfn A mapping function to call on every element of the array.
  3323. * @param thisArg Value of 'this' used to invoke the mapfn.
  3324. */
  3325. from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array;
  3326. }
  3327. declare var Uint32Array: Uint32ArrayConstructor;
  3328. /**
  3329. * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number
  3330. * of bytes could not be allocated an exception is raised.
  3331. */
  3332. interface Float32Array {
  3333. /**
  3334. * The size in bytes of each element in the array.
  3335. */
  3336. readonly BYTES_PER_ELEMENT: number;
  3337. /**
  3338. * The ArrayBuffer instance referenced by the array.
  3339. */
  3340. readonly buffer: ArrayBufferLike;
  3341. /**
  3342. * The length in bytes of the array.
  3343. */
  3344. readonly byteLength: number;
  3345. /**
  3346. * The offset in bytes of the array.
  3347. */
  3348. readonly byteOffset: number;
  3349. /**
  3350. * Returns the this object after copying a section of the array identified by start and end
  3351. * to the same array starting at position target
  3352. * @param target If target is negative, it is treated as length+target where length is the
  3353. * length of the array.
  3354. * @param start If start is negative, it is treated as length+start. If end is negative, it
  3355. * is treated as length+end.
  3356. * @param end If not specified, length of the this object is used as its default value.
  3357. */
  3358. copyWithin(target: number, start: number, end?: number): this;
  3359. /**
  3360. * Determines whether all the members of an array satisfy the specified test.
  3361. * @param predicate A function that accepts up to three arguments. The every method calls
  3362. * the predicate function for each element in the array until the predicate returns a value
  3363. * which is coercible to the Boolean value false, or until the end of the array.
  3364. * @param thisArg An object to which the this keyword can refer in the predicate function.
  3365. * If thisArg is omitted, undefined is used as the this value.
  3366. */
  3367. every(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;
  3368. /**
  3369. * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
  3370. * @param value value to fill array section with
  3371. * @param start index to start filling the array at. If start is negative, it is treated as
  3372. * length+start where length is the length of the array.
  3373. * @param end index to stop filling the array at. If end is negative, it is treated as
  3374. * length+end.
  3375. */
  3376. fill(value: number, start?: number, end?: number): this;
  3377. /**
  3378. * Returns the elements of an array that meet the condition specified in a callback function.
  3379. * @param predicate A function that accepts up to three arguments. The filter method calls
  3380. * the predicate function one time for each element in the array.
  3381. * @param thisArg An object to which the this keyword can refer in the predicate function.
  3382. * If thisArg is omitted, undefined is used as the this value.
  3383. */
  3384. filter(predicate: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;
  3385. /**
  3386. * Returns the value of the first element in the array where predicate is true, and undefined
  3387. * otherwise.
  3388. * @param predicate find calls predicate once for each element of the array, in ascending
  3389. * order, until it finds one where predicate returns true. If such an element is found, find
  3390. * immediately returns that element value. Otherwise, find returns undefined.
  3391. * @param thisArg If provided, it will be used as the this value for each invocation of
  3392. * predicate. If it is not provided, undefined is used instead.
  3393. */
  3394. find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;
  3395. /**
  3396. * Returns the index of the first element in the array where predicate is true, and -1
  3397. * otherwise.
  3398. * @param predicate find calls predicate once for each element of the array, in ascending
  3399. * order, until it finds one where predicate returns true. If such an element is found,
  3400. * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
  3401. * @param thisArg If provided, it will be used as the this value for each invocation of
  3402. * predicate. If it is not provided, undefined is used instead.
  3403. */
  3404. findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;
  3405. /**
  3406. * Performs the specified action for each element in an array.
  3407. * @param callbackfn A function that accepts up to three arguments. forEach calls the
  3408. * callbackfn function one time for each element in the array.
  3409. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  3410. * If thisArg is omitted, undefined is used as the this value.
  3411. */
  3412. forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;
  3413. /**
  3414. * Returns the index of the first occurrence of a value in an array.
  3415. * @param searchElement The value to locate in the array.
  3416. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  3417. * search starts at index 0.
  3418. */
  3419. indexOf(searchElement: number, fromIndex?: number): number;
  3420. /**
  3421. * Adds all the elements of an array separated by the specified separator string.
  3422. * @param separator A string used to separate one element of an array from the next in the
  3423. * resulting String. If omitted, the array elements are separated with a comma.
  3424. */
  3425. join(separator?: string): string;
  3426. /**
  3427. * Returns the index of the last occurrence of a value in an array.
  3428. * @param searchElement The value to locate in the array.
  3429. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  3430. * search starts at index 0.
  3431. */
  3432. lastIndexOf(searchElement: number, fromIndex?: number): number;
  3433. /**
  3434. * The length of the array.
  3435. */
  3436. readonly length: number;
  3437. /**
  3438. * Calls a defined callback function on each element of an array, and returns an array that
  3439. * contains the results.
  3440. * @param callbackfn A function that accepts up to three arguments. The map method calls the
  3441. * callbackfn function one time for each element in the array.
  3442. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  3443. * If thisArg is omitted, undefined is used as the this value.
  3444. */
  3445. map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;
  3446. /**
  3447. * Calls the specified callback function for all the elements in an array. The return value of
  3448. * the callback function is the accumulated result, and is provided as an argument in the next
  3449. * call to the callback function.
  3450. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  3451. * callbackfn function one time for each element in the array.
  3452. * @param initialValue If initialValue is specified, it is used as the initial value to start
  3453. * the accumulation. The first call to the callbackfn function provides this value as an argument
  3454. * instead of an array value.
  3455. */
  3456. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;
  3457. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;
  3458. /**
  3459. * Calls the specified callback function for all the elements in an array. The return value of
  3460. * the callback function is the accumulated result, and is provided as an argument in the next
  3461. * call to the callback function.
  3462. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  3463. * callbackfn function one time for each element in the array.
  3464. * @param initialValue If initialValue is specified, it is used as the initial value to start
  3465. * the accumulation. The first call to the callbackfn function provides this value as an argument
  3466. * instead of an array value.
  3467. */
  3468. reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
  3469. /**
  3470. * Calls the specified callback function for all the elements in an array, in descending order.
  3471. * The return value of the callback function is the accumulated result, and is provided as an
  3472. * argument in the next call to the callback function.
  3473. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  3474. * the callbackfn function one time for each element in the array.
  3475. * @param initialValue If initialValue is specified, it is used as the initial value to start
  3476. * the accumulation. The first call to the callbackfn function provides this value as an
  3477. * argument instead of an array value.
  3478. */
  3479. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;
  3480. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;
  3481. /**
  3482. * Calls the specified callback function for all the elements in an array, in descending order.
  3483. * The return value of the callback function is the accumulated result, and is provided as an
  3484. * argument in the next call to the callback function.
  3485. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  3486. * the callbackfn function one time for each element in the array.
  3487. * @param initialValue If initialValue is specified, it is used as the initial value to start
  3488. * the accumulation. The first call to the callbackfn function provides this value as an argument
  3489. * instead of an array value.
  3490. */
  3491. reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
  3492. /**
  3493. * Reverses the elements in an Array.
  3494. */
  3495. reverse(): Float32Array;
  3496. /**
  3497. * Sets a value or an array of values.
  3498. * @param array A typed or untyped array of values to set.
  3499. * @param offset The index in the current array at which the values are to be written.
  3500. */
  3501. set(array: ArrayLike<number>, offset?: number): void;
  3502. /**
  3503. * Returns a section of an array.
  3504. * @param start The beginning of the specified portion of the array.
  3505. * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
  3506. */
  3507. slice(start?: number, end?: number): Float32Array;
  3508. /**
  3509. * Determines whether the specified callback function returns true for any element of an array.
  3510. * @param predicate A function that accepts up to three arguments. The some method calls
  3511. * the predicate function for each element in the array until the predicate returns a value
  3512. * which is coercible to the Boolean value true, or until the end of the array.
  3513. * @param thisArg An object to which the this keyword can refer in the predicate function.
  3514. * If thisArg is omitted, undefined is used as the this value.
  3515. */
  3516. some(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;
  3517. /**
  3518. * Sorts an array.
  3519. * @param compareFn Function used to determine the order of the elements. It is expected to return
  3520. * a negative value if first argument is less than second argument, zero if they're equal and a positive
  3521. * value otherwise. If omitted, the elements are sorted in ascending order.
  3522. * ```ts
  3523. * [11,2,22,1].sort((a, b) => a - b)
  3524. * ```
  3525. */
  3526. sort(compareFn?: (a: number, b: number) => number): this;
  3527. /**
  3528. * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements
  3529. * at begin, inclusive, up to end, exclusive.
  3530. * @param begin The index of the beginning of the array.
  3531. * @param end The index of the end of the array.
  3532. */
  3533. subarray(begin?: number, end?: number): Float32Array;
  3534. /**
  3535. * Converts a number to a string by using the current locale.
  3536. */
  3537. toLocaleString(): string;
  3538. /**
  3539. * Returns a string representation of an array.
  3540. */
  3541. toString(): string;
  3542. /** Returns the primitive value of the specified object. */
  3543. valueOf(): Float32Array;
  3544. [index: number]: number;
  3545. }
  3546. interface Float32ArrayConstructor {
  3547. readonly prototype: Float32Array;
  3548. new(length: number): Float32Array;
  3549. new(array: ArrayLike<number> | ArrayBufferLike): Float32Array;
  3550. new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float32Array;
  3551. /**
  3552. * The size in bytes of each element in the array.
  3553. */
  3554. readonly BYTES_PER_ELEMENT: number;
  3555. /**
  3556. * Returns a new array from a set of elements.
  3557. * @param items A set of elements to include in the new array object.
  3558. */
  3559. of(...items: number[]): Float32Array;
  3560. /**
  3561. * Creates an array from an array-like or iterable object.
  3562. * @param arrayLike An array-like or iterable object to convert to an array.
  3563. */
  3564. from(arrayLike: ArrayLike<number>): Float32Array;
  3565. /**
  3566. * Creates an array from an array-like or iterable object.
  3567. * @param arrayLike An array-like or iterable object to convert to an array.
  3568. * @param mapfn A mapping function to call on every element of the array.
  3569. * @param thisArg Value of 'this' used to invoke the mapfn.
  3570. */
  3571. from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array;
  3572. }
  3573. declare var Float32Array: Float32ArrayConstructor;
  3574. /**
  3575. * A typed array of 64-bit float values. The contents are initialized to 0. If the requested
  3576. * number of bytes could not be allocated an exception is raised.
  3577. */
  3578. interface Float64Array {
  3579. /**
  3580. * The size in bytes of each element in the array.
  3581. */
  3582. readonly BYTES_PER_ELEMENT: number;
  3583. /**
  3584. * The ArrayBuffer instance referenced by the array.
  3585. */
  3586. readonly buffer: ArrayBufferLike;
  3587. /**
  3588. * The length in bytes of the array.
  3589. */
  3590. readonly byteLength: number;
  3591. /**
  3592. * The offset in bytes of the array.
  3593. */
  3594. readonly byteOffset: number;
  3595. /**
  3596. * Returns the this object after copying a section of the array identified by start and end
  3597. * to the same array starting at position target
  3598. * @param target If target is negative, it is treated as length+target where length is the
  3599. * length of the array.
  3600. * @param start If start is negative, it is treated as length+start. If end is negative, it
  3601. * is treated as length+end.
  3602. * @param end If not specified, length of the this object is used as its default value.
  3603. */
  3604. copyWithin(target: number, start: number, end?: number): this;
  3605. /**
  3606. * Determines whether all the members of an array satisfy the specified test.
  3607. * @param predicate A function that accepts up to three arguments. The every method calls
  3608. * the predicate function for each element in the array until the predicate returns a value
  3609. * which is coercible to the Boolean value false, or until the end of the array.
  3610. * @param thisArg An object to which the this keyword can refer in the predicate function.
  3611. * If thisArg is omitted, undefined is used as the this value.
  3612. */
  3613. every(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;
  3614. /**
  3615. * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
  3616. * @param value value to fill array section with
  3617. * @param start index to start filling the array at. If start is negative, it is treated as
  3618. * length+start where length is the length of the array.
  3619. * @param end index to stop filling the array at. If end is negative, it is treated as
  3620. * length+end.
  3621. */
  3622. fill(value: number, start?: number, end?: number): this;
  3623. /**
  3624. * Returns the elements of an array that meet the condition specified in a callback function.
  3625. * @param predicate A function that accepts up to three arguments. The filter method calls
  3626. * the predicate function one time for each element in the array.
  3627. * @param thisArg An object to which the this keyword can refer in the predicate function.
  3628. * If thisArg is omitted, undefined is used as the this value.
  3629. */
  3630. filter(predicate: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;
  3631. /**
  3632. * Returns the value of the first element in the array where predicate is true, and undefined
  3633. * otherwise.
  3634. * @param predicate find calls predicate once for each element of the array, in ascending
  3635. * order, until it finds one where predicate returns true. If such an element is found, find
  3636. * immediately returns that element value. Otherwise, find returns undefined.
  3637. * @param thisArg If provided, it will be used as the this value for each invocation of
  3638. * predicate. If it is not provided, undefined is used instead.
  3639. */
  3640. find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;
  3641. /**
  3642. * Returns the index of the first element in the array where predicate is true, and -1
  3643. * otherwise.
  3644. * @param predicate find calls predicate once for each element of the array, in ascending
  3645. * order, until it finds one where predicate returns true. If such an element is found,
  3646. * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
  3647. * @param thisArg If provided, it will be used as the this value for each invocation of
  3648. * predicate. If it is not provided, undefined is used instead.
  3649. */
  3650. findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;
  3651. /**
  3652. * Performs the specified action for each element in an array.
  3653. * @param callbackfn A function that accepts up to three arguments. forEach calls the
  3654. * callbackfn function one time for each element in the array.
  3655. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  3656. * If thisArg is omitted, undefined is used as the this value.
  3657. */
  3658. forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;
  3659. /**
  3660. * Returns the index of the first occurrence of a value in an array.
  3661. * @param searchElement The value to locate in the array.
  3662. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  3663. * search starts at index 0.
  3664. */
  3665. indexOf(searchElement: number, fromIndex?: number): number;
  3666. /**
  3667. * Adds all the elements of an array separated by the specified separator string.
  3668. * @param separator A string used to separate one element of an array from the next in the
  3669. * resulting String. If omitted, the array elements are separated with a comma.
  3670. */
  3671. join(separator?: string): string;
  3672. /**
  3673. * Returns the index of the last occurrence of a value in an array.
  3674. * @param searchElement The value to locate in the array.
  3675. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
  3676. * search starts at index 0.
  3677. */
  3678. lastIndexOf(searchElement: number, fromIndex?: number): number;
  3679. /**
  3680. * The length of the array.
  3681. */
  3682. readonly length: number;
  3683. /**
  3684. * Calls a defined callback function on each element of an array, and returns an array that
  3685. * contains the results.
  3686. * @param callbackfn A function that accepts up to three arguments. The map method calls the
  3687. * callbackfn function one time for each element in the array.
  3688. * @param thisArg An object to which the this keyword can refer in the callbackfn function.
  3689. * If thisArg is omitted, undefined is used as the this value.
  3690. */
  3691. map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;
  3692. /**
  3693. * Calls the specified callback function for all the elements in an array. The return value of
  3694. * the callback function is the accumulated result, and is provided as an argument in the next
  3695. * call to the callback function.
  3696. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  3697. * callbackfn function one time for each element in the array.
  3698. * @param initialValue If initialValue is specified, it is used as the initial value to start
  3699. * the accumulation. The first call to the callbackfn function provides this value as an argument
  3700. * instead of an array value.
  3701. */
  3702. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;
  3703. reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;
  3704. /**
  3705. * Calls the specified callback function for all the elements in an array. The return value of
  3706. * the callback function is the accumulated result, and is provided as an argument in the next
  3707. * call to the callback function.
  3708. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
  3709. * callbackfn function one time for each element in the array.
  3710. * @param initialValue If initialValue is specified, it is used as the initial value to start
  3711. * the accumulation. The first call to the callbackfn function provides this value as an argument
  3712. * instead of an array value.
  3713. */
  3714. reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
  3715. /**
  3716. * Calls the specified callback function for all the elements in an array, in descending order.
  3717. * The return value of the callback function is the accumulated result, and is provided as an
  3718. * argument in the next call to the callback function.
  3719. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  3720. * the callbackfn function one time for each element in the array.
  3721. * @param initialValue If initialValue is specified, it is used as the initial value to start
  3722. * the accumulation. The first call to the callbackfn function provides this value as an
  3723. * argument instead of an array value.
  3724. */
  3725. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;
  3726. reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;
  3727. /**
  3728. * Calls the specified callback function for all the elements in an array, in descending order.
  3729. * The return value of the callback function is the accumulated result, and is provided as an
  3730. * argument in the next call to the callback function.
  3731. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
  3732. * the callbackfn function one time for each element in the array.
  3733. * @param initialValue If initialValue is specified, it is used as the initial value to start
  3734. * the accumulation. The first call to the callbackfn function provides this value as an argument
  3735. * instead of an array value.
  3736. */
  3737. reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
  3738. /**
  3739. * Reverses the elements in an Array.
  3740. */
  3741. reverse(): Float64Array;
  3742. /**
  3743. * Sets a value or an array of values.
  3744. * @param array A typed or untyped array of values to set.
  3745. * @param offset The index in the current array at which the values are to be written.
  3746. */
  3747. set(array: ArrayLike<number>, offset?: number): void;
  3748. /**
  3749. * Returns a section of an array.
  3750. * @param start The beginning of the specified portion of the array.
  3751. * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
  3752. */
  3753. slice(start?: number, end?: number): Float64Array;
  3754. /**
  3755. * Determines whether the specified callback function returns true for any element of an array.
  3756. * @param predicate A function that accepts up to three arguments. The some method calls
  3757. * the predicate function for each element in the array until the predicate returns a value
  3758. * which is coercible to the Boolean value true, or until the end of the array.
  3759. * @param thisArg An object to which the this keyword can refer in the predicate function.
  3760. * If thisArg is omitted, undefined is used as the this value.
  3761. */
  3762. some(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;
  3763. /**
  3764. * Sorts an array.
  3765. * @param compareFn Function used to determine the order of the elements. It is expected to return
  3766. * a negative value if first argument is less than second argument, zero if they're equal and a positive
  3767. * value otherwise. If omitted, the elements are sorted in ascending order.
  3768. * ```ts
  3769. * [11,2,22,1].sort((a, b) => a - b)
  3770. * ```
  3771. */
  3772. sort(compareFn?: (a: number, b: number) => number): this;
  3773. /**
  3774. * at begin, inclusive, up to end, exclusive.
  3775. * @param begin The index of the beginning of the array.
  3776. * @param end The index of the end of the array.
  3777. */
  3778. subarray(begin?: number, end?: number): Float64Array;
  3779. toString(): string;
  3780. /** Returns the primitive value of the specified object. */
  3781. valueOf(): Float64Array;
  3782. [index: number]: number;
  3783. }
  3784. interface Float64ArrayConstructor {
  3785. readonly prototype: Float64Array;
  3786. new(length: number): Float64Array;
  3787. new(array: ArrayLike<number> | ArrayBufferLike): Float64Array;
  3788. new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float64Array;
  3789. /**
  3790. * The size in bytes of each element in the array.
  3791. */
  3792. readonly BYTES_PER_ELEMENT: number;
  3793. /**
  3794. * Returns a new array from a set of elements.
  3795. * @param items A set of elements to include in the new array object.
  3796. */
  3797. of(...items: number[]): Float64Array;
  3798. /**
  3799. * Creates an array from an array-like or iterable object.
  3800. * @param arrayLike An array-like or iterable object to convert to an array.
  3801. */
  3802. from(arrayLike: ArrayLike<number>): Float64Array;
  3803. /**
  3804. * Creates an array from an array-like or iterable object.
  3805. * @param arrayLike An array-like or iterable object to convert to an array.
  3806. * @param mapfn A mapping function to call on every element of the array.
  3807. * @param thisArg Value of 'this' used to invoke the mapfn.
  3808. */
  3809. from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array;
  3810. }
  3811. declare var Float64Array: Float64ArrayConstructor;
  3812. /////////////////////////////
  3813. /// ECMAScript Internationalization API
  3814. /////////////////////////////
  3815. declare namespace Intl {
  3816. interface CollatorOptions {
  3817. usage?: string | undefined;
  3818. localeMatcher?: string | undefined;
  3819. numeric?: boolean | undefined;
  3820. caseFirst?: string | undefined;
  3821. sensitivity?: string | undefined;
  3822. ignorePunctuation?: boolean | undefined;
  3823. }
  3824. interface ResolvedCollatorOptions {
  3825. locale: string;
  3826. usage: string;
  3827. sensitivity: string;
  3828. ignorePunctuation: boolean;
  3829. collation: string;
  3830. caseFirst: string;
  3831. numeric: boolean;
  3832. }
  3833. interface Collator {
  3834. compare(x: string, y: string): number;
  3835. resolvedOptions(): ResolvedCollatorOptions;
  3836. }
  3837. var Collator: {
  3838. new(locales?: string | string[], options?: CollatorOptions): Collator;
  3839. (locales?: string | string[], options?: CollatorOptions): Collator;
  3840. supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];
  3841. };
  3842. interface NumberFormatOptions {
  3843. localeMatcher?: string | undefined;
  3844. style?: string | undefined;
  3845. currency?: string | undefined;
  3846. currencySign?: string | undefined;
  3847. useGrouping?: boolean | undefined;
  3848. minimumIntegerDigits?: number | undefined;
  3849. minimumFractionDigits?: number | undefined;
  3850. maximumFractionDigits?: number | undefined;
  3851. minimumSignificantDigits?: number | undefined;
  3852. maximumSignificantDigits?: number | undefined;
  3853. }
  3854. interface ResolvedNumberFormatOptions {
  3855. locale: string;
  3856. numberingSystem: string;
  3857. style: string;
  3858. currency?: string;
  3859. minimumIntegerDigits: number;
  3860. minimumFractionDigits: number;
  3861. maximumFractionDigits: number;
  3862. minimumSignificantDigits?: number;
  3863. maximumSignificantDigits?: number;
  3864. useGrouping: boolean;
  3865. }
  3866. interface NumberFormat {
  3867. format(value: number): string;
  3868. resolvedOptions(): ResolvedNumberFormatOptions;
  3869. }
  3870. var NumberFormat: {
  3871. new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
  3872. (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
  3873. supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];
  3874. readonly prototype: NumberFormat;
  3875. };
  3876. interface DateTimeFormatOptions {
  3877. localeMatcher?: "best fit" | "lookup" | undefined;
  3878. weekday?: "long" | "short" | "narrow" | undefined;
  3879. era?: "long" | "short" | "narrow" | undefined;
  3880. year?: "numeric" | "2-digit" | undefined;
  3881. month?: "numeric" | "2-digit" | "long" | "short" | "narrow" | undefined;
  3882. day?: "numeric" | "2-digit" | undefined;
  3883. hour?: "numeric" | "2-digit" | undefined;
  3884. minute?: "numeric" | "2-digit" | undefined;
  3885. second?: "numeric" | "2-digit" | undefined;
  3886. timeZoneName?: "short" | "long" | "shortOffset" | "longOffset" | "shortGeneric" | "longGeneric" | undefined;
  3887. formatMatcher?: "best fit" | "basic" | undefined;
  3888. hour12?: boolean | undefined;
  3889. timeZone?: string | undefined;
  3890. }
  3891. interface ResolvedDateTimeFormatOptions {
  3892. locale: string;
  3893. calendar: string;
  3894. numberingSystem: string;
  3895. timeZone: string;
  3896. hour12?: boolean;
  3897. weekday?: string;
  3898. era?: string;
  3899. year?: string;
  3900. month?: string;
  3901. day?: string;
  3902. hour?: string;
  3903. minute?: string;
  3904. second?: string;
  3905. timeZoneName?: string;
  3906. }
  3907. interface DateTimeFormat {
  3908. format(date?: Date | number): string;
  3909. resolvedOptions(): ResolvedDateTimeFormatOptions;
  3910. }
  3911. var DateTimeFormat: {
  3912. new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
  3913. (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
  3914. supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];
  3915. readonly prototype: DateTimeFormat;
  3916. };
  3917. }
  3918. interface String {
  3919. /**
  3920. * Determines whether two strings are equivalent in the current or specified locale.
  3921. * @param that String to compare to target string
  3922. * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.
  3923. * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.
  3924. */
  3925. localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number;
  3926. }
  3927. interface Number {
  3928. /**
  3929. * Converts a number to a string by using the current or specified locale.
  3930. * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
  3931. * @param options An object that contains one or more properties that specify comparison options.
  3932. */
  3933. toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;
  3934. }
  3935. interface Date {
  3936. /**
  3937. * Converts a date and time to a string by using the current or specified locale.
  3938. * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
  3939. * @param options An object that contains one or more properties that specify comparison options.
  3940. */
  3941. toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
  3942. /**
  3943. * Converts a date to a string by using the current or specified locale.
  3944. * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
  3945. * @param options An object that contains one or more properties that specify comparison options.
  3946. */
  3947. toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
  3948. /**
  3949. * Converts a time to a string by using the current or specified locale.
  3950. * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
  3951. * @param options An object that contains one or more properties that specify comparison options.
  3952. */
  3953. toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
  3954. }