lib.es5.d.ts 210 KB

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