diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 930f751c85..df45a8a9e7 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,6 +3,7 @@ # See https://github.com/DefinitelyTyped/DefinitelyTyped#edit-an-existing-package /types/a-big-triangle/ @MathiasPaumgarten +/types/a11y-dialog/ @Goyatuzo /types/abbrev/ @BendingBender /types/abs/ @AyaMorisawa /types/absolute/ @AyaMorisawa @@ -15,7 +16,7 @@ /types/ace-diff/ @innovation-team /types/acl/ @tkQubo /types/acorn/ @RReverser @e-cloud -/types/actioncable/ @zhu1230 +/types/actioncable/ @zhu1230 @szechyjs /types/actions-on-google/ @joelhegg /types/activedirectory2/ @pasthelod /types/activex-access/ @zspitz @@ -52,11 +53,14 @@ /types/aggregate-error/ @BendingBender /types/agora-rtc-sdk/ @menthays /types/ajv-errors/ @afshawnlotfi +/types/ale-url-parser/ @msn0 /types/alertify/ @jjeffery /types/alexa-sdk/ @petebeegle @hoo29 @pascalwhoop @blforce @rk-7 @alexmalcoci /types/alexa-voice-service/ @dolanmiu /types/algebra.js/ @CaselIT -/types/algoliasearch/ @cbaptiste @haroenv @aherve @samouss +/types/algoliasearch/ @cbaptiste @haroenv @aherve @samouss @keichinger +/types/ali-app/ @taoqf +/types/ali-oss/ @ptrdu /types/allure-js-commons/ @zaqqaz /types/almost-equal/ @cmaddalozzo /types/alt/ @Shearerbeard @@ -68,7 +72,7 @@ /types/amphtml-validator/ @kevincharm /types/amplify/ @joeriks /types/amplify-deferred/ @joeriks @laurentiustamate94 -/types/amplitude-js/ @Asido +/types/amplitude-js/ @Asido @danmana /types/amqp/ @seikho @jonnysparkplugs /types/amqp-connection-manager/ @rogierschouten /types/amqp-rpc/ @wokim @@ -149,6 +153,7 @@ /types/animation-frame/ @qinfchen /types/animejs/ @A-Babin /types/annyang/ @hisham @theluk +/types/ansi/ @Gustavo6046 /types/ansi-colors/ @rogierschouten /types/ansi-escape-sequences/ @aomarks /types/ansi-escapes/ @jacobbubu @@ -161,6 +166,7 @@ /types/any-db-transaction/ @rogierschouten /types/anybar/ @khoomeister /types/anymatch/ @BendingBender +/types/aos/ @shermendev /types/apex.js/ @y13i /types/aphrodite/ @asvetliakov /types/api-error-handler/ @tkrotoff @@ -168,6 +174,7 @@ /types/apigee-access/ @CasperSkydt /types/apollo-codegen/ @bradleyayers @kostspielig /types/apollo-upload-client/ @Slessi +/types/apostrophe/ @afholderman /types/app-root-dir/ @chenyang-biu /types/app-root-path/ @shantmarouti /types/appdmg/ @unindented @@ -195,18 +202,22 @@ /types/array-sort/ @DanielMSchmidt /types/array-uniq/ @DanielRosenwasser /types/array-unique/ @CSLTech +/types/array.prototype.flatmap/ @hallettj /types/arrify/ @wanganjun /types/artillery/ @kmccoan-allocadia /types/asana/ @tkqubo /types/asap/ @fpascutti +/types/ascii-art/ @lukaselmer /types/ascii2mathml/ @RagibHasin /types/asenv/ @remisery /types/asn1js/ @microshine /types/aspnet-identity-pw/ @jt000 +/types/assert/ @nicoabie /types/assert-equal-jsx/ @seryl /types/assert-plus/ @KostyaTretyak /types/assertsharp/ @brunolm /types/assets-webpack-plugin/ @kryops +/types/astring/ @nkappler /types/async/ @borisyankov @kern0 @Penryn @fenying @pascalmartin /types/async-cache/ @BendingBender /types/async-lock/ @elisee @afharo @rhymmor @@ -214,6 +225,7 @@ /types/async-retry/ @albertywu @MeLlamoPablo /types/async.nexttick/ @pyrho /types/asynciterator/ @rubensworks +/types/athenajs/ @warpdesign /types/atlaskit__button/ @dijimsta /types/atlaskit__calendar/ @lstanden /types/atlaskit__inline-edit/ @lstanden @@ -227,7 +239,8 @@ /types/atom-mocha-test-runner/ @GlenCFL /types/atpl/ @soywiz /types/audiosprite/ @Perlmint -/types/auth0/ @wbhob @westy92 @amiram +/types/auth-header/ @ForbesLindesay +/types/auth0/ @westy92 /types/auth0-angular/ @homesar /types/auth0-js/v7/ @advancedrei /types/auth0-js/ @adrianchia @mdurrant @peterblazejewicz @@ -238,12 +251,12 @@ /types/auto-sni/ @janwo /types/autobahn/ @darkl @valepu /types/autolinker/ @leonyu -/types/autoprefixer/ @odnamrataizem +/types/autoprefixer/ @odnamrataizem @murt /types/autosize/ @kingdango @keika299 @NeekSandhu /types/autosuggest-highlight/ @senukartur /types/awesomplete/ @webbiesdk @bmdixon @tbekolay @chrislopresto /types/aws-iot-device-sdk/ @niik @mlamp -/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase @repl-chris @aneilbaboo @jeznag @louislarry @dpapukchiev @ohookins +/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase @repl-chris @aneilbaboo @jeznag @louislarry @dpapukchiev @ohookins @trevor-leach @jagregory /types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez /types/aws4/ @ajcrites /types/axe-webdriverjs/ @JoshuaKGoldberg @@ -301,10 +314,11 @@ /types/bases/ @harikv /types/bash-glob/ @mrmlnc /types/basic-auth/ @moonpyk @vesse +/types/basicauth-middleware/ @nchaulet /types/batch-stream/ @drudge /types/bazinga-translator/ @alexndlm /types/bcrypt/ @codeanimal @IOAyman @dstapleton92 -/types/bcryptjs/ @RafaelKr +/types/bcryptjs/ @RafaelKr @branoholy /types/bdfjs/ @jeremejevs /types/beats/ @urish /types/bech32/ @micksatana @@ -314,10 +328,10 @@ /types/bencode/ @tobenna /types/better-curry/ @pocesar /types/better-queue/ @maozedong -/types/better-scroll/ @stoneChen +/types/better-scroll/ @stoneChen @cnjack /types/better-sqlite3/ @Morfent @matrumz /types/bezier-easing/ @ptlis -/types/bezier-js/ @danmarshall +/types/bezier-js/ @danmarshall @Epskampie /types/bgiframe/ @sumegizoltan /types/bidirectional-map/ @helenanderson /types/big.js/ @nycdotnet @googol @@ -338,9 +352,8 @@ /types/bitcoinjs-lib/ @mhegazy @dlebrecht @rbuckton @micksatana @youssefgh @kento1218 /types/bitcore-lib/ @lautarodragan /types/bittorrent-protocol/ @feross @tlaziuk -/types/bitwise/ @danwbyrne /types/bitwise-xor/ @rogierschouten -/types/bl/ @Bartvds +/types/bl/ @Bartvds @reconbot /types/blacklist/ @mhegazy /types/blazy/ @julienpa /types/blessed/ @brynbellomy @skellock @@ -371,7 +384,7 @@ /types/boom/ @rogatty @AJamesPhillips @jineshshah36 @TimonVS @danielmachado /types/bootbox/ @vbortone @konpikwastaken @kanup @icereed @trodi @stannynuytkens @renjfk /types/bootpag/ @rdeneau -/types/bootstrap/v3/ @borisyankov +/types/bootstrap/v3/ @borisyankov @denisname /types/bootstrap/ @denisname /types/bootstrap-3-typeahead/ @AndersonFriaca /types/bootstrap-datepicker/ @borisyankov @@ -383,6 +396,7 @@ /types/bootstrap-slider/ @dbeckwith @leonard-thieu /types/bootstrap-switch/ @johnmbaughman /types/bootstrap-table/ @talatbaig +/types/bootstrap-toggle/ @gricey432 /types/bootstrap-touchspin/ @albinsunnanbo /types/bootstrap-treeview/ @jbtronics /types/bootstrap-validator/ @BradyLiles @@ -401,6 +415,7 @@ /types/breeze/ @borisyankov /types/bricks.js/ @kondi /types/bro-fs/ @ffflorian +/types/broccoli-plugin/ @dfreeman /types/brorand/ @chrootsu /types/browser-bunyan/ @PaulLockwood @kryops /types/browser-fingerprint/ @LKay @@ -409,7 +424,7 @@ /types/browser-report/ @JTOne123 /types/browser-resolve/ @marionebl /types/browser-sync/ @joeskeen @aznnomness -/types/browserify/ @AndrewGaspar @jvilk @leonard-thieu +/types/browserify/ @AndrewGaspar @jvilk @leonard-thieu @LinusU /types/bs58/ @chrootsu /types/bson/ @horiuchi @CaselIT /types/btoa/ @johngeorgewright @@ -423,7 +438,7 @@ /types/bufferstream/ @Bartvds /types/builtin-modules/ @ajafff /types/bull/v2/ @bgrieder @JProgrammer -/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 +/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 @danmana /types/bump-regex/ @silkentrance /types/bunnymq/ @cyrilschumacher /types/bunyan/ @amikhalev @@ -439,9 +454,11 @@ /types/byline/ @reppners /types/bytebuffer/ @cappellin /types/bytes/ @danny8002 @believer +/types/bytewise/ @danwbyrne /types/c3/ @mcliment @gerinjacob @denyo @dmitryshindin @timn /types/cache-manager/ @GausSim /types/cal-heatmap/ @RetroChrisB +/types/caller/ @ignocide /types/callsite/ @newclear /types/callsites/ @BendingBender /types/calq/ @eirikhm @@ -450,6 +467,7 @@ /types/camelcase-keys/ @mhegazy /types/camo/ @lucasmciruzzi /types/cancan/ @Vincent-Pang +/types/caniuse-api/ @davecardwell /types/cannon/ @clark-stevenson @Gelio /types/canvas-confetti/ @matracey /types/canvas-gauges/ @Mikhus @@ -475,6 +493,7 @@ /types/chai-datetime/ @cliffburger @mattbishop /types/chai-dom/ @mattlewis92 /types/chai-enzyme/ @asvetliakov +/types/chai-fs/ @dimitardanailov /types/chai-fuzzy/ @Bartvds /types/chai-http/ @Nemo157 @G1itcher @CaselIT @bas-l /types/chai-jest-snapshot/ @mattvperry @@ -493,7 +512,7 @@ /types/chardet/ @Gebatzens /types/charm/ @Xananax /types/charset/ @cspotcode -/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr @mernen @josefpaij @danmana @guillaume-ro-fr @archy-bold @braincore @gebeto @frabnt @alexdor @mahnuh +/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr @mernen @josefpaij @danmana @guillaume-ro-fr @archy-bold @braincore @frabnt @alexdor @mahnuh @Conrad777 /types/chartist/ @mtgibbs @psimonski @clottman @affilnost @sunnyrjuneja /types/chartmogul-node/ @chartmogul /types/chayns/ @HenningKuehl @@ -506,6 +525,7 @@ /types/chessboardjs/ @sliverb @davidmpaz /types/chmodr/ @BendingBender /types/chokidar/ @reppners @felixfbecker @bayssmekanique +/types/chordsheetjs/ @adamsbloom /types/chosen-js/ @borisyankov @denisname /types/chownr/ @BendingBender /types/chroma-js/v0/ @invliD @@ -533,6 +553,7 @@ /types/cleave.js/ @clentfort @jasongi-at-sportsbet @sashashakun /types/cli/ @kayahr /types/cli-color/ @ChaosinaCan +/types/cli-interact/ @ffflorian /types/cli-progress/ @mhegazy /types/cli-spinner/ @janslow /types/cli-table/ @arylo @@ -573,18 +594,20 @@ /types/color-namer/ @in19farkt /types/color-string/ @BendingBender @danmarshall /types/colorbrewer/ @mtraynham +/types/colresizable/ @gilleswaeber /types/com.darktalker.cordova.screenshot/ @akarienta /types/com.wikitude.phonegap.wikitudeplugin/ @zbarbuto /types/combine-source-map/ @TeamworkGuy2 /types/combined-stream/ @felixge @tlaziuk /types/combokeys/ @iclanton -/types/cometd/ @derekcicerone +/types/cometd/ @derekcicerone @unindented @alxHenry /types/command-line-args/v4/ @CzBuCHi @75lb /types/command-line-args/ @75lb /types/command-line-commands/ @CzBuCHi /types/command-line-usage/ @matrumz @Dvorsky /types/commangular/ @hiraash /types/comment-json/ @Jason3S +/types/commercetools__enzyme-extensions/ @screendriver /types/common-errors/ @icopp /types/common-prefix/ @seangenabe /types/common-tags/ @zuzusik @tzupengwang @@ -592,7 +615,7 @@ /types/commonmark/ @nicojs @leonard-thieu /types/compare-version/ @jpevarnek /types/compare-versions/ @LogvinovLeon -/types/complex/ @AyaMorisawa +/types/complex/ @AyaMorisawa @pavasich /types/component-emitter/ @psnider /types/compose-function/ @denis-sokolov /types/compressible/ @BendingBender @@ -612,6 +635,7 @@ /types/confit/ @ethanresnick /types/connect/ @SomaticIT @EvanHahn /types/connect-busboy/ @pinguet62 +/types/connect-datadog/ @moshegood /types/connect-ensure-login/ @0x6368656174 /types/connect-flash/ @AndreasGassmann /types/connect-history-api-fallback/ @douglasduteil @@ -623,8 +647,10 @@ /types/connect-redis/ @xstoudi @morcerf /types/connect-slashes/ @samherrmann /types/connect-timeout/ @cyrilschumacher +/types/consola/ @Jungwoo-An /types/console-log-level/ @ofrobots /types/console-stamp/ @ericbyers @guusdegraeve +/types/console-ui/ @dfreeman /types/consolidate/ @soywiz @theosherry @nicolashenry /types/consul/ @chrootsu /types/content-disposition/ @bomret @@ -651,6 +677,7 @@ /types/cordova-plugin-background-mode/ @Lordnoname /types/cordova-plugin-badge/ @timbru31 /types/cordova-plugin-ble-central/ @gjunge +/types/cordova-plugin-bluetoothclassic-serial/ @tuvokki /types/cordova-plugin-canvascamera/ @lordazzi /types/cordova-plugin-device-name/ @larrybahr /types/cordova-plugin-file-opener2/ @cyrilgandon @@ -669,17 +696,19 @@ /types/cordova_app_version_plugin/ @larrybahr /types/cordovarduino/ @hendrikmaus /types/core-js/ @rbuckton @mfdeveloper +/types/core-object/ @dfreeman /types/correlation-id/ @natemara /types/cors/ @pluma /types/cosmiconfig/v4/ @ozum /types/cosmiconfig/ @ozum @szeck87 @saadq @jinwoo -/types/cote/ @makepost +/types/cote/ @makepost @roblabat /types/couchbase/ @maouida @fluggo /types/countdown/ @gjuchault /types/counterpart/ @santiagodoldan /types/countries-and-timezones/ @zero51 /types/country-list/ @iRoachie /types/country-select-js/ @humrochagf +/types/countup.js/ @shermendev /types/coverup/ @bevalorous /types/cp-file/ @BendingBender /types/cpx/ @alan-agius4 @@ -694,12 +723,14 @@ /types/createjs-lib/ @evilangelist @gyohk /types/credential/ @phuvo /types/credit-card-type/ @LKay +/types/critters-webpack-plugin/ @JuanJoseGonGi /types/cron/ @horiuchi @winup /types/cropperjs/ @stepancar /types/croppie/ @connor4312 @dklmuc @sarunint @knuthelgesen /types/cross-spawn/ @Alorel /types/crossfilter/ @schmuli @iebaker @nordfjord /types/crossroads/ @diullei +/types/crpc/ @0xdeafcafe /types/cryptiles/ @awendland /types/crypto-js/ @misak113 /types/crypto-random-string/ @MrManny @@ -725,15 +756,16 @@ /types/cucumber/ @abraaoalves @jan-molak @isoung @BendingBender @ErikSchierboom /types/currency-formatter/ @mhegazy @davidmpaz /types/custom-error-generator/ @thmiceli +/types/custom-functions-runtime/ @OfficeDev @Zlatkovsky @mscharlock /types/cwise/ @taoqf /types/cwise-compiler/ @taoqf /types/cwise-parser/ @taoqf /types/cybozulabs-md5/ @pine613 /types/cytoscape/ @phreed @wy193777 @ypconstante @janniclas @cerberuser /types/d3/v3/ @gustavderdrache @borisyankov @MatthiasJobst -/types/d3/v4/ @tomwanzek @gustavderdrache @borisyankov -/types/d3/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-array/ @gustavderdrache @borisyankov @tomwanzek +/types/d3/v4/ @tomwanzek @gustavderdrache @borisyankov @denisname +/types/d3/ @tomwanzek @gustavderdrache @borisyankov @denisname +/types/d3-array/ @gustavderdrache @borisyankov @tomwanzek @denisname /types/d3-axis/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-box/ @lk-chen /types/d3-brush/ @tomwanzek @gustavderdrache @borisyankov @@ -751,10 +783,11 @@ /types/d3-force/ @tomwanzek @gustavderdrache @borisyankov /types/d3-format/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-geo/ @ledragon @tomwanzek @gustavderdrache @borisyankov +/types/d3-graphviz/ @DomParfitt /types/d3-hexbin/ @uncovertruth @tomwanzek @denisname /types/d3-hierarchy/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-hsv/ @arrayjam @denisname -/types/d3-interpolate/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-interpolate/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-path/ @tomwanzek @gustavderdrache @borisyankov /types/d3-polygon/ @tomwanzek @gustavderdrache @borisyankov /types/d3-quadtree/ @tomwanzek @gustavderdrache @borisyankov @denisname @@ -765,12 +798,12 @@ /types/d3-scale/v1/ @tomwanzek @gustavderdrache @borisyankov /types/d3-scale/ @tomwanzek @gustavderdrache @borisyankov /types/d3-scale-chromatic/ @Ledragon @gustavderdrache @borisyankov @henriquefm -/types/d3-selection/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-selection/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-selection-multi/ @gustavderdrache @borisyankov /types/d3-shape/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-time/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-time/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-time-format/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-timer/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-timer/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-tip/ @brspnnggrt /types/d3-transition/ @tomwanzek @gustavderdrache @borisyankov /types/d3-voronoi/ @tomwanzek @gustavderdrache @borisyankov @denisname @@ -802,6 +835,7 @@ /types/datejs/ @rupertavery /types/daterangepicker/ @SirMartin @smasala @nertzy /types/dav/ @ToastHawaii +/types/dayzed/ @samhh /types/db-migrate-base/ @nickiannone /types/db-migrate-pg/ @nickiannone /types/db.js/ @cgwrench @@ -809,8 +843,8 @@ /types/dd-trace/ @ColinBradley @alloy /types/deasync/ @Sicilica /types/debessmann/ @vkorehov -/types/debounce/ @denis-sokolov -/types/debug/ @swook @galtalmor @zamb3zi +/types/debounce/ @denis-sokolov @joshuakgoldberg +/types/debug/ @swook @galtalmor @zamb3zi @brasten /types/decamelize/ @samverschueren /types/decay/ @enaeseth /types/decompress/ @plantain-00 @jbethke @@ -824,7 +858,6 @@ /types/deep-freeze/ @Bartvds @aluanhaddad /types/deep-freeze-es6/ @mattbishop /types/deep-freeze-strict/ @mhegazy -/types/deepmerge/ @marvinscharle @syy1125 @AppLover69 /types/defaults/ @IbtihelCHNAB /types/defer-promise/ @niklasf /types/define-lazy-prop/ @BendingBender @@ -857,7 +890,9 @@ /types/detect-pointer/ @thomastilkema /types/detect-port/ @lith-light-g /types/detect-touch-events/ @thomastilkema -/types/detox/ @TareqElMasri +/types/detective/ @TeamworkGuy2 +/types/detox/ @TareqElMasri @stevechun +/types/dev-ip/ @mike-engel /types/devexpress-aspnetcore-bootstrap/ @devexpress @skubarenko /types/df-visible/ @Litee /types/dhtmlxgantt/ @mkozhukh @chriscamicas @@ -866,8 +901,9 @@ /types/di-lite/ @dcrusader /types/diacritics/ @otociulis /types/dialogflow/ @dyladan -/types/diff/ @vvakame @szdc +/types/diff/ @vvakame @szdc @moc-yuto /types/diff2html/ @rtfpessoa +/types/digibyte/ @lautarodragan @werewolfe /types/dir-resolve/ @andy-ms /types/discontinuous-range/ @OiCMudkips /types/discourse-sso/ @championswimmer @@ -886,10 +922,11 @@ /types/dojo/ @vansimke /types/dom-clipboard-api/ @43081j /types/dom-inputevent/ @diagramatics +/types/dom-loaded/ @ltetzlaff /types/dom-to-image/ @JipSterk /types/dom4/ @adidahiya @giladgray /types/domo/ @Steve-Fenton -/types/dompurify/ @bazuzi +/types/dompurify/ @bazuzi @FlowCrypt /types/domready/ @dotnetnerd /types/donna/ @vvakame /types/dookie/ @swanest @@ -916,6 +953,7 @@ /types/draggabilly/ @jaydubu /types/dragster/ @zskovacs /types/dragula/ @pwelter34 @abruzzihraig +/types/dropbox-chooser/ @quas94 /types/dropboxjs/ @Steve-Fenton @xperiments /types/dropkickjs/ @VorobeY1326 /types/dropzone/v4/ @nvivo @outring @renuo @Hikariii @@ -923,7 +961,7 @@ /types/dts-generator/ @mtraynham /types/duplexer2/ @Goldsmith42 /types/duplexer3/ @BendingBender -/types/duplexify/ @strax +/types/duplexify/ @strax @kinwa91 /types/duplicate-package-checker-webpack-plugin/ @mtraynham /types/durandal/ @BlueSpire /types/dustjs-linkedin/ @mdezem @@ -959,6 +997,7 @@ /types/ejs/ @benliddicott /types/ejs-locals/ @jt000 /types/ejson/ @shantanubhadoria +/types/elastic-apm-node/ @shahaed /types/elasticsearch/ @CasperSkydt @bfsmith @ddunkin @pushplay @mlamp @ahmadferdous @SimonSchick @brabster @deerawan /types/electron-config/ @mrfunkycold @unindented /types/electron-debug/ @unindented @@ -1024,6 +1063,7 @@ /types/emojione/ @dbrgn /types/empower/ @vvakame /types/emscripten/ @zakki @periklis +/types/encoding-down/ @MeirionHughes @danwbyrne /types/end-of-stream/ @strax /types/engine.io/ @KentarouTakeda /types/engine.io-client/ @KentarouTakeda @@ -1106,7 +1146,8 @@ /types/expo/v24/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger /types/expo/v25/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov /types/expo/v26/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @tinaroh -/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki +/types/expo/v27/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo +/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo /types/expo__status-bar-height/ @dawnmist /types/expo__vector-icons/ @incleaf /types/express/ @borisyankov @@ -1137,6 +1178,7 @@ /types/express-mung/ @cyrilschumacher /types/express-myconnection/ @Cellule /types/express-mysql-session/ @Akim95 +/types/express-ntlm/ @forivall /types/express-oauth-server/ @atd-schubert /types/express-openapi/ @mugeso /types/express-paginate/ @AmirTugi @@ -1149,12 +1191,14 @@ /types/express-sanitized/ @cjbarth /types/express-serve-static-core/ @borisyankov @19majkel94 @kacepe @micksatana @samijaber /types/express-session/ @horiuchi @jacobbogers @builtinnya @ry7n +/types/express-sitemap-xml/ @ffflorian /types/express-socket.io-session/ @AylaJK /types/express-to-koa/ @xiaohanzhang /types/express-unless/ @wokim /types/express-wechat-access/ @simmons8616 /types/express-winston/ @bricka /types/express-ws/ @ajliv +/types/express-ws-routes/ @gstamac /types/express-xml-bodyparser/ @noticeMaker @macedigital /types/extend/ @reppners /types/extjs/ @brian428 @@ -1168,8 +1212,9 @@ /types/f1/ @neolwc /types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson @RogerioTeixeira @BradleyHill /types/facebook-instant-games/ @menushka @oyvindjam -/types/facebook-js-sdk/ @amritk @mahmoudzohdi +/types/facebook-js-sdk/ @amritk @mahmoudzohdi @fluidsonic /types/facebook-pixel/ @noctishsu +/types/factory-girl/ @stackbuilders @sestrella @elcuy /types/faker/v3/ @Kuniwak /types/faker/ @bensw @basp @Kuniwak @mattbishop /types/falcor/ @Quramy @@ -1186,6 +1231,10 @@ /types/fast-list/ @BendingBender /types/fast-stats/ @rogierschouten /types/fastclick/ @shinnn +/types/fastify-cors/ @jannikkeye +/types/fastify-jwt/ @jannikkeye +/types/fastify-multipart/ @jannikkeye +/types/fastify-static/ @leomelzer /types/favico.js/ @drowse314-dev-ymat /types/favicons/ @mohsen1 /types/fb/ @JoshStrobl @@ -1212,7 +1261,7 @@ /types/feedme/ @codeanimal /types/feedparser/ @cortopy /types/fetch-jsonp/ @tkrotoff -/types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair @matttennison @quentinbouygues +/types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair @matttennison @quentinbouygues @mtsmfm /types/fetch.io/ @newraina /types/ffi/ @loyd @waitingsong /types/ffi-napi/ @keerthi16 @KiranNiranjan @@ -1247,7 +1296,7 @@ /types/firebase-token-generator/ @dotdotcommadot /types/firebird/ @karak /types/firefox/ @vvakame -/types/firefox-webext-browser/ @bomjacob +/types/firefox-webext-browser/ @jsmnbom /types/firmata/ @troywweber7 /types/first-mate/ @GlenCFL /types/fixed-data-table/ @pepaar @stephenjelfs @@ -1265,6 +1314,7 @@ /types/flush-write-stream/ @djcsdy /types/flux/ @stkb @GiedriusGrabauskas /types/fluxible/ @xbim +/types/fluxible-addons-react/ @xbim /types/fluxible-router/ @xbim /types/fluxxor/ @mrk21 /types/fm-websync/ @markusmauch @@ -1289,6 +1339,7 @@ /types/foundation/ @borisyankov /types/fpsmeter/ @alampros /types/framebus/ @kbukum +/types/franc/ @wlegate /types/frctl__fractal/ @pmccloghrylaing /types/freedom/ @jpevarnek /types/freeport/ @atd-schubert @@ -1328,6 +1379,7 @@ /types/fxn/ @charrondev /types/gae.channel.api/ @vvakame /types/gamedig/ @ivansieder +/types/gamepad/ @Lange /types/gamequery/ @Laubi /types/ganache-core/ @LogvinovLeon /types/gandi-livedns/ @xstoudi @@ -1490,9 +1542,11 @@ /types/get-stdin/ @DanielRosenwasser /types/get-stream/ @douglasduteil @BendingBender /types/get-value/ @DanielRosenwasser +/types/getenv/ @impankratov /types/getopts/ @azasypkin /types/getos/ @BendingBender /types/gettext.js/ @jucrouzet +/types/gh-pages/ @DanielRosenwasser /types/gifffer/ @gatimus /types/gijgo/ @atatanasov /types/giraffe/ @darthapo @@ -1500,6 +1554,7 @@ /types/git-branch/ @rynclark /types/git-config/ @stpettersens /types/git-remote-origin-url/ @janslow +/types/git-rev-sync/ @khoi-fish /types/git-url-parse/ @ajafff /types/github-url-to-object/ @ajafff /types/github-username-regex/ @BehindTheMath @@ -1509,7 +1564,8 @@ /types/gl-texture2d/ @MathiasPaumgarten /types/gldatepicker/ @qcz /types/glidejs/ @milanjaros -/types/glob/ @vvakame @voy +/types/glob/v5/ @vvakame @voy +/types/glob/ @vvakame @voy @ajafff /types/glob-base/ @alan-agius4 /types/glob-expand/ @vvakame /types/glob-parent/ @mrmlnc @@ -1520,8 +1576,9 @@ /types/globalize-compiler/ @iclanton /types/globby/ @douglasduteil @ikatyang /types/globule/ @durad +/types/glue/v4/ @gjednaszewski /types/glue/ @garfty -/types/gm/ @ChaosinaCan @maartenvanvliet +/types/gm/ @ChaosinaCan @maartenvanvliet @mlejva /types/go/ @NorthwoodsSoftware /types/google-adwords-scripts/ @jafaircl /types/google-apps-script/ @motemen @grant @@ -1542,17 +1599,20 @@ /types/google.geolocation/ @vbortone /types/google.picker/ @grapswiz /types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov @glebm +/types/google__maps/ @indrimuska /types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss @bolatovumar @gauthierm /types/googlemaps.infobubble/ @Dashue -/types/googlepay/ @Fluccioni @Radu-Raicea -/types/got/ @BendingBender @LinusU @ikokostya +/types/googlepay/ @Fluccioni @Radu-Raicea @fstanis +/types/got/v8/ @BendingBender @LinusU @ikokostya +/types/got/ @BendingBender @LinusU @ikokostya @stijnvn /types/graceful-fs/v2/ @Bartvds /types/graceful-fs/ @Bartvds @BendingBender /types/gradient-string/ @Ailrun /types/graham_scan/ @hberntsen /types/gramps__rest-helpers/ @claude /types/graphite-udp/ @EricByers -/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher @clayne11 +/types/graphlib-dot/ @DomParfitt +/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher @clayne11 @JCMais /types/graphql-date/ @enaeseth /types/graphql-deduplicator/ @lfades /types/graphql-depth-limit/ @eritikass @@ -1561,6 +1621,7 @@ /types/graphql-query-complexity/ @abhikmitra /types/graphql-relay/ @arvitaly @nitintutlani @Grelinfo /types/graphql-resolve-batch/ @nayni +/types/graphql-resolvers/ @mike-engel /types/graphql-type-json/ @schfkt /types/graphviz/ @mhfrantz /types/grasp/ @agnoster @@ -1570,12 +1631,11 @@ /types/grecaptcha/v0/ @brentj73 /types/grecaptcha/ @DethAriel @rafaeltavares /types/gregorian-calendar/ @cwalv -/types/grid-styled/ @antonvasin @vittorio @lhache /types/gridfs-stream/ @liorm /types/gridstack/ @PascalSenn @ZoolWay @Sl1MBoy /types/grpc-error/ @danwbyrne /types/grunt/ @jeffmay @basarat -/types/gsap/ @codebelt @ProbablePrime @philipbulley +/types/gsap/ @codebelt @ProbablePrime @philipbulley @leomeloxp /types/gtin/ @RafaelKr /types/guid/ @maroy1986 /types/gulp/ @GiedriusGrabauskas @@ -1721,6 +1781,8 @@ /types/holderjs/ @renjfk /types/hooker/ @misak113 /types/hopscotch/ @pimterry @Aurimas1 +/types/host-validation/ @dintopple +/types/hosted-git-info/ @OiyouYeahYou /types/howler/ @xperiments @tdukart @alien35 @nicholashza /types/hpp/ @kryops /types/html-entities/ @xstoudi @@ -1732,7 +1794,7 @@ /types/html-void-elements/ @rhysd /types/html-webpack-plugin/ @deevus @bumbleblym @tlaziuk /types/html-webpack-template/ @bumbleblym -/types/html2canvas/ @rwhepburn @tan9 @sschocke +/types/html2canvas/ @rwhepburn @tan9 @sschocke @Ristaaf /types/htmlbars-inline-precompile/ @chriskrycho /types/htmlparser2/ @staticfunction @LinusU /types/htmltojsx/ @basarat @@ -1744,7 +1806,7 @@ /types/http-graceful-shutdown/ @dlee-nvisia /types/http-link-header/ @screendriver /types/http-proxy/ @SomaticIT @Raigen @DanielMSchmidt -/types/http-proxy-agent/ @mrmlnc +/types/http-proxy-agent/ @mrmlnc @steprescott /types/http-proxy-middleware/ @zebMcCorkle @BendingBender /types/http-rx/ @L2jLiga /types/http-server/ @plantain-00 @@ -1763,9 +1825,11 @@ /types/hypertext-application-language/ @maks3w /types/hystrixjs/ @igorsechyn /types/i18n/ @SomaticIT @FindQ +/types/i18n-abide/ @smbell /types/i18n-js/ @ypresto /types/i18next/v2/ @mxl @deerawan @GiedriusGrabauskas -/types/i18next/ @mxl @deerawan @GiedriusGrabauskas +/types/i18next/v8/ @mxl @deerawan @GiedriusGrabauskas +/types/i18next/ @mxl @deerawan @GiedriusGrabauskas @lenovouser @qqilihq @butchyyyy /types/i18next-browser-languagedetector/v0/ @cyrilschumacher @GiedriusGrabauskas /types/i18next-browser-languagedetector/ @cyrilschumacher @GiedriusGrabauskas /types/i18next-express-middleware/ @cyrilschumacher @@ -1791,6 +1855,7 @@ /types/ignore-styles/ @tai2 /types/iltorb/ @Alorel @reconbot /types/image-size/ @elisee +/types/image-type/ @ffflorian /types/imagemagick/ @soywiz /types/imagemagick-native/ @horiuchi /types/imagemapster/ @delphinus35 @@ -1806,7 +1871,7 @@ /types/imgur-rest-api/ @lukewestby /types/imperium/ @gaetansenn /types/impress/ @borisyankov -/types/in-app-purchase/ @l-jonas +/types/in-app-purchase/ @l-jonas @IchordeDionysos /types/in-range/ @DanielRosenwasser /types/inboxsdk/ @rdoursenaud @amiram /types/incremental-dom/ @basarat @lanthaler @vvakame @@ -1818,9 +1883,11 @@ /types/inherits/ @chrootsu /types/ini/ @marcinporebski /types/iniparser/ @chrootsu +/types/init-package-json/ @kfarnung /types/inline-css/ @philipisapain -/types/inline-style-prefixer/ @ahz @dpetrezselyova +/types/inline-style-prefixer/ @ahz @dpetrezselyova @franklixuefei /types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood @kwkelly @Ailrun +/types/inquirer-npm-name/ @manuth /types/insert-module-globals/ @leonard-thieu /types/insight/ @vvakame /types/integer/ @Morfent @@ -1841,7 +1908,7 @@ /types/ion-rangeslider/v1/ @dduugg @Karel-van-de-Plassche /types/ion-rangeslider/ @Karel-van-de-Plassche /types/ioredis/v3/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor @palindrom615 @reconbot -/types/ioredis/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor @palindrom615 @reconbot +/types/ioredis/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor @palindrom615 @reconbot @funthing @iamolegga /types/iota.lib.js/ @fogsh /types/ip/ @codeanimal /types/ip-address/ @icopp @danwbyrne @@ -1859,10 +1926,11 @@ /types/is-ci/ @atd-schubert /types/is-color/ @VitorLuizC /types/is-compressed/ @mhegazy +/types/is-docker/ @YashdalfTheGray /types/is-empty/ @termosa /types/is-finite/ @mhegazy /types/is-glob/ @mrmlnc -/types/is-hotkey/ @petester42 +/types/is-hotkey/ @petester42 @kalley /types/is-ip/ @coderslagoon /types/is-mobile/ @LogvinovLeon /types/is-my-json-valid/ @kruncher @@ -1885,6 +1953,7 @@ /types/is-url-superb/ @kryops /types/is-uuid/ @tedre191 /types/is-windows/ @mizunashi-mana +/types/isaac/ @mo /types/isbn-utils/ @elhaard /types/iscroll/ @csrakowski @devlato /types/ismobilejs/ @Ty3uK @@ -1908,6 +1977,7 @@ /types/japanese-holidays/ @syamatoo /types/jasmine/ @borisyankov @theodorejb @davidparsson @gmoothart @lukas-zech-software @Engineer2B /types/jasmine-ajax/ @lgrignon +/types/jasmine-data-provider/ @tlaziuk /types/jasmine-data_driven_tests/ @AnthonyMacKinnon /types/jasmine-enzyme/ @bolatovumar /types/jasmine-es6-promise-matchers/ @stephenlautier @@ -1918,7 +1988,7 @@ /types/jasmine-node/ @svi3c /types/jasmine-promise-matchers/ @matthewjh /types/jasmine_dom_matchers/ @devoto13 -/types/jasminewd2/ @sjelin +/types/jasminewd2/ @sjelin @gkalpak /types/java/ @jimlloyd @hrl7 @darti /types/java-applet/ @cyrilschumacher /types/javascript-astar/ @ptlis @@ -1930,8 +2000,9 @@ /types/jdataview/ @RReverser /types/jdenticon/ @mtr /types/jest/v16/ @NoHomey @jwbay -/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @joshuakgoldberg @UselessPickles @r3nya @hotell @sebald +/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @joshuakgoldberg @UselessPickles @r3nya @hotell @sebald @andys8 /types/jest-axe/ @JoshuaKGoldberg +/types/jest-cli/ @lifeiscontent /types/jest-diff/ @myabc /types/jest-docblock/ @ikatyang /types/jest-each/ @theutz @nickmccurdy @@ -1956,6 +2027,7 @@ /types/johnny-five/ @nakakura @ujvzolee @workshop2 /types/joi/v6/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW /types/joi/v10/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @aconanlai +/types/joi/v13/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai @zaphoyd @thewillg @SimonSchick /types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai @zaphoyd @thewillg @SimonSchick /types/joigoose/ @boothwhack /types/josa/ @vichyssoise @@ -1967,7 +2039,7 @@ /types/jqrangeslider/ @qcz /types/jquery/v1/ @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @DickvdBrink @King2500 @leonard-thieu /types/jquery/v2/ @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @DickvdBrink @King2500 @leonard-thieu -/types/jquery/ @leonard-thieu @borisyankov @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @johnnyreilly @DickvdBrink @King2500 +/types/jquery/ @leonard-thieu @borisyankov @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @johnnyreilly @DickvdBrink @King2500 @terrymun /types/jquery-ajax-chain/ @humana-fragilitas /types/jquery-alertable/ @stever /types/jquery-animate-scroll/ @AndersonFriaca @@ -1982,6 +2054,7 @@ /types/jquery-editable-select/ @baywet /types/jquery-focus-exit/ @AndersonFriaca /types/jquery-focusable/ @AndersonFriaca +/types/jquery-formatdatetime/ @AndersonFriaca /types/jquery-fullscreen/ @bgrieder /types/jquery-galleria/ @rimig /types/jquery-gray/ @AndersonFriaca @@ -2104,7 +2177,7 @@ /types/js-yaml/ @Bartvds @sclausen /types/js.spec/ @mattbishop /types/jsbn/ @Evgenus @al2xed -/types/jschannel/ @yitzchok +/types/jschannel/ @yitzchok @McFlat /types/jscrollpane/ @qcz /types/jsdeferred/ @minodisk /types/jsdom/ @leonard-thieu @palmfjord @@ -2112,7 +2185,7 @@ /types/jsend/ @CaselIT /types/jsesc/ @Bartvds /types/jsfl/ @soywiz -/types/jsforce/ @dolanmiu @netes @amphro @tnoonan-salesforce @whiteabelincoln +/types/jsforce/ @dolanmiu @netes @amphro @tnoonan-salesforce @whiteabelincoln @borys-kupar /types/jsftp/ @xyleen /types/jsgraph/ @rosinbum /types/jshamcrest/ @dharkness @@ -2125,6 +2198,7 @@ /types/json-patch-gen/ @RohdeK /types/json-pointer/ @Bartvds /types/json-query/ @mtraynham +/types/json-rpc-random-id/ @micahriggan /types/json-rpc-ws/ @npenin @mlamp /types/json-schema/ @bcherny @cyrilletuzi @lucianbuzzo @rolandjitsu /types/json-socket/ @svi3c @@ -2144,15 +2218,18 @@ /types/jsonnet/ @hookclaw /types/jsonp/ @surenkov /types/jsonpath/ @horiuchi @ikatyang +/types/jsonquery/ @JimmyBoh /types/jsonrpc-serializer/ @Akim95 @many20 /types/jsonstream/ @Bartvds /types/jsontoxml/ @benstevens48 -/types/jsonwebtoken/ @SomaticIT @danielheim @brikou @vpk +/types/jsonwebtoken/ @SomaticIT @danielheim @brikou @vpk @rlgod /types/jsonwebtoken-promisified/ @SomaticIT @danielheim @brikou @aneilbaboo +/types/jspath/ @dex4er /types/jspdf/ @amberjs /types/jsqrcode/ @lordazzi /types/jsrender/ @zakki /types/jsreport-core/ @taoqf +/types/jsreport-html-embedded-in-docx/ @taoqf /types/jsreport-html-to-xlsx/v1/ @me /types/jsreport-html-to-xlsx/ @me /types/jsreport-jsrender/ @taoqf @@ -2174,6 +2251,7 @@ /types/jui/ @easylogic /types/jui-core/ @easylogic /types/jui-grid/ @easylogic +/types/just-debounce-it/ @azizhk /types/just-extend/ @pe8ter /types/jweixin/ @taoqf @gomydodo /types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw @bpdsw @@ -2184,8 +2262,10 @@ /types/jwt-express/ @nickp10 /types/jwt-simple/ @kenfdev @GaelMagnan /types/jwt-then/ @phenomax +/types/k6/ @MajorBreakfast /types/kafka-node/ @dansitu @bkim54 @sfrooster @amiram -/types/karma/ @tkrotoff @43081j +/types/karma/v1/ @tkrotoff @43081j +/types/karma/ @tkrotoff @43081j @devoto13 /types/karma-chai/ @JayAndCatchFire /types/karma-chai-sinon/ @vasek17 /types/karma-coverage/ @tkrotoff @@ -2195,11 +2275,12 @@ /types/karma-webpack/ @mtraynham /types/katex/ @mrand01 /types/kcors/ @Xstoudi @izayoiko -/types/kdbush/ @DenisCarriere +/types/kdbush/ @DenisCarriere @chrfrasco /types/keen-tracking/ @rui-ferreira /types/kefir/ @AyaMorisawa @HitoriSensei /types/kendo-ui/ @telerik -/types/keyboardjs/ @vbortone @piranha771 +/types/keyboardjs/ @vbortone @piranha771 @teoxoy +/types/keycloak-connect/ @gstamac /types/keygrip/ @jkeylu /types/keymaster/ @nitram509 /types/keymirror/ @jfahrenkrug @@ -2263,6 +2344,7 @@ /types/koa-pino-logger/ @khell /types/koa-pug/ @Xstoudi /types/koa-range/ @strax +/types/koa-ratelimit/ @OutdatedVersion /types/koa-redis/ @nsimmons /types/koa-redis-cache/ @dimamukhin /types/koa-requestid/ @sjmcdowall @@ -2275,15 +2357,17 @@ /types/koa-sslify/ @wingsbob /types/koa-static/ @hellopao @tlaziuk /types/koa-static-cache/ @JounQin +/types/koa-static-server/ @wulunyi /types/koa-views/ @brooklyndev /types/koa-webpack/ @malj @leebenson @miZyind @tlaziuk -/types/koa-websocket/ @moimael @jacogr @zdila +/types/koa-websocket/ @moimael @jacogr @zdila @Kroisse /types/koa-xml-body/ @uwinkelvos /types/koa2-cors/ @xialeistudio /types/koa2-session-redis/ @DimaMukhin /types/koa__cors/ @Xstoudi @izayoiko @stevehipwell @sjmcdowall /types/kolite/ @borisyankov /types/konami.js/ @mareek +/types/kos-core/ @ali-Kos /types/kraken-js/ @darkwebdev @micksatana /types/kramed/ @tonicblue /types/kss/ @giladgray @@ -2292,13 +2376,16 @@ /types/kuromoji/ @mzsm @kgtkr /types/lab/ @prashaantt /types/ladda/ @dflor003 @leemicw +/types/lambda-log/ @armonge +/types/lambda-tester/ @ivank @HajoAhoMantila /types/lasso/ @darkwebdev /types/later/ @jasond-s /types/latinize/ @GiedriusGrabauskas /types/latlon-geohash/ @rimig /types/launchpad/ @rictic +/types/layzr.js/ @shermendev /types/lazy-value/ @ikatyang -/types/lazy.js/ @Bartvds +/types/lazy.js/ @Bartvds @miso440 /types/lazypipe/ @tomc974 /types/ldapjs/ @cvillemure @peterkooijmans /types/leadfoot/ @theintern @@ -2314,7 +2401,7 @@ /types/leaflet-imageoverlay-rotated/ @tkleinke /types/leaflet-label/ @Nemo157 /types/leaflet-mouse-position/ @Hanyon -/types/leaflet-polylinedecorator/ @soucekv +/types/leaflet-polylinedecorator/ @soucekv @michaelfaisst /types/leaflet-providers/ @BendingBender /types/leaflet-rotatedmarker/ @robert-prib-polestar /types/leaflet-routing-machine/ @chanakadrathnayaka @@ -2329,21 +2416,28 @@ /types/leaflet.pancontrol/ @Brictarus /types/leaflet.pm/ @tkleinke /types/leaflet.polylinemeasure/ @RiON69 +/types/leakage/ @atd-schubert /types/leapmotionts/ @logotype +/types/ledgerhq__hw-transport/ @danwbyrne +/types/ledgerhq__hw-transport-node-hid/ @danwbyrne +/types/ledgerhq__hw-transport-u2f/ @danwbyrne /types/legal-eagle/ @j-f1 /types/lerna-get-packages/ @LogvinovLeon -/types/less/ @thasner @pranaygp @dwaxweiler +/types/less/ @thasner @pranaygp @dwaxweiler @chigix /types/less-middleware/ @federicobond /types/less2sass/ @gatimus /types/lestate/ @thelambdaparty /types/level-codec/ @danwbyrne /types/level-sublevel/ @basp -/types/leveldown/ @tarruda @LinusU -/types/levelup/ @blittle @tarruda +/types/leveldown/v1/ @tarruda @LinusU +/types/leveldown/ @MeirionHughes @danwbyrne +/types/levelup/v1/ @blittle @tarruda +/types/levelup/ @MeirionHughes @danwbyrne /types/leven/ @jmalonzo /types/levenshtein/ @geoffreak /types/libpq/ @Lodin /types/libsodium-wrappers/ @ffflorian +/types/libsodium-wrappers-sumo/ @ffflorian /types/libxmljs/ @fdecampredon @ComFreek /types/libxslt/ @alejo90 /types/license-checker/ @rogierschouten @unindented @@ -2353,6 +2447,7 @@ /types/line-reader/ @stpettersens /types/linear-gradient/ @Jack-Works /types/lingui__core/ @huan086 +/types/lingui__macro/ @huan086 /types/lingui__react/ @huan086 /types/linkify-it/ @praxxis /types/listr/ @durad @@ -2371,6 +2466,7 @@ /types/lockfile/v0/ @Bartvds /types/lockfile/ @Bartvds @BendingBender /types/lockr/ @droritos +/types/locks/ @flippynips /types/locutus/ @hookclaw /types/lodash/v3/ @bczengel @chrootsu /types/lodash/ @bczengel @chrootsu @stepancar @aj-r @ailrun @e-cloud @thorn0 @jtmthf @DomiR @@ -2690,6 +2786,7 @@ /types/luxon/ @colbydehart @FourwingsY @jsiebern /types/lwip/ @AyaMorisawa /types/lz-string/ @M0ns1gn0r +/types/lzma-native/ @leshow /types/magic-number/ @stpettersens /types/magicsuggest/ @leonardochaia /types/magnet-uri/ @tlaziuk @@ -2701,7 +2798,9 @@ /types/main-bower-files/ @k-kagurazaka /types/make-dir/ @ikatyang @BendingBender /types/maker.js/ @danmarshall -/types/mali/ @danwbyrne +/types/makeup-expander/ @darkwebdev +/types/makeup-floating-label/ @darkwebdev +/types/makeup-screenreader-trap/ @darkwebdev /types/mali-compose/ @danwbyrne /types/mali-onerror/ @danwbyrne /types/mandrill-api/ @pocesar @@ -2720,6 +2819,7 @@ /types/markdown-it/ @rapropos /types/markdown-it-anchor/ @seryl /types/markdown-it-container/ @hronex +/types/markdown-it-lazy-headers/ @knom /types/markdown-pdf/ @MonsieurMan /types/markdownlint/ @ark120202 /types/marked/ @worr @BendingBender @CrossR @@ -2730,7 +2830,8 @@ /types/maskedinput/ @lokeshpeta /types/masonry-layout/ @m-a-wilson @warriorrocker /types/massive/v3/ @swissspidy @clarenceh -/types/massive/ @swissspidy @clarenceh @AmazingTurtle +/types/massive/v4/ @swissspidy @clarenceh @AmazingTurtle +/types/massive/ @swissspidy @clarenceh @AmazingTurtle @mike-engel /types/match-media-mock/ @asvetliakov /types/match-sorter/ @claasahl /types/material-components-web/ @BrentDouglas @ckosti @@ -2772,6 +2873,7 @@ /types/maxmind/ @geoffreak /types/mcustomscrollbar/ @flurg /types/md5/ @arcdev1 @jprogrammer +/types/md5-file/ @BamButz /types/mdns/ @reppners /types/mdurl/ @rokt33r /types/media-typer/ @BendingBender @@ -2800,11 +2902,12 @@ /types/messenger/ @derekcicerone /types/meteor/ @barbatus @fullflavedave @orefalo @dagatsoin @birkskyum @ardatan @stefanholzapfel @andrei-markeev @lmachens /types/meteor-accounts-phone/ @DAB0mB +/types/meteor-astronomy/ @Deadly0 /types/meteor-collection-hooks/ @twastvedt /types/meteor-jboulhous-dev/ @vangorra /types/meteor-persistent-session/ @vangorra /types/meteor-prime8consulting-oauth2/ @vangorra -/types/meteor-publish-composite/ @vangorra +/types/meteor-publish-composite/ @vangorra @mrz5018 /types/meteor-roles/ @vangorra @mattmm3d /types/meteor-universe-i18n/ @mathewmeconry /types/method-override/ @santialbo @@ -2841,12 +2944,13 @@ /types/mitm/ @alejo90 /types/mixpanel/ @hjellek @Manduro /types/mixto/ @vvakame -/types/mjml/ @aahoughton +/types/mjml/ @aahoughton @marpstar /types/mkdirp/ @Bartvds @mrmlnc /types/mkdirp-promise/ @pluma /types/mkpath/ @optical /types/ml-levenberg-marquardt/ @m93a /types/mobx-apollo/ @pselden +/types/mobx-cookie/ @t49tran /types/mobx-devtools-mst/ @pluma /types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight @cspotcode @1999 /types/mocha-each/ @magnostherobot @@ -2863,6 +2967,7 @@ /types/modernizr/ @borisyankov @theodorejb @leonyu @lucax88x @nhardy /types/modesl/ @neeschit /types/module-alias/ @KevinRamharak +/types/module-deps/ @TeamworkGuy2 /types/moji/ @yasupeke /types/moment-business/ @wonbyte /types/moment-business-time/ @swist @@ -2877,11 +2982,11 @@ /types/money-math/ @taoqf /types/mongo-sanitize/ @CedricCazin /types/mongodb/v2/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi -/types/mongodb/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian @denys-bushulyak @BastienAr @sindbach @geraldinelemeur @jishi @various89 @angela-1 +/types/mongodb/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian @denys-bushulyak @BastienAr @sindbach @geraldinelemeur @jishi @various89 @angela-1 @lirbank @hector7 @floric /types/mongodb-memory-server/ @dmitryrogozhny /types/mongodb-uri/ @mernxl /types/mongoose/v4/ @simonxca @horiuchi @sindrenm @lukasz-zak -/types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab @jussikinnula @ondratra @alfirin @idandrd @various89 +/types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab @jussikinnula @ondratra @alfirin @idandrd @various89 @Fazendaaa @NormanPerrin @danmana @stablio /types/mongoose-auto-increment/ @AyaMorisawa /types/mongoose-deep-populate/ @AyaMorisawa /types/mongoose-geojson-schema/ @bondz @@ -2893,6 +2998,7 @@ /types/mongoose-simple-random/ @rsxdalv /types/mongoose-unique-validator/ @stevehipwell /types/mongorito/ @pinguet62 +/types/mongration/ @soulthreads /types/moo/ @deltaidea @MofX /types/moonjs/ @DanielRosenwasser /types/morgan/ @staticfunction @pscanf @@ -2902,6 +3008,7 @@ /types/motor-hat/ @muntyan /types/mousetrap/ @qcz /types/move-concurrently/ @mgroenhoff +/types/moveto/ @shermendev /types/moviedb/ @basarat @0x6368656174 /types/moxios/ @itoasuka /types/mozilla-readability/ @charlesvdv @@ -2918,6 +3025,7 @@ /types/muicss/ @samuelneff /types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob /types/multer-gridfs-storage/v1/ @devconcept +/types/multer-gridfs-storage/v2/ @devconcept /types/multer-gridfs-storage/ @devconcept /types/multer-s3/ @tcaesvk @galtalmor @terski /types/multi-typeof/ @mhegazy @@ -2932,10 +3040,11 @@ /types/murmurhash3js/ @dlee-nvisia /types/musicmetadata/ @Xstoudi /types/mustache/ @markashleybell @manuth +/types/mutexify/ @maistho /types/mv/ @nenadalm /types/mysql/ @wjohnsto @kacepe @kpping @jdmunro /types/mz/ @ThomasHickman -/types/n3/ @phreed @rubensworks +/types/n3/ @phreed @rubensworks @LaurensRietveld /types/named-regexp-groups/ @jewbre /types/named-routes/ @qqilihq /types/nanoajax/ @nathancahill @@ -2973,11 +3082,13 @@ /types/network-interfaces/ @anderswestberg /types/new-relic-browser/ @renehamburger @piotrkubisa /types/newline-remove/ @OpenByteDev -/types/newman/ @LogvinovLeon -/types/newrelic/ @mastermatt +/types/newman/ @LogvinovLeon @Graham42 +/types/newrelic/ @mastermatt @brookspatton /types/nexpect/ @vvakame -/types/next/ @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira +/types/next/ @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira @ajliv +/types/next-redux-saga/ @leocavalcante /types/next-redux-wrapper/ @stevegeek @Jungwoo-An +/types/next-server/ @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira @ajliv /types/ng-command/ @stephenlautier /types/ng-cordova/ @ksachdeva /types/ng-dialog/ @stephenlautier @@ -3006,25 +3117,27 @@ /types/noble/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko /types/nock/ @bonnici @horiuchi @afharo @mastermatt @damour @paambaati /types/nodal/ @charrondev -/types/node/v4/ @eps1lon @Archcry -/types/node/v6/ @WilcoBakker @inlined @eps1lon @Alorel @KSXGitHub @Archcry -/types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub @Archcry -/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @brunoscheufler @KSXGitHub @islishude @r3nya -/types/node/v9/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude @r3nya @eyqs -/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude @r3nya @ZaneHannanAU @ThomasdenH @eyqs @matthieusieben +/types/node/v0/ @Microsoft @DefinitelyTyped +/types/node/v4/ @Microsoft @DefinitelyTyped @eps1lon @Archcry +/types/node/v6/ @Microsoft @DefinitelyTyped @WilcoBakker @inlined @eps1lon @Alorel @KSXGitHub @Archcry +/types/node/v7/ @Microsoft @DefinitelyTyped @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub @Archcry +/types/node/v8/ @Microsoft @DefinitelyTyped @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @brunoscheufler @KSXGitHub @islishude @r3nya +/types/node/v9/ @Microsoft @DefinitelyTyped @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude @r3nya @eyqs +/types/node/ @Microsoft @DefinitelyTyped @jkomyno @a-tarasyuk @alvis @r3nya @brunoscheufler @smac89 @tellnes @DeividasBakanas @eyqs @Flarna @Hannes-Magnusson-CK @KSXGitHub @hoo29 @kjin @ajafff @islishude @mwiktorczyk @matthieusieben @mohsen1 @n-e @octo-sniffle @parambirs @eps1lon @SimonSchick @ThomasdenH @WilcoBakker @wwwy3y3 @ZaneHannanAU @jeremiergz /types/node-7z/ @erkie /types/node-array-ext/ @Beng89 /types/node-cache/ @chrootsu @dthunell @useltmann /types/node-calendar/ @luzianz /types/node-cleanup/ @agadar -/types/node-cron/ @maximelkin +/types/node-crate/ @gjednaszewski +/types/node-cron/ @maximelkin @burtek /types/node-dijkstra/ @nokutu /types/node-dir/ @panuhorsmalahti /types/node-dogstatsd/ @chrisbobo /types/node-emoji/ @jonestristand @styu /types/node-fetch/ @torstenwerner @nikcorg /types/node-fibers/ @caryhaynie -/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 @beenotung +/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 @beenotung @joeflateau /types/node-gcm/ @horiuchi /types/node-geocoder/ @rosek86 /types/node-getopt/ @kcauchy @@ -3044,6 +3157,7 @@ /types/node-pushnotifications/ @menushka /types/node-ral/ @ssddi456 /types/node-red/ @andersea @tbowmo +/types/node-redis-pubsub/ @renekeijzer /types/node-resque/ @gordey4doronin /types/node-rsa/ @alitaheri @xm /types/node-schedule/ @cyrilschumacher @flowpl @@ -3078,9 +3192,10 @@ /types/nodeunit/ @jedigo /types/noisejs/ @izmhr /types/nomnom/ @panopticoncentral +/types/nookies/ @andreasbergqvist /types/nopt/ @jbondc /types/normalize-package-data/ @jdxcode -/types/normalize-url/ @odin3 @BendingBender +/types/normalize-url/ @odin3 @BendingBender @mathieumg /types/notie/ @mateusdemboski /types/notify/ @hellochar /types/notifyjs/ @soundTricker @NateScarlet @@ -3091,13 +3206,13 @@ /types/nouislider/ @bleuarg @lagaffe /types/novnc-core/ @smithkl42 @BendingBender /types/npm/ @SomaticIT -/types/npm-package-arg/ @mgroenhoff +/types/npm-package-arg/ @mgroenhoff @OiYouYeahYou /types/npm-packlist/ @ajafff /types/npmlog/ @DanielMSchmidt @littlepiggy03 /types/ns-api/ @Archcry /types/nslog/ @unindented /types/nsqjs/ @cezaryrk -/types/nuka-carousel/ @Romic +/types/nuka-carousel/ @Romic @altaudio /types/number-is-nan/ @mhegazy /types/number-to-words/ @frederickfogerty /types/numeral/ @vbortone @BehindTheMath @klujanrosas @@ -3108,13 +3223,15 @@ /types/nvd3/ @PjMitchell /types/nw.gui/ @xperiments /types/nw.js/ @alirdn +/types/nwmatcher/ @woutervh- /types/o.js/ @IceOnFire @bradzacher @janhommes @jcchalte -/types/oauth/ @nonAlgebraic +/types/oauth/ @nonAlgebraic @EduardoAC /types/oauth.js/ @nobuoka /types/oauth2-server/ @vangorra @cirick @d-fischer /types/oauth2orize/ @wokim @heycalmdown @stevehipwell /types/obelisk.js/ @bdrupieski /types/obj-file-parser/ @benc-uk +/types/obj-str/ @saenglert /types/object-assign/ @chbrown /types/object-diff/ @rogierschouten /types/object-hash/ @misak113 @@ -3133,6 +3250,7 @@ /types/odata/ @janhommes @jcchalte /types/ofe/ @Morfent /types/office-js/ @OfficeDev @LanceEA @Zlatkovsky @kbrandl @Rick-Kirkham @AlexJerabek @ElizabethSamuel-MSFT +/types/office-runtime/ @Zlatkovsky @mscharlock /types/offline-js/ @cgwrench /types/oibackoff/ @geoffreak /types/oidc-token-manager/ @rosieks @@ -3142,11 +3260,12 @@ /types/omggif/ @ffflorian /types/on-finished/ @czechboy0 @BendingBender /types/on-headers/ @jjeffery @BendingBender +/types/on-wake-up/ @ajafff /types/once/ @denis-sokolov @BendingBender /types/onesignal-cordova-plugin/ @broder /types/onetime/ @BendingBender /types/oniguruma/ @smhxx -/types/onoff/ @marcel-ernst +/types/onoff/ @marcel-ernst @Kallu609 /types/ontime/ @Hirse /types/open/ @Bartvds /types/opener/ @tikurahul @@ -3157,16 +3276,18 @@ /types/openlayers/v2/ @bolhovsky /types/openlayers/v3/ @osechet @matthiasdailey-ccri /types/openlayers/ @osechet @wb14123 @ailrun @mylen @iamthechad @danmana @yairtawil @pierremarc @hauke96 @gberaudo -/types/openpgp/ @errietta +/types/openpgp/ @errietta @damonpam /types/openstack-wrapper/ @sanjaymadane /types/opentok/ @westy92 @CatGuardian /types/opentype.js/ @danmarshall @edzis /types/opn/ @shinnn @SomaticIT @tlent +/types/opossum/ @quinnlangille @lance /types/optics-agent/ @crevil /types/optimist/ @soywiz @chbrown /types/optimize-css-assets-webpack-plugin/ @odnamrataizem /types/ora/v0/ @basarat @screendriver /types/ora/ @basarat @screendriver @BendingBender @azasypkin +/types/oracle__oraclejet/ @nolakara @jingxwu /types/oracledb/ @Bigous /types/orchestrator/ @tkQubo @TeamworkGuy2 /types/orderedmap/ @bradleyayers @@ -3219,6 +3340,7 @@ /types/p-wait-for/ @BendingBender /types/p-whilst/ @BendingBender /types/p2/ @clark-stevenson +/types/p5/ @p5-types /types/package-json/ @jinwoo /types/packery/ @piraveen @hanssens /types/pad/ @mhegazy @@ -3226,10 +3348,11 @@ /types/paho-mqtt/ @amikhalev /types/pako/ @cappellin @calebegg /types/pangu/ @plantain-00 -/types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly @albertorestifo @BehindTheMath @3af +/types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly @albertorestifo @BehindTheMath @3af @jliuhtonen /types/paper/ @clark-stevenson @Xakaloz @sebaswebdev @rfried /types/parallel-transform/ @djcsdy /types/paralleljs/ @jbaldwin +/types/parcel-bundler/ @pinage404 /types/parcel-env/ @fathyb /types/parent-package-json/ @sgmccli /types/parity-pmd/ @leovujanic @jewbre @@ -3259,6 +3382,8 @@ /types/parsimmon/ @Bartvds @mizunashi-mana @bcherny @bvanreeven @leonard-thieu @MrJohz /types/passport/ @horiuchi @enaeseth @theigor @tlaziuk @danielpa9708 /types/passport-anonymous/ @0x6368656174 +/types/passport-auth0/ @johnbendi @iamvishnusankar +/types/passport-azure-ad/ @ShekharNain /types/passport-beam/ @AtlasDev /types/passport-cognito/ @mbutsykin /types/passport-discord/ @kzay @@ -3275,7 +3400,7 @@ /types/passport-local/ @SomaticIT /types/passport-local-mongoose/ @linusbrolin /types/passport-naver/ @Park9eon @zerocho -/types/passport-oauth2/ @pasieronen @WangZishi +/types/passport-oauth2/ @pasieronen @WangZishi @EduardoAC /types/passport-oauth2-client-password/ @akaNightmare /types/passport-remember-me-extended/ @AylaJK /types/passport-saml/ @cjbarth @dassennato @@ -3283,6 +3408,8 @@ /types/passport-strategy/ @liorm /types/passport-twitter/ @staticfunction /types/passport-unique-token/ @briman0094 @SomaticIT +/types/passport-vkontakte/ @soulthreads +/types/passport-windowsauth/ @forivall /types/password-hash/ @mugeso /types/password-hash-and-salt/ @alitaheri /types/path-exists/v1/ @shiwano @@ -3300,7 +3427,7 @@ /types/pbkdf2/ @timonegk /types/pdfjs-dist/ @jbaldwin /types/pdfkit/ @erichillah -/types/pdfmake/ @m1llen1um @radziksh +/types/pdfmake/ @m1llen1um @radziksh @evolkmann /types/pdfobject/ @nielsboogaard /types/pebblekitjs/ @makotokw /types/peer-dial/ @RealTYPICAL @@ -3308,6 +3435,7 @@ /types/pegjs/ @vvakame @SrTobi @siegebell /types/pem/ @tony19 @DethAriel /types/pem-jwk/ @alessiopcc +/types/permit/ @jannikkeye /types/persona/ @Nycto /types/pet-finder-api/ @me /types/pg/v6/ @pspeter3 @@ -3340,11 +3468,13 @@ /types/pidusage/ @cyrilschumacher @mx601595686 /types/pify/ @samverschueren @mad-mike @c7hm4r /types/pigpio/ @manerfan -/types/pikaday/ @MidnightDesign @wake42 +/types/pigpio-dht/ @erikma +/types/pikaday/ @MidnightDesign @wake42 @mezoistvan /types/pikaday-time/ @Sayan751 /types/pinkyswear/ @chances /types/pino/v3/ @psnider -/types/pino/ @psnider @BendingBender @screendriver @paambaati +/types/pino/ @psnider @BendingBender @screendriver @paambaati @alferpal +/types/pino-http/ @screendriver /types/pino-multi-stream/ @JakeGinnivan /types/pinterest-sdk/ @adamburmister /types/pinyin/ @wanganjun @@ -3359,6 +3489,7 @@ /types/playerframework/ @ricardosabino /types/playmusic/ @nickp10 /types/pleasejs/ @nakakura +/types/plist/ @higuri /types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart @szechyjs @MercifulCode @soorajpudiyadath @jonfreedman @meganrm /types/plugapi/ @BNedry /types/plugin-error/ @rogierschouten @@ -3380,6 +3511,9 @@ /types/popcorn/ @grapswiz /types/portscanner/ @douglasduteil /types/postal/ @lokeshpeta @myitcv +/types/postcss-calc/ @huan086 +/types/postcss-icss-values/ @huan086 +/types/postcss-modules-resolve-imports/ @huan086 /types/postman-collection/ @kbuzby /types/postmark/ @benbayard @jineshshah36 /types/pouch-redux-middleware/ @charrondev @@ -3393,7 +3527,7 @@ /types/pouchdb-adapter-node-websql/ @spaulg @geppy @fredgalvao /types/pouchdb-adapter-websql/ @spaulg @geppy @fredgalvao /types/pouchdb-browser/ @spaulg @geppy @fredgalvao -/types/pouchdb-core/ @spaulg @trubit @geppy @fredgalvao @TobiasBales @tiangolo +/types/pouchdb-core/ @spaulg @trubit @geppy @fredgalvao @TobiasBales @tiangolo @kmoe /types/pouchdb-find/ @trubit @tiangolo /types/pouchdb-http/ @spaulg @geppy @fredgalvao /types/pouchdb-mapreduce/ @spaulg @geppy @fredgalvao @@ -3443,6 +3577,7 @@ /types/prompt-sync/ @MugeSo /types/prompt-sync-history/ @MugeSo /types/promptly/ @danrspencer +/types/prompts/ @Berkays /types/prop-types/ @DovydasNavickas @ferdaber /types/proper-lockfile/ @qlonik /types/properties-reader/ @Goldsmith42 @@ -3462,7 +3597,7 @@ /types/prosemirror-tables/ @superchu @eshvedai @patsimm /types/prosemirror-transform/ @bradleyayers @davidka @timjb @patsimm /types/prosemirror-view/ @bradleyayers @davidka @timjb @patsimm -/types/proton-native/ @khanhas +/types/proton-native/ @khanhas @ltetzlaff /types/protractor-browser-logs/ @rokadias /types/protractor-helpers/ @johncant /types/protractor-http-mock/ @Crevil @@ -3483,7 +3618,8 @@ /types/pumpify/ @JustinBeckwith @aoberoi /types/pupa/ @nju33 /types/puppeteer/v0/ @marvinhagemeister @cdeutsch -/types/puppeteer/ @marvinhagemeister @cdeutsch @ksm2 +/types/puppeteer/ @marvinhagemeister @cdeutsch @ksm2 @SimonSchick +/types/puppeteer-core/ @mtsmfm /types/pure-render-decorator/ @seansfkelley /types/purl/ @danfma /types/pusher-js/ @tkqubo @cainlevy @@ -3496,7 +3632,7 @@ /types/qhistory/ @Kovensky /types/qiniu-js/ @taoqf /types/qlik/ @RubenSlabbert @AginicX -/types/qlik-engineapi/ @konne +/types/qlik-engineapi/ @konne @richardison /types/qlik-visualizationextensions/ @konne /types/qr-image/ @taoqf /types/qrcode/ @plantain-00 @@ -3517,7 +3653,7 @@ /types/rabbit.js/ @wokim /types/radium/ @alexgorbatchev @nupplaphil @asvetliakov /types/radius/ @codeanimal -/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern @rayhaneh @rgm +/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern @rayhaneh @rgm @drewwyatt /types/random-js/ @pistacchio /types/random-number/ @OpenByteDev /types/random-seed/ @endel @@ -3541,23 +3677,26 @@ /types/raty/ @terrawheat /types/raven/ @scttcper @1999 @shreyjain1994 /types/raven-for-redux/ @chiubaka -/types/raygun4js/ @xt0rted @BenjaminHarding +/types/raygun/ @UberMouse +/types/raygun4js/ @xt0rted @BenjaminHarding @UberMouse /types/rbac-a/ @tlaziuk /types/rc/ @DanielRosenwasser /types/rc-select/ @DenisTirilis /types/rc-slider/ @mantasmarcinkus @mattoni @paustint @j-fro @Deanna2 +/types/rc-time-picker/ @Hoff97 /types/rc-tree/ @johnnyreilly @Methuselah96 /types/rcloader/ @panuhorsmalahti /types/rdf-data-model/ @rubensworks -/types/rdf-js/ @rubensworks +/types/rdf-js/ @rubensworks @LaurensRietveld /types/rdflib/ @cenotelie /types/re-base/ @jordandrako /types/reach__router/ @kingdaro /types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz /types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @hotell @franklixuefei /types/react-adal/ @dkorolev1 -/types/react-albus/ @sseppola -/types/react-alert/ @ssyrell +/types/react-albus/ @sseppola @conradreuter @kuirak +/types/react-alert/v2/ @ssyrell +/types/react-alert/ @g1eny0ung /types/react-alice-carousel/ @endigo /types/react-amplitude/ @rayzor65 /types/react-animate-on-scroll/ @ralbuque @@ -3568,6 +3707,7 @@ /types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch @rosskevin /types/react-avatar-editor/ @diogocorrea @gabsprates /types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint @marknelissen +/types/react-better-password/ @mhuynh1 /types/react-big-calendar/ @piotrwitek @paustint @pikpok @eps1lon @strongpauly /types/react-body-classname/ @mhegazy /types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa @r3nya @t49tran @@ -3576,7 +3716,7 @@ /types/react-bootstrap-table/v2/ @flaub @alelode @UJosue10 /types/react-bootstrap-table/ @flaub @alelode @UJosue10 @dawnmist @Ogglas /types/react-bootstrap-typeahead/ @Guymestef @radziksh @PaitoAnderson -/types/react-breadcrumbs/ @KostyaEsmukov +/types/react-breadcrumbs/ @guoyunhe /types/react-breadcrumbs-dynamic/ @mitsuruog /types/react-broadcast/ @kandros /types/react-burger-menu/ @radziksh @@ -3585,6 +3725,7 @@ /types/react-cartographer/ @trevonmckay /types/react-circular-progressbar/ @lstanden /types/react-click-outside/ @screendriver +/types/react-close-on-escape/ @JamesAlias /types/react-codemirror/ @velveret @rudi-c /types/react-coinhive/ @sktbcbbs /types/react-collapse/ @Kimahriman @@ -3594,6 +3735,7 @@ /types/react-content-loader/ @alaatm @samwalshnz /types/react-copy-to-clipboard/ @mabels @BernabeFelix /types/react-copy-write/ @samhh @davej +/types/react-countup/ @danielbrodin /types/react-credit-cards/ @vstrimaitis @olefrank /types/react-cropper/ @stepancar /types/react-css-modules/ @KostyaEsmukov @skirsdeda @@ -3607,15 +3749,17 @@ /types/react-datagrid/ @stephenjelfs /types/react-date-range/ @Junbong /types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue @KoalaHuman @seansfkelley -/types/react-daterange-picker/ @uncovertruth @MartynasZilinskas @donaldtf +/types/react-daterange-picker/ @uncovertruth @MartynasZilinskas @donaldtf @vladflorescu94 /types/react-dates/ @ArturAmpilogov @NathanNZ /types/react-daum-postcode/ @Sa-ryong /types/react-dnd-multi-backend/ @dawnmist @beeequeue /types/react-dnd-touch-backend/ @mleko @dawnmist @beeequeue +/types/react-document-meta/ @ulrichb /types/react-document-title/ @cleverguy25 /types/react-dom/v15/ @MartynasZilinskas /types/react-dom/ @MartynasZilinskas @theruther4d /types/react-dom-factories/ @jgoz +/types/react-draft-wysiwyg/ @imechZhangLY /types/react-dragtastic/ @nscarcella /types/react-dropzone/v2/ @matdube @LynxEyes @goblindegook @benbayard /types/react-dropzone/v3/ @matdube @LynxEyes @goblindegook @benbayard @LKay @@ -3625,6 +3769,7 @@ /types/react-event-listener/ @asvetliakov /types/react-fa/ @flaub @patsissons @LKay /types/react-facebook-login/ @apare @jankarres +/types/react-facebook-login-component/ @koss-lebedev /types/react-faux-dom/ @alitaheri @cleverguy25 @deviousm @hanai /types/react-file-input/ @dmitryrogozhny /types/react-file-reader-input/ @dmitryrogozhny @alitaheri @@ -3640,6 +3785,7 @@ /types/react-gateway/ @jsonunger /types/react-geosuggest/ @brmenchl /types/react-global-configuration/ @ryokik +/types/react-google-login-component/ @koss-lebedev /types/react-google-maps-loader/ @vasilysn /types/react-google-places-suggest/ @vasilysn /types/react-google-recaptcha/ @KoalaHuman @@ -3652,38 +3798,43 @@ /types/react-helmet/ @evanbb @isman-usoh @lith-light-g @sammkj @yuit /types/react-helmet-async/ @forabi /types/react-highlight/ @joshuakgoldberg -/types/react-highlight-words/ @mhegazy @diogodca +/types/react-highlight-words/ @mhegazy @diogodca @kellyrmilligan /types/react-highlighter/ @oizie /types/react-holder/ @isman-usoh /types/react-hot-loader/ @jacekjagiello @MartynasZilinskas @DovydasNavickas /types/react-hyperscript/ @tock203 -/types/react-i18next/v1/ @KostyaEsmukov -/types/react-i18next/v4/ @GiedriusGrabauskas @netanelgilad -/types/react-i18next/ @GiedriusGrabauskas @chnoch @beheh @whtsky /types/react-icon-base/ @apare @LKay /types/react-icons/ @apare @johnnyreilly @LKay /types/react-image-crop/ @danielasy +/types/react-image-fallback/ @8enSmith /types/react-image-gallery/ @adamwpc /types/react-imageloader/ @stephenjelfs +/types/react-images/ @KonstantinLukaschenko +/types/react-imgpro/ @echoulen /types/react-infinite/ @rhysd /types/react-infinite-calendar/ @christianchown -/types/react-infinite-scroll-component/ @sroy3 @burtek @davidkevork -/types/react-infinite-scroller/ @Lapanti @psrebniak +/types/react-infinite-scroll-component/ @sroy3 @burtek @davidkevork @JoshuaScript +/types/react-infinite-scroller/ @Lapanti @psrebniak @WrathZA /types/react-input-autosize/ @jsonunger @franklixuefei /types/react-input-calendar/ @stepancar /types/react-input-mask/v1/ @apare /types/react-input-mask/ @apare @dima7a14 +/types/react-instantsearch/ @gburgett @jpowell +/types/react-instantsearch-core/ @gburgett @jpowell +/types/react-instantsearch-dom/ @gburgett @jpowell +/types/react-instantsearch-native/ @gburgett @jpowell /types/react-intl/v1/ @bgrieder /types/react-intl/ @bgrieder @cdroulers @gyzerok @tillwolff @LKay @bhouser @kristerkari @formatlos @lukyth /types/react-intl-redux/ @LKay -/types/react-is/ @AviVahl +/types/react-is/ @AviVahl @christianchown /types/react-is-deprecated/ @seansfkelley -/types/react-joyride/ @kdy1 +/types/react-joyride/ @kdy1 @kamranayub /types/react-js-pagination/ @netoisc /types/react-json/ @spielc /types/react-json-pretty/ @LKay /types/react-json-tree/ @gnestor -/types/react-jsonschema-form/ @iamdanfox @sirreal @iplus26 @KurtPreston @phbou72 @LucianBuzzo +/types/react-jsonschema-form/ @iamdanfox @iplus26 @KurtPreston @phbou72 @LucianBuzzo @sthenault @sbusch +/types/react-jss/ @eps1lon /types/react-lazyload/ @m0a /types/react-lazylog/ @benjaminRomano /types/react-leaflet/ @danzel @davschne @yuit @@ -3691,24 +3842,26 @@ /types/react-list/ @buptyyf @tomshen /types/react-loadable/ @Kovensky @odensc @ianks @tlaziuk @iMobs /types/react-loader/ @artfuldev +/types/react-lottie/ @Kana00 @Ricki-BumbleDev /types/react-mailchimp-subscribe/ @osdiab /types/react-map-gl/ @rimig @fnberta /types/react-maskedinput/ @LKay @lavoaster @CarlosBonetti /types/react-mce/ @morphologue /types/react-mdl/ @bradzacher /types/react-measure/ @asvetliakov @marcfallows +/types/react-mentions/ @activescott /types/react-mixin/ @tkqubo -/types/react-modal/ @radziksh @drewnoakes @homburg @ttamminen @hallowatcher @peterblazejewicz +/types/react-modal/ @radziksh @drewnoakes @homburg @ttamminen @hallowatcher @peterblazejewicz @jpowell /types/react-motion/ @stepancar @asvetliakov @dimitarnestorov /types/react-motion-slider/ @asvetliakov /types/react-motion-ui-pack/ @jsonunger -/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk @mvdam +/types/react-native/ @alloy @huhuanming @iRoachie @skn0tt @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk @mvdam @esemesek @mrnickel /types/react-native-android-taskdescription/ @christianchown /types/react-native-auth0/ @ascariandrea /types/react-native-autocomplete-input/ @ifiokjr /types/react-native-background-timer/ @chillkroeteTTS /types/react-native-bluetooth-serial/ @RodrigoAWeber -/types/react-native-calendars/ @Tyler-Zhang @DavidNorena +/types/react-native-calendars/ @Tyler-Zhang @DavidNorena @FabianMeul /types/react-native-communications/ @huhuanming @PaitoAnderson /types/react-native-custom-tabs/ @philnova /types/react-native-datepicker/ @jacobbaskin @@ -3723,8 +3876,9 @@ /types/react-native-fbsdk/ @ifiokjr /types/react-native-fetch-blob/ @MNBuyskih /types/react-native-fs/ @pocesar @josephroque -/types/react-native-google-signin/ @j-fro +/types/react-native-google-signin/ @j-fro @bm-software @christianchown @echentw /types/react-native-htmlview/ @ifiokjr +/types/react-native-huawei-protected-apps/ @christianchown /types/react-native-i18n/ @VincentLanglet /types/react-native-indicators/ @ifiokjr /types/react-native-keep-awake/ @huhuanming @@ -3746,7 +3900,10 @@ /types/react-native-popup-dialog/ @PaitoAnderson @connectdotz @bm-software /types/react-native-push-notification/ @PaitoAnderson @tomSawkins /types/react-native-qrcode/ @plantain-00 +/types/react-native-referrer/ @christianchown +/types/react-native-restart/ @christianchown /types/react-native-safari-view/ @mrand01 +/types/react-native-scaled-image/ @Jaeger25 /types/react-native-scrollable-tab-view/ @CaiHuan @egorshulga /types/react-native-sensor-manager/ @SahinVardar /types/react-native-settings-list/ @MrLuje @@ -3756,6 +3913,7 @@ /types/react-native-sortable-list/ @sivolobov @RookY2K /types/react-native-sqlite-storage/ @dryganets @cavarzan /types/react-native-star-rating/ @iRoachie +/types/react-native-status-bar-height/ @fiznool /types/react-native-svg-charts/ @krzysztof-miemiec /types/react-native-svg-uri/ @iRoachie /types/react-native-swiper/ @CaiHuan @huhuanming @mhcgrq @@ -3764,11 +3922,12 @@ /types/react-native-text-input-mask/ @RodrigoAWeber /types/react-native-toast-native/ @bm-software /types/react-native-touch-id/ @huhuanming @gazaret @jinshin1013 +/types/react-native-uuid-generator/ @burtek /types/react-native-vector-icons/ @iRoachie @timwangdev /types/react-native-version-number/ @VincentLanglet /types/react-native-video/ @huhuanming /types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi -/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj @TizioFittizio @stigi @LinusU @jshosomichi @jakebooyah @brunoro @DenisFrezzato @mickaelw +/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj @TizioFittizio @stigi @LinusU @jshosomichi @jakebooyah @brunoro @DenisFrezzato @mickaelw @maxdavidson @jkillian /types/react-navigation-material-bottom-tabs/ @iRoachie /types/react-no-ssr/ @rafalfilipek /types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar @@ -3776,8 +3935,9 @@ /types/react-notify-toast/ @klaascuvelier /types/react-numeric-input/ @heatherbooker @akx /types/react-onclickoutside/v5/ @LKay -/types/react-onclickoutside/ @LKay -/types/react-onsenui/ @salim7 @jemmyw +/types/react-onclickoutside/ @LKay @surgeboris +/types/react-onsenui/ @salim7 @jemmyw @lirbank +/types/react-outside-click-handler/ @zubivan /types/react-overlays/ @aaronbeall @vitosamson /types/react-owl-carousel/ @tbounsiar @igorissen @KennethanCeyer /types/react-paginate/v4/ @deevus @wouterhardeman @pegel03 @archy-bold @@ -3793,6 +3953,7 @@ /types/react-qr-reader/ @davidkevork /types/react-radio-group/ @jsonunger /types/react-recaptcha/ @mhegazy @zzanol +/types/react-reconciler/ @Methuselah96 /types/react-redux/v5/ @tkqubo @thasner @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva /types/react-redux/ @tkqubo @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva @kallikrein @val1984 @jrakotoharisoa @apapirovski /types/react-redux-epic/ @forabi @@ -3806,8 +3967,8 @@ /types/react-responsive/ @asvetliakov @alechill @xaviergonz /types/react-rnd/ @Ragg- @fsubal @zyh825 /types/react-router/v2/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov -/types/react-router/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @ssorallen @gillchristian -/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina @pret-a-porter @t49tran +/types/react-router/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @ssorallen @gillchristian @nulladdict +/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina @pret-a-porter @t49tran @8enSmith /types/react-router-bootstrap/ @vlesierse @LKay @olmobrutall /types/react-router-config/ @lith-light-g @johnnyreilly /types/react-router-dom/ @tkrotoff @huy-nguyen @p-jackson @johnnyreilly @@ -3839,7 +4000,9 @@ /types/react-sparklines/ @henrinormak /types/react-spinkit/v1/ @tkqubo @mleko @pelotom /types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol +/types/react-star-rating-component/ @marpstar /types/react-sticky/ @curtisw0 @ajhyndman +/types/react-sticky-box/ @koss-lebedev /types/react-sticky-el/ @jbraithwaite /types/react-stickynode/ @tstirrat /types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha @9y5 @thchia @@ -3849,10 +4012,11 @@ /types/react-swipe/ @DeividasBakanas /types/react-swipeable/ @GiedriusGrabauskas @mctep @horiuchi /types/react-swipeable-views/ @mxl @DeividasBakanas -/types/react-syntax-highlighter/ @NoHomey -/types/react-table/ @royxue @psakalo @Havret +/types/react-syntax-highlighter/ @NoHomey @ajgamble-milner +/types/react-table/ @royxue @psakalo @Havret @andys8 /types/react-table-filter/ @gjsln -/types/react-tabs/ @danez +/types/react-tabs/ @danez @Equationist +/types/react-tag-autocomplete/ @jlismore /types/react-tag-input/ @Ogglas @jankarres @matthewberryman /types/react-tagcloud/ @wassname /types/react-tagsinput/ @mykter @@ -3862,6 +4026,7 @@ /types/react-tether/ @ryprice /types/react-text-mask/ @guilhermehubner @cavarzan @needpower /types/react-textarea-autosize/ @asvetliakov @zry656565 +/types/react-timeago/ @koss-lebedev /types/react-timeout/ @kerwynrg /types/react-toastify/ @icopp /types/react-toastr/ @shssoichiro @DanRegazzi @@ -3880,11 +4045,13 @@ /types/react-virtual-keyboard/ @bsurai /types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @kraenhansen @Stevearzh @mgoszcz2 @brandonhall /types/react-virtualized-select/ @seansfkelley +/types/react-visibility-sensor/ @JRasmusBm /types/react-webcam/ @squat /types/react-weui/ @tairan -/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya @MBillemaz +/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya @MBillemaz @georg94 /types/react-widgets-moment/ @dawnmist /types/react-window/ @martynaskadisa +/types/react-window-size/ @jakejrichards /types/react-youtube/ @kgtkr /types/react-youtube-embed/ @charles-salmon /types/reactable/ @spielc @@ -3901,16 +4068,20 @@ /types/readline-sync/ @jonestristand /types/readline-transform/ @dex4er /types/reapop/ @Barrokgl +/types/rebass/ @ryee-dev +/types/rebass__grid/ @antonvasin @vittorio @lhache @lavoaster /types/recaptcha2/ @l-jonas /types/recase/ @18steps /types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan @pkeuter @jrsaunde @paulmelnikow @crusectrl @apalugniok +/types/recharts-scale/ @johnnyreilly /types/recluster/ @dex4er -/types/recompose/ @iskandersierra @mrapogee @clayne11 @Pajn @lucasterra +/types/recompose/ @iskandersierra @mrapogee @clayne11 @Pajn @lucasterra @brian-lives-outdoors /types/reconnect-core/ @thw0rted /types/reconnectingwebsocket/ @nguarracino +/types/recorder-js/ @higuri /types/recursive-readdir/v1/ @elisee /types/recursive-readdir/ @elisee @MicahZoltu -/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski +/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski @1pete /types/redis-errors/ @43081j /types/redis-mock/ @BendingBender /types/redis-rate-limiter/ @westy92 @@ -3921,7 +4092,7 @@ /types/reduce-reducers/ @huy-nguyen /types/redux-action/ @newraina /types/redux-action-utils/ @tkqubo -/types/redux-actions/ @jaysoo @alexgorbatchev @alechill @alexey-pelykh +/types/redux-actions/ @jaysoo @alexgorbatchev @alechill @alexey-pelykh @7hi4g0 /types/redux-async-queue/ @andreiho /types/redux-auth-wrapper/v1/ @LKay /types/redux-auth-wrapper/ @LKay @@ -3931,14 +4102,15 @@ /types/redux-devtools-dock-monitor/ @mc-petry /types/redux-devtools-log-monitor/ @mc-petry /types/redux-doghouse/ @BendingBender -/types/redux-first-router/ @Valbrand @viggyfresh @janb87 @corydeppen @jscinoz +/types/redux-first-router/ @Valbrand @viggyfresh @janb87 @corydeppen @jscinoz @surgeboris /types/redux-first-router-link/ @janb87 /types/redux-first-router-restore-scroll/ @icopp /types/redux-first-routing/ @tlaziuk /types/redux-form/v4/ @aikoven /types/redux-form/v6/ @carsonf @aikoven @LKay @bancek -/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @ethanresnick @reggino @maddijoyce -/types/redux-immutable/ @oizie @sebald @gavingregory +/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @ethanresnick @reggino @maddijoyce @smifun +/types/redux-immutable/v3/ @oizie @sebald @gavingregory +/types/redux-immutable/ @oizie @sebald @gavingregory @lukyth /types/redux-immutable-state-invariant/ @remojansen @highflying /types/redux-infinite-scroll/ @silkyfray /types/redux-injectable-store/ @unindented @@ -3980,13 +4152,15 @@ /types/relateurl/ @tkrotoff /types/relaxed-json/ @18steps /types/relay-runtime/ @voxmatt @alloy +/types/rellax/ @shermendev /types/remarkable/ @makepost /types/remote-redux-devtools/ @ColinEberhardt @unindented @mamodom @colindekker /types/remove-markdown/ @RagibHasin /types/rename/ @Aankhen /types/replace-ext/ @DeividasBakanas +/types/replacestream/ @dex4er /types/req-cwd/ @Alorel -/types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens @lookfirst @mastermatt @josecolella +/types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens @lookfirst @mastermatt @josecolella @murbanowicz /types/request-as-curl/ @atd-schubert /types/request-ip/ @mrhen /types/request-promise/ @cglantschnig @joeskeen @AyaMorisawa @mastermatt @@ -4005,7 +4179,7 @@ /types/resolve/ @marionebl @ajafff /types/resolve-from/ @unional /types/resourcejs/ @shaunluttin -/types/response-time/ @urossmolnik @TonyPythoneer +/types/response-time/ @urossmolnik @TonyPythoneer @danmana /types/rest/ @Nemo157 /types/restangular/ @borisyankov /types/restful.js/ @tkqubo @@ -4043,6 +4217,7 @@ /types/rmfr/ @pluma /types/roads/ @dancespiele /types/roads-server/ @dancespiele +/types/rocksdb/ @MeirionHughes @danwbyrne /types/roll/ @icopp /types/rolling-rate-limiter/ @l-jonas /types/rollup-plugin-json/ @asmockler @hotell @@ -4053,7 +4228,7 @@ /types/round-to/ @seangenabe /types/route-parser/ @ianks @bobbuehler /types/routie/ @Adilson -/types/royalslider/ @csrakowski +/types/royalslider/ @csrakowski @sKopheK /types/rpio/ @DominikPalo @Pencl /types/rrc/ @DeividasBakanas /types/rsmq/ @MugeSo @@ -4109,11 +4284,13 @@ /types/satnav/ @DotNetNerd /types/saywhen/ @SeanSobey /types/scalike/ @ryoppy +/types/schedule/ @Methuselah96 +/types/scheduler/ @Methuselah96 /types/schema-registry/ @bonzzy /types/schwifty/ @ozum /types/scoped-http-client/ @mattvperry @rianadon /types/screenfull/ @icholy @lionelb @joelshepherd -/types/screeps/ @MarkoSulamagi @NhanHo @bryanbecker @resir014 @Arcath @apemanzilla +/types/screeps/ @MarkoSulamagi @NhanHo @bryanbecker @resir014 @Arcath @dmarcuse /types/screeps-profiler/ @ramblurr /types/scriptjs/ @ssttevee /types/scroll-into-view/ @zivni @@ -4126,7 +4303,8 @@ /types/scryptsy/ @micksatana /types/sdp-transform/ @loc /types/seamless/ @danmana -/types/seamless-immutable/ @alex3165 @xsburg @geirsagberg +/types/seamless-immutable/ @alex3165 @xsburg @geirsagberg @RMHonor +/types/season/ @dex4er /types/secp256k1/ @anler /types/seed-random/ @l-jonas /types/seededshuffle/ @urish @@ -4169,33 +4347,36 @@ /types/send/ @MikeJerred /types/seneca/ @psnider @kevynb /types/sequelize/v3/ @samuelneff @codeanimal @drinchev @morpheusxaut @torhal -/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd @nrschultz @thomas-b +/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd @nrschultz @thomas-b @Antoine38660 /types/sequelize-cursor-pagination/ @pilagod /types/sequelize-fixtures/ @cschwarz /types/sequencify/ @npenin /types/sequester/ @Strate /types/serialize-error/ @thomasthiebaud -/types/serialize-javascript/ @lith-light-g +/types/serialize-javascript/ @lith-light-g @Pochodaydayup /types/serialport/v4/ @codefoster +/types/serialport/v6/ @codefoster @apearson /types/serialport/ @codefoster @apearson /types/serve-favicon/ @urossmolnik /types/serve-index/ @tkrotoff /types/serve-static/ @urossmolnik @LinusU /types/server/ @sant123 @iddan /types/server-destroy/ @gyszalai +/types/serverless/ @hassankhan /types/servicenow/ @bryceg /types/session-file-store/ @blendsdk @rokt33r /types/set-cookie-parser/ @nickp10 /types/set-value/ @DanielRosenwasser /types/settings/ @shreyjain1994 /types/sha1/ @arcdev1 +/types/sha256/ @nhardy /types/shallow-equals/ @rsolomon /types/shallowequal/ @seansfkelley /types/shapefile/ @DenisCarriere @Thw0rted /types/sharedb/ @soney /types/sharedworker/ @nakakura /types/sharepoint/ @gandjustas @andrei-markeev @baywet @teroarvola @dennispg -/types/sharp/ @lith-light-g @wooseopkim +/types/sharp/ @lith-light-g @wooseopkim @BTOdell /types/sheetify/ @toddself /types/shell-escape/ @nenadalm /types/shell-quote/ @jason0x43 @@ -4206,10 +4387,12 @@ /types/shipit-utils/ @cyrilschumacher /types/shopify-buy/ @openminder @straiforos @totemika /types/shortid/ @stpettersens @despairblue -/types/shot/ @AJamesPhillips +/types/shot/v3/ @AJamesPhillips @SimonSchick +/types/shot/ @AJamesPhillips @SimonSchick /types/should-sinon/ @Arylo /types/showdown/ @cbowdon @tan9 @arielsaldana /types/shrink-ray/ @forabi +/types/shuffle-seed/ @LeartS /types/siema/ @Irmiz @0x6368656174 @samnau /types/siesta/ @bquarmby /types/sigmajs/ @qinfchen @@ -4234,9 +4417,10 @@ /types/simplemde/ @Scalesoft /types/simplesmtp/ @rogierschouten /types/simplestorage.js/ @axelcostaspena @mxl +/types/sindresorhus__df/ @whatknight /types/single-line-log/ @ffflorian /types/single-spa-react/ @Garrett-Smith-iq -/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg +/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg @gjednaszewski /types/sinon-as-promised/ @igrayson /types/sinon-chai/v2/ @kazimanzurrashid @jedmao /types/sinon-chai/ @kazimanzurrashid @jedmao @elpdpt @@ -4259,12 +4443,12 @@ /types/slack-winston/ @BlueHatbRit /types/slackdown/ @nju33 /types/slackify-html/ @hypexr -/types/slate/ @andykent @majelbstoat @JanLoebel @YangusKhan @kalley @Kornil @isubasti +/types/slate/ @andykent @majelbstoat @JanLoebel @YangusKhan @kalley @Kornil @isubasti @sgreav /types/slate-base64-serializer/ @YangusKhan /types/slate-html-serializer/ @YangusKhan /types/slate-irc/ @elisee -/types/slate-plain-serializer/ @YangusKhan -/types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan @isubasti +/types/slate-plain-serializer/ @YangusKhan @mkiefel +/types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan @isubasti @sgreav /types/sleep/ @rajarz /types/slickgrid/ @jbaldwin /types/slideout/ @ToastHawaii @@ -4281,7 +4465,9 @@ /types/snazzy-info-window/ @milosd92 /types/snekfetch/ @ANekoIsFineToo @ShayBox @Dev-Yukine /types/snoowrap/ @vitosamson @TheAppleFreak +/types/snowball-stemmers/ @ryanvolum /types/snowboy/ @dolanmiu +/types/socket.io/v1/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi @BrainMaestro /types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi @BrainMaestro /types/socket.io-client/ @progre @divillysausages @florentpoujol /types/socket.io-p2p/ @saenglert @@ -4297,8 +4483,9 @@ /types/solidity-parser-antlr/ @LogvinovLeon @albrow /types/solr-client/ @liul85 /types/solution-center-communicator/ @dami-gg +/types/sonic-boom/ @alferpal /types/sort-array/ @mrmlnc -/types/sortablejs/ @Maw-Fox +/types/sortablejs/ @Maw-Fox @maartenstaa /types/soundmanager2/ @elton2048 /types/soupbintcp/ @jewbre /types/source-list-map/ @e-cloud @@ -4325,7 +4512,7 @@ /types/spotify-api/ @skovmand /types/spotify-web-playback-sdk/ @Festify @mraerino @NeoLegends /types/sprintf/ @soywiz @BendingBender -/types/sprintf-js/ @jasonswearingen @BendingBender +/types/sprintf-js/ @jasonswearingen @BendingBender @cdagli /types/sql-bricks/ @adn05 @paleo /types/sql.js/ @Hozuki /types/sqlanywhere/ @pkeuter @@ -4334,7 +4521,7 @@ /types/squirejs/ @bradleyayers /types/srp/ @Patman64 /types/ssh-key-decrypt/ @BendingBender -/types/ssh2/ @tkQubo @rbuckton +/types/ssh2/ @tkQubo @rbuckton @wrboyce /types/ssh2-sftp-client/ @igrayson @ascariandrea @kartik2406 /types/ssh2-streams/ @rbuckton /types/sshpk/ @mabels @@ -4346,6 +4533,8 @@ /types/stampit/v2/ @koresar /types/stampit/ @koresar @lummish /types/stamplay-js-sdk/ @ridermansb +/types/standard-error/ @roblabat +/types/standard-http-error/ @roblabat /types/starwars-names/ @claasahl /types/stat-mode/ @BendingBender /types/stats.js/ @gregolai @hberntsen @danvk @@ -4358,13 +4547,16 @@ /types/steam-totp/ @phenomax /types/steamid/ @Slessi /types/steed/ @Paul-Isache -/types/stellar-sdk/ @carl-foster @tristonj @pselden @maxbause +/types/stellar-sdk/ @carl-foster @tristonj @pselden @maxbause @charlie-wasp /types/stemmer/ @will-ockmore /types/sticky-cluster/ @paustint +/types/stompit/ @DanielRose /types/stompjs/ @jimic @Dr4k4n /types/stoppable/ @EricByers +/types/storage-helper/ @ajafff /types/store/ @vbortone @harry0000 @Ky6uk /types/storybook-addon-jsx/ @jameslnewell +/types/storybook-readme/ @lonyele /types/storybook__addon-a11y/ @hyunseob /types/storybook__addon-actions/ @joscha @jicjjang /types/storybook__addon-backgrounds/ @hyunseob @@ -4379,6 +4571,7 @@ /types/storybook__react/ @joscha @wapgear /types/storybook__react-native/ @joscha @wapgear @alechill @iRoachie /types/storybook__vue/ @pntgupta +/types/stream-array/ @Tyler-Murphy /types/stream-buffers/ @Jason3S /types/stream-chain/ @uhop /types/stream-csv-as-json/ @uhop @@ -4397,8 +4590,10 @@ /types/strftime/ @cyrilschumacher /types/strict-uri-encode/ @hoishin /types/string/ @basp +/types/string-argv/ @vladimir-tikhonov /types/string-format/ @lal12 /types/string-hash/ @ethanrubio +/types/string-replace-webpack-plugin/ @pd4d10 /types/string-similarity/ @ragtime /types/string-template/ @TonyPythoneer /types/string-width/ @jacobbubu @@ -4407,7 +4602,7 @@ /types/strip-ansi/ @mhegazy /types/strip-bom/ @mhegazy /types/strip-json-comments/ @dmoonfire -/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly @tzarger +/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly @tzarger @ifiokjr /types/stripe-checkout/ @cgwrench /types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak /types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak @@ -4416,16 +4611,22 @@ /types/strong-error-handler/ @blankstar85 /types/strong-log-transformer/ @azasypkin /types/strophe/ @DavidKDeutsch +/types/strophe.js/ @DavidKDeutsch /types/structured-source/ @azu -/types/styled-components/ @Igorbek @Igmat +/types/styled-components/v3/ @Igorbek @Igmat +/types/styled-components/ @Igorbek @Igmat @lavoaster /types/styled-jsx/ @R1ZZU -/types/styled-system/ @maxdeviant @phobon @zephraph @damassi @alloy @maoueh @lavoaster +/types/styled-react-modal/ @Lavoaster +/types/styled-system/ @maxdeviant @phobon @zephraph @damassi @alloy @maoueh @lavoaster @jschuler +/types/styled-theming/ @ArjanJ /types/stylelint/v7/ @alan-agius4 -/types/stylelint/ @alan-agius4 +/types/stylelint/ @alan-agius4 @filipsalpe /types/stylelint-webpack-plugin/ @bahlo +/types/stylenames/ @bengry /types/stylus/ @SomaticIT /types/subscribe-ui-event/ @wangcheng678 /types/subsume/ @BendingBender +/types/subtitle/ @jenglamlow /types/succinct/ @EnableSoftware /types/sudo-block/ @BendingBender /types/suitescript/ @darrenhillconsulting @@ -4466,7 +4667,7 @@ /types/swagger-parser/ @Tobias4872 @EricHenry /types/swagger-restify-mw/ @micmro /types/swagger-sails-hook/ @micmro -/types/swagger-schema-official/ @mohsen1 @bsouthga @nimerritt +/types/swagger-schema-official/ @mohsen1 @bsouthga @nimerritt @mauriedo /types/swagger-tools/ @bricka /types/swagger-ui-dist/ @haowen737 /types/swagger-ui-express/ @dmitryrogozhny @@ -4478,7 +4679,7 @@ /types/swig-email-templates/ @mrhen @micksatana /types/swipe/ @kant2002 /types/swiper/v3/ @sgaliano @lucax88x -/types/swiper/ @sgaliano @lucax88x @ematseruk @odahcam +/types/swiper/ @sgaliano @lucax88x @ematseruk @odahcam @jmca /types/swipeview/ @borisyankov /types/switchery/ @bgrieder @claylaut /types/swiz/ @jedigo @@ -4486,6 +4687,7 @@ /types/synaptic/ @ToastHawaii @austincummings /types/systeminformation/ @PixelcrabAT /types/systemjs/ @ludohenin @NathanWalker @GiedriusGrabauskas @aluanhaddad +/types/tabbable/ @mokkan /types/table/ @evanshortiss @mrmlnc /types/tableau/ @protip /types/tabris-plugin-firebase/ @eclipsesource @@ -4500,6 +4702,7 @@ /types/tar-stream/ @glicht /types/task-graph-runner/ @mgroenhoff /types/tcp-ping/ @stegano +/types/tcp-port-used/ @gautejohan /types/teddy/ @lannonbr /types/tedious/ @rogierschouten @cjthompson @v-suhame /types/tedious-connection-pool/ @sandorfr @@ -4507,24 +4710,29 @@ /types/temp/ @DanielRosenwasser /types/temp-write/ @BendingBender /types/tempfile/ @SamVerschueren @BendingBender -/types/tempy/ @douglasduteil +/types/tempy/ @douglasduteil @maistho /types/terminal-menu/ @aravindarun +/types/tern/ @nkappler +/types/terser/ @JordiAnderl +/types/test-console/ @roberto @guidoux @gbmoretti /types/test-listen/ @stephenmathieson /types/testingbot-api/ @timbru31 /types/tether/ @adidahiya /types/tether-drop/ @adidahiya /types/tether-shepherd/ @mtgibbs /types/text-buffer/ @GlenCFL -/types/text-encoding/ @pine613 @mohsen1 +/types/text-encoding/ @pine613 @mohsen1 @nwmqpa /types/text-encoding-utf-8/ @trxcllnt /types/text-table/ @saadq /types/textarea-caret/ @shiftkey /types/textract/ @lal12 /types/textversionjs/ @aaronosher +/types/texzilla/ @m93a /types/tgfancy/ @Dabolus /types/theming/ @eps1lon +/types/theo/ @petekp /types/thepiratebay/ @jsorrell -/types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv @apurvaojas @NotWoods @sethk @elk941 @Methuselah96 @Dukuo +/types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv @apurvaojas @NotWoods @sethk @elk941 @Methuselah96 @Dukuo @JulianSSS @devilsparta /types/thrift/ @kamek-pf @kevin-greene-ck @jessezhang91 /types/throng/ @cyrilschumacher @tatethurston /types/throttle/ @BendingBender @@ -4545,6 +4753,7 @@ /types/tinajs__tina-redux/ @Jimexist /types/tinder/ @pingec /types/tingle.js/ @ajafff +/types/tiny-async-pool/ @krlwlfrt /types/tiny-secp256k1/ @eduhenke /types/tiny-slider-react/ @screendriver /types/tinycolor2/ @M-Zuber @geertjansen @nvh @Ailrun @@ -4571,6 +4780,7 @@ /types/topojson-simplify/ @denisname @ricardo-mello /types/topojson-specification/ @denisname /types/toposort/ @danwbyrne +/types/torrent-search-api/ @ngirardin /types/torrent-stream/ @xstoudi /types/touch/ @mizunashi-mana @BendingBender /types/touch-events/ @kevinb7 @@ -4587,6 +4797,7 @@ /types/travis-fold/ @andy-ms /types/trayballoon/ @korve /types/tress/ @sindilevich +/types/trianglify/ @unindented /types/trim/ @skysteve /types/triple-beam/ @danwbyrne /types/triplesec/ @threesquared @@ -4657,9 +4868,9 @@ /types/unzip/ @coding2012 /types/unzipper/ @s73obrien @natemara @bartje321 /types/update-notifier/v1/ @vvakame @nchen63 -/types/update-notifier/ @vvakame @nchen63 @bitjson +/types/update-notifier/ @vvakame @nchen63 @bitjson @grinich /types/uploadcare/ @jineshshah36 -/types/upng-js/ @plantain-00 +/types/upng-js/ @plantain-00 @pineapplemachine /types/uppercamelcase/ @plantain-00 /types/urbanairship-cordova/ @Justin-Credible /types/uri-templates/ @Bartvds @barnski @@ -4693,6 +4904,7 @@ /types/uuid-parse/ @screendriver /types/uuid-validate/ @HiromiShikata /types/uws/ @plantain-00 @orblazer +/types/v-chart-plugin/ @natemara /types/valdr/ @ilbertz /types/valdr-message/ @ilbertz /types/valerie/ @conficient @@ -4760,6 +4972,7 @@ /types/w3c-web-usb/ @larsgk /types/waitme/ @totpero /types/wake_on_lan/ @SrTobi +/types/walk/ @poppa /types/wallabyjs/ @andrewconnell /types/wallpaper/ @BendingBender /types/wampy/ @KSDaemon @@ -4769,6 +4982,7 @@ /types/watchpack/ @e-cloud /types/waterline/ @arvitaly /types/watson-developer-cloud/ @waldo000000 @Naktibalda +/types/wavesurfer.js/ @higuri /types/waypoints/ @dominikbulaj @Koloto @evil-shrike /types/wcwidth/ @rokt33r /types/weak/ @int0h @@ -4776,7 +4990,7 @@ /types/web-animations-js/ @kritollm /types/web-bluetooth/ @urish /types/web-push/ @paullessing -/types/web3/ @simon-jentzsch @nitzantomer @zurbo @yxliang01 @phra @naddison36 @icaroharry @linusnorton @jpeletier @anneau @matrushka @andrevmatos @levino @zlumer @archangel-irk +/types/web3/ @simon-jentzsch @nitzantomer @zurbo @yxliang01 @phra @naddison36 @icaroharry @linusnorton @jpeletier @anneau @matrushka @andrevmatos @levino @zlumer @archangel-irk @sogasg @donamk @dkent600 @nerddan /types/web3-eth-abi/ @LogvinovLeon /types/web3-provider-engine/ @LogvinovLeon /types/webappsec-credential-management/ @iainmcgin @@ -4785,14 +4999,14 @@ /types/webcl/ @NCARalph /types/webcomponents.js/ @adidahiya /types/webcrypto/ @iislucas -/types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 @phil-lgr +/types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 @daveparslow @phil-lgr /types/webfontloader/ @doskallemaskin /types/webgl-ext/ @zenmumbler /types/webgl2/ @nkemnitz @karhu /types/webidl2/ @saschanaz /types/webmidi/ @lostfictions -/types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @christophehurpeau -/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau @ZSkycat @johnnyreilly +/types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @christophehurpeau @rwaskiewicz @kuehlein +/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau @ZSkycat @johnnyreilly @rwaskiewicz @kuehlein /types/webpack-assets-manifest/ @FranklinWhale /types/webpack-bundle-analyzer/ @kryops /types/webpack-chain/ @eirikurn @psachs21 @@ -4816,9 +5030,11 @@ /types/webpack-serve/ @rynclark @Jokcy @ZSkycat /types/webpack-sources/ @e-cloud @chriseppstein /types/webpack-stream/ @iclanton @bumbleblym +/types/webpack-subresource-integrity/ @huan086 /types/webpack-validator/ @deevus /types/webpackbar/ @rynclark /types/webpagetest/ @ksm2 +/types/webprogbase-console-view/ @veetaha /types/webrtc/ @nakakura /types/webscopeio__react-textarea-autocomplete/ @michauzo /types/websequencediagrams/ @ffflorian @@ -4864,6 +5080,7 @@ /types/wnumb/ @acoreyj /types/wonder.js/ @yyc-git /types/word-list-json/ @dovidm +/types/word2vector/ @renekeijzer /types/wordcloud/ @joeskeen /types/words-to-numbers/ @James-Frowen /types/workbox-sw/ @wessberg @@ -4905,18 +5122,20 @@ /types/xsockets/ @pushplay /types/xxhashjs/ @mDibyo /types/yallist/ @BendingBender +/types/yaml/ @ikatyang @ColinBradley /types/yandex-maps/ @Delagen /types/yandex-money-sdk/ @chrootsu /types/yar/ @SimonSchick /types/yargs/v8/ @poelstra @mizunashi-mana @pushplay @jeffkenney /types/yargs/v10/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC /types/yargs/v11/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC -/types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC +/types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC @tkazec /types/yargs-interactive/ @szeck87 +/types/yargs-parser/ @milesj /types/yauzl/ @ffflorian /types/yauzl-promise/ @dlee-nvisia /types/yayson/ @Codesleuth -/types/yazl/ @taoqf +/types/yazl/ @taoqf @seangenabe /types/ydn-db/ @yathit @gabrielmaldi /types/yeoman-generator/ @armorik83 @janslow @ikatyang /types/yeoman-test/ @ikatyang @@ -4930,7 +5149,7 @@ /types/youtube/ @DazWilkin @JoshuaKGoldberg @eliotfallon213 @terrymun /types/youtube-dl/ @bsurai /types/yui/ @giabao -/types/yup/ @dhardtke @vtserman @MoretonBayRC @sseppola +/types/yup/ @dhardtke @vtserman @MoretonBayRC @sseppola @YashdalfTheGray /types/z-schema/ @pgonzal /types/zapier-platform-core/ @bradleyayers /types/zeit__next-typescript/ @icopp @@ -4943,6 +5162,7 @@ /types/zeromq/ @davemckeown @erikma @TitaneBoy /types/zip-webpack-plugin/ @blaise-io /types/zip.js/ @lgrignon +/types/zipcelx/ @aleburato /types/zipcodes/ @headdetect @dobesv /types/zipkin-context-cls/ @plantain-00 /types/zipkin-instrumentation-express/ @plantain-00 diff --git a/.gitignore b/.gitignore index ac63b6f6b5..079ad27699 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ npm-debug.log .settings/launch.json .vs .vscode +.history # yarn yarn.lock diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..9cf9495031 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false \ No newline at end of file diff --git a/README.es.md b/README.es.md index c3cff967db..df675cbe41 100644 --- a/README.es.md +++ b/README.es.md @@ -22,15 +22,15 @@ Este es el método preferido. Solo está disponible para usuarios TypeScript 2.0 npm install --save-dev @types/node ``` -Los types deberían ser incluidos automaticamente por el compilador. +Los types deberían ser incluidos automáticamente por el compilador. Vea más en el [manual](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html). -Para un paquete NPM "foo", Estos `typings` estarán en "@types/foo". +Para un paquete NPM "foo", estos `typings` estarán en "@types/foo". Si no puedes encontrar tu paquete, búscalo en [TypeSearch](https://microsoft.github.io/TypeSearch/). Si aún no puedes encontrarlo, comprueba si el paquete ya [incluye](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) los typings. Esto es provisto usualmente en el campo `"types"` o `"typings"` en el `package.json`, -o solo busca por cualquier archivo ".d.ts" en el paquete e incluyelo manualmente con un `/// `. +o solo busca por cualquier archivo ".d.ts" en el paquete e inclúyelo manualmente con un `/// `. ### Otros métodos @@ -39,7 +39,7 @@ Estos pueden ser utilizados por TypeScript 1.0. * [Typings](https://github.com/typings/typings) * ~~[NuGet](http://nuget.org/packages?q=DefinitelyTyped)~~ (use las alternativas preferidas, la publicación DT type de nuget ha sido desactivada) -* Descarguelo manualmente desde la `master` branch de este repositorio +* Descárguelo manualmente desde la `master` branch de este repositorio Tal vez debas añadir manualmente las [referencias](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). @@ -88,7 +88,7 @@ Primero, haz un [fork](https://guides.github.com/activities/forking/) en este re * `cd types/my-package-to-edit` * Haz cambios. Recuerda editar las pruebas. Si realiza cambios importantes, no olvide [actualizar una versión principal](#quiero-actualizar-un-paquete-a-una-nueva-versión-principal). -* También puede que quieras añadirte la sección "Definitions by" en el encabezado del paquete. +* También puede que quieras añadirle la sección "Definitions by" en el encabezado del paquete. - Esto hará que seas notificado (a través de tu nombre de usuario en GitHub) cada vez que alguien haga un pull request o issue sobre el paquete. - Haz esto añadiendo tu nombre al final de la línea, así como en `// Definitions by: Alice , Bob `. - O si hay más personas, puede ser multiline @@ -109,7 +109,7 @@ Si no lo hace, puedes hacerlo en el comentario asociado con el PR. Si eres el autor de la librería, o puedes hacer un pull request a la biblioteca, [bundle types](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) en vez de publicarlo en DefinitelyTyped. Si estás agregando typings para un paquete NPM, crea un directorio con el mismo nombre. -Si el paquete al que le estás agregando typings no es para NPM, asegurate de que el nombre que escojas no genere problemas con el nombre del paquete en NPM. +Si el paquete al que le estás agregando typings no es para NPM, asegúrate de que el nombre que escojas no genere problemas con el nombre del paquete en NPM. (Puedes usar `npm info foo` para verificar la existencia del paquete `foo`.) Tu paquete debería tener esta estructura: @@ -126,7 +126,7 @@ Ve todas las opciones en [dts-gen](https://github.com/Microsoft/dts-gen). También puedes configurar el `tsconfig.json` para añadir nuevos archivos, para agregar un `"target": "es6"` (necesitado por las funciones asíncronas), para agregar a la `"lib"`, o para agregar la opción de compilación `"jsx"`. -Los miembros de DefinitelyTyped frecuentemente monitorean nuevos PRs, pero ten en mente que la cantidad de PRs podrian ralentizar el proceso. +Los miembros de DefinitelyTyped frecuentemente monitorean nuevos PRs, pero ten en mente que la cantidad de PRs podrían ralentizar el proceso. Para un buen paquete de ejemplo, vea [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js). @@ -135,7 +135,7 @@ Para un buen paquete de ejemplo, vea [base64-js](https://github.com/DefinitelyTy * Primero, sigue el consejo del [manual](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html). * Formatear: Ya sea utilizar todo en tabs, o siempre utiliza 4 espacios. -* `function sum(nums: number[]): number`: Utiliza `ReadonlyArray` si una funcion no escribe a sus parámetros. +* `function sum(nums: number[]): number`: Utiliza `ReadonlyArray` si una función no escribe a sus parámetros. * `interface Foo { new(): Foo; }`: Este define el tipo de objeto que esten nuevos. Probablemente quieras `declare class Foo { constructor(); }`. * `const Class: { new(): IClass; }`: @@ -146,7 +146,7 @@ Para un buen paquete de ejemplo, vea [base64-js](https://github.com/DefinitelyTy Un ejemplo donde un tipo de parámetro es aceptable: `function id(value: T): T;`. Un ejemplo donde no es aceptable: `function parseJson(json: string): T;`. Una excepción: `new Map()` está bien. -* Utilizando los tipos `Function` y `Object` casi nunca es una buena idea. En 99% de los casos es posible especificar un tipo más especifico. Los ejemplos son `(x: number) => number` para [funciones](http://www.typescriptlang.org/docs/handbook/functions.html#function-types) y `{ x: number, y: number }` para objetos. Si no hay certeza en lo absoluto del tipo, [`any`](http://www.typescriptlang.org/docs/handbook/basic-types.html#any) es la opción correcta, no `Object`. Si el único hecho conocido sobre el tipo es que es un objecto, usa el tipo [`object`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type), no `Object` o `{ [key: string]: any }`. +* Utilizando los tipos `Function` y `Object` casi nunca es una buena idea. En 99% de los casos es posible especificar un tipo más específico. Los ejemplos son `(x: number) => number` para [funciones](http://www.typescriptlang.org/docs/handbook/functions.html#function-types) y `{ x: number, y: number }` para objetos. Si no hay certeza en lo absoluto del tipo, [`any`](http://www.typescriptlang.org/docs/handbook/basic-types.html#any) es la opción correcta, no `Object`. Si el único hecho conocido sobre el tipo es que es un objecto, usa el tipo [`object`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type), no `Object` o `{ [key: string]: any }`. * `var foo: string | any`: Cuando es usado `any` en un tipo de unión, el tipo resultante todavía es `any`. Así que mientras la porción `string` de este tipo de anotación puede _verse_ útil, de hecho, no ofrece ningún typechecking adicional más que un simple `any`. Dependiendo de la intención, una alternativa aceptable puede ser `any`, `string`, o `string | object`. @@ -204,11 +204,11 @@ Este script utiliza [dtslint](https://github.com/Microsoft/dtslint). #### ¿Cuál es exactamente la relación entre este repositorio y los paquetes de `@types` en NPM? -La `master` branch es automaticamente publicada en el alcance de los `@types` en NPM gracias a los [types-publisher](https://github.com/Microsoft/types-publisher). +La `master` branch es automáticamente publicada en el alcance de los `@types` en NPM gracias a los [types-publisher](https://github.com/Microsoft/types-publisher). #### He enviado un pull request. ¿Cuánto tardará en ser merged? -Esto depende, pero la mayoría de los pull requests serán merged en alrededor de una semana. PRs que hayan sido aprovados por un autor listado en el encabezado de las definiciones usualmente son merged más rápidamente; PRs para nuevas definiciones tomarán más tiempo ya que requieren más revisiones de los mantenedores. Cada PR es revisado por un miembro de TypeScript o DefinitelyTyped antes de ser merged, por favor se paciente debido a que factores humanos pueden causar retrasos. Revisa el [PR Burndown Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen) para ver el progreso mientras los mantenedores trabajan on los PRs abiertos. +Esto depende, pero la mayoría de los pull requests serán merged en alrededor de una semana. PRs que hayan sido aprobados por un autor listado en el encabezado de las definiciones usualmente son merged más rápidamente; PRs para nuevas definiciones tomarán más tiempo ya que requieren más revisiones de los mantenedores. Cada PR es revisado por un miembro de TypeScript o DefinitelyTyped antes de ser merged, por favor sé paciente debido a que factores humanos pueden causar retrasos. Revisa el [PR Burndown Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen) para ver el progreso mientras los mantenedores trabajan en los PRs abiertos. #### Mi PR ha sido merged; ¿cuándo será actualizado el paquete de `@types` NPM? @@ -216,12 +216,12 @@ Los paquetes NPM deberán ser actualizados en unas cuantas horas. Si ha pasado m #### Estoy escribiendo una definición que depende de otra definición. Debería utilizar `` o una import? -Si el modulo al cual te estás refiriendo es un módulo externo (utiliza `export`), utilice una import. +Si el módulo al cual te estás refiriendo es un módulo externo (utiliza `export`), utilice una import. Si el módulo al cual te refieres es un módulo ambiente (utiliza `declare module`, o simplemente declara las globales), utilice ``. #### He notado que algunos paquetes aquí tienen `package.json`. -Normalmente no lo necesitaras. Cuando publicas un paquete normalmente nosotros automáticamente crearemos un `package.json` para eso. +Normalmente no lo necesitarás. Cuando publicas un paquete normalmente nosotros automáticamente crearemos un `package.json` para eso. Un `package.json` puede ser incluido por el bien de especificar dependencias. Aquí tienen un [ejemplo](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pikaday/package.json). No aceptamos otros campos, tales como `"description"`, para que sean definidos manualmente. Además, si necesitas referencia a una versión anterior de typings, debes hacerlo añadiendo `"dependencies": { "@types/foo": "x.y.z" }` al package.json. @@ -260,7 +260,7 @@ Cuando ya no sea un borrador, lo podremos eliminar desde DefinitelyType y hacer Si planeas continuar actualizando la versión anterior del paquete, puedes crear una subcarpeta con la versión actual p.ej. `v2`, y copia los archivos existentes. Si es así, necesitarás: 1. Actualiza las rutas relativas en `tsconfig.json` al igual que `tslint.json`. -2. Añadir reglas de mapeo de rutas para asegurart de que la prueba se está ejecutando contra la versión prevista. +2. Añadir reglas de mapeo de rutas para asegurarte de que la prueba se está ejecutando contra la versión prevista. Por ejemplo [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/history/v2/tsconfig.json) se ve así: @@ -280,24 +280,24 @@ Por ejemplo [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/Defi } ``` -Si hay otros paquetes en DefinitelyTyped que son incompatibles con la nueva versión, necesitaras mapear las rutas a la versión anterior. También deberá hacer esto para los paquetes que dependen de paquetes que dependen de una version anterior. +Si hay otros paquetes en DefinitelyTyped que son incompatibles con la nueva versión, necesitarás mapear las rutas a la versión anterior. También deberá hacer esto para los paquetes que dependen de paquetes que dependen de una version anterior. Por ejemplo, `react-router` depende de `history@2`, así que [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/tsconfig.json) tiene una ruta mapeada a "history": `[ "history/v2" ]`; transitivo así mismo, `react-router-bootstrap` (que depende de `react-router`) también añade una ruta mapeada en su [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router-bootstrap/tsconfig.json). -Además, `/// ` no trabajara con rutas mapeadas, así que las dependencias deberán utilizar `import`. +Además, `/// ` no trabajará con rutas mapeadas, así que las dependencias deberán utilizar `import`. #### ¿Cómo escribo definitions para paquetes que pueden ser usados globalmente y como un módulo? -El manual de TypeScript contiene excelente [información general para escribir definiciones](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html), ademas [este archivo de definiciones de ejemplo](https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html) el cual muestra como crear una definición utilizando la sintaxis de módulo en ES6, asi como también especificando objetos que son disponibles en el alcance global. Esta técnica es demostrada practicamente en la [definición para big.js](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/big.js/index.d.ts), el cual es una librería que puede ser cargada globalmente a travéz de una etiqueta script en una página web, o importada via require o imports estilo ES6. +El manual de TypeScript contiene excelente [información general para escribir definiciones](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html), además [este archivo de definiciones de ejemplo](https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html) el cual muestra como crear una definición utilizando la sintaxis de módulo en ES6, asi como también especificando objetos que son disponibles en el alcance global. Esta técnica es demostrada prácticamente en la [definición para big.js](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/big.js/index.d.ts), el cual es una librería que puede ser cargada globalmente a través de una etiqueta script en una página web, o importada vía require o imports estilo ES6. -Para probar como puede ser usada tu definición cuando se refieren globalmente o como un módulo importado, crea una carpeta `test`, y coloca dos archivos de prueba en él. nombra uno `YourLibraryName-global.test.ts` y el otro `YourLibraryName-module.test.ts`. El archivo de prueba _global_ debe ejercer la definición de acuerdo como va a ser usado en un script cargado en una página web donde la librería estará disponible en el alcance global - en este escenario no debes de especificar la sentencia de import. El archivo _módulo_ de prueba debe de ejercer la definición de acuerdo a como va a ser utilizado cuando sea importado (incluyendo las sentencias `import`). Si especificas un propiedad `files` en tu archivo tsconfig.json, asegurate de incluir ambos archivos de prueba. Un [ejemplo práctico de esto](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/big.js/test) es también disponible en la definición de big.js. +Para probar como puede ser usada tu definición cuando se refieren globalmente o como un módulo importado, crea una carpeta `test`, y coloca dos archivos de prueba en él. nombra uno `YourLibraryName-global.test.ts` y el otro `YourLibraryName-module.test.ts`. El archivo de prueba _global_ debe ejercer la definición de acuerdo como va a ser usado en un script cargado en una página web donde la librería estará disponible en el alcance global - en este escenario no debes de especificar la sentencia de import. El archivo _módulo_ de prueba debe de ejercer la definición de acuerdo a como va a ser utilizado cuando sea importado (incluyendo las sentencias `import`). Si especificas una propiedad `files` en tu archivo tsconfig.json, asegurate de incluir ambos archivos de prueba. Un [ejemplo práctico de esto](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/big.js/test) es también disponible en la definición de big.js. Por favor tenga en cuenta que no es necesario para ejercer plenamente la definición en cada archivo de prueba - Es suficiente con probar solo los elementos globalmente accesibles en la prueba de archivos globales y ejercer la definición en el módulo del archivo de prueba, o viceversa. #### ¿Qué pasa con paquetes scoped? -Types para un paquete scoped `@foo/bar` deberán ir en `types/foo__bar`. tenga en cuenta el doble guion bajo. +Types para un paquete scoped `@foo/bar` deberán ir en `types/foo__bar`. tenga en cuenta el doble guión bajo. Cuando `dts-gen` es utilizado como scaffold en un paquete scoped, las propiedades `paths` deberán ser adaptadas manualmente en el paquete generado `tsconfig.json` para referenciar correctamente el paquete scoped: diff --git a/notNeededPackages.json b/notNeededPackages.json index 968192123b..6c4e1ce887 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -144,6 +144,12 @@ "sourceRepoURL": "https://github.com/Azure/azure-mobile-apps-node/", "asOfVersion": "3.0.0" }, + { + "libraryName": "@babel/parser", + "typingsPackageName": "babel__parser", + "sourceRepoURL": "https://github.com/babel/babel", + "asOfVersion": "7.1.0" + }, { "libraryName": "BabylonJS", "typingsPackageName": "babylonjs", @@ -396,6 +402,12 @@ "sourceRepoURL": "https://github.com/MikeMcl/decimal.js", "asOfVersion": "7.4.0" }, + { + "libraryName": "deepmerge", + "typingsPackageName": "deepmerge", + "sourceRepoURL": "git@github.com:KyleAMathews/deepmerge.git", + "asOfVersion": "2.2.0" + }, { "libraryName": "delay", "typingsPackageName": "delay", @@ -534,6 +546,12 @@ "sourceRepoURL": "https://github.com/code-chris/extended-listbox", "asOfVersion": "4.0.1" }, + { + "libraryName": "fast-diff", + "typingsPackageName": "fast-diff", + "sourceRepoURL": "https://github.com/jhchen/fast-diff", + "asOfVersion": "1.2.0" + }, { "libraryName": "JSON-Patch", "typingsPackageName": "fast-json-patch", @@ -924,12 +942,24 @@ "sourceRepoURL": "https://github.com/blakeembrey/lower-case-first", "asOfVersion": "1.0.1" }, + { + "libraryName": "mali", + "typingsPackageName": "mali", + "sourceRepoURL": "https://github.com/malijs/mali", + "asOfVersion": "0.9.2" + }, { "libraryName": "maquette", "typingsPackageName": "maquette", "sourceRepoURL": "http://maquettejs.org/", "asOfVersion": "2.1.6" }, + { + "libraryName": "maxmind", + "typingsPackageName": "maxmind", + "sourceRepoURL": "https://github.com/runk/node-maxmind", + "asOfVersion": "2.0.5" + }, { "libraryName": "mendixmodelsdk", "typingsPackageName": "mendixmodelsdk", @@ -966,6 +996,12 @@ "sourceRepoURL": "https://github.com/mweststrate/mobservable-react", "asOfVersion": "1.0.0" }, + { + "libraryName": "Mobx Cookie", + "typingsPackageName": "mobx-cookie", + "sourceRepoURL": "https://github.com/will-stone/mobx-cookie", + "asOfVersion": "1.1.1" + }, { "libraryName": "Moment", "typingsPackageName": "moment", @@ -1194,6 +1230,12 @@ "sourceRepoURL": "https://github.com/react-ga/react-ga", "asOfVersion": "2.3.0" }, + { + "libraryName": "react-i18next", + "typingsPackageName": "react-i18next", + "sourceRepoURL": "https://github.com/i18next/react-i18next", + "asOfVersion": "8.1.0" + }, { "libraryName": "react-monaco-editor", "typingsPackageName": "react-monaco-editor", diff --git a/types/a11y-dialog/a11y-dialog-tests.ts b/types/a11y-dialog/a11y-dialog-tests.ts new file mode 100644 index 0000000000..3df694fcdd --- /dev/null +++ b/types/a11y-dialog/a11y-dialog-tests.ts @@ -0,0 +1,30 @@ +import A11yDialog = require('a11y-dialog'); + +const dialogEl = new A11yDialog(document.getElementById("test")); +const dialogElTwo = new A11yDialog(document.getElementById("test"), document.getElementById("testContainer")); +const dialogElThree = new A11yDialog(document.getElementById("test"), "dummy-element"); + +dialogEl.show(); +dialogEl.hide(); +dialogElTwo.destroy(); +dialogElThree.create(); + +// Test out interfaces that extends Element. +dialogEl.on("show", (el: HTMLElement) => { + el.textContent; +}); + +// Test out element and event. +dialogEl.on("create", (el: HTMLElement, evt) => { + el.textContent; + + evt.target; +}); + +dialogEl.on('hide', () => { + const t = 5; +}); + +dialogEl.off("show", (el: HTMLElement) => { + el.textContent; +}); diff --git a/types/a11y-dialog/index.d.ts b/types/a11y-dialog/index.d.ts new file mode 100644 index 0000000000..105aaa70e7 --- /dev/null +++ b/types/a11y-dialog/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for a11y-dialog 5.2 +// Project: https://github.com/edenspiekermann/a11y-dialog +// Definitions by: Yuto +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +type DialogEvents = "show" | "hide" | "destroy" | "create"; +declare class A11yDialog { + constructor(el: Element | null, containers?: NodeList | Element | string | null); + /** + * Shows the dialog. + */ + show(): void; + /** + * Hides the dialog. + */ + hide(): void; + /** + * Unbind click listeners from dialog openers and closers and remove all bound custom event listeners registered with `.on()` + */ + destroy(): void; + /** + * Bind click listeners to dialog openers and closers. + */ + create(el?: Element | null, containers?: NodeList | Element | string | null): void; + + on(evt: DialogEvents, callback: (dialogElement: any, event: Event) => void): void; + off(evt: DialogEvents, callback: (dialogElement: any, event: Event) => void): void; +} + +export = A11yDialog; diff --git a/types/a11y-dialog/tsconfig.json b/types/a11y-dialog/tsconfig.json new file mode 100644 index 0000000000..a27d99d6bf --- /dev/null +++ b/types/a11y-dialog/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "a11y-dialog-tests.ts" + ] +} \ No newline at end of file diff --git a/types/a11y-dialog/tslint.json b/types/a11y-dialog/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/a11y-dialog/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/ace/test/selection.ts b/types/ace/test/selection.ts index be7da64331..e698664b83 100644 --- a/types/ace/test/selection.ts +++ b/types/ace/test/selection.ts @@ -123,7 +123,7 @@ const aceSelectionTests = { }, "test: moveCursor word left with umlauts": function () { - var session = new AceAjax.EditSession(" Fu� F��e"); + var session = new AceAjax.EditSession(" Fu¢ F¢¢e"); var selection = session.getSelection(); selection.moveCursorTo(0, 9) diff --git a/types/actioncable/index.d.ts b/types/actioncable/index.d.ts index 9194e81d6f..b5bdbf429a 100644 --- a/types/actioncable/index.d.ts +++ b/types/actioncable/index.d.ts @@ -1,13 +1,15 @@ -// Type definitions for ActionCable -// Project: https://github.com/rails/rails/tree/master/actioncable +// Type definitions for ActionCable 5.2 +// Project: https://github.com/rails/rails/tree/master/actioncable/app/assets/javascripts // Definitions by: Vincent Zhu +// Jared Szechy // Definitions: https://github.com/zhu1230/DefinitelyTyped +// TypeScript Version: 2.3 declare module ActionCable { interface Channel { unsubscribe(): void; perform(action: string, data: {}): void; - send(data: Object): boolean; + send(data: any): boolean; } interface Subscriptions { @@ -16,12 +18,16 @@ declare module ActionCable { interface Cable { subscriptions: Subscriptions; + send(data: any): void; + connect(): void; + disconnect(): void; + ensureActiveConnection(): void; } interface CreateMixin { connected(): void; disconnected(): void; - received(obj: Object): void; + received(obj: any): void; [key: string]: Function; } diff --git a/types/adone/glosses/utils.d.ts b/types/adone/glosses/utils.d.ts index 5d2eb5f198..a08d4af4bd 100644 --- a/types/adone/glosses/utils.d.ts +++ b/types/adone/glosses/utils.d.ts @@ -451,7 +451,7 @@ declare namespace adone { | encoding.Multibyte; } - const defaultCharUnicode: "�"; + const defaultCharUnicode: string; const defaultCharSingleByte: "?"; diff --git a/types/aframe/test/aframe-io-tests.ts b/types/aframe/test/aframe-io-tests.ts index 77fe716390..1120b50be8 100644 --- a/types/aframe/test/aframe-io-tests.ts +++ b/types/aframe/test/aframe-io-tests.ts @@ -533,9 +533,10 @@ AFRAME.registerComponent('audioanalyser-waveform', { rings.forEach(function transformRing(ring: THREE.Line, index: number) { var normLevel; normLevel = levels[RINGCOUNT - index - 1] + 0.01; // Avoid scaling by 0. - (ring.material as THREE.LineBasicMaterial).color.setHSL(colors[index], 1, normLevel); - ring.material.linewidth = normLevel * 3; - ring.material.opacity = normLevel; + const lineMaterial = ring.material as THREE.LineBasicMaterial; + lineMaterial.color.setHSL(colors[index], 1, normLevel); + lineMaterial.linewidth = normLevel * 3; + lineMaterial.opacity = normLevel; ring.scale.z = normLevel; }); }, diff --git a/types/agenda/index.d.ts b/types/agenda/index.d.ts index 75246ecda3..37b9ce6b2c 100644 --- a/types/agenda/index.d.ts +++ b/types/agenda/index.d.ts @@ -64,7 +64,7 @@ declare class Agenda extends EventEmitter { defaultConcurrency(value: number): this; /** - * Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is + * Takes a number which specifies the max number jobs that can be locked at any given moment. By default it is * 0 for no max. * @param value The value to set. */ @@ -189,7 +189,7 @@ declare namespace Agenda { defaultLockLimit?: number; /** - * Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is + * Takes a number which specifies the max number jobs that can be locked at any given moment. By default it is * 0 for no max. */ lockLimit?: number; diff --git a/types/ajv-errors/index.d.ts b/types/ajv-errors/index.d.ts index fed9e4585f..3b5c2d2322 100644 --- a/types/ajv-errors/index.d.ts +++ b/types/ajv-errors/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/epoberezkin/ajv-errors // Definitions by: Afshawn Lotfi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 import { Ajv } from "ajv"; diff --git a/types/ale-url-parser/ale-url-parser-tests.ts b/types/ale-url-parser/ale-url-parser-tests.ts new file mode 100644 index 0000000000..2a5d9fe632 --- /dev/null +++ b/types/ale-url-parser/ale-url-parser-tests.ts @@ -0,0 +1,22 @@ +import { parse, stringify } from 'ale-url-parser'; + +let url; +let urlObject; + +url = stringify({}); +console.log(url); + +url = stringify({ + protocol: 'protocol', + host: 'host', + path: ['foo', 'bar', 'baz'], + hash: 'hash', + query: { + foo: 1, + bar: [2, '3'] + } +}); +console.log(url); + +urlObject = parse('//any.dom.ain.co.m/foo/bar?test=1&test=2#hash'); +console.log(urlObject); diff --git a/types/ale-url-parser/index.d.ts b/types/ale-url-parser/index.d.ts new file mode 100644 index 0000000000..31b2d2fd03 --- /dev/null +++ b/types/ale-url-parser/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for ale-url-parser 0.10 +// Project: https://github.com/msn0/ale-url-parser#readme +// Definitions by: MichaÅ‚ Jezierski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export interface QueryParams { + [key: string]: any; +} + +export interface UrlObject { + protocol?: string; + host?: string; + path?: string[]; + query?: QueryParams; + hash?: string; +} + +/** + * Parse url string into url object. + * @return UrlObject + */ +export function parse(url: string): UrlObject; + +/** + * Stringify url object into url string. + * @return string + */ +export function stringify(urlObject: UrlObject): string; diff --git a/types/ale-url-parser/tsconfig.json b/types/ale-url-parser/tsconfig.json new file mode 100644 index 0000000000..2d18200901 --- /dev/null +++ b/types/ale-url-parser/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ale-url-parser-tests.ts" + ] +} diff --git a/types/babel__parser/tslint.json b/types/ale-url-parser/tslint.json similarity index 100% rename from types/babel__parser/tslint.json rename to types/ale-url-parser/tslint.json diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts index 87fdb95a01..cbd98d253a 100644 --- a/types/algoliasearch/algoliasearch-tests.ts +++ b/types/algoliasearch/algoliasearch-tests.ts @@ -21,6 +21,7 @@ let _algoliaResponse: Response = { processingTimeMS: 32, query: '', params: '', + index: '', }; let _clientOptions: ClientOptions = { @@ -103,7 +104,8 @@ let _algoliaQueryParameters: QueryParameters = { filters: '', attributesToRetrieve: [''], restrictSearchableAttributes: [''], - facets: '', + facets: [''], + facetingAfterDistinct: true, maxValuesPerFacet: 2, attributesToHighlight: [''], attributesToSnippet: [''], @@ -120,28 +122,29 @@ let _algoliaQueryParameters: QueryParameters = { typoTolerance: false, allowTyposOnNumericTokens: false, ignorePlurals: false, - disableTypoToleranceOnAttributes: '', + disableTypoToleranceOnAttributes: [''], aroundLatLng: '', aroundLatLngViaIP: '', aroundRadius: 0, aroundPrecision: 0, minimumAroundRadius: 0, insideBoundingBox: [[0]], - queryType: '', + queryType: 'prefixAll', insidePolygon: [[0]], - removeWordsIfNoResults: '', + removeWordsIfNoResults: 'firstWords', advancedSyntax: false, optionalWords: [''], removeStopWords: [''], disableExactOnAttributes: [''], - exactOnSingleWordQuery: '', - alternativesAsExact: true, + exactOnSingleWordQuery: 'attribute', + alternativesAsExact: ["ignorePlurals"], distinct: 0, getRankingInfo: false, numericAttributesToIndex: [''], + numericAttributesForFiltering: [''], numericFilters: [''], - tagFilters: '', - facetFilters: '', + tagFilters: [''], + facetFilters: [''], analytics: false, analyticsTags: [''], synonyms: true, @@ -171,8 +174,38 @@ index.partialUpdateObjects([{}], false).then(() => {}); let indexName : string = index.indexName; // complete copy -client.copyIndex('from', 'to').then(()=>{}) -client.copyIndex('from', 'to', ()=> {}) +client.copyIndex('from', 'to').then(()=>{}); +client.copyIndex('from', 'to', ()=> {}); // with scope -client.copyIndex('from', 'to', ['settings']).then(()=>{}) -client.copyIndex('from', 'to', ['synonyms', 'rules'], ()=> {}) +client.copyIndex('from', 'to', ['settings']).then(()=>{}); +client.copyIndex('from', 'to', ['synonyms', 'rules'], ()=> {}); + +// Browsing +const browser = index.browseAll(); +index.browseAll('query'); +index.browseAll('', { + filters: 'dog', +}); + +let hits: Object[] = []; + +browser.on('result', function onResult(content) { + hits = hits.concat(content.hits); +}); + +browser.on('end', function onEnd() { + const _message = `We got ${hits.length} hits` +}); + +browser.on('error', function onError(err) { + throw err; +}); + +browser.stop(); + +index.browse("", { + advancedSyntax: false, + attributesToRetrieve: ['dogs'] +}); +client.copyIndex('from', 'to', ['settings']).then(()=>{}); +client.copyIndex('from', 'to', ['synonyms', 'rules'], ()=> {}); diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 71684995a4..04291996ba 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -1,11 +1,14 @@ -// Type definitions for algoliasearch-client-js 3.27.0 +// Type definitions for algoliasearch-client-js 3.30.0 // Project: https://github.com/algolia/algoliasearch-client-js // Definitions by: Baptiste Coquelle // Haroen Viaene // Aurélien Hervé // Samuel Vaillant +// Kai Eichinger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.8 + +type Omit = Pick> declare namespace algoliasearch { /** @@ -611,6 +614,11 @@ declare namespace algoliasearch { options: SearchForFacetValues.Parameters, cb: (err: Error, res: SearchForFacetValues.Response) => void ): void; + /** + * Browse an index + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browse(query: string, parameters: BrowseParameters, cb: (err: Error, res: BrowseResponse) => void): void; /** * Browse an index * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse @@ -620,7 +628,7 @@ declare namespace algoliasearch { * Browse an index * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse */ - browse(query: string): Promise; + browse(query: string, parameters?: BrowseParameters): Promise; /** * Browse an index from a cursor * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse @@ -638,7 +646,7 @@ declare namespace algoliasearch { * Browse an entire index * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse */ - browseAll(): Promise; + browseAll(query?: string, parameters?: BrowseParameters): Browser; /** * Clear an index content * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex @@ -966,6 +974,22 @@ declare namespace algoliasearch { query: string; processingTimeMS: number; } + type BrowseParameters = Omit< + QueryParameters, + | "typoTolerance" + | "distinct" + | "facets" + | "getRankingInfo" + | "attributesToHighlight" + | "attributesToSnippet" + > + interface Browser { + on(type: "error", cb: (err: Error) => void): void + on(type: "end", cb: () => void): void + on(type: "stop", cb: () => void): void + on(type: "result", cb: (content: BrowseResponse) => void): void + stop(): void + } /** * Describes a synonym object */ @@ -1099,112 +1123,121 @@ declare namespace algoliasearch { userToken?: string; } interface QueryParameters { + /** + * Query string used to perform the search + * default: '' + * https://www.algolia.com/doc/api-reference/api-parameters/query/ + */ + query?: string; + /** + * Filter the query with numeric, facet or/and tag filters + * default: "" + * https://www.algolia.com/doc/api-reference/api-parameters/filters/ + */ + filters?: string; + /** + * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer. + * default: * + * https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/ + */ + attributesToRetrieve?: string[]; + /** + * List of attributes you want to use for textual search + * default: attributeToIndex + * https://www.algolia.com/doc/api-reference/api-parameters/restrictSearchableAttributes/ + */ + restrictSearchableAttributes?: string[]; + /** + * You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes + * default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/facets/ + */ + facets?: string[]; /** - * Query string used to perform the search - * default: '' - * https://github.com/algolia/algoliasearch-client-js#query - */ - query?: string; - /** - * Filter the query with numeric, facet or/and tag filters - * default: "" - * https://github.com/algolia/algoliasearch-client-js#filters - */ - filters?: string; - /** - * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer. - * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve - */ - attributesToRetrieve?: string[]; - /** - * List of attributes you want to use for textual search - * default: attributeToIndex - * https://github.com/algolia/algoliasearch-client-js#restrictsearchableattributes - */ - restrictSearchableAttributes?: string[]; - /** - * You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes - * default: "" - * https://github.com/algolia/algoliasearch-client-js#facets - */ - facets?: string | string[]; + * Force faceting to be applied after de-duplication (via the Distinct setting). + * When using the distinct setting in combination with faceting, facet counts may be higher than expected. + * This is because the engine, by default, computes faceting before applying de-duplication (distinct). + * When facetingAfterDistinct is set to true, the engine calculates faceting after the de-duplication has been applied. + * default "" + * https://www.algolia.com/doc/api-reference/api-parameters/facetingAfterDistinct/ + */ + facetingAfterDistinct?: boolean; /** * Limit the number of facet values returned for each facet. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet + * default: 100 + * https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/ */ maxValuesPerFacet?: number; /** * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestohighlight + * https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/ */ attributesToHighlight?: string[]; /** * Default list of attributes to snippet alongside the number of words to return * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestosnippet + * https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/ */ attributesToSnippet?: string[]; /** * Specify the string that is inserted before the highlighted parts in the query result * default: - * https://github.com/algolia/algoliasearch-client-js#highlightpretag + * https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/ */ highlightPreTag?: string; /** * Specify the string that is inserted after the highlighted parts in the query result * default: - * https://github.com/algolia/algoliasearch-client-js#highlightposttag + * https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/ */ highlightPostTag?: string; /** * String used as an ellipsis indicator when a snippet is truncated. * default: … - * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext + * https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/ */ snippetEllipsisText?: string; /** * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets * default: false - * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays + * https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/ */ restrictHighlightAndSnippetArrays?: boolean; /** * Pagination parameter used to select the number of hits per page * default: 20 - * https://github.com/algolia/algoliasearch-client-js#hitsperpage + * https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/ */ hitsPerPage?: number; /** * Pagination parameter used to select the page to retrieve. * default: 0 - * https://github.com/algolia/algoliasearch-client-js#page + * https://www.algolia.com/doc/api-reference/api-parameters/page/ */ page?: number; /** * Offset of the first hit to return * default: null - * https://github.com/algolia/algoliasearch-client-js#offset + * https://www.algolia.com/doc/api-reference/api-parameters/offset/ */ offset?: number; /** * Number of hits to return. * default: null - * https://github.com/algolia/algoliasearch-client-js#length + * https://www.algolia.com/doc/api-reference/api-parameters/length/ */ length?: number; /** * The minimum number of characters needed to accept one typo. * default: 4 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo + * https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/ */ minWordSizefor1Typo?: number; /** * The minimum number of characters needed to accept two typo. * fault: 8 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + * https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor2Typos/ */ minWordSizefor2Typos?: number; /** @@ -1214,62 +1247,62 @@ declare namespace algoliasearch { * 'false' The typo tolerance is disabled. All results with typos will be hidden. * 'min' Only keep results with the minimum number of typos * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + * https://www.algolia.com/doc/api-reference/api-parameters/typoTolerance/ */ typoTolerance?: boolean; /** * If set to false, disables typo tolerance on numeric tokens (numbers). * default: - * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens + * https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/ */ allowTyposOnNumericTokens?: boolean; /** * If set to true, plural won't be considered as a typo * default: false - * https://github.com/algolia/algoliasearch-client-js#ignoreplurals + * https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/ */ ignorePlurals?: boolean; /** * List of attributes on which you want to disable typo tolerance - * default: "" - * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes + * default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/ */ - disableTypoToleranceOnAttributes?: string; + disableTypoToleranceOnAttributes?: string[]; /** * Search for entries around a given location * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlng + * https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/ */ aroundLatLng?: string; /** * Search for entries around a given latitude/longitude automatically computed from user IP address. * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlngviaip + * https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLngViaIP/ */ aroundLatLngViaIP?: string; /** * Control the radius associated with a geo search. Defined in meters. * default: null * You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area - * https://github.com/algolia/algoliasearch-client-js#aroundradius + * https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/ */ aroundRadius?: number | 'all'; /** * Control the precision of a geo search * default: null - * https://github.com/algolia/algoliasearch-client-js#aroundprecision + * https://www.algolia.com/doc/api-reference/api-parameters/aroundPrecision/ */ aroundPrecision?: number; /** * Define the minimum radius used for a geo search when aroundRadius is not set. * default: null - * https://github.com/algolia/algoliasearch-client-js#minimumaroundradius + * https://www.algolia.com/doc/api-reference/api-parameters/minimumAroundRadius/ */ minimumAroundRadius?: number; /** * Search entries inside a given area defined by the two extreme points of a rectangle * default: null - * https://github.com/algolia/algoliasearch-client-js#insideboundingbox + * https://www.algolia.com/doc/api-reference/api-parameters/insideBoundingBox/ */ insideBoundingBox?: number[][]; /** @@ -1278,13 +1311,13 @@ declare namespace algoliasearch { * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. - * https://github.com/algolia/algoliasearch-client-js#querytype + * https://www.algolia.com/doc/api-reference/api-parameters/queryType/ */ - queryType?: any; + queryType?: "prefixAll"|"prefixLast"|"prefixNone"; /** * Search entries inside a given area defined by a set of points * defauly: '' - * https://github.com/algolia/algoliasearch-client-js#insidepolygon + * https://www.algolia.com/doc/api-reference/api-parameters/insidePolygon/ */ insidePolygon?: number[][]; /** @@ -1294,19 +1327,19 @@ declare namespace algoliasearch { * 'firstWords' When a query does not return any results, the first word will be added as optional * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional * 'none' No specific processing is done when a query does not return any results - * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults + * https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/ */ - removeWordsIfNoResults?: string; + removeWordsIfNoResults?: "none"|"lastWords"|"firstWords"|"allOptional"; /** * Enables the advanced query syntax * default: false - * https://github.com/algolia/algoliasearch-client-js#advancedsyntax + * https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/ */ advancedSyntax?: boolean; /** * A string that contains the comma separated list of words that should be considered as optional when found in the query * default: [] - * https://github.com/algolia/algoliasearch-client-js#optionalwords + * https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/ */ optionalWords?: string[]; /** @@ -1314,13 +1347,13 @@ declare namespace algoliasearch { * default: false * true|false: enable or disable stop words for all 41 supported languages; or * a list of language ISO codes (as a comma-separated string) for which stop words should be enable - * https://github.com/algolia/algoliasearch-client-js#removestopwords + * https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/ */ - removeStopWords?: string[]; + removeStopWords?: boolean|string[]; /** * List of attributes on which you want to disable the computation of exact criteria * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes + * https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/ */ disableExactOnAttributes?: string[]; /** @@ -1329,81 +1362,90 @@ declare namespace algoliasearch { * 'none': no exact on single word query * 'word': exact set to 1 if the query word is found in the record * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query - * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery + * https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/ */ - exactOnSingleWordQuery?: string; + exactOnSingleWordQuery?: "attribute"|"none"|"word"; /** * Specify the list of approximation that should be considered as an exact match in the ranking formula * default: ['ignorePlurals', 'singleWordSynonym'] * 'ignorePlurals': alternative words added by the ignorePlurals feature * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") * 'multiWordsSynonym': multiple-words synonym - * https://github.com/algolia/algoliasearch-client-js#alternativesasexact + * https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/ */ - alternativesAsExact?: any; + alternativesAsExact?: Array<"ignorePlurals"|"singleWordSynonym"|"multiWordsSynonym">; /** * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. - * https://github.com/algolia/algoliasearch-client-js#distinct + * https://www.algolia.com/doc/api-reference/api-parameters/distinct/ */ - distinct?: any; + distinct?: number|boolean; /** * If set to true, the result hits will contain ranking information in the _rankingInfo attribute. * default: false - * https://github.com/algolia/algoliasearch-client-js#getrankinginfo + * https://www.algolia.com/doc/api-reference/api-parameters/getRankingInfo/ */ getRankingInfo?: boolean; /** + * @deprecated Use `numericAttributesForFiltering` instead * All numerical attributes are automatically indexed as numerical filters * default: '' - * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex + * https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/ */ numericAttributesToIndex?: string[]; + /** + * All numerical attributes are automatically indexed as numerical filters + * default: '' + * https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/ + */ + numericAttributesForFiltering?: string[]; /** * @deprecated please use filters instead * A string that contains the comma separated list of numeric filters you want to apply. - * https://github.com/algolia/algoliasearch-client-js#numericfilters-deprecated + * https://www.algolia.com/doc/api-reference/api-parameters/numericFilters/ */ numericFilters?: string[]; /** * @deprecated + * * Filter the query by a set of tags. - * https://github.com/algolia/algoliasearch-client-js#tagfilters-deprecated + * Default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/ */ - tagFilters?: string; + tagFilters?: string[]; /** - * @deprecated * Filter the query by a set of facets. - * https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated + * Default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/ */ - facetFilters?: string | string[] + facetFilters?: string[]|string[][]; /** * If set to false, this query will not be taken into account in the analytics feature. * default true - * https://github.com/algolia/algoliasearch-client-js#analytics + * https://www.algolia.com/doc/api-reference/api-parameters/analytics/ */ analytics?: boolean; /** * If set, tag your query with the specified identifiers - * default: null - * https://github.com/algolia/algoliasearch-client-js#analyticstags + * default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/ */ analyticsTags?: string[]; /** * If set to false, the search will not use the synonyms defined for the targeted index. * default: true - * https://github.com/algolia/algoliasearch-client-js#synonyms + * https://www.algolia.com/doc/api-reference/api-parameters/synonyms/ */ synonyms?: boolean; /** * If set to false, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result. * default: true - * https://github.com/algolia/algoliasearch-client-js#replacesynonymsinhighlight + * https://www.algolia.com/doc/api-reference/api-parameters/replaceSynonymsInHighlight/ */ replaceSynonymsInHighlight?: boolean; /** * Configure the precision of the proximity ranking criterion * default: 1 - * https://github.com/algolia/algoliasearch-client-js#minproximity + * https://www.algolia.com/doc/api-reference/api-parameters/minProximity/ */ minProximity?: number; @@ -1456,7 +1498,7 @@ declare namespace algoliasearch { interface Task { taskID: number; createdAt: string; - objectID?: string; + objectID?: string; } interface TaskStatus { @@ -1739,42 +1781,42 @@ declare namespace algoliasearch { interface Response { /** * Contains all the hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ hits: any[]; /** * Current page - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ page: number; /** * Number of total hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ nbHits: number; /** * Number of pages - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ nbPages: number; /** * Number of hits per pages - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ hitsPerPage: number; /** * Engine processing time (excluding network transfer) - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ processingTimeMS: number; /** * Query used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ query: string; /** * GET parameters used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ params: string; facets?: { @@ -1788,6 +1830,16 @@ declare namespace algoliasearch { sum: number, }; }; + /** + * The index name is only set when searching multiple indices. + * https://www.algolia.com/doc/api-reference/api-methods/multiple-queries/?language=javascript#response + */ + index?: string; + /** + * The cursor is only set when browsing the index. + * https://www.algolia.com/doc/api-reference/api-methods/browse/ + */ + cursor?: string; } interface MultiResponse { diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts index 4f068d5647..ce58d6a428 100644 --- a/types/algoliasearch/lite/index.d.ts +++ b/types/algoliasearch/lite/index.d.ts @@ -1,12 +1,15 @@ -// Type definitions for algoliasearch-client-js 3.27.0 +// Type definitions for algoliasearch-client-js 3.30.0 // Project: https://github.com/algolia/algoliasearch-client-js // Definitions by: Baptiste Coquelle // Haroen Viaene // Aurélien Hervé // Samuel Vaillant // Claas Brüggemann +// Kai Eichinger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.8 + +type Omit = Pick> declare namespace algoliasearch { /** @@ -130,6 +133,11 @@ declare namespace algoliasearch { options: SearchForFacetValues.Parameters, cb: (err: Error, res: SearchForFacetValues.Response) => void ): void; + /** + * Browse an index + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browse(query: string, parameters: BrowseParameters, cb: (err: Error, res: BrowseResponse) => void): void; /** * Browse an index * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse @@ -139,7 +147,7 @@ declare namespace algoliasearch { * Browse an index * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse */ - browse(query: string): Promise; + browse(query: string, parameters?: BrowseParameters): Promise; /** * Browse an index from a cursor * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse @@ -194,114 +202,122 @@ declare namespace algoliasearch { query: string; processingTimeMS: number; } - + type BrowseParameters = Omit< + QueryParameters, + | "typoTolerance" + | "distinct" + | "facets" + | "getRankingInfo" + | "attributesToHighlight" + | "attributesToSnippet" + > interface QueryParameters { /** * Query string used to perform the search * default: '' - * https://github.com/algolia/algoliasearch-client-js#query + * https://www.algolia.com/doc/api-reference/api-parameters/query/ */ query?: string; /** * Filter the query with numeric, facet or/and tag filters * default: "" - * https://github.com/algolia/algoliasearch-client-js#filters + * https://www.algolia.com/doc/api-reference/api-parameters/filters/ */ filters?: string; /** * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer. * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve + * https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/ */ attributesToRetrieve?: string[]; /** * List of attributes you want to use for textual search * default: attributeToIndex - * https://github.com/algolia/algoliasearch-client-js#restrictsearchableattributes + * https://www.algolia.com/doc/api-reference/api-parameters/restrictSearchableAttributes/ */ restrictSearchableAttributes?: string[]; /** * You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes - * default: "" - * https://github.com/algolia/algoliasearch-client-js#facets + * default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/facets/ */ - facets?: string; + facets?: string[]; /** * Limit the number of facet values returned for each facet. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet + * default: 100 + * https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/ */ maxValuesPerFacet?: number; /** * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestohighlight + * https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/ */ attributesToHighlight?: string[]; /** * Default list of attributes to snippet alongside the number of words to return * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestosnippet + * https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/ */ attributesToSnippet?: string[]; /** * Specify the string that is inserted before the highlighted parts in the query result * default: - * https://github.com/algolia/algoliasearch-client-js#highlightpretag + * https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/ */ highlightPreTag?: string; /** * Specify the string that is inserted after the highlighted parts in the query result * default: - * https://github.com/algolia/algoliasearch-client-js#highlightposttag + * https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/ */ highlightPostTag?: string; /** * String used as an ellipsis indicator when a snippet is truncated. * default: … - * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext + * https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/ */ snippetEllipsisText?: string; /** * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets * default: false - * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays + * https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/ */ restrictHighlightAndSnippetArrays?: boolean; /** * Pagination parameter used to select the number of hits per page * default: 20 - * https://github.com/algolia/algoliasearch-client-js#hitsperpage + * https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/ */ hitsPerPage?: number; /** * Pagination parameter used to select the page to retrieve. * default: 0 - * https://github.com/algolia/algoliasearch-client-js#page + * https://www.algolia.com/doc/api-reference/api-parameters/page/ */ page?: number; /** * Offset of the first hit to return * default: null - * https://github.com/algolia/algoliasearch-client-js#offset + * https://www.algolia.com/doc/api-reference/api-parameters/offset/ */ offset?: number; /** * Number of hits to return. * default: null - * https://github.com/algolia/algoliasearch-client-js#length + * https://www.algolia.com/doc/api-reference/api-parameters/length/ */ length?: number; /** * The minimum number of characters needed to accept one typo. * default: 4 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo + * https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/ */ minWordSizefor1Typo?: number; /** * The minimum number of characters needed to accept two typo. * fault: 8 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + * https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor2Typos/ */ minWordSizefor2Typos?: number; /** @@ -311,62 +327,62 @@ declare namespace algoliasearch { * 'false' The typo tolerance is disabled. All results with typos will be hidden. * 'min' Only keep results with the minimum number of typos * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + * https://www.algolia.com/doc/api-reference/api-parameters/typoTolerance/ */ typoTolerance?: boolean; /** * If set to false, disables typo tolerance on numeric tokens (numbers). * default: - * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens + * https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/ */ allowTyposOnNumericTokens?: boolean; /** * If set to true, plural won't be considered as a typo * default: false - * https://github.com/algolia/algoliasearch-client-js#ignoreplurals + * https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/ */ ignorePlurals?: boolean; /** * List of attributes on which you want to disable typo tolerance - * default: "" - * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes + * default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/ */ - disableTypoToleranceOnAttributes?: string; + disableTypoToleranceOnAttributes?: string[]; /** * Search for entries around a given location * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlng + * https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/ */ aroundLatLng?: string; /** * Search for entries around a given latitude/longitude automatically computed from user IP address. * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlngviaip + * https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLngViaIP/ */ aroundLatLngViaIP?: string; /** * Control the radius associated with a geo search. Defined in meters. * default: null * You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area - * https://github.com/algolia/algoliasearch-client-js#aroundradius + * https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/ */ aroundRadius?: number | 'all'; /** * Control the precision of a geo search * default: null - * https://github.com/algolia/algoliasearch-client-js#aroundprecision + * https://www.algolia.com/doc/api-reference/api-parameters/aroundPrecision/ */ aroundPrecision?: number; /** * Define the minimum radius used for a geo search when aroundRadius is not set. * default: null - * https://github.com/algolia/algoliasearch-client-js#minimumaroundradius + * https://www.algolia.com/doc/api-reference/api-parameters/minimumAroundRadius/ */ minimumAroundRadius?: number; /** * Search entries inside a given area defined by the two extreme points of a rectangle * default: null - * https://github.com/algolia/algoliasearch-client-js#insideboundingbox + * https://www.algolia.com/doc/api-reference/api-parameters/insideBoundingBox/ */ insideBoundingBox?: number[][]; /** @@ -375,13 +391,13 @@ declare namespace algoliasearch { * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. - * https://github.com/algolia/algoliasearch-client-js#querytype + * https://www.algolia.com/doc/api-reference/api-parameters/queryType/ */ - queryType?: any; + queryType?: "prefixAll"|"prefixLast"|"prefixNone"; /** * Search entries inside a given area defined by a set of points * defauly: '' - * https://github.com/algolia/algoliasearch-client-js#insidepolygon + * https://www.algolia.com/doc/api-reference/api-parameters/insidePolygon/ */ insidePolygon?: number[][]; /** @@ -391,19 +407,19 @@ declare namespace algoliasearch { * 'firstWords' When a query does not return any results, the first word will be added as optional * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional * 'none' No specific processing is done when a query does not return any results - * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults + * https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/ */ - removeWordsIfNoResults?: string; + removeWordsIfNoResults?: "none"|"lastWords"|"firstWords"|"allOptional"; /** * Enables the advanced query syntax * default: false - * https://github.com/algolia/algoliasearch-client-js#advancedsyntax + * https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/ */ advancedSyntax?: boolean; /** * A string that contains the comma separated list of words that should be considered as optional when found in the query * default: [] - * https://github.com/algolia/algoliasearch-client-js#optionalwords + * https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/ */ optionalWords?: string[]; /** @@ -411,13 +427,13 @@ declare namespace algoliasearch { * default: false * true|false: enable or disable stop words for all 41 supported languages; or * a list of language ISO codes (as a comma-separated string) for which stop words should be enable - * https://github.com/algolia/algoliasearch-client-js#removestopwords + * https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/ */ - removeStopWords?: string[]; + removeStopWords?: boolean|string[]; /** * List of attributes on which you want to disable the computation of exact criteria * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes + * https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/ */ disableExactOnAttributes?: string[]; /** @@ -426,81 +442,90 @@ declare namespace algoliasearch { * 'none': no exact on single word query * 'word': exact set to 1 if the query word is found in the record * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query - * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery + * https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/ */ - exactOnSingleWordQuery?: string; + exactOnSingleWordQuery?: "attribute"|"none"|"word"; /** * Specify the list of approximation that should be considered as an exact match in the ranking formula * default: ['ignorePlurals', 'singleWordSynonym'] * 'ignorePlurals': alternative words added by the ignorePlurals feature * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") * 'multiWordsSynonym': multiple-words synonym - * https://github.com/algolia/algoliasearch-client-js#alternativesasexact + * https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/ */ - alternativesAsExact?: any; + alternativesAsExact?: Array<"ignorePlurals"|"singleWordSynonym"|"multiWordsSynonym">; /** * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. - * https://github.com/algolia/algoliasearch-client-js#distinct + * https://www.algolia.com/doc/api-reference/api-parameters/distinct/ */ - distinct?: any; + distinct?: number|boolean; /** * If set to true, the result hits will contain ranking information in the _rankingInfo attribute. * default: false - * https://github.com/algolia/algoliasearch-client-js#getrankinginfo + * https://www.algolia.com/doc/api-reference/api-parameters/getRankingInfo/ */ getRankingInfo?: boolean; /** + * @deprecated Use `numericAttributesForFiltering` instead * All numerical attributes are automatically indexed as numerical filters * default: '' - * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex + * https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/ */ numericAttributesToIndex?: string[]; + /** + * All numerical attributes are automatically indexed as numerical filters + * default: '' + * https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/ + */ + numericAttributesForFiltering?: string[]; /** * @deprecated please use filters instead * A string that contains the comma separated list of numeric filters you want to apply. - * https://github.com/algolia/algoliasearch-client-js#numericfilters-deprecated + * https://www.algolia.com/doc/api-reference/api-parameters/numericFilters/ */ numericFilters?: string[]; /** * @deprecated + * * Filter the query by a set of tags. - * https://github.com/algolia/algoliasearch-client-js#tagfilters-deprecated + * Default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/ */ - tagFilters?: string; + tagFilters?: string[]; /** - * @deprecated * Filter the query by a set of facets. - * https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated + * Default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/ */ - facetFilters?: string; + facetFilters?: string[]|string[][]; /** * If set to false, this query will not be taken into account in the analytics feature. * default true - * https://github.com/algolia/algoliasearch-client-js#analytics + * https://www.algolia.com/doc/api-reference/api-parameters/analytics/ */ analytics?: boolean; /** * If set, tag your query with the specified identifiers - * default: null - * https://github.com/algolia/algoliasearch-client-js#analyticstags + * default: [] + * https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/ */ analyticsTags?: string[]; /** * If set to false, the search will not use the synonyms defined for the targeted index. * default: true - * https://github.com/algolia/algoliasearch-client-js#synonyms + * https://www.algolia.com/doc/api-reference/api-parameters/synonyms/ */ synonyms?: boolean; /** * If set to false, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result. * default: true - * https://github.com/algolia/algoliasearch-client-js#replacesynonymsinhighlight + * https://www.algolia.com/doc/api-reference/api-parameters/replaceSynonymsInHighlight/ */ replaceSynonymsInHighlight?: boolean; /** * Configure the precision of the proximity ranking criterion * default: 1 - * https://github.com/algolia/algoliasearch-client-js#minproximity + * https://www.algolia.com/doc/api-reference/api-parameters/minProximity/ */ minProximity?: number; @@ -530,42 +555,42 @@ declare namespace algoliasearch { interface Response { /** * Contains all the hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ hits: any[]; /** * Current page - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ page: number; /** * Number of total hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ nbHits: number; /** * Number of pages - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ nbPages: number; /** * Number of hits per pages - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ hitsPerPage: number; /** * Engine processing time (excluding network transfer) - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ processingTimeMS: number; /** * Query used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ query: string; /** * GET parameters used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format + * https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response */ params: string; facets?: { @@ -579,6 +604,16 @@ declare namespace algoliasearch { sum: number, }; }; + /** + * The index name is only set when searching multiple indices. + * https://www.algolia.com/doc/api-reference/api-methods/multiple-queries/?language=javascript#response + */ + index?: string; + /** + * The cursor is only set when browsing the index. + * https://www.algolia.com/doc/api-reference/api-methods/browse/ + */ + cursor?: string; } interface MultiResponse { diff --git a/types/ali-app/ali-app-tests.ts b/types/ali-app/ali-app-tests.ts new file mode 100644 index 0000000000..a42301aed1 --- /dev/null +++ b/types/ali-app/ali-app-tests.ts @@ -0,0 +1,2153 @@ +(() => { + // https://docs.alipay.com/mini/api/ui-navigate + my.navigateTo({ + url: 'new_page?count=100' + }); + // test.js + Page({ + onLoad(query: any) { + my.alert({ + content: JSON.stringify(query), + }); + } + }); + my.redirectTo({ + url: 'new_page?count=100' + }); + // 注æ„:调用 navigateTo 跳转时,调用该方法的页é¢ä¼šè¢«åŠ å…¥å †æ ˆï¼Œ + // 而 redirectTo 方法则ä¸ä¼šã€‚è§ä¸‹æ–¹ç¤ºä¾‹ä»£ç  + + // 此处是oneé¡µé¢ + my.navigateTo({ + url: 'two?pageId=10000' + }); + + // 此处是twoé¡µé¢ + my.navigateTo({ + url: 'one?pageId=99999' + }); + + // 在three页é¢å†… navigateBack,将返回oneé¡µé¢ + my.navigateBack({ + delta: 2 + }); + my.reLaunch({ + url: '/page/index' + }); + my.setNavigationBar({ + title: '你好', + backgroundColor: '#108ee9', + success() { + my.alert({ + content: '设置æˆåŠŸ', + }); + }, + fail() { + my.alert({ + content: '设置是失败', + }); + }, + }); + my.showNavigationBarLoading(); + my.hideNavigationBarLoading(); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-tabbar + my.switchTab({ + url: '/home' + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-feedback + my.alert({ + title: '亲', + content: '您本月的账å•已出', + buttonText: '我知é“了', + success: () => { + my.alert({ + title: '用户点击了「我知é“了ã€', + }); + }, + }); + my.confirm({ + title: '温馨æç¤º', + content: 'æ‚¨æ˜¯å¦æƒ³æŸ¥è¯¢å¿«é€’å•å·ï¼š1234567890', + confirmButtonText: '马上查询', + cancelButtonText: 'æš‚ä¸éœ€è¦', + success: (result) => { + my.alert({ + title: `${result.confirm}`, + }); + }, + }); + my.prompt({ + title: '标题å•行', + message: '说明当å‰çжæ€ã€æç¤ºç”¨æˆ·è§£å†³æ–¹æ¡ˆï¼Œæœ€å¥½ä¸è¦è¶…过两行。', + placeholder: '给朋å‹ç•™è¨€', + okButtonText: '确定', + cancelButtonText: 'å–æ¶ˆ', + success: (result) => { + my.alert({ + title: JSON.stringify(result), + }); + }, + }); + my.showToast({ + type: 'success', + content: 'æ“作æˆåŠŸ', + duration: 3000, + success: () => { + my.alert({ + title: 'toast 消失了', + }); + }, + }); + my.hideToast(); + my.showLoading({ + content: '加载中...', + delay: 1000, + }); + + my.hideLoading(); + + Page({ + onLoad() { + my.showLoading(); + const that = this; + setTimeout(() => { + my.hideLoading({ + page: that, // 防止执行时已ç»åˆ‡æ¢åˆ°å…¶å®ƒé¡µé¢ï¼Œpage指å‘ä¸å‡†ç¡® + }); + }, 4000); + } + }); + my.showNavigationBarLoading(); + my.hideNavigationBarLoading(); + my.showActionSheet({ + title: '支付å®-ActionSheet', + items: ['èœå•一', 'èœå•二', 'èœå•三', 'èœå•å››', 'èœå•五'], + badges: [ + { index: 0, type: 'none' }, + { index: 1, type: 'point' }, + { index: 2, type: 'num', text: '99' }, + { index: 3, type: 'text', text: '推è' }, + { index: 4, type: 'more' }], + cancelButtonText: 'å–æ¶ˆå¥½äº†', + success: (res) => { + const btn = res.index === -1 ? 'å–æ¶ˆ' : `第${res.index}个`; + my.alert({ + title: `你点了${btn}按钮` + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-pulldown + Page({ + onPullDownRefresh() { + my.stopPullDownRefresh(); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-contact + my.choosePhoneContact({ + success: (res) => { + my.alert({ + content: `å§“å:${res.name}\nå·ç ï¼š${res.mobile}` + }); + } + }); + my.chooseAlipayContact({ + count: 2, + success: (res) => { + my.alert({ + content: 'chooseAlipayContact response: ' + JSON.stringify(res) + }); + }, + fail: (res) => { + my.alert({ + content: 'chooseAlipayContact response: ' + JSON.stringify(res) + }); + } + }); + my.chooseContact({ + chooseType: 'multi', // å¤šé€‰æ¨¡å¼ + includeMe: true, // 包å«è‡ªå·± + includeMobileContactMode: 'known', // 仅包å«åŒå‘手机通讯录è”系人,也å³åŒæ–¹æ‰‹æœºé€šè®¯å½•都存有对方å·ç çš„è”系人 + multiChooseMax: 3, // 最多能选择三个è”系人 + multiChooseMaxTips: '超过选择的最大人数了', + success: (res) => { + my.alert({ + content: 'chooseContact : ' + JSON.stringify(res) + }); + }, + fail: (res) => { + my.alert({ + content: 'chooseContact : ' + JSON.stringify(res) + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-city + my.chooseCity({ + cities: [ + { + city: 'æœé˜³åŒº', + adCode: '110105', + spell: 'chaoyang' + }, + { + city: '海淀区', + adCode: '110108', + spell: 'haidian' + }, + { + city: '丰å°åŒº', + adCode: '110106', + spell: 'fengtai' + }, + { + city: '东城区', + adCode: '110101', + spell: 'dongcheng' + }, + { + city: '西城区', + adCode: '110102', + spell: 'xicheng' + }, + { + city: '房山区', + adCode: '110111', + spell: 'fangshan' + } + ], + hotCities: [ + { + city: 'æœé˜³åŒº', + adCode: '110105' + }, + { + city: '海淀区', + adCode: '110108' + }, + { + city: '丰å°åŒº', + adCode: '110106' + } + ], + success: (res) => { + my.alert({ + content: `${res.city}:${res.adCode}` + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-date + my.datePicker({ + format: 'yyyy-MM-dd', + currentDate: '2012-12-12', + startDate: '2012-12-10', + endDate: '2012-12-15', + success: (res) => { + my.alert({ + content: res.date, + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-animation + const animation = my.createAnimation({ + transformOrigin: "top right", + duration: 3000, + timeFunction: "ease-in-out", + delay: 100, + }); + Page({ + data: { + animationInfo: {} + }, + onShow() { + const animation = my.createAnimation({ + duration: 1000, + timeFunction: 'ease-in-out', + }); + + this.animation = animation; + + animation.scale(3, 3).rotate(60).step(); + + this.setData({ + animationInfo: animation.export() + }); + + setTimeout(() => { + animation.translate(35).step(); + this.setData({ + animationInfo: animation.export(), + }); + }, 1500); + }, + rotateAndScale(this: my.Page) { + // æ—‹è½¬åŒæ—¶æ”¾å¤§ + this.animation.rotate(60).scale(3, 3).step(); + this.setData({ + animationInfo: this.animation.export(), + }); + }, + rotateThenScale(this: my.Page) { + // å…ˆæ—‹è½¬åŽæ”¾å¤§ + this.animation.rotate(60).step(); + this.animation.scale(3, 3).step(); + this.setData({ + animationInfo: this.animation.export(), + }); + }, + rotateAndScaleThenTranslate(this: my.Page) { + // å…ˆæ—‹è½¬åŒæ—¶æ”¾å¤§ï¼Œç„¶åŽå¹³ç§» + this.animation.rotate(60).scale(3, 3).step(); + this.animation.translate(100, 100).step({ duration: 2000 }); + this.setData({ + animationInfo: this.animation.export() + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-canvas + const ctx = my.createCanvasContext('awesomeCanvas'); + ctx.toTempFilePath({ + success() { }, + }); + + ctx.setTextAlign("left"); + ctx.fillText("Hello world", 0, 100); + + ctx.setTextBaseline("top"); + ctx.fillText("Hello world", 0, 100); + + ctx.setFillStyle('blue'); + ctx.fillRect(50, 50, 100, 175); + ctx.draw(); + + ctx.setStrokeStyle('blue'); + ctx.strokeRect(50, 50, 100, 175); + ctx.draw(); + + ctx.setFillStyle('red'); + ctx.setShadow(15, 45, 45, 'yellow'); + ctx.fillRect(20, 20, 100, 175); + ctx.draw(); + + const grd = ctx.createLinearGradient(10, 10, 150, 10); + grd.addColorStop(0, 'yellow'); + grd.addColorStop(1, 'blue'); + + ctx.setFillStyle(grd); + ctx.fillRect(20, 20, 250, 180); + ctx.draw(); + + grd.addColorStop(0, 'blue'); + grd.addColorStop(1, 'red'); + + ctx.setFillStyle(grd); + ctx.fillRect(20, 20, 250, 180); + ctx.draw(); + + grd.addColorStop(0.36, 'orange'); + grd.addColorStop(0.56, 'cyan'); + grd.addColorStop(0.63, 'yellow'); + grd.addColorStop(0.76, 'blue'); + grd.addColorStop(0.54, 'green'); + grd.addColorStop(1, 'purple'); + grd.addColorStop(0.4, 'red'); + + ctx.setFillStyle(grd); + ctx.fillRect(20, 20, 250, 180); + ctx.draw(); + + ctx.beginPath(); + ctx.moveTo(20, 20); + ctx.lineTo(250, 10); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(10); + ctx.moveTo(20, 35); + ctx.lineTo(250, 30); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(20); + ctx.moveTo(20, 50); + ctx.lineTo(250, 55); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(25); + ctx.moveTo(20, 80); + ctx.lineTo(250, 85); + ctx.stroke(); + + ctx.draw(); + + ctx.beginPath(); + ctx.moveTo(10, 10); + ctx.lineTo(150, 10); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineCap('round'); + ctx.setLineWidth(20); + ctx.moveTo(20, 70); + ctx.lineTo(250, 80); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineCap('butt'); + ctx.setLineWidth(10); + ctx.moveTo(25, 80); + ctx.lineTo(250, 30); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineCap('square'); + ctx.setLineWidth(10); + ctx.moveTo(35, 47); + ctx.lineTo(230, 120); + ctx.stroke(); + + ctx.draw(); + + ctx.beginPath(); + ctx.moveTo(20, 30); + ctx.lineTo(150, 70); + ctx.lineTo(20, 100); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineJoin('round'); + ctx.setLineWidth(20); + ctx.moveTo(100, 20); + ctx.lineTo(280, 80); + ctx.lineTo(100, 100); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineJoin('bevel'); + ctx.setLineWidth(20); + ctx.moveTo(60, 25); + ctx.lineTo(180, 80); + ctx.lineTo(90, 100); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineJoin('miter'); + ctx.setLineWidth(15); + ctx.moveTo(130, 70); + ctx.lineTo(250, 50); + ctx.lineTo(230, 100); + ctx.stroke(); + + ctx.draw(); + + ctx.beginPath(); + ctx.setLineWidth(15); + ctx.setLineJoin('miter'); + ctx.setMiterLimit(1); + ctx.moveTo(10, 10); + ctx.lineTo(100, 50); + ctx.lineTo(10, 90); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(15); + ctx.setLineJoin('miter'); + ctx.setMiterLimit(2); + ctx.moveTo(50, 10); + ctx.lineTo(140, 50); + ctx.lineTo(50, 90); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(15); + ctx.setLineJoin('miter'); + ctx.setMiterLimit(3); + ctx.moveTo(90, 10); + ctx.lineTo(180, 50); + ctx.lineTo(90, 90); + ctx.stroke(); + + ctx.draw(); + + ctx.rect(20, 20, 250, 80); + ctx.setFillStyle('blue'); + ctx.fill(); + ctx.draw(); + + ctx.fillRect(20, 20, 250, 80); + ctx.setFillStyle('blue'); + ctx.draw(); + + ctx.setStrokeStyle('blue'); + ctx.strokeRect(20, 20, 250, 80); + ctx.draw(); + + ctx.setFillStyle('blue'); + ctx.fillRect(250, 10, 250, 200); + ctx.setFillStyle('yellow'); + ctx.fillRect(0, 0, 150, 200); + ctx.clearRect(10, 10, 150, 75); + ctx.draw(); + + ctx.moveTo(20, 20); + ctx.lineTo(200, 20); + ctx.lineTo(200, 200); + ctx.fill(); + ctx.draw(); + + ctx.rect(20, 20, 110, 40); + ctx.setFillStyle('blue'); + ctx.fill(); + + ctx.beginPath(); + ctx.rect(20, 30, 150, 40); + + ctx.setFillStyle('yellow'); + ctx.fillRect(20, 80, 150, 40); + + ctx.rect(20, 150, 150, 40); + + ctx.setFillStyle('red'); + ctx.fill(); + ctx.draw(); + + ctx.moveTo(20, 20); + ctx.lineTo(150, 10); + ctx.lineTo(150, 150); + ctx.stroke(); + ctx.draw(); + + ctx.rect(10, 10, 100, 30); + ctx.setStrokeStyle('blue'); + ctx.stroke(); + + ctx.beginPath(); + ctx.rect(20, 50, 150, 50); + + ctx.setStrokeStyle('yellow'); + ctx.strokeRect(15, 75, 200, 35); + + ctx.rect(20, 200, 150, 30); + + ctx.setStrokeStyle('red'); + ctx.stroke(); + ctx.draw(); + + ctx.rect(20, 20, 150, 50); + ctx.setFillStyle('blue'); + ctx.fill(); + + ctx.beginPath(); + ctx.rect(20, 50, 150, 40); + + ctx.setFillStyle('yellow'); + ctx.fillRect(20, 170, 150, 40); + + ctx.rect(10, 100, 100, 30); + + ctx.setFillStyle('red'); + ctx.fill(); + ctx.draw(); + + ctx.moveTo(20, 20); + ctx.lineTo(150, 20); + ctx.lineTo(150, 150); + ctx.closePath(); + ctx.stroke(); + ctx.draw(); + + ctx.rect(20, 20, 150, 50); + ctx.closePath(); + + ctx.beginPath(); + ctx.rect(20, 50, 150, 40); + + ctx.setFillStyle('red'); + ctx.fillRect(20, 80, 120, 30); + + ctx.rect(20, 150, 150, 40); + + ctx.setFillStyle('blue'); + ctx.fill(); + ctx.draw(); + + ctx.moveTo(20, 20); + ctx.lineTo(150, 15); + + ctx.moveTo(20, 55); + ctx.lineTo(120, 60); + ctx.stroke(); + ctx.draw(); + + ctx.moveTo(20, 20); + ctx.rect(20, 20, 80, 30); + ctx.lineTo(120, 80); + ctx.stroke(); + ctx.draw(); + + ctx.arc(200, 75, 50, 0, 2 * Math.PI); + ctx.setFillStyle('#CCCCCC'); + ctx.fill(); + + ctx.beginPath(); + ctx.moveTo(50, 65); + ctx.lineTo(170, 80); + ctx.moveTo(200, 35); + ctx.lineTo(200, 235); + ctx.setStrokeStyle('#AAAAAA'); + ctx.stroke(); + + ctx.setFontSize(12); + ctx.setFillStyle('yellow'); + ctx.fillText('0', 165, 78); + ctx.fillText('0.6*PI', 96, 148); + ctx.fillText('1*PI', 15, 57); + ctx.fillText('1.7*PI', 94, 20); + + ctx.beginPath(); + ctx.arc(200, 85, 2, 0, 2 * Math.PI); + ctx.setFillStyle('blue'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(200, 35, 2, 0, 2 * Math.PI); + ctx.setFillStyle('green'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(450, 60, 2, 0, 2 * Math.PI); + ctx.setFillStyle('red'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(150, 35, 50, 0, 1.8 * Math.PI); + ctx.setStrokeStyle('#666666'); + ctx.stroke(); + + ctx.draw(); + + ctx.beginPath(); + ctx.arc(30, 30, 2, 0, 2 * Math.PI); + ctx.setFillStyle('red'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(250, 25, 2, 0, 2 * Math.PI); + ctx.setFillStyle('blue'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(20, 100, 2, 0, 2 * Math.PI); + ctx.arc(200, 100, 2, 0, 2 * Math.PI); + ctx.setFillStyle('green'); + ctx.fill(); + + ctx.setFillStyle('yellow'); + ctx.setFontSize(14); + + ctx.beginPath(); + ctx.moveTo(30, 30); + ctx.lineTo(30, 100); + ctx.lineTo(150, 75); + + ctx.moveTo(250, 30); + ctx.lineTo(250, 80); + ctx.lineTo(70, 75); + ctx.setStrokeStyle('#EEEEEE'); + ctx.stroke(); + + ctx.beginPath(); + ctx.moveTo(30, 30); + ctx.bezierCurveTo(30, 150, 250, 150, 180, 20); + ctx.setStrokeStyle('black'); + ctx.stroke(); + + ctx.draw(); + + ctx.beginPath(); + ctx.arc(30, 30, 2, 0, 2 * Math.PI); + ctx.setFillStyle('red'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(250, 20, 2, 0, 2 * Math.PI); + ctx.setFillStyle('blue'); + ctx.fill(); + + ctx.beginPath(); + ctx.arc(30, 200, 2, 0, 2 * Math.PI); + ctx.setFillStyle('green'); + ctx.fill(); + + ctx.setFillStyle('black'); + ctx.setFontSize(12); + + ctx.beginPath(); + ctx.moveTo(30, 30); + ctx.lineTo(30, 150); + ctx.lineTo(250, 30); + ctx.setStrokeStyle('#AAAAAA'); + ctx.stroke(); + + ctx.beginPath(); + ctx.moveTo(30, 30); + ctx.quadraticCurveTo(30, 150, 250, 25); + ctx.setStrokeStyle('black'); + ctx.stroke(); + + ctx.draw(); + + ctx.strokeRect(15, 15, 30, 25); + ctx.scale(3, 3); + ctx.strokeRect(15, 15, 30, 25); + ctx.scale(3, 3); + ctx.strokeRect(15, 15, 30, 25); + + ctx.draw(); + + ctx.strokeRect(200, 20, 180, 150); + ctx.rotate(30 * Math.PI / 180); + ctx.strokeRect(200, 20, 180, 150); + ctx.rotate(30 * Math.PI / 180); + ctx.strokeRect(200, 20, 180, 150); + + ctx.draw(); + + ctx.strokeRect(20, 20, 250, 80); + ctx.translate(30, 30); + ctx.strokeRect(20, 20, 250, 80); + ctx.translate(30, 30); + ctx.strokeRect(20, 20, 250, 80); + + ctx.draw(); + + ctx.setFontSize(14); + ctx.fillText('14', 20, 20); + ctx.setFontSize(22); + ctx.fillText('22', 40, 40); + ctx.setFontSize(30); + ctx.fillText('30', 60, 60); + ctx.setFontSize(38); + ctx.fillText('38', 90, 90); + + ctx.draw(); + + ctx.setFontSize(42); + ctx.fillText('Hello', 30, 30); + ctx.fillText('alipay', 200, 200); + + ctx.draw(); + + ctx.drawImage('https://img.alicdn.com/tfs/TB1GvVMj2BNTKJjy0FdXXcPpVXa-520-280.jpg', 2, 2, 250, 80); + ctx.draw(); + + ctx.setFillStyle('yellow'); + ctx.fillRect(10, 10, 150, 100); + ctx.setGlobalAlpha(0.2); + ctx.setFillStyle('blue'); + ctx.fillRect(50, 50, 150, 100); + ctx.setFillStyle('red'); + ctx.fillRect(100, 100, 150, 100); + + ctx.draw(); + + ctx.setLineDash([5, 15, 25]); + ctx.beginPath(); + ctx.moveTo(0, 100); + ctx.lineTo(400, 100); + ctx.stroke(); + + ctx.draw(); + + ctx.rotate(45 * Math.PI / 180); + ctx.setFillStyle('red'); + ctx.fillRect(70, 0, 100, 30); + + ctx.transform(1, 1, 0, 1, 0, 0); + ctx.setFillStyle('#000'); + ctx.fillRect(0, 0, 100, 100); + + ctx.draw(); + + ctx.rotate(45 * Math.PI / 180); + ctx.setFillStyle('red'); + ctx.fillRect(70, 0, 100, 30); + + ctx.setTransform(1, 1, 0, 1, 0, 0); + ctx.setFillStyle('#000'); + ctx.fillRect(0, 0, 100, 100); + + ctx.draw(); + + ctx.save(); + ctx.setFillStyle('red'); + ctx.fillRect(20, 20, 250, 80); + + ctx.restore(); + ctx.fillRect(60, 60, 155, 130); + + ctx.draw(); + + ctx.setFillStyle('blue'); + ctx.fillRect(20, 20, 180, 80); + ctx.draw(); + ctx.fillRect(60, 60, 250, 120); + ctx.draw(true); + + ctx.font = 'italic bold 50px cursive'; + const { width } = ctx.measureText('hello world'); + console.log(width); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-map + Page({ + onReady() { + // 使用 my.createMapContext èŽ·å– map 上下文 + this.mapCtx = my.createMapContext('userMap'); + }, + getCenterLocation(this: my.Page) { + (this.mapCtx as my.MapContext).getCenterLocation({ + success(res) { + console.log(res.longitude); + console.log(res.latitude); + } + }); + }, + moveToLocation() { + this.mapCtx.moveToLocation(); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ui-hidekeyboard + my.hideKeyboard(); +})(); + +(() => { + // https://docs.alipay.com/mini/api/scroll + my.pageScrollTo({ + scrollTop: 100 + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/selector-query + Page({ + onReady() { + my.createSelectorQuery() + .select('#non-exists').boundingClientRect() + .select('#one').boundingClientRect() + .selectAll('.all').boundingClientRect() + .select('#scroll').scrollOffset() + .selectViewport().boundingClientRect() + .selectViewport().scrollOffset().exec((ret) => { + console.log(JSON.stringify(ret, null, 2)); + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/ewdxl3 + my.multiLevelSelect({ + title: 'nihao', // 级è”选择标题 + list: [ + { + name: "æ­å·žå¸‚", // æ¡ç›®åç§° + subList: [ + { + name: "西湖区", + subList: [ + { + name: "å¤ç¿ è¡—é“" + }, + { + name: "文新街é“" + } + ] + }, + { + name: "上城区", + subList: [ + { + name: "延安街é“" + }, + { + name: "龙翔桥街é“" + } + ] + } + ]// 级è”å­æ•°æ®åˆ—表 + } + ]// çº§è”æ•°æ®åˆ—表 + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/openapi-authorize + my.getAuthCode({ + scopes: 'auth_user', + success: (res) => { + my.alert({ + content: res.authCode, + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/userinfo + my.getAuthCode({ + scopes: 'auth_user', + success: (res) => { + my.getAuthUserInfo({ + success: (userInfo) => { + my.alert({ + content: userInfo.nickName + }); + my.alert({ + content: userInfo.avatar + }); + } + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/openapi-pay + my.tradePay({ + tradeNO: '201711152100110410533667792', // 调用统一收å•交易创建接å£ï¼ˆalipay.trade.create),获得返回字段支付å®äº¤æ˜“å·trade_no + success: (res) => { + my.alert({ + content: JSON.stringify(res), + }); + }, + fail: (res) => { + my.alert({ + content: JSON.stringify(res), + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/pay-sign + my.paySignCenter({ + // tslint:disable-next-line:max-line-length + signStr: 'biz_content%3D%257B%2522access_params%2522%253A%257B%2522channel%2522%253A%2522ALIPAYAPP%2522%257D%252C%2522external_agreement_no%2522%253A%2522xidong___2317%2522%252C%2522external_logon_id%2522%253A%252213852852877%2522%252C%2522personal_product_code%2522%253A%2522GENERAL_WITHHOLDING_P%2522%252C%2522product_code%2522%253A%2522GENERAL_WITHHOLDING%2522%252C%2522sign_scene%2522%253A%2522INDUSTRY%257CCARRENTAL%2522%252C%2522third_party_type%2522%253A%2522PARTNER%2522%257D%26sign%3Df3pjBDTRftOwXWnCqAMAnkBfGTFlcMmZI8hEgmV6uREZRXVDuLsSjD8WO%252FeZ1fjDG8GqVO9t1AN7q6yCUHKX%252Bw%252FE7efXwpVDWldr4iVuXDtNd3UJDJUiRJhIm6b73czWacVzm1XIery%252F2DyKI2y08tBf5NNWuQCC3d%252FITxziTl8%253D%26timestamp%3D2017-06-27%2B14%253A44%253A00%26sign_type%3DRSA%26notify_url%3Dhttp%253A%252F%252Fapi.test.alipay.net%252Fatinterface%252Freceive_notify.htm%26charset%3DUTF-8%26app_id%3D2017060101317939%26method%3Dalipay.user.agreement.page.sign%26return_url%3Dhttp%253A%252F%252Fapi.test.alipay.net%252Fatinterface%252Freceive_notify.htm%26version%3D1.0', + success: (res) => { + my.alert({ + title: 'success', // alert框的标题 + content: JSON.stringify(res) + }); + }, + fail: (res) => { + my.alert({ + title: 'fail', // alert框的标题 + content: JSON.stringify(res) + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/card-voucher-ticket + my.openCardList(); + my.openMerchantCardList({ partnerId: '2088xxxxx' }); + // ä¼ å…¥passIdæ¥æ‰“å¼€ + my.openCardDetail({ passId: "11xxxxx" }); + my.openVoucherList(); + my.openMerchantVoucherList({ partnerId: '2088xxxx' }); + // ä¼ å…¥passIdæ¥æ‰“å¼€ + my.openVoucherDetail({ passId: "20170921" }); + + // ä¼ å…¥partnerId å’Œ serialNumberæ¥æ‰“å¼€ + my.openVoucherDetail({ + partnerId: "2018xxxx", + serialNumber: "20170921" + }); + // ä¼ å…¥passIdæ¥æ‰“å¼€ + my.openKBVoucherDetail({ passId: "20170921" }); + + // ä¼ å…¥partnerId å’Œ serialNumberæ¥æ‰“å¼€ + my.openKBVoucherDetail({ + partnerId: "2088xxxx", + serialNumber: "20170921" + }); + my.openTicketList(); + my.openMerchantTicketList({ partnerId: '2088xxxx' }); + // ä¼ å…¥passIdæ¥æ‰“å¼€ + my.openTicketDetail({ passId: "20170921" }); + + // ä¼ å…¥partnerId å’Œ serialNumberæ¥æ‰“å¼€ + my.openTicketDetail({ + partnerId: "2088xxxx", + serialNumber: "20170921" + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/add-card-auth + my.addCardAuth({ + url: '从 openapi 接å£èŽ·å–到的 url', + success: (res) => { + my.alert({ content: 'æŽˆæƒæˆåŠŸ' }); + }, + fail: (res) => { + my.alert({ content: '授æƒå¤±è´¥' }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/zm-service + my.startZMVerify({ + bizNo: 'your-biz-no', + success: (res) => { + my.alert({ title: 'success:' + JSON.stringify(res) }); + }, + fail: (res) => { + my.alert({ title: 'fail: ' + JSON.stringify(res) }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/zmcreditborrow + my.zmCreditBorrow({ + credit_biz: "", + out_order_no: "", + borrow_shop_name: "", + goods_name: "", + product_code: "w1010100000000002858", + rent_unit: "HOUR_YUAN", + rent_amount: "0.10", + deposit_amount: "0.50", + deposit_state: "Y", + invoke_return_url: "", + invoke_type: "TINYAPP", + borrow_time: "2017-04-27 10:01:01", + expiry_time: "2017-05-27 10:01:01", + rent_info: "2hour-free", + success: (res) => { + try { + const { resultStatus, result } = res; + switch (resultStatus) { + case '9000': + const callbackData = result.callbackData; + const decodedCallbackData = decodeURIComponent(callbackData); + const json = JSON.parse(decodedCallbackData.match(/{.*}/)!.toString()); + const jsonStr = JSON.stringify(json, null, 4); + if (json.success === true || json.success === 'true') { + // åˆ›å»ºè®¢å•æˆåŠŸ, 此时å¯ä»¥è·³è½¬åˆ°è®¢å•è¯¦æƒ…é¡µé¢ + my.alert({ content: '䏋啿ˆåŠŸ: ' + jsonStr }); + } else { + // 创建订å•失败, 请æç¤ºç”¨æˆ·åˆ›å»ºå¤±è´¥ + my.alert({ content: '下å•失败: ' + jsonStr }); + } + // (this as any as my.Page).setData({ + // callbackData, + // decodedCallbackData, + // parsedJSON: jsonStr, + // }); + break; + case '6001': + // 用户点击返回, å–æ¶ˆæ­¤æ¬¡æœåŠ¡, 此时å¯ä»¥ç»™æç¤º + my.alert({ content: 'å–æ¶ˆ' }); + break; + default: + break; + } + } catch (error) { + // 异常, 请在这里æç¤ºç”¨æˆ·ç¨åŽé‡è¯• + my.alert({ + content: '异常' + JSON.stringify(error, null, 4) + }); + } + }, + fail: (error) => { + // 调用接å£å¤±è´¥, 请在这里æç¤ºç”¨æˆ·ç¨åŽé‡è¯• + my.alert({ + content: '调用失败' + JSON.stringify(error, null, 4) + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/templatemessage +})(); + +(() => { + // https://docs.alipay.com/mini/api/text-identification + my.textRiskIdentification({ + content: '加我支付å®', + type: ['keyword', '0', '1', '2', '3'], + success: (res) => { + my.alert({ + title: 'ok', // alert 框的标题 + content: JSON.stringify(res), + }); + }, + fail: (res) => { + my.alert({ + title: 'fail', // alert 框的标题 + content: JSON.stringify(res), + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/open-miniprogram + my.navigateToMiniProgram({ + appId: 'xxxx', + extraData: { + data1: "test" + }, + success: (res) => { + console.log(JSON.stringify(res)); + }, + fail: (res) => { + console.log(JSON.stringify(res)); + } + }); + my.navigateBackMiniProgram({ + extraData: { + data1: "test" + }, + success: (res) => { + console.log(JSON.stringify(res)); + }, + fail: (res) => { + console.log(JSON.stringify(res)); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/webview-context + Page({ + onLoad() { + this.webViewContext = my.createWebViewContext('web-view-1'); + }, + // 接收æ¥è‡ªH5çš„æ¶ˆæ¯ + onMessage(e: any) { + console.log(e); // {'sendToMiniProgram': '0'} + // å‘H5å‘逿¶ˆæ¯ + this.webViewContext.postMessage({ sendToWebView: '1' }); + } + }); + // H5çš„js代ç ä¸­éœ€è¦å…ˆå®šä¹‰my.onMessage 用于接收æ¥è‡ªå°ç¨‹åºçš„æ¶ˆæ¯ã€‚ + my.onMessage = (e) => { + console.log(e); // {'sendToWebView': '1'} + }; + // H5想å°ç¨‹åºå‘逿¶ˆæ¯ + my.postMessage({ sendToMiniProgram: '0' }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/media-image + const img = null as any as HTMLImageElement; + my.chooseImage({ + count: 2, + success: (res) => { + img.src = res.apFilePaths[0]; + }, + }); + my.previewImage({ + current: 2, + urls: [ + 'https://img.alicdn.com/tps/TB1sXGYIFXXXXc5XpXXXXXXXXXX.jpg', + 'https://img.alicdn.com/tps/TB1pfG4IFXXXXc6XXXXXXXXXXXX.jpg', + 'https://img.alicdn.com/tps/TB1h9xxIFXXXXbKXXXXXXXXXXXX.jpg' + ], + }); + my.saveImage({ + url: 'https://img.alicdn.com/tps/TB1sXGYIFXXXXc5XpXXXXXXXXXX.jpg' + }); + my.compressImage({ + apFilePaths: ['https://resource/apmlcc0ed184daffc5a0d8da86b2f518cf7b.image'], + // level: 1, + success: (res) => { + console.log(JSON.stringify(res)); + } + }); + // 网络图片路径 + my.getImageInfo({ + src: 'https://img.alicdn.com/tps/TB1sXGYIFXXXXc5XpXXXXXXXXXX.jpg', + success: (res) => { + console.log(JSON.stringify(res)); + } + }); + + // apFilePath + my.chooseImage({ + success: (res) => { + my.getImageInfo({ + src: res.apFilePaths[0], + success: (res) => { + console.log(JSON.stringify(res)); + } + }); + }, + }); + + // 相对路径 + my.getImageInfo({ + src: 'image/api.png', + success: (res) => { + console.log(JSON.stringify(res)); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/storage + my.setStorage({ + key: 'currentCity', + data: { + cityName: 'æ­å·ž', + adCode: '330100', + spell: ' hangzhou', + }, + success() { + my.alert({ content: '写入æˆåŠŸ' }); + } + }); + my.setStorageSync({ + key: 'currentCity', + data: { + cityName: 'æ­å·ž', + adCode: '330100', + spell: ' hangzhou', + } + }); + my.getStorage({ + key: 'currentCity', + success(res) { + my.alert({ content: 'èŽ·å–æˆåŠŸï¼š' + res.data.cityName }); + }, + fail(res) { + my.alert({ content: res.errorMessage }); + } + }); + const res = my.getStorageSync({ key: 'currentCity' }); + my.alert({ + content: JSON.stringify(res.data), + }); + my.removeStorage({ + key: 'currentCity', + success() { + my.alert({ content: '删除æˆåŠŸ' }); + } + }); + my.removeStorageSync({ + key: 'currentCity', + }); + my.clearStorage(); + my.clearStorageSync(); + my.getStorageInfo({ + success(res) { + console.log(res.keys); + console.log(res.currentSize); + console.log(res.limitSize); + } + }); + const res1 = my.getStorageInfoSync(); + console.log(res1.keys); + console.log(res1.currentSize); + console.log(res1.limitSize); +})(); + +(() => { + // https://docs.alipay.com/mini/api/file + my.chooseImage({ + success: (res) => { + my.saveFile({ + apFilePath: res.apFilePaths[0], + success: (res) => { + console.log(JSON.stringify(res)); + }, + }); + }, + }); + my.getFileInfo({ + apFilePath: 'https://resource/apml953bb093ebd2834530196f50a4413a87.video', + digestAlgorithm: 'sha1', + success: (res) => { + console.log(JSON.stringify(res)); + } + }); + my.getSavedFileInfo({ + apFilePath: 'https://resource/apml953bb093ebd2834530196f50a4413a87.video', + success: (res) => { + console.log(JSON.stringify(res)); + } + }); + my.getSavedFileList({ + success: (res) => { + console.log(JSON.stringify(res)); + } + }); + my.getSavedFileList({ + success: (res) => { + my.removeSavedFile({ + apFilePath: res.fileList[0].apFilePath, + success: (res) => { + console.log('remove success'); + } + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/location + my.getLocation({ + success(res) { + my.hideLoading(); + console.log(res); + /* that对象为Pageå¯ä»¥è®¾ç½®æ•°æ®åˆ·æ–°ç•Œé¢ + that.setData({ + hasLocation: true, + location: formatLocation(res.longitude, res.latitude) + }) + */ + }, + fail() { + my.hideLoading(); + my.alert({ title: '定ä½å¤±è´¥' }); + }, + }); + my.openLocation({ + longitude: '121.549697', + latitude: '31.227250', + name: '支付å®', + address: 'æ¨é«˜è·¯åœ°é“ç«™', + }); + my.chooseLocation({ + success: (res) => { + console.log(res); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/network + my.httpRequest({ + url: 'http://httpbin.org/post', + method: 'POST', + data: { + from: '支付å®', + production: 'AlipayJSAPI', + }, + dataType: 'json', + success(res) { + my.alert({ content: 'success' }); + }, + fail(res) { + my.alert({ content: 'fail' }); + }, + complete(res) { + my.hideLoading(); + my.alert({ content: 'complete' }); + } + }); + my.uploadFile({ + url: '请使用自己æœåŠ¡å™¨åœ°å€', + fileType: 'image', + fileName: 'file', + filePath: '...', + success: (res) => { + my.alert({ + content: '上传æˆåŠŸ' + }); + }, + }); + my.downloadFile({ + url: 'http://img.alicdn.com/tfs/TB1x669SXXXXXbdaFXXXXXXXXXX-520-280.jpg', + success({ apFilePath }) { + my.previewImage({ + urls: [apFilePath], + }); + }, + fail(res) { + my.alert({ + content: res.errorMessage || res.error, + }); + }, + }); + my.connectSocket({ + url: 'test.php', + data: {}, + header: { + 'content-type': 'application/json' + }, + method: 'GET' + }); + my.connectSocket({ + url: 'test.php', + }); + + my.onSocketOpen(() => { + console.log('WebSocket 连接已打开ï¼'); + }); + Page({ + onLoad() { + this.callback = this.callback.bind(this); + my.onSocketOpen(this.callback); + }, + onUnload() { + my.offSocketOpen(this.callback); + }, + callback() { + }, + }); + my.connectSocket({ + url: 'å¼€å‘者的æœåŠ¡å™¨åœ°å€' + }); + + my.onSocketOpen(() => { + console.log('WebSocket 连接已打开ï¼'); + }); + + my.onSocketError(() => { + console.log('WebSocket 连接打开失败,请检查ï¼'); + }); + Page({ + onLoad() { + this.callback = this.callback.bind(this); + my.onSocketError(this.callback); + }, + onUnload() { + my.offSocketError(this.callback); + }, + callback() { + my.sendSocketMessage({ + data: this.data.toSendMessage, // 需è¦å‘é€çš„内容 + success: (res) => { + my.alert({ content: 'æ•°æ®å‘é€ï¼' + this.data.toSendMessage }); + }, + }); + }, + }); + my.connectSocket({ + url: 'æœåŠ¡å™¨åœ°å€' + }); + + my.onSocketMessage((res) => { + console.log('收到æœåŠ¡å™¨å†…å®¹ï¼š' + res.data); + }); + my.onSocketOpen(() => { + my.closeSocket(); + }); + + my.onSocketClose(() => { + console.log('WebSocket 已关闭ï¼'); + }); + Page({ + // onLoad() { + onLaunch() { + // 注æ„: 回调方法的注册在整个å°ç¨‹åºå¯åŠ¨é˜¶æ®µåªè¦åšä¸€æ¬¡ï¼Œè°ƒå¤šæ¬¡ä¼šæœ‰å¤šæ¬¡å›žè°ƒ + my.onSocketClose(() => { + my.alert({ content: '连接已关闭ï¼' }); + this.setData({ + sendMessageAbility: false, + closeLinkAbility: false, + }); + }); + // 注æ„: 回调方法的注册在整个å°ç¨‹åºå¯åŠ¨é˜¶æ®µåªè¦åšä¸€æ¬¡ï¼Œè°ƒå¤šæ¬¡ä¼šæœ‰å¤šæ¬¡å›žè°ƒ + my.onSocketOpen(() => { + my.alert({ content: '连接已打开ï¼' }); + this.setData({ + sendMessageAbility: true, + closeLinkAbility: true, + }); + }); + + my.onSocketError((res) => { + my.alert({ content: 'WebSocket 连接打开失败,请检查ï¼' + res }); + }); + + // 注æ„: 回调方法的注册在整个å°ç¨‹åºå¯åŠ¨é˜¶æ®µåªè¦åšä¸€æ¬¡ï¼Œè°ƒå¤šæ¬¡ä¼šæœ‰å¤šæ¬¡å›žè°ƒ + my.onSocketMessage((res) => { + my.alert({ content: '收到数æ®ï¼' + JSON.stringify(res) }); + }); + }, + connect_start() { + my.connectSocket({ + url: 'æœåŠ¡å™¨åœ°å€', // å¼€å‘者æœåŠ¡å™¨æŽ¥å£åœ°å€ï¼Œå¿…须是 wss å议,且域å必须是åŽå°é…ç½®çš„åˆæ³•域å + success: (res) => { + my.showToast({ + content: 'success', // 文字内容 + }); + }, + fail: () => { + my.showToast({ + content: 'fail', // 文字内容 + }); + } + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/can-i-use + my.canIUse('getFileInfo'); + my.canIUse('closeSocket.object.code'); + my.canIUse('getLocation.object.type'); + my.canIUse('getSystemInfo.return.brand'); + my.canIUse('lifestyle'); + my.canIUse('button.open-type.share'); +})(); + +(() => { + // https://docs.alipay.com/mini/api/sdk-version + console.log(my.SDKVersion); +})(); + +(() => { + // https://docs.alipay.com/mini/api/system-info + Page({ + data: { + systemInfo: {} + }, + getSystemInfoPage(this: my.Page) { + my.getSystemInfo({ + success: (res) => { + this.setData({ + systemInfo: res + }); + } + }); + }, + }); + Page({ + data: { + systemInfo: {} + }, + getSystemInfoSyncPage(this: my.Page) { + this.setData({ + systemInfo: my.getSystemInfoSync() + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/network-status + Page({ + data: { + hasNetworkType: false + }, + getNetworkType(this: my.Page) { + my.getNetworkType({ + success: (res) => { + this.setData({ + hasNetworkType: true, + networkType: res.networkType + }); + } + }); + }, + clear(this: my.Page) { + this.setData({ + hasNetworkType: false, + networkType: '' + }); + }, + }); + my.onNetworkStatusChange((res) => { + console.log(JSON.stringify(res)); + }); + my.offNetworkStatusChange(); +})(); + +(() => { + // https://docs.alipay.com/mini/api/clipboard + Page({ + data: { + text: '3.1415926', + copy: '', + }, + + handlePaste(this: my.Page) { + my.getClipboard({ + success: ({ text }) => { + this.setData({ copy: text }); + }, + }); + }, + }); + Page({ + data: { + text: '3.1415926', + copy: '', + }, + + handleCopy() { + my.setClipboard({ + text: this.data.text, + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/shake + Page({ + watchShake() { + my.watchShake({ + success() { + console.log('动起æ¥äº†'); + my.alert({ title: '动起æ¥äº† o.o' }); + } + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/vibrate + Page({ + vibrate() { + my.vibrate({ + success: () => { + my.alert({ title: '震动起æ¥äº†' }); + } + }); + }, + }); + Page({ + vibrateLong() { + my.vibrateLong({ + success: () => { + my.alert({ title: '震动起æ¥äº†' }); + } + }); + }, + }); + Page({ + vibrateShort() { + my.vibrateShort({ + success: () => { + my.alert({ title: '震动起æ¥äº†' }); + } + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/macke-call + Page({ + makePhoneCall() { + my.makePhoneCall({ number: '95888' }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/get-server-time + // getServerTime(){ + // my.getServerTime({ + // success: (res) => { + // my.alert({ + // title: res.time, + // }); + // }, + // }); + // }; +})(); + +(() => { + // https://docs.alipay.com/mini/api/user-capture-screen + my.onUserCaptureScreen(() => { + my.alert({ + content: '收到用户截å±äº‹ä»¶' + }); + }); + my.offUserCaptureScreen(); +})(); + +(() => { + // https://docs.alipay.com/mini/api/screen-brightness + my.setKeepScreenOn({ + keepScreenOn: true, + success: (res) => { + }, + fail: (res) => { + }, + }); + my.getScreenBrightness({ + success: (res) => { + console.log(JSON.stringify(res)); + }, + fail: (res) => { + }, + }); + my.setScreenBrightness({ + brightness: 0.5, + success: (res) => { + console.log(JSON.stringify(res)); + }, + fail: (res) => { + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/show-auth-guide + my.showAuthGuide({ + authType: 'LBSSERVICE' + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/scan + Page({ + scan() { + my.scan({ + type: 'qr', + success: (res) => { + my.alert({ title: res.code }); + }, + }); + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/bluetooth-intro + // åˆå§‹åŒ– + my.openBluetoothAdapter({ + success: (res) => { + console.log(res); + } + }); + // 注册å‘现事件 + my.onBluetoothDeviceFound({ + success: (res) => { + const device = res.devices[0]; + // 连接å‘现的设备 + my.connectBLEDevice({ + deviceId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + // åœæ­¢æœç´¢ + my.stopBluetoothDevicesDiscovery({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + } + }); + const deviceId = 'test'; + const serviceId = 'test'; + const characteristicId = 'test'; + // 注册连接事件 + my.onBLEConnectionStateChanged({ + success: (res) => { + console.log(res); + if (res.connected) { + // 开始读写notifyç­‰æ“作 + my.notifyBLECharacteristicValueChange({ + deviceId, + serviceId, + characteristicId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + } + } + }); + // 注册接收read或notifyçš„æ•°æ® + my.onBLECharacteristicValueChange({ + success: (res) => { + console.log(res); + } + }); + // 开始æœç´¢ + my.startBluetoothDevicesDiscovery({ + services: ['fff0'], + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + + // 断开连接 + my.disconnectBLEDevice({ + deviceId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + + // 注销事件 + my.offBluetoothDeviceFound(); + my.offBLEConnectionStateChanged(); + my.offBLECharacteristicValueChange(); + + // 退出è“ç‰™æ¨¡å— + my.closeBluetoothAdapter({ + success: (res) => { + }, + fail: (res) => { + }, + complete: (res) => { + } + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/bluetooth-api + my.openBluetoothAdapter({ + success: (res) => { + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.closeBluetoothAdapter({ + success: (res) => { + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.getBluetoothAdapterState({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.startBluetoothDevicesDiscovery({ + services: ['fff0'], + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.stopBluetoothDevicesDiscovery({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.getBluetoothDevices({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.getConnectedBluetoothDevices({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + const deviceId = 'test'; + const serviceId = 'test'; + const characteristicId = 'test'; + my.connectBLEDevice({ + // 这里的 deviceId 需è¦åœ¨ä¸Šé¢çš„ getBluetoothDevices 或 onBluetoothDeviceFound 接å£ä¸­èŽ·å– + deviceId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.disconnectBLEDevice({ + deviceId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.writeBLECharacteristicValue({ + deviceId, + serviceId, + characteristicId, + value: 'fffe', + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.readBLECharacteristicValue({ + deviceId, + serviceId, + characteristicId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.notifyBLECharacteristicValueChange({ + deviceId, + serviceId, + characteristicId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.getBLEDeviceServices({ + deviceId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + my.getBLEDeviceCharacteristics({ + deviceId, + serviceId, + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + Page({ + onLoad() { + this.callback = this.callback.bind(this); + my.onBluetoothDeviceFound(this.callback); + }, + onUnload() { + my.offBluetoothDeviceFound(this.callback); + }, + callback(res: any) { + console.log(res); + }, + }); + my.offBluetoothDeviceFound(); + Page({ + onLoad() { + this.callback = this.callback.bind(this); + my.onBLECharacteristicValueChange(this.callback); + }, + onUnload() { + my.offBLECharacteristicValueChange(this.callback); + }, + callback(res: any) { + console.log(res); + }, + }); + my.offBLECharacteristicValueChange(); + my.offBLEConnectionStateChanged(); + my.offBluetoothAdapterStateChange(); +})(); + +(() => { + // https://docs.alipay.com/mini/api/yqleyc + my.startBeaconDiscovery({ + uuids: ['uuid1', 'uuid2'], + success: (res) => { + console.log(res); + }, + fail: () => { + }, + complete: () => { + } + }); + + my.stopBeaconDiscovery({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + + my.getBeacons({ + success: (res) => { + console.log(res); + }, + fail: (res) => { + }, + complete: (res) => { + } + }); + + my.onBeaconUpdate({ + success: (res) => { + }, + }); + + my.onBeaconServiceChange({ + success: (res) => { + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/data-safe + Page({ + data: { + inputValue: '', + outputValue: '', + }, + onInput(this: my.Page, e: any) { + this.setData({ inputValue: e.detail.value }); + }, + onEncrypt(this: my.Page) { + my.rsa({ + action: 'encrypt', + // 设置公钥 + // tslint:disable-next-line:max-line-length + key: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDKmi0dUSVQ04hL6GZGPMFK8+d6\nGzulagP27qSUBYxIJfE04KT+OHVeFFb6K+8nWDea5mkmZrIgp022zZVDgdWPNM62\n3ouBwHlsfm2ekey8PpQxfXaj8lhM9t8rJlC4FEc0s8Qp7Q5/uYrowQbT9m6t7BFK\n3egOO2xOKzLpYSqfbQIDAQAB', + text: this.data.inputValue, + success: (result) => { + this.setData({ outputValue: result.text }); + }, + fail(e) { + my.alert({ + content: e.errorMessage || e.error, + }); + }, + }); + }, + onDecrypt(this: my.Page) { + my.rsa({ + action: 'decrypt', + text: this.data.inputValue, + // 设置ç§é’¥ + // tslint:disable-next-line:prefer-template + key: 'MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMqaLR1RJVDTiEvo\n' + + 'ZkY8wUrz53obO6VqA/bupJQFjEgl8TTgpP44dV4UVvor7ydYN5rmaSZmsiCnTbbN\n' + + 'lUOB1Y80zrbei4HAeWx+bZ6R7Lw+lDF9dqPyWEz23ysmULgURzSzxCntDn+5iujB\n' + + 'BtP2bq3sEUrd6A47bE4rMulhKp9tAgMBAAECgYBjsfRLPdfn6v9hou1Y2KKg+F5K\n' + + 'ZsY2AnIK+6l+sTAzfIAx7e0ir7OJZObb2eyn5rAOCB1r6RL0IH+MWaN+gZANNG9g\n' + + 'pXvRgcZzFY0oqdMZDuSJjpMTj7OEUlPyoGncBfvjAg0zdt9QGAG1at9Jr3i0Xr4X\n' + + '6WrFhtfVlmQUY1VsoQJBAPK2Qj/ClkZNtrSDfoD0j083LcNICqFIIGkNQ+XeuTwl\n' + + '+Gq4USTyaTOEe68MHluiciQ+QKvRAUd4E1zeZRZ02ikCQQDVscINBPTtTJt1JfAo\n' + + 'wRfTzA0Lvgig136xLLeQXREcgq1lzgkf+tGyUGYoy9BXsV0mOuYAT9ldja4jhJeq\n' + + 'cEulAkEAuSJ5KjV9dyb0RIFAz5C8d8o5KAodwaRIxJkPv5nCZbT45j6t9qbJxDg8\n' + + 'N+vghDlHI4owvl5wwVlAO8iQBy8e8QJBAJe9CVXFV0XJR/n/XnER66FxGzJjVi0f\n' + + '185nOlFARI5CHG5VxxT2PUCo5mHBl8ctIj+rQvalvGs515VQ6YEVDCECQE3S0AU2\n' + + 'BKyFVNtTpPiTyRUWqig4EbSXwjXdr8iBBJDLsMpdWsq7DCwv/ToBoLg+cQ4Crc5/\n5DChU8P30EjOiEo=', + success: (result) => { + this.setData({ outputValue: result.text }); + }, + fail(e) { + my.alert({ + content: e.errorMessage || e.error, + }); + }, + }); + }, + }); +})(); + +(() => { + // https://docs.alipay.com/mini/api/share_app + Page({ + onShareAppMessage() { + return { + title: 'å°ç¨‹åºç¤ºä¾‹', + desc: 'å°ç¨‹åºå®˜æ–¹ç¤ºä¾‹Demo,展示已支æŒçš„æŽ¥å£èƒ½åŠ›åŠç»„件。', + path: 'page/component/component-pages/view/view?param=123' + }; + }, + }); + + my.hideShareMenu(); +})(); + +(() => { + // https://docs.alipay.com/mini/api/report + my.reportAnalytics('purchase', { + status: 200, + reason: 'ok' + }); +})(); diff --git a/types/ali-app/index.d.ts b/types/ali-app/index.d.ts new file mode 100644 index 0000000000..82f7b2bf27 --- /dev/null +++ b/types/ali-app/index.d.ts @@ -0,0 +1,3265 @@ +// Type definitions for ali-app 1.0 +// Project: https://docs.alipay.com/mini/api/overview (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) +// Definitions by: taoqf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// 公共部分 +declare namespace my { + // #region åŸºæœ¬å‚æ•° + interface DataResponse { + /** 回调函数返回的内容 */ + data: any; + /** å¼€å‘者æœåŠ¡å™¨è¿”å›žçš„ HTTP 状æ€ç  */ + status: number; + /** å¼€å‘者æœåŠ¡å™¨è¿”å›žçš„ HTTP Response Header */ + headers: object; + } + interface ErrMsgResponse { + /** æˆåŠŸï¼šokï¼Œé”™è¯¯ï¼šè¯¦ç»†ä¿¡æ¯ */ + errMsg: "ok" | string; + } + interface TempFileResponse { + /** 文件的临时路径 */ + apFilePath: string; + } + interface BaseOptions { + /** 接å£è°ƒç”¨æˆåŠŸçš„å›žè°ƒå‡½æ•° */ + success?(res: R): void; + /** 接å£è°ƒç”¨å¤±è´¥çš„回调函数 */ + fail?(res: E): void; + /** 接å£è°ƒç”¨ç»“æŸçš„回调函数(调用æˆåŠŸã€å¤±è´¥éƒ½ä¼šæ‰§è¡Œï¼‰ */ + complete?(res: any): void; + } + interface ErrCodeResponse { + errCode: number; + } + // #endregion +} + +// ç•Œé¢ +declare namespace my { + //#region å¯¼èˆªæ  https://docs.alipay.com/mini/api/ui-navigate + interface NavigateToOptions extends BaseOptions { + /** 需è¦è·³è½¬çš„应用内页é¢çš„路径 */ + url: string; + } + /** + * ä¿ç•™å½“å‰é¡µé¢ï¼Œè·³è½¬åˆ°åº”用内的æŸä¸ªé¡µé¢ï¼Œä½¿ç”¨wx.navigateBackå¯ä»¥è¿”回到原页é¢ã€‚ + * + * 注æ„:为了ä¸è®©ç”¨æˆ·åœ¨ä½¿ç”¨å°ç¨‹åºæ—¶é€ æˆå›°æ‰°ï¼Œ + * 我们规定页é¢è·¯å¾„åªèƒ½æ˜¯äº”层,请尽é‡é¿å…多层级的交互方å¼ã€‚ + */ + function navigateTo(options: NavigateToOptions): void; + + interface RedirectToOptions extends BaseOptions { + /** 需è¦è·³è½¬çš„应用内页é¢çš„路径 */ + url: string; + } + /** + * 关闭当å‰é¡µé¢ï¼Œè·³è½¬åˆ°åº”用内的æŸä¸ªé¡µé¢ã€‚ + */ + function redirectTo(options: RedirectToOptions): void; + + interface NavigateBackOptions extends BaseOptions { + /** è¿”å›žçš„é¡µé¢æ•°ï¼Œå¦‚æžœ delta å¤§äºŽçŽ°æœ‰æ‰“å¼€çš„é¡µé¢æ•°ï¼Œåˆ™è¿”回到首页 */ + delta: number; + } + /** + * 关闭当å‰é¡µé¢ï¼Œè¿”回上一级或多级页é¢ã€‚å¯é€šè¿‡ getCurrentPages 获å–当å‰çš„页颿 ˆä¿¡æ¯ï¼Œå†³å®šéœ€è¦è¿”回几层。 + */ + function navigateBack(options?: NavigateBackOptions): void; + + interface ReLaunchOptions extends BaseOptions { + /** + * 需è¦è·³è½¬çš„应用内页é¢è·¯å¾„ , 路径åŽå¯ä»¥å¸¦å‚数。 + * 傿•°ä¸Žè·¯å¾„之间使用?åˆ†éš”ï¼Œå‚æ•°é”®ä¸Žå‚数值用=相连,ä¸åŒå‚数用&分隔 + * 如 'path?key=value&key2=value2',如果跳转的页é¢è·¯å¾„是 tabBar 页é¢åˆ™ä¸èƒ½å¸¦å‚æ•° + */ + url: string; + } + /** + * 关闭所有页é¢ï¼Œæ‰“开到应用内的æŸä¸ªé¡µé¢ã€‚ + */ + function reLaunch(options?: ReLaunchOptions): void; + + interface SetNavigationBarOptions extends BaseOptions { + /** 页颿 ‡é¢˜ */ + title: string; + /** 图片连接地å€ï¼Œå¿…须是https,请使用3x高清图片。若设置了image则title傿•°å¤±æ•ˆ */ + image: string; + /** 导航æ èƒŒæ™¯è‰²ï¼Œæ”¯æŒå六进制颜色值 */ + backgroundColor: string; + /** 导航æ åº•部边框颜色,支æŒå六进制颜色值。若设置了 backgroundColor,则borderBottomColor ä¸ä¼šç”Ÿæ•ˆï¼Œé»˜è®¤ä¼šå’Œ backgroundColor 颜色一样 */ + borderBottomColor: string; + /** 是å¦é‡ç½®å¯¼èˆªæ ä¸ºæ”¯ä»˜å®é»˜è®¤é…色,默认 false */ + reset: boolean; + } + /** + * 动æ€è®¾ç½®å½“å‰é¡µé¢çš„æ ‡é¢˜ã€‚ + */ + function setNavigationBar(options: Partial): void; + + /** + * æ˜¾ç¤ºå¯¼èˆªæ  loading + */ + function showNavigationBarLoading(): void; + + /** éšè—å¯¼èˆªæ  loading。 */ + function hideNavigationBarLoading(): void; + //#endregion + + //#region TabBar https://docs.alipay.com/mini/api/ui-tabbar + interface SwitchTabOptions extends BaseOptions { + /** + * 需è¦è·³è½¬çš„ tabBar 页é¢çš„路径 + * (需在 app.json çš„ tabBar 字段定义的页é¢ï¼‰ï¼Œè·¯å¾„åŽä¸èƒ½å¸¦å‚æ•° + */ + url: string; + } + /** + * 跳转到指定 tabBar 页é¢ï¼Œå¹¶å…³é—­å…¶ä»–æ‰€æœ‰éž tabBar é¡µé¢ + */ + function switchTab(options: SwitchTabOptions): void; + //#endregion + + //#region 交互å馈 https://docs.alipay.com/mini/api/ui-feedback + + interface AlertOptions extends BaseOptions { + /** alert框的标题 */ + title: string; + /** alert框的内容 */ + content: string; + /** 按钮文字,默认确定 */ + buttonText: string; + } + function alert(options: Partial): void; + + interface ConfirmOptions extends BaseOptions { + /** confirm框的标题 */ + title: string; + /** confirm框的内容 */ + content: string; + /** 确认按钮文字,默认‘确定’ */ + confirmButtonText: string; + /** ç¡®è®¤æŒ‰é’®æ–‡å­—ï¼Œé»˜è®¤â€˜å–æ¶ˆâ€™ */ + cancelButtonText: string; + success(result: { confirm: boolean; }): void; + } + function confirm(options: Partial): void; + + interface PromptOptions extends BaseOptions { + /** prompt框标题 */ + title?: string; + /** prompt框文本,默认‘请输入内容’ */ + message?: string; + /** 输入框内的æç¤ºæ–‡æ¡ˆ */ + placeholder?: string; + /** message坹齿–¹å¼ï¼Œå¯ç”¨æžšä¸¾left/center/right,iOS ‘center’, android ‘left’ */ + align?: 'left' | 'center' | 'right' | string; + /** 确认按钮文字,默认‘确定’ */ + okButtonText: string; + /** ç¡®è®¤æŒ‰é’®æ–‡å­—ï¼Œé»˜è®¤â€˜å–æ¶ˆâ€™ */ + cancelButtonText: string; + success(result: { ok: boolean; inputValue: string; }): void; + } + function prompt(options: PromptOptions): void; + + interface ToastOptions extends BaseOptions { + /** + * 文字内容 + */ + content: string; + /** toast 类型,展示相应图标,默认 noneï¼Œæ”¯æŒ success / fail / exception / none’。其中 exception ç±»åž‹å¿…é¡»ä¼ æ–‡å­—ä¿¡æ¯ */ + type?: 'none' | 'success' | 'fail' | 'exception' | string; + /** + * 显示时长,å•ä½ä¸º ms,默认 2000 + */ + duration?: number; + } + /** + * æ˜¾ç¤ºæ¶ˆæ¯æç¤ºæ¡† + */ + function showToast(options: Partial): void; + function hideToast(): void; + + interface LoadingOptions extends BaseOptions { + /** + * loading的文字内容 + */ + content?: string; + /** + * 延迟显示,å•ä½ ms,默认 0。如果在此时间之å‰è°ƒç”¨äº† my.hideLoading 则ä¸ä¼šæ˜¾ç¤º + */ + delay?: number; + } + /** + * 显示加载æç¤º + */ + function showLoading(options?: LoadingOptions): void; + interface HideLoadingOptions { + /** + * 体指当å‰page实例,æŸäº›åœºæ™¯ä¸‹ï¼Œéœ€è¦æŒ‡æ˜Žåœ¨å“ªä¸ªpage执行hideLoading。 + */ + page: any; + } + /** + * éšè—æ¶ˆæ¯æç¤ºæ¡† + */ + function hideLoading(options?: HideLoadingOptions): void; + + interface Badge { + /** 需è¦é£˜çº¢çš„选项的索引,从0开始 */ + index: number; + /** + * é£˜çº¢ç±»åž‹ï¼Œæ”¯æŒ none(无红点)/ point(纯红点) / num(数字红点)/ text(文案红点)/ more(...) + * + */ + type: 'none' | 'point' | 'num' | 'text' | 'more' | string; + + /** + * 自定义飘红文案: + * + * 1ã€type为none/point/more时本文案å¯ä¸å¡« + * 2ã€type为numæ—¶æœ¬æ–‡æ¡ˆä¸ºå°æ•°æˆ–<=0å‡ä¸æ˜¾ç¤º, >100 显示"..." + */ + text: string; + } + interface ActionSheetOptions extends BaseOptions { + /** èœå•标题 */ + title?: string; + /** + * èœå•按钮文字数组 + */ + items: string[]; + /** + * å–æ¶ˆæŒ‰é’®æ–‡æ¡ˆã€‚é»˜è®¤ä¸ºâ€˜å–æ¶ˆâ€™ã€‚注:Android平尿­¤å­—段无效,ä¸ä¼šæ˜¾ç¤ºå–消按钮。 + */ + cancelButtonText?: string; + /** + * (iOS特殊处ç†ï¼‰æŒ‡å®šæŒ‰é’®çš„索引å·ï¼Œä»Ž0开始,使用场景:需è¦åˆ é™¤æˆ–清除数æ®ç­‰ç±»ä¼¼åœºæ™¯ï¼Œé»˜è®¤çº¢è‰² + */ + destructiveBtnIndex?: number; + /** + * 需飘红选项的数组,数组内部对象字段è§ä¸‹è¡¨ + */ + badges?: Array>; + /** + * 接å£è°ƒç”¨æˆåŠŸçš„å›žè°ƒå‡½æ•° + */ + success?(res: { + /** + * 用户点击的按钮,从上到下的顺åºï¼Œä»Ž0开始 + */ + index: number; + }): void; + } + /** + * 显示æ“作èœå• + */ + function showActionSheet(options: ActionSheetOptions): void; + //#endregion + + //#region 下拉刷新 https://docs.alipay.com/mini/api/ui-pulldown + /** + * Page 实现的接å£å¯¹è±¡ + */ + interface PageOptions { + /** + * 下拉刷新 + * 在 Page 中定义 onPullDownRefresh 处ç†å‡½æ•°ï¼Œç›‘å¬è¯¥é¡µé¢ç”¨æˆ·ä¸‹æ‹‰åˆ·æ–°äº‹ä»¶ã€‚ + * 需è¦åœ¨é¡µé¢å¯¹åº”çš„ .json é…置文件中é…ç½® "pullRefresh": true 选项,æ‰èƒ½å¼€å¯ä¸‹æ‹‰åˆ·æ–°äº‹ä»¶ã€‚ + * 当处ç†å®Œæ•°æ®åˆ·æ–°åŽï¼Œè°ƒç”¨ my.stopPullDownRefresh å¯ä»¥åœæ­¢å½“å‰é¡µé¢çš„下拉刷新。 + */ + onPullDownRefresh?(this: Page): void; + } + /** + * åœæ­¢å½“å‰é¡µé¢çš„下拉刷新。 + */ + function stopPullDownRefresh(): void; + //#endregion + + //#region è”系人 https://docs.alipay.com/mini/api/ui-contact + interface ChoosePhoneContactOptions extends BaseOptions { + success(result: { + name: string; // 选中的è”系人姓å + mobile: string; // 选中的è”ç³»äººæ‰‹æœºå· + }): void; + /** + * 10 没有æƒé™ + * 11 ç”¨æˆ·å–æ¶ˆæ“作(或设备未授æƒä½¿ç”¨é€šè®¯å½•) + */ + fail?(error: 10 | 11): void; + } + /** + * 选择本地系统通信录中æŸä¸ªè”系人的电è¯ã€‚ + */ + function choosePhoneContact(options: ChoosePhoneContactOptions): void; + + interface ChooseAlipayContactOptions extends BaseOptions { + /** 啿¬¡æœ€å¤šé€‰æ‹©è”系人个数,默认 1,最大 10 */ + count: number; + success(result: { + realName: string; // è´¦å·çš„真实姓å + mobile: string; // è´¦å·å¯¹åº”的手机å·ç  + email: string; // è´¦å·çš„邮箱 + avatar: string; // è´¦å·çš„头åƒé“¾æŽ¥ + userId: string; // 支付å®è´¦å·å”¯ä¸€ userId + }): void; + /** + * 10 没有æƒé™ + * 11 ç”¨æˆ·å–æ¶ˆæ“作(或设备未授æƒä½¿ç”¨é€šè®¯å½•) + */ + fail?(error: 10 | 11): void; + } + /** + * 唤起支付å®é€šè®¯å½•,选择一个或者多个支付å®è”系人。 + */ + function chooseAlipayContact(options: ChooseAlipayContactOptions): void; + + interface ContactsDic { + /** + * 支付å®è´¦å·å”¯ä¸€ userId + */ + userId: string; + /** + * è´¦å·çš„头åƒé“¾æŽ¥ + */ + avatar: string; + /** + * è´¦å·å¯¹åº”的手机å·ç  + */ + mobile: string; + /** + * è´¦å·çš„真实姓å + */ + realName: string; + /** + * è´¦å·çš„æ˜¾ç¤ºåç§°ï¼šä¹Ÿå³æ”¯ä»˜å®è®¾ç½®çš„备注å称,默认为朋å‹åœˆé‡Œé¢çš„æ˜µç§° + */ + displayName: string; // è´¦å·çš„æ˜¾ç¤ºåç§°ï¼šä¹Ÿå³æ”¯ä»˜å®è®¾ç½®çš„备注å称,默认为朋å‹åœˆé‡Œé¢çš„æ˜µç§° + } + interface ChooseContactOptions extends BaseOptions { + /** 选择类型,值为single(å•选)或者 multi(多选) */ + chooseType: 'single' | 'multi' | string; + /** åŒ…å«æ‰‹æœºé€šè®¯å½•è”系人的模å¼ï¼šé»˜è®¤ä¸ºä¸åŒ…å«ï¼ˆnoneï¼‰ã€æˆ–者仅仅包å«åŒå‘通讯录è”系人(knownï¼‰ã€æˆ–è€…åŒ…å«æ‰‹æœºé€šè®¯å½•è”系人(all) */ + includeMobileContactMode?: 'none' | 'known' | 'all' | string; + /** 是å¦åŒ…å«è‡ªå·± */ + includeMe?: boolean; + /** 最大选择人数,仅 chooseType 为 multi æ—¶æ‰æœ‰æ•ˆ */ + multiChooseMax?: number; + /** 多选达到上é™çš„æ–‡æ¡ˆï¼Œä»… chooseType 为 multi æ—¶æ‰æœ‰æ•ˆ */ + multiChooseMaxTips?: string; + + success(result: { + contactsDicArray: ContactsDic[]; + }): void; + } + /** + * 唤起选人组件,默认åªåŒ…嫿”¯ä»˜å®è”系人,å¯ä»¥é€šè¿‡ä¿®æ”¹å‚æ•°åŒ…å«æ‰‹æœºé€šè®¯å½•è”系人或者åŒå‘通讯录è”系人。 + */ + function chooseContact(options: ChooseContactOptions): void; + //#endregion + + //#region 选择城市 https://docs.alipay.com/mini/api/ui-city + interface City { + city: string; // 城市å + adCode: string; // è¡Œæ”¿åŒºåˆ’ä»£ç  + spell?: string; // 城市å对应拼音拼写,方便用户æœç´¢ + } + interface ChooseCityOptions extends BaseOptions { + showLocatedCity: boolean; // æ˜¯å¦æ˜¾ç¤ºå½“å‰å®šä½åŸŽå¸‚,默认 false + showHotCities: boolean; // æ˜¯å¦æ˜¾ç¤ºçƒ­é—¨åŸŽå¸‚,默认 true + cities: City[]; // 自定义城市列表,列表内对象字段è§ä¸‹è¡¨ + hotCities: City[]; // 自定义热门城市列表,列表内对象字段è§ä¸‹è¡¨ + success(result: { city: string; adCode: string; }): void; + } + /** + * 打开城市选择列表 + * + * 如果用户没有选择任何城市直接点击了返回,将ä¸ä¼šè§¦å‘回调函数。 + */ + function chooseCity(options: Partial): void; + //#endregion + + //#region 选择日期 https://docs.alipay.com/mini/api/ui-date + interface DatePickerOptions extends BaseOptions { + /** + * 返回的日期格å¼ï¼Œ + * 1. yyyy-MM-dd(默认) + * 2. HH:mm + * 3. yyyy-MM-dd HH:mm + * 4. yyyy-MM (最低基础库:1.1.1, å¯ç”¨ canIUse('datePicker.object.format.yyyy-MM') 判断) + * 5. yyyy (最低基础库:1.1.1,å¯ç”¨ canIUse('datePicker.object.format.yyyy') 判断) + */ + format: 'yyyy-MM-dd' | 'HH:mm' | 'yyyy-MM-dd HH:mm' | 'yyyy-MM' | 'yyyy'; + /** åˆå§‹é€‰æ‹©çš„æ—¥æœŸæ—¶é—´ï¼Œé»˜è®¤å½“剿—¶é—´ */ + currentDate: string; + /** æœ€å°æ—¥æœŸæ—¶é—´ */ + startDate: string; + /** 最大日期时间 */ + endDate: string; + success(result: { date: string; }): void; + /** 11 ç”¨æˆ·å–æ¶ˆæ“作 */ + fail(error: 11): void; + } + /** + * 打开日期选择列表 + */ + function datePicker(optiosn: Partial): void; + //#endregion + + //#region 动画 https://docs.alipay.com/mini/api/ui-animation + type TimingFunction = + | "linear" + | "ease" + | "ease-in" + | "ease-in-out" + | "ease-out" + | "step-start" + | "step-end"; + interface CreateAnimationOptions { + /** 动画æŒç»­æ—¶é—´ï¼Œå•ä½ms,默认值 400 */ + duration: number; + /** 定义动画的效果,默认值"linear",有效值:"linear","ease","ease-in","ease-in-out","ease-out","step-start","step-end" */ + timeFunction: TimingFunction; + /** 动画æŒç»­æ—¶é—´ï¼Œå•ä½ ms,默认值 0 */ + delay: number; + /** 设置transform-origin,默认为"50% 50% 0" */ + transformOrigin: string; + } + interface Animator { + actions: AnimationAction[]; + } + interface AnimationAction { + animates: Animate[]; + option: AnimationActionOption; + } + interface AnimationActionOption { + transformOrigin: string; + transition: AnimationTransition; + } + interface AnimationTransition { + delay: number; + duration: number; + timingFunction: TimingFunction; + } + interface Animate { + type: string; + args: any[]; + } + /** + * 创建动画实例 animationã€‚è°ƒç”¨å®žä¾‹çš„æ–¹æ³•æ¥æè¿°åŠ¨ç”»ï¼Œæœ€åŽé€šè¿‡åŠ¨ç”»å®žä¾‹çš„export方法将动画数æ®å¯¼å‡ºå¹¶ä¼ é€’给组件的animation属性。 + * + * 注æ„: export æ–¹æ³•æ¯æ¬¡è°ƒç”¨åŽä¼šæ¸…掉之å‰çš„动画æ“作 + */ + function createAnimation(options: Partial): Animation; + /** 动画实例å¯ä»¥è°ƒç”¨ä»¥ä¸‹æ–¹æ³•æ¥æè¿°åŠ¨ç”»ï¼Œè°ƒç”¨ç»“æŸåŽä¼šè¿”回自身,支æŒé“¾å¼è°ƒç”¨çš„写法。 */ + interface Animation { + /** + * 调用动画æ“作方法åŽè¦è°ƒç”¨ step() æ¥è¡¨ç¤ºä¸€ç»„动画完æˆï¼Œ + * å¯ä»¥åœ¨ä¸€ç»„动画中调用任æ„多个动画方法, + * ä¸€ç»„åŠ¨ç”»ä¸­çš„æ‰€æœ‰åŠ¨ç”»ä¼šåŒæ—¶å¼€å§‹ï¼Œ + * 一组动画完æˆåŽæ‰ä¼šè¿›è¡Œä¸‹ä¸€ç»„动画。 + * @param options 指定当å‰ç»„动画的é…ç½® + */ + step(options?: CreateAnimationOptions): void; + /** + * 导出动画æ“作 + * + * 注æ„: export æ–¹æ³•æ¯æ¬¡è°ƒç”¨åŽä¼šæ¸…掉之å‰çš„动画æ“作 + */ + export(): Animator; + /** 逿˜Žåº¦ï¼Œå‚数范围 0~1 */ + opacity(value: number): Animation; + /** 颜色值 */ + backgroundColor(color: string): Animation; + /** 长度值,如果传入 Number 则默认使用 px,å¯ä¼ å…¥å…¶ä»–自定义å•ä½çš„长度值 */ + width(length: number): Animation; + /** 长度值,如果传入 Number 则默认使用 px,å¯ä¼ å…¥å…¶ä»–自定义å•ä½çš„长度值 */ + height(length: number): Animation; + /** 长度值,如果传入 Number 则默认使用 px,å¯ä¼ å…¥å…¶ä»–自定义å•ä½çš„长度值 */ + top(length: number): Animation; + /** 长度值,如果传入 Number 则默认使用 px,å¯ä¼ å…¥å…¶ä»–自定义å•ä½çš„长度值 */ + left(length: number): Animation; + /** 长度值,如果传入 Number 则默认使用 px,å¯ä¼ å…¥å…¶ä»–自定义å•ä½çš„长度值 */ + bottom(length: number): Animation; + /** 长度值,如果传入 Number 则默认使用 px,å¯ä¼ å…¥å…¶ä»–自定义å•ä½çš„长度值 */ + right(length: number): Animation; + /** deg的范围-180~180,从原点顺时针旋转一个deg角度 */ + rotate(deg: number): Animation; + /** deg的范围-180~180,在X轴旋转一个deg角度 */ + rotateX(deg: number): Animation; + /** deg的范围-180~180,在Y轴旋转一个deg角度 */ + rotateY(deg: number): Animation; + /** deg的范围-180~180,在Z轴旋转一个deg角度 */ + rotateZ(deg: number): Animation; + /** åŒtransform-function rotate3d */ + rotate3d(x: number, y: number, z: number, deg: number): Animation; + /** + * ä¸€ä¸ªå‚æ•°æ—¶ï¼Œè¡¨ç¤ºåœ¨Xè½´ã€Yè½´åŒæ—¶ç¼©æ”¾sx倿•°ï¼› + * ä¸¤ä¸ªå‚æ•°æ—¶è¡¨ç¤ºåœ¨X轴缩放sx倿•°ï¼Œåœ¨Y轴缩放sy倿•° + */ + scale(sx: number, sy?: number): Animation; + /** 在X轴缩放sx倿•° */ + scaleX(sx: number): Animation; + /** 在Y轴缩放sy倿•° */ + scaleY(sy: number): Animation; + /** 在Z轴缩放sy倿•° */ + scaleZ(sz: number): Animation; + /** 在X轴缩放sx倿•°ï¼Œåœ¨Y轴缩放sy倿•°ï¼Œåœ¨Z轴缩放sz倿•° */ + scale3d(sx: number, sy: number, sz: number): Animation; + /** + * ä¸€ä¸ªå‚æ•°æ—¶ï¼Œè¡¨ç¤ºåœ¨Xè½´åç§»tx,å•ä½pxï¼› + * ä¸¤ä¸ªå‚æ•°æ—¶ï¼Œè¡¨ç¤ºåœ¨Xè½´åç§»tx,在Yè½´åç§»ty,å•ä½px。 + */ + translate(tx: number, ty?: number): Animation; + /** + * 在Xè½´åç§»tx,å•ä½px + */ + translateX(tx: number): Animation; + /** + * 在Yè½´åç§»tx,å•ä½px + */ + translateY(ty: number): Animation; + /** + * 在Zè½´åç§»tx,å•ä½px + */ + translateZ(tz: number): Animation; + /** + * 在Xè½´åç§»tx,在Yè½´åç§»ty,在Zè½´åç§»tz,å•ä½px + */ + translate3d(tx: number, ty: number, tz: number): Animation; + /** + * 傿•°èŒƒå›´-180~180ï¼› + * ä¸€ä¸ªå‚æ•°æ—¶ï¼ŒYè½´åæ ‡ä¸å˜ï¼ŒXè½´åæ ‡å»¶é¡ºæ—¶é’ˆå€¾æ–œax度; + * ä¸¤ä¸ªå‚æ•°æ—¶ï¼Œåˆ†åˆ«åœ¨X轴倾斜ax度,在Y轴倾斜ay度 + */ + skew(ax: number, ay?: number): Animation; + /** 傿•°èŒƒå›´-180~180ï¼›Yè½´åæ ‡ä¸å˜ï¼ŒXè½´åæ ‡å»¶é¡ºæ—¶é’ˆå€¾æ–œax度 */ + skewX(ax: number): Animation; + /** 傿•°èŒƒå›´-180~180ï¼›Xè½´åæ ‡ä¸å˜ï¼ŒYè½´åæ ‡å»¶é¡ºæ—¶é’ˆå€¾æ–œay度 */ + skewY(ay: number): Animation; + /** + * åŒtransform-function matrix + */ + matrix( + a: number, + b: number, + c: number, + d: number, + tx: number, + ty: number + ): Animation; + /** åŒtransform-function matrix3d */ + matrix3d( + a1: number, + b1: number, + c1: number, + d1: number, + a2: number, + b2: number, + c2: number, + d2: number, + a3: number, + b3: number, + c3: number, + d3: number, + a4: number, + b4: number, + c4: number, + d4: number + ): Animation; + } + //#endregion + + //#region 画布 https://docs.alipay.com/mini/api/ui-canvas + interface ToTempFilePathOptions extends BaseOptions { + x: number; // 画布 x 轴起点,默认为 0 + y: number; // 画布 y 轴起点,默认为 0 + width: number; // 画布宽度,默认为 canvas 宽度 - x + height: number; // 画布高度,默认为 canvas 高度 - y + destWidth: number; // 输出的图片宽度,默认为 width + destHeight: number; // 输出的图片高度,默认为 height + } + type Color = string | number[] | number | CanvasAction; + + interface CanvasAction { + /** + * 创建一个颜色的æ¸å˜ç‚¹ã€‚ + * å°äºŽæœ€å° stop çš„éƒ¨åˆ†ä¼šæŒ‰æœ€å° stop çš„ color æ¥æ¸²æŸ“,大于最大 stop 的部分会按最大 stop çš„ color æ¥æ¸²æŸ“。 + * + * @param stop æ¸å˜ç‚¹ä½ç½®ï¼Œå€¼å¿…须在 [0,1] 范围内 + * @param color 颜色值 + */ + addColorStop(stop: number, color: Color): void; + } + + interface TextMetrics { + width: number; + } + + interface ConvasContext { + font: string; + /** + * 把当å‰ç”»å¸ƒçš„内容导出生æˆå›¾ç‰‡ï¼Œå¹¶è¿”回文件路径。 + */ + toTempFilePath(options?: Partial): void; + /** + * textAlign 是 Canvas 2D API æè¿°ç»˜åˆ¶æ–‡æœ¬æ—¶ï¼Œæ–‡æœ¬çš„坹齿–¹å¼çš„属性。注æ„ï¼Œè¯¥å¯¹é½æ˜¯åŸºäºŽ + * CanvasRenderingContext2D.fillText 方法的x的值。所以如果 textAlign="center",那么该文本将画在 x-50%*width + */ + setTextAlign(textAlign: 'left' | 'right' | 'center' | 'start' | 'end'): void; + /** + * textBaseline 是 Canvas 2D API æè¿°ç»˜åˆ¶æ–‡æœ¬æ—¶ï¼Œå½“剿–‡æœ¬åŸºçº¿çš„属性。 + */ + setTextBaseline(textBaseline: 'top' | 'hanging' | 'middle' | 'alphabetic' | 'ideographic' | 'bottom'): void; + /** + * 设置填充色。 + * + * 如果没有设置 fillStyle,则默认颜色为 black。 + */ + setFillStyle(color: Color): void; + /** + * 设置边框颜色。 + * + * 如果没有设置 strokeStyle,则默认颜色为 black。 + */ + setStrokeStyle(color: Color): void; + /** + * 设置阴影样å¼ã€‚ + * 如果没有设置,offsetX 的默认值为 0, offsetY 的默认值为 0, blur 的默认值为 0,color 的默认值为 black。 + * @param offsetX 阴影相对于形状水平方å‘çš„åç§» + * @param offsetY 阴影相对于形状竖直方å‘çš„åç§» + * @param blur 0~100 阴影的模糊级别,值越大越模糊 + * @param color 阴影颜色 + */ + setShadow(offsetX: number, offsetY: number, blur: number, color: Color): void; + + /** + * 创建一个线性的æ¸å˜è‰²ã€‚ + * + * @param x0 起点 x åæ ‡ + * @param y0 起点 y åæ ‡ + * @param x1 终点 x åæ ‡ + * @param y1 终点 y åæ ‡ + */ + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasAction; + + /** + * 创建一个圆形的æ¸å˜è‰²ã€‚ + * 起点在圆心,终点在圆环。 + * 需è¦ä½¿ç”¨ addColorStop() æ¥æŒ‡å®šæ¸å˜ç‚¹ï¼Œè‡³å°‘需è¦ä¸¤ä¸ªã€‚ + * @param x 圆心 x åæ ‡ + * @param y 圆心 y åæ ‡ + * @param r 圆åŠå¾„ + * @returns + */ + createCircularGradient(x: number, y: number, r: number): CanvasAction; + + /** + * 设置线æ¡çš„宽度。 + * @param lineWidth 线æ¡å®½åº¦ï¼Œå•ä½ä¸º px + */ + setLineWidth(lineWidth: number): void; + + /** + * 设置线æ¡çš„端点样å¼ã€‚ + * + * @param lineCap 线æ¡çš„结æŸç«¯ç‚¹æ ·å¼ + */ + setLineCap(lineCap: 'round' | 'butt' | 'square'): void; + + /** + * 设置线æ¡çš„交点样å¼ã€‚ + * + * @param lineJoin 线æ¡çš„结æŸäº¤ç‚¹æ ·å¼ + */ + setLineJoin(lineJoin: 'round' | 'bevel' | 'miter'): void; + + /** + * 设置最大斜接长度,斜接长度指的是在两æ¡çº¿äº¤æ±‡å¤„内角和外角之间的è·ç¦»ã€‚ 当 setLineJoin() 为 miter æ—¶æ‰æœ‰æ•ˆã€‚超过最大倾斜长度的,连接处将以 lineJoin 为 bevel æ¥æ˜¾ç¤º + * + * @param miterLimit 最大斜接长度 + */ + setMiterLimit(miterLimit: number): void; + + /** + * 创建一个矩形。 + * + * @param x 矩形左上角的 x åæ ‡ + * @param y 矩形左上角的 y åæ ‡ + * @param width 矩形路径宽度 + * @param height 矩形路径高度 + */ + rect(x: number, y: number, width: number, height: number): void; + + /** + * 填充矩形。 + * 用 setFillStyle() 设置矩形的填充色,如果没设置则默认是 black。 + * @param x 矩形左上角的 x åæ ‡ + * @param y 矩形左上角的 y åæ ‡ + * @param width 矩形路径宽度 + * @param height 矩形路径高度 + */ + fillRect(x: number, y: number, width: number, height: number): void; + + /** + * 画一个矩形(éžå¡«å……)。 + * 用 setFillStroke() 设置矩形线æ¡çš„颜色,如果没设置默认是 black。 + * @param x 矩形左上角的 x åæ ‡ + * @param y 矩形左上角的 y åæ ‡ + * @param width 矩形路径宽度 + * @param height 矩形路径高度 + */ + strokeRect(x: number, y: number, width: number, height: number): void; + + /** + * 清除画布上在该矩形区域内的内容。 + * clearRect å¹¶éžç”»ä¸€ä¸ªç™½è‰²çš„矩形在地å€åŒºåŸŸï¼Œè€Œæ˜¯æ¸…空,为了有直观感å—,å¯ä»¥å¯¹ canvas 加了一层背景色。 + * @param x 矩形左上角的 x åæ ‡ + * @param y 矩形左上角的 y åæ ‡ + * @param width 矩形路径宽度 + * @param height 矩形路径高度 + */ + clearRect(x: number, y: number, width: number, height: number): void; + + /** + * 对当å‰è·¯å¾„中的内容进行填充。默认的填充色为黑色。 + * + */ + fill(): void; + + /** + * 画出当å‰è·¯å¾„的边框。默认 black。 + * stroke() æç»˜çš„的路径是从 beginPath() 开始计算,但是ä¸ä¼šå°† strokeRect() 包å«è¿›åŽ» + */ + stroke(): void; + + /** + * 关闭一个路径 + * 关闭路径会连接起点和终点。 + * å¦‚æžœå…³é—­è·¯å¾„åŽæ²¡æœ‰è°ƒç”¨ fill() 或者 stroke() å¹¶å¼€å¯äº†æ–°çš„路径,那之å‰çš„路径将ä¸ä¼šè¢«æ¸²æŸ“。 + */ + beginPath(): void; + + /** + * 关闭一个路径 + * 关闭路径会连接起点和终点。 + * + */ + closePath(): void; + + /** + * 把路径移动到画布中的指定点,ä¸åˆ›å»ºçº¿æ¡ã€‚ + * 用 stroke() 方法æ¥ç”»çº¿æ¡ + * @param x 目标ä½ç½® x åæ ‡ + * @param y 目标ä½ç½® y åæ ‡ + */ + moveTo(x: number, y: number): void; + + /** + * lineTo 方法增加一个新点,然åŽåˆ›å»ºä¸€æ¡ä»Žä¸Šæ¬¡æŒ‡å®šç‚¹åˆ°ç›®æ ‡ç‚¹çš„线。 + * 用 stroke() 方法æ¥ç”»çº¿æ¡ + * + * @param x 目标ä½ç½® x åæ ‡ + * @param y 目标ä½ç½® y åæ ‡ + */ + lineTo(x: number, y: number): void; + + /** + * 画一æ¡å¼§çº¿ã€‚ + * 创建一个圆å¯ä»¥ç”¨ arc() 方法指定其实弧度为0,终止弧度为 2 * Math.PI。 + * + * @param x + * @param y + * @param r + * @param sAngle + * @param eAngle + */ + arc(x: number, y: number, r: number, sAngle: number, eAngle: number): void; + + /** + * 创建三次方è´å¡žå°”曲线路径。 + * 曲线的起始点为路径中å‰ä¸€ä¸ªç‚¹ã€‚ + * @param cp1x + * @param cp1y + * @param cp2x + * @param cp2y + * @param x + * @param y + */ + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + + /** + * 将当å‰åˆ›å»ºçš„路径设置为当å‰å‰ªåˆ‡è·¯å¾„。 + * + */ + clip(): void; + + /** + * 创建二次è´å¡žå°”曲线路径。 + * 曲线的起始点为路径中å‰ä¸€ä¸ªç‚¹ã€‚ + * @param cpx è´å¡žå°”控制点 x åæ ‡ + * @param cpy è´å¡žå°”控制点 y åæ ‡ + * @param x 结æŸç‚¹ x åæ ‡ + * @param y 结æŸç‚¹ y åæ ‡ + */ + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + + /** + * 在调用scale方法åŽï¼Œä¹‹åŽåˆ›å»ºçš„è·¯å¾„å…¶æ¨ªçºµåæ ‡ä¼šè¢«ç¼©æ”¾ã€‚多次调用scaleï¼Œå€æ•°ä¼šç›¸ä¹˜ã€‚ + * + * @param scaleWidth æ¨ªåæ ‡ç¼©æ”¾å€æ•° (1 = 100%,0.5 = 50%,2 = 200%) + * @param scaleHeight çºµåæ ‡è½´ç¼©æ”¾å€æ•° (1 = 100%,0.5 = 50%,2 = 200%) + */ + scale(scaleWidth: number, scaleHeight: number): void; + + /** + * 以原点为中心,原点å¯ä»¥ç”¨ translate方法修改。顺时针旋转当å‰å标轴。多次调用rotate,旋转的角度会å åŠ ã€‚ + * + * @param rotate 旋转角度,以弧度计(degrees * Math.PI/180ï¼›degrees 范围为0~360) + */ + rotate(rotate: number): void; + + /** + * 对当å‰å标系的原点(0, 0)è¿›è¡Œå˜æ¢ï¼Œé»˜è®¤çš„åæ ‡ç³»åŽŸç‚¹ä¸ºé¡µé¢å·¦ä¸Šè§’。 + * + * @param x æ°´å¹³åæ ‡å¹³ç§»é‡ + * @param y ç«–ç›´åæ ‡å¹³ç§»é‡ + */ + translate(x: number, y: number): void; + + /** + * 设置字体大å°ã€‚ + * + * @param fontSize å­—å· + */ + setFontSize(fontSize: number): void; + + /** + * 在画布上绘制被填充的文本。 + * + * @param text 文本 + * @param x 绘制文本的左上角 x åæ ‡ + * @param y 绘制文本的左上角 y åæ ‡ + */ + fillText(text: string, x: number, y: number): void; + + /** + * 绘制图åƒï¼Œå›¾åƒä¿æŒåŽŸå§‹å°ºå¯¸ã€‚ + * + * @param imageResource 图片资æº, åªæ”¯æŒçº¿ä¸Š cdn åœ°å€æˆ–离线包地å€ï¼Œçº¿ä¸Š cdn 需返回头 Access-Control-Allow-Origin: * + * @param x 图åƒå·¦ä¸Šè§’ x åæ ‡ + * @param y 图åƒå·¦ä¸Šè§’ y åæ ‡ + * @param width 图åƒå®½åº¦ + * @param height 图åƒé«˜åº¦ + */ + drawImage(imageResource: string, x: number, y: number, width: number, height: number): void; + + /** + * è®¾ç½®å…¨å±€ç”»ç¬”é€æ˜Žåº¦ã€‚ + * + * @param alpha 逿˜Žåº¦ï¼Œ0 è¡¨ç¤ºå®Œå…¨é€æ˜Žï¼Œ1 表示ä¸é€æ˜Ž 范围 [0, 1] + */ + setGlobalAlpha(alpha: number): void; + + /** + * è®¾ç½®è™šçº¿çš„æ ·å¼ + * + * @param segments 一组æè¿°äº¤æ›¿ç»˜åˆ¶çº¿æ®µå’Œé—´è·ï¼ˆå标空间å•ä½ï¼‰é•¿åº¦çš„æ•°å­—。 å¦‚æžœæ•°ç»„å…ƒç´ çš„æ•°é‡æ˜¯å¥‡æ•°ï¼Œ 数组的元素会被å¤åˆ¶å¹¶é‡å¤ã€‚例如, [5, 15, 25] ä¼šå˜æˆ [5, 15, 25, 5, 15, 25]。 + */ + setLineDash(segments: number[]): void; + + /** + * 使用矩阵多次å åР当å‰å˜æ¢çš„æ–¹æ³•ï¼ŒçŸ©é˜µç”±æ–¹æ³•çš„å‚æ•°è¿›è¡Œæè¿°ã€‚ä½ å¯ä»¥ç¼©æ”¾ã€æ—‹è½¬ã€ç§»åŠ¨å’Œå€¾æ–œä¸Šä¸‹æ–‡ã€‚ + * + * @param scaleX 水平缩放 + * @param skewX 水平倾斜 + * @param skewY 垂直倾斜 + * @param scaleY 垂直缩放 + * @param translateX 水平移动 + * @param translateY 垂直移动 + */ + transform(scaleX: number, skewX: number, skewY: number, scaleY: number, translateX: number, translateY: number): void; + + /** + * 使用å•ä½çŸ©é˜µé‡æ–°è®¾ç½®ï¼ˆè¦†ç›–)当å‰çš„å˜æ¢å¹¶è°ƒç”¨å˜æ¢çš„æ–¹æ³•ï¼Œæ­¤å˜æ¢ç”±æ–¹æ³•çš„å˜é‡è¿›è¡Œæè¿°ã€‚ + * + * @param scaleX 水平缩放 + * @param skewX 水平倾斜 + * @param skewY 垂直倾斜 + * @param scaleY 垂直缩放 + * @param translateX 水平移动 + * @param translateY 垂直移动 + */ + setTransform(scaleX: number, skewX: number, skewY: number, scaleY: number, translateX: number, translateY: number): void; + + /** + * ä¿å­˜å½“å‰çš„绘图上下文。 + * + */ + save(): void; + + /** + * æ¢å¤ä¹‹å‰ä¿å­˜çš„绘图上下文。 + */ + restore(): void; + + /** + * 将之å‰åœ¨ç»˜å›¾ä¸Šä¸‹æ–‡ä¸­çš„æè¿°ï¼ˆè·¯å¾„ã€å˜å½¢ã€æ ·å¼ï¼‰ç”»åˆ° canvas 中。 + * 绘图上下文需è¦ç”± my.createCanvasContext(canvasId) æ¥åˆ›å»ºã€‚ + * @param [reserve] æœ¬æ¬¡ç»˜åˆ¶æ˜¯å¦æŽ¥ç€ä¸Šä¸€æ¬¡ç»˜åˆ¶ï¼Œå³ reserve 傿•°ä¸º false 时则在本次调用 drawCanvasç»˜åˆ¶ä¹‹å‰ native 层应先清空画布å†ç»§ç»­ç»˜åˆ¶ï¼›è‹¥ reserver 傿•°ä¸ºtrue 时,则ä¿ç•™å½“å‰ç”»å¸ƒä¸Šçš„内容,本次调用drawCanvas绘制的内容覆盖在上é¢ï¼Œé»˜è®¤ false + */ + draw(reserve?: boolean): void; + + measureText(text: string): TextMetrics; + } + /** + * 创建 canvas 绘图上下文 + * + * 该绘图上下文åªä½œç”¨äºŽå¯¹åº” canvasId çš„ + */ + function createCanvasContext(canvasId: string): ConvasContext; + //#endregion + + //#region 地图 https://docs.alipay.com/mini/api/ui-map + interface GetCenterLocationOptions extends BaseOptions { + success?(res: { longitude: string; latitude: string; }): void; + } + + interface MapContext extends BaseOptions { + /** + * 获å–当å‰åœ°å›¾ä¸­å¿ƒçš„ç»çº¬åº¦ï¼Œè¿”回 gcj02 åæ ‡ç³»çš„值,å¯ä»¥ç”¨äºŽ my.openLocation + * + * @param options + */ + getCenterLocation(options: GetCenterLocationOptions): void; + /** + * 将地图中心移动到当å‰å®šä½ç‚¹ï¼Œéœ€è¦é…åˆ map 组件的 show-location 使用 + */ + moveToLocation(): void; + } + + /** + * 创建并返回一个 map 上下文对象 mapContext。 + * + * @param mapId + * @returns + */ + function createMapContext(mapId: string): MapContext; + + //#endregion + + //#region 键盘 https://docs.alipay.com/mini/api/ui-hidekeyboard + /** + * éšè—键盘 + * + */ + function hideKeyboard(): void; + //#endregion + + //#region 滚动 https://docs.alipay.com/mini/api/scroll + interface PageScrollToOptions { + scrollTop: number; // 滚动到页é¢çš„目标ä½ç½®ï¼Œå•ä½ px + } + + /** + * 滚动到页é¢çš„目标ä½ç½® + * + * @param options + */ + function pageScrollTo(options: PageScrollToOptions): void; + //#endregion + + //#region 节点查询 https://docs.alipay.com/mini/api/selector-query + interface RectArea { + /** èŠ‚ç‚¹çš„å·¦è¾¹ç•Œåæ ‡ */ + left: number; + /** 节点的å³è¾¹ç•Œåæ ‡ */ + right: number; + /** èŠ‚ç‚¹çš„ä¸Šè¾¹ç•Œåæ ‡ */ + top: number; + /** èŠ‚ç‚¹çš„ä¸‹è¾¹ç•Œåæ ‡ */ + bottom: number; + /** 节点的宽度 */ + width: number; + /** 节点的高度 */ + height: number; + } + interface NodesRefRect extends RectArea { + /** 节点的ID */ + id: string; + /** 节点的dataset */ + dataset: any; + } + interface NodeRefOffset { + /** 节点的ID */ + id: string; + /** 节点的dataset */ + dataset: any; + /** 节点的水平滚动ä½ç½® */ + scrollLeft: number; + /** 节点的竖直滚动ä½ç½® */ + scrollTop: number; + } + interface NodesRef { + /** + * 添加节点的布局ä½ç½®çš„æŸ¥è¯¢è¯·æ±‚,相对于显示区域,以åƒç´ ä¸ºå•ä½ã€‚ + * 其功能类似于DOMçš„getBoundingClientRect。 + * 返回值是nodesRef对应的selectorQuery。 + * 返回的节点信æ¯ä¸­ï¼Œæ¯ä¸ªèŠ‚ç‚¹çš„ä½ç½®ç”¨ + * leftã€rightã€topã€bottomã€widthã€height字段æè¿°ã€‚ + * 如果æä¾›äº†callback回调函数,在执行selectQueryçš„execæ–¹æ³•åŽ + * 节点信æ¯ä¼šåœ¨callback中返回。 + */ + boundingClientRect( + callback?: (rect: T) => void + ): SelectorQuery; + /** + * 添加节点的滚动ä½ç½®æŸ¥è¯¢è¯·æ±‚,以åƒç´ ä¸ºå•ä½ã€‚ + * 节点必须是scroll-view或者viewport。 + * 返回值是nodesRef对应的selectorQuery。 + * 返回的节点信æ¯ä¸­ï¼Œæ¯ä¸ªèŠ‚ç‚¹çš„æ»šåŠ¨ä½ç½®ç”¨scrollLeftã€scrollHeight字段æè¿°ã€‚ + * 如果æä¾›äº†callback回调函数,在执行selectQueryçš„exec方法åŽï¼ŒèŠ‚ç‚¹ä¿¡æ¯ä¼šåœ¨callback中返回。 + */ + scrollOffset(callback?: (rect: NodeRefOffset) => void): SelectorQuery; + // /** + // * 获å–节点的相关信æ¯ï¼Œéœ€è¦èŽ·å–的字段在fields中指定。 + // * 返回值是nodesRef对应的selectorQuery。 + // */ + // fields( + // fields: NodeRefFieldsOptions, + // callback?: (result: any) => void + // ): SelectorQuery; + } + /** + * SelectorQuery对象实例 + */ + interface SelectorQuery { + // /** + // * 将选择器的选å–范围更改为自定义组件component内 + // * (åˆå§‹æ—¶ï¼Œé€‰æ‹©å™¨ä»…选å–页é¢èŒƒå›´çš„节点,ä¸ä¼šé€‰å–任何自定义组件中的节点 + // * @version 1.6.0 + // */ + // in(component: Component): SelectorQuery; + /** + * 在当å‰é¡µé¢ä¸‹é€‰æ‹©ç¬¬ä¸€ä¸ªåŒ¹é…选择器selector的节点,返回一个NodesRef对象实例,å¯ä»¥ç”¨äºŽèŽ·å–节点信æ¯ã€‚ + * selector类似于CSS的选择器,但仅支æŒä¸‹åˆ—语法。 + * + ID选择器:#the-id + * + class选择器(å¯ä»¥è¿žç»­æŒ‡å®šå¤šä¸ªï¼‰ï¼š.a-class.another-class + * + å­å…ƒç´ é€‰æ‹©å™¨ï¼š.the-parent > .the-child + * + åŽä»£é€‰æ‹©å™¨ï¼š.the-ancestor .the-descendant + * + 跨自定义组件的åŽä»£é€‰æ‹©å™¨ï¼š.the-ancestor >>> .the-descendant + * + 多选择器的并集:#a-node, .some-other-nodes + */ + select(selector: string): NodesRef; + /** + * 在当å‰é¡µé¢ä¸‹é€‰æ‹©åŒ¹é…选择器selector的节点,返回一个NodesRef对象实例。 + * 与selectorQuery.selectNode(selector)ä¸åŒçš„æ˜¯ï¼Œå®ƒé€‰æ‹©æ‰€æœ‰åŒ¹é…选择器的节点。 + */ + selectAll(selector: string): NodesRef; + /** + * 选择显示区域,å¯ç”¨äºŽèŽ·å–æ˜¾ç¤ºåŒºåŸŸçš„å°ºå¯¸ã€æ»šåЍä½ç½®ç­‰ä¿¡æ¯ + * 返回一个NodesRef对象实例。 + */ + selectViewport(): NodesRef; + /** + * 执行所有的请求 + * è¯·æ±‚ç»“æžœæŒ‰è¯·æ±‚æ¬¡åºæž„æˆæ•°ç»„,在callbackçš„ç¬¬ä¸€ä¸ªå‚æ•°ä¸­è¿”回。 + */ + exec(callback?: (result: any[]) => void): void; + } + /** + * 获å–一个节点查询对象 SelectorQuery。 + * + * @param page å¯ä»¥æŒ‡å®š page 属性,默认为当å‰é¡µé¢ + * @returns + */ + function createSelectorQuery(page?: any): SelectorQuery; + //#endregion + + //#region 级è”选择 https://docs.alipay.com/mini/api/ewdxl3 + interface MultiLevelSelectItem { + name: string; + subList?: MultiLevelSelectItem[]; + } + interface MultiLevelSelectOptions extends BaseOptions { + title?: string; // 标题 + list?: MultiLevelSelectItem[]; // 选择数æ®åˆ—表 + name?: string; // æ¡ç›®åç§° + subList?: MultiLevelSelectItem[]; // å­æ¡ç›®åˆ—表 + success?(res: { + success: boolean; // 是å¦é€‰æ‹©å®Œæˆ,å–æ¶ˆè¿”回false + result: MultiLevelSelectItem[]; // 选择的结果,如[{“nameâ€:â€æ­å·žå¸‚â€},{“nameâ€:â€ä¸ŠåŸŽåŒºâ€},{“nameâ€:â€å¤ç¿ è¡—é“â€}] + }): void; + } + + function multiLevelSelect(options?: MultiLevelSelectOptions): void; + //#endregion +} + +// å¼€æ”¾æŽ¥å£ +declare namespace my { + //#region ç”¨æˆ·æŽˆæƒ https://docs.alipay.com/mini/api/openapi-authorize + interface GetAuthCodeOptions extends BaseOptions { + scopes?: string | string[]; // 授æƒç±»åž‹ï¼Œé»˜è®¤ auth_baseã€‚æ”¯æŒ auth_base(é™é»˜æŽˆæƒï¼‰/ auth_user(主动授æƒï¼‰ / auth_zhima(èŠéº»ä¿¡ç”¨ï¼‰ + success?(res: { + authCode: string; // 授æƒç  + authErrorScope: { + [scope: string]: number; + }; // 失败的授æƒç±»åž‹ï¼Œkey是授æƒå¤±è´¥çš„ scope,value æ˜¯å¯¹åº”çš„é”™è¯¯ç  + authSucessScope: string[]; // æˆåŠŸçš„æŽˆæƒ scope + }): void; + } + /** + * èŽ·å–æŽˆæƒç ã€‚ + * è¯¦ç»†ç”¨æˆ·æŽˆæƒæŽ¥å…¥å‚考 [指引](https://docs.alipay.com/mini/introduce/auth)。 + */ + function getAuthCode(options: GetAuthCodeOptions): void; + //#endregion + + //#region 客户端获å–ä¼šå‘˜ä¿¡æ¯ https://docs.alipay.com/mini/api/userinfo + interface GetAuthUserInfoOptions extends BaseOptions { + success?(res: { + nickName: string; // 用户昵称 + avatar: string; // 用户头åƒé“¾æŽ¥ + }): void; + } + /** + * 客户端获å–ä¼šå‘˜ä¿¡æ¯ + * 获å–会员信æ¯é¦–先需è¦èŽ·å–用户授æƒï¼Œè¯¦ç»†ä¼šå‘˜ä¿¡æ¯èŽ·å–å‚考[指引](https://docs.alipay.com/mini/introduce/auth),采用 jsapi 调用的方å¼ã€‚ + */ + function getAuthUserInfo(options: GetAuthUserInfoOptions): void; + //#endregion + + //#region å°ç¨‹åºå”¤èµ·æ”¯ä»˜ https://docs.alipay.com/mini/api/openapi-pay + interface TradePayOptions extends BaseOptions { + tradeNO?: string; // 接入å°ç¨‹åºæ”¯ä»˜æ—¶ä¼ å…¥æ­¤å‚æ•°ã€‚æ­¤å‚æ•°ä¸ºæ”¯ä»˜å®äº¤æ˜“å· + success?(res: { + // resultCode | æè¿° + // -----------|------ + // 9000 | è®¢å•æ”¯ä»˜æˆåŠŸ + // 8000 | 正在处ç†ä¸­ + // 4000 | è®¢å•æ”¯ä»˜å¤±è´¥ + // 6001 | ç”¨æˆ·ä¸­é€”å–æ¶ˆ + // 6002 | 网络连接出错 + // 6004 | 支付结果未知(有å¯èƒ½å·²ç»æ”¯ä»˜æˆåŠŸï¼‰ï¼Œè¯·æŸ¥è¯¢å•†æˆ·è®¢å•列表中订å•çš„æ”¯ä»˜çŠ¶æ€ + // 99 | 用户点击忘记密ç å¯¼è‡´å¿«æ·ç•Œé¢é€€å‡º(only iOS) + resultCode: string; + }): void; + } + /** + * å‘起支付。 + * 详细接入支付方å¼å‚考[指引](https://docs.alipay.com/mini/introduce/pay)。 + * @param options + */ + function tradePay(options: TradePayOptions): void; + //#endregion + + //#region 支付代扣签约 https://docs.alipay.com/mini/api/pay-sign + interface PaySignCenterOptions extends BaseOptions { + signStr: string; // 签约字符串 + } + + /** + * 签约中心 + * + * è¿”å›žç  | å«ä¹‰ + * ------|------ + * 7000 | å议签约æˆåŠŸ + * 7001 | 签约结果未知(有å¯èƒ½å·²ç»ç­¾çº¦æˆåŠŸï¼‰ï¼Œè¯·æ ¹æ®å¤–éƒ¨ç­¾çº¦å·æŸ¥è¯¢ç­¾çº¦çŠ¶æ€ + * 7002 | å议签约失败 + * 6001 | ç”¨æˆ·ä¸­é€”å–æ¶ˆ + * 6002 | 网络连接错误 * @param options + */ + function paySignCenter(options: PaySignCenterOptions): void; + //#endregion + + //#region å°ç¨‹åºäºŒç»´ç  https://docs.alipay.com/mini/api/openapi-qrcode + // @see https://docs.alipay.com/mini/api/openapi-qrcode + // @see https://docs.alipay.com/mini/introduce/qrcode + //#endregion + + //#region 跳转支付å®å¡åŒ… https://docs.alipay.com/mini/api/card-voucher-ticket + /** + * 打开支付å®å¡åˆ—表。 + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openCardList(): void; + interface OpenMerchantCardList extends BaseOptions { + partnerId: string; // å•†æˆ·ç¼–å· + } + + /** + * 打开支付å®å¡åˆ—表。 + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + * @param options + */ + function openMerchantCardList(options: OpenMerchantCardList): void; + + interface OpenCardDetailOptions extends BaseOptions { + passId: string; // å¡å®žä¾‹Id + } + /** + * 打开当å‰ç”¨æˆ·çš„æŸå¼ å¡çš„详情页 + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + * + * passIdèŽ·å–æ–¹å¼ï¼š + * 1)通过alipassåˆ›å»ºçš„å¡ + * 调用alipay.pass.instance.add(支付å®pass新建å¡åˆ¸å®žä¾‹æŽ¥å£)接å£ï¼Œåœ¨å‡ºå‚“resultâ€ä¸­å¯èŽ·å– + * 2)通过会员å¡åˆ›å»ºçš„å¡ + * 调用alipay.marketing.card.query(ä¼šå‘˜å¡æŸ¥è¯¢)接å£ï¼Œåœ¨schema_url中å¯èŽ·å–ï¼Œå…·ä½“å‚æ•°ä¸ºâ€œp=xxxâ€ï¼Œxxxå³ä¸ºpassId。 + */ + function openCardDetail(options: OpenCardDetailOptions): void; + + /** + * 打开支付å®åˆ¸åˆ—表 + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + * + * @param options + */ + function openVoucherList(): void; + + interface OpenMerchantVoucherListOptions extends BaseOptions { + partnerId: string; // å•†æˆ·ç¼–å· + } + /** + * 打开当å‰ç”¨æˆ·çš„æŸä¸ªå•†æˆ·çš„åˆ¸åˆ—è¡¨ + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openMerchantVoucherList(options: OpenMerchantVoucherListOptions): void; + + interface OpenVoucherDetailOptions1 extends BaseOptions { + passId: string; // 券实例Idï¼Œè°ƒç”¨åˆ¸å‘æ”¾æŽ¥å£å¯ä»¥èŽ·å–è¯¥å‚æ•°ï¼ˆå¦‚果传入了partnerIdå’ŒserialNumber则ä¸éœ€ä¼ å…¥ï¼‰ + } + interface OpenVoucherDetailOptions2 extends BaseOptions { + partnerId: string; // 商户编å·ï¼Œä»¥ 2088 为开头(如果传入了passId则ä¸éœ€ä¼ å…¥ï¼‰ + serialNumber: string; // åºåˆ—å·ï¼Œè°ƒç”¨æ–°å»ºå¡åˆ¸æ¨¡æ¿å¯ä»¥èŽ·å–è¯¥å‚æ•°ï¼ˆå¦‚果传入了passId则ä¸éœ€ä¼ å…¥ï¼‰ + } + /** + * 打开当å‰ç”¨æˆ·çš„æŸå¼ åˆ¸çš„è¯¦æƒ…é¡µï¼ˆéžå£ç¢‘) + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openVoucherDetail(options: OpenVoucherDetailOptions1 | OpenVoucherDetailOptions2): void; + + interface OpenKBVoucherDetailOptions1 extends BaseOptions { + passId: string; // å¡å®žä¾‹Id(如果传入了partnerIdå’ŒserialNumber则ä¸éœ€ä¼ å…¥ï¼‰ + } + interface OpenKBVoucherDetailOptions2 extends BaseOptions { + partnerId: string; // 商户编å·ï¼ˆå¦‚果传入了passId则ä¸éœ€ä¼ å…¥ï¼‰ + serialNumber: string; // åºåˆ—å·ï¼ˆå¦‚果传入了passId则ä¸éœ€ä¼ å…¥ï¼‰ + } + /** + * 打开当å‰ç”¨æˆ·çš„æŸå¼ åˆ¸çš„è¯¦æƒ…é¡µï¼ˆå£ç¢‘) + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openKBVoucherDetail(options: OpenKBVoucherDetailOptions1 | OpenKBVoucherDetailOptions2): void; + + /** + * 打开支付å®ç¥¨åˆ—表。 + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openTicketList(): void; + + interface OpenMerchantTicketListOptions extends BaseOptions { + partnerId: string; // å•†æˆ·ç¼–å· + } + /** + * 打开æŸä¸ªå•†æˆ·çš„票列表 + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openMerchantTicketList(options: OpenMerchantTicketListOptions): void; + + interface OpenTicketDetailOptions1 extends BaseOptions { + passId: string; // å¡å®žä¾‹Id(如果传入了partnerIdå’ŒserialNumber则ä¸éœ€è¦ä¼ å…¥passId) + } + interface OpenTicketDetailOptions2 extends BaseOptions { + partnerId: string; // 商户编å·ï¼ˆå¦‚果传入了passId则ä¸éœ€è¦ä¼ å…¥partnerId) + serialNumber: string; // åºåˆ—å·ï¼ˆå¦‚果传入了passId则ä¸éœ€è¦ä¼ å…¥serialNumber) + } + /** + * 打开当å‰ç”¨æˆ·çš„æŸå¼ ç¥¨çš„è¯¦æƒ…é¡µ + * + * 有关支付å®å¡åŒ…详细功能,è§[支付å®å¡åŒ…产å“介ç»](https://docs.alipay.com/mini/introduce/voucher) + */ + function openTicketDetail(options: OpenTicketDetailOptions1 | OpenTicketDetailOptions2): void; + //#endregion + + //#region ä¼šå‘˜å¼€å¡æŽˆæƒ https://docs.alipay.com/mini/api/add-card-auth + interface AddCardAuthResult { + success: true | boolean; // true è¡¨ç¤ºé¢†å¡æˆåŠŸ + resultStatus: string; // 9000 表示æˆåŠŸ + result: { + app_id: string; // 应用id + auth_code: string; // 授æƒç ï¼Œç”¨äºŽæ¢å–authtoken + state: string; // 授æƒçš„state + scope: string; // 授æƒscope + template_id: string; // ä¼šå‘˜å¡æ¨¡æ¿Id + request_id: string; // 会员å¡è¡¨å•ä¿¡æ¯è¯·æ±‚Id + out_string: string; // 会员å¡é¢†å¡é“¾æŽ¥é€ä¼ å‚æ•° + }; + } + interface AddCardAuthResult { + success: false | boolean; // false 表示领å¡å¤±è´¥ + /** + * å¤±è´¥çš„é”™è¯¯ç  + * 领å¡å¤±è´¥ code 说明 + * åç§° | 类型 | 说明 + * -----|-----|----- + * JSAPI_SERVICE_TERMINATED | String | ç”¨æˆ·å–æ¶ˆ + * JSAPI_PARAM_INVALID | String | url ä¸ºç©ºæˆ–éžæ³•傿•° + * JSAPI_SYSTEM_ERROR | String | 系统错误 + */ + code: string; + } + interface AddCardAuthOptions extends BaseOptions { + /** + * å¼€å¡æŽˆæƒçš„页é¢åœ°å€ï¼Œä»Žalipay.marketing.card.activateurl.apply接å£èŽ·å– + */ + url: string; + success?(res: AddCardAuthResult): void; + } + /** + * å°ç¨‹åºå”¤èµ·ä¼šå‘˜å¼€å¡æŽˆæƒé¡µé¢ï¼Œå°ç¨‹åºæŽ¥å…¥ä¼šå‘˜å¡[点此查看](https://docs.alipay.com/mini/introduce/card) + */ + function addCardAuth(options: AddCardAuthOptions): void; + //#endregion + + //#region èŠéº»è®¤è¯ https://docs.alipay.com/mini/api/zm-service + interface StartZMVerifyOptions extends BaseOptions { + bizNo: string; // è®¤è¯æ ‡è¯† + success?(res: { + token: string; // è®¤è¯æ ‡è¯† + passed: string; // è®¤è¯æ˜¯å¦é€šè¿‡ + reason?: string; // 认è¯ä¸é€šè¿‡åŽŸå›  + }): void; + } + /** + * èŠéº»è®¤è¯æŽ¥å£ï¼Œè°ƒç”¨æ­¤æŽ¥å£å¯ä»¥å”¤èµ·èŠéº»è®¤è¯é¡µé¢å¹¶è¿›è¡Œäººè„¸èº«ä»½éªŒè¯ã€‚ + * 有关èŠéº»è®¤è¯çš„产å“和接入介ç»ï¼Œè¯¦è§ [èŠéº»è®¤è¯](https://docs.alipay.com/mini/introduce/zm-verify)。 + * 需è¦é€šè¿‡èš‚èšå¼€å‘å¹³å°ï¼Œè°ƒç”¨certification.initialize接å£è¿›è¡Œ[认è¯åˆå§‹åŒ–](https://docs.alipay.com/zmxy/271/105914)。获得biz_no åŽï¼Œæ–¹èƒ½é€šè¿‡ä»¥ä¸‹æŽ¥å£æ¿€æ´»èŠéº»è®¤è¯å°ç¨‹åºã€‚ + */ + function startZMVerify(options: StartZMVerifyOptions): void; + //#endregion + + //#region 信用借还 https://docs.alipay.com/mini/api/zmcreditborrow + interface ZMCreditBorrowOptions extends BaseOptions { + /** + * 外部订å•å·ï¼Œéœ€è¦å”¯ä¸€ï¼Œç”±å•†æˆ·ä¼ å…¥ï¼ŒèŠéº»å†…部会åšå¹‚等控制,格å¼ä¸ºï¼šyyyyMMddHHmmss+éšæœºæ•° + * + */ + out_order_no: string; + /** + * 信用借还的产å“ç ï¼Œä¼ å…¥å›ºå®šå€¼ï¼šw1010100000000002858 + */ + product_code: string; + /** + * 物å“åç§°,最长ä¸èƒ½è¶…过14个汉字 + */ + goods_name: string; + /** + * 租金å•ä½ï¼Œç§Ÿé‡‘+租金å•ä½ç»„åˆæ‰å…·å¤‡å®žé™…的租金æ„义。 + * å–值定义如下: + * DAY_YUAN: å…ƒ / 天 + * HOUR_YUAN: å…ƒ / å°æ—¶ + * YUAN: å…ƒ + * YUAN_ONCE: å…ƒ / 次 + */ + rent_unit: string; + /** + * 租金,租金 + 租金å•ä½ç»„åˆæ‰å…·å¤‡å®žé™…的租金æ„义。 + * > 0.00元,代表有租金 + * = 0.00元,代表无租金,å…费借用 + * æ³¨ï¼šå‚æ•°ä¼ å€¼å¿…é¡» >= 0ï¼Œä¼ å…¥å…¶ä»–å€¼ä¼šæŠ¥é”™å‚æ•°éžæ³• + */ + rent_amount: string; + /** + * 押金,金é¢å•ä½ï¼šå…ƒã€‚ + * 注:ä¸å…è®¸å…æŠ¼é‡‘çš„ç”¨æˆ·æŒ‰æ­¤é‡‘é¢æ”¯ä»˜æŠ¼é‡‘;当物å“丢失时,赔å¿é‡‘é¢ä¸å¾—高于该金é¢ã€‚ + */ + deposit_amount: string; + /** + * 该字段目å‰é»˜è®¤ä¼ Yï¼› + * æ˜¯å¦æ”¯æŒå½“借用用户信用ä¸å¤Ÿï¼ˆä¸å‡†å…¥ï¼‰æ—¶ï¼Œå¯è®©ç”¨æˆ·æ”¯ä»˜æŠ¼é‡‘借用: + * Y: æ”¯æŒ + * N: 䏿”¯æŒ + * 注:支付押金的金é¢ç­‰åŒäºŽdeposit_amount。 + */ + deposit_state?: string; // 该字段目å‰é»˜è®¤ä¼ Yï¼› + /** + * 回调到商户的å°ç¨‹åºschema地å€ã€‚说明:商户的回调地å€å¯ä»¥åœ¨å•†æˆ·åŽå°é‡Œè¿›è¡Œé…置,æœåŠ¡ç«¯å›žè°ƒæ—¶ï¼Œé¦–å…ˆæ ¹æ®å‚数:invoke_type æŸ¥è¯¢æ˜¯å¦æœ‰å¯¹åº”çš„é…置地å€ï¼Œå¦‚果有,则使用已定义的地å€ï¼Œå¦åˆ™ï¼Œä½¿ç”¨è¯¥å­—æ®µå®šä¹‰çš„åœ°å€æ‰§è¡Œå›žè°ƒï¼› + * å‚考表格下方的说明一; + * å°ç¨‹åºå›žè°ƒåœ°å€å‚考表格下方的说明三; + * 说明一: + * 支付å®å•†æˆ·è´¦å·ç™»å½•我的商家æœåŠ¡æ‰“å¼€å…¥å£é“¾æŽ¥ï¼› + * 商家æœåŠ¡ä¸­é€‰æ‹©â€œæ‚¨å¯èƒ½éœ€è¦->ä¿¡ç”¨å€Ÿè¿˜â€æˆ–者点击链接; + * 场景IDé…ç½®->é…置新IDï¼Œé€‰æ‹©å¯¹åº”çš„ä¸šåŠ¡ç±»åž‹ã€æœåŠ¡ç±»ç›®å’Œè”盟,将生æˆçš„场景ID作为credit_biz的值传入å³å¯ï¼› + * 回调地å€é…ç½®->设置å°ç¨‹åºå›žè°ƒåœ°å€ï¼Œæ³¨æ„:若设置了该回调地å€ï¼Œåˆ™æŽ¥å£my.zmCreditBorrow中的入å‚invoke_return_url将会失效,以该处设置为准; + * 说明三: + * å°ç¨‹åºå›žè°ƒåœ°å€ç¤ºä¾‹ä¸€ï¼šalipays://platformapi/startapp?appId=1999ï¼› + * å°ç¨‹åºå›žè°ƒåœ°å€ç¤ºä¾‹äºŒï¼šalipays://platformapi/startapp?appId=1999&page=pages/mapï¼› + */ + invoke_return_url?: string; + /** + * 商户访问蚂èšçš„对接模å¼ï¼Œé»˜è®¤ä¼ TINYAPP: + * TINYAPP:回跳至å°ç¨‹åºåœ°å€ï¼› + * WINDOWSï¼šæ”¯ä»˜å®æœåŠ¡çª—ï¼Œé»˜è®¤å€¼ï¼› + */ + invoke_type?: 'TINYAPP' | 'TINYAPP' | 'WINDOWS' | string; + /** + * 信用业务æœåŠ¡ï¼Œæ³¨æ„:该字段ä¸èƒ½ä¸ºç©ºï¼Œä¸”必须根æ®è¯´æ˜Žçš„æŒ‡å¼•é…置商户专属的场景ID,商户自助接入时,登录åŽå°å¯é…置场景ID,将åŽå°é…置的场景ID作为该字段的输入; + * å‚考说明一自助进行é…置; + */ + credit_biz: string; + /** + * 商户订å•创建的起始借用时间,格å¼ï¼šYYYY - MM - DD HH: MM: SS。如果ä¸ä¼ å…¥æˆ–者为空,则认为订å•åˆ›å»ºèµ·å§‹æ—¶é—´ä¸ºè°ƒç”¨æ­¤æŽ¥å£æ—¶çš„æ—¶é—´ã€‚ + */ + borrow_time?: string; + /** + * 到期时间,ä¸å…许为空,请根æ®å®žé™…业务åˆç†è®¾ç½®è¯¥å€¼ï¼Œæ ¼å¼ï¼šYYYY - MM - DD HH: MM: SS,是指最晚归还时间,表示借用用户如果超过此时间还未完结订å•ï¼ˆæœªå½’è¿˜ç‰©å“æˆ–者未支付租金)将会进入逾期状æ€ï¼ŒèŠéº»ä¼šç»™å€Ÿç”¨ç”¨æˆ·å‘é€å‚¬æ”¶æé†’ï¼›éœ€è¦æ™šäºŽborrow_time。 + */ + expiry_time: string; + /** + * 借用用户的手机å·ç ï¼Œå¯é€‰å­—段。推è商户传入此值,会将此手机å·ç ä¸Žç”¨æˆ·èº«ä»½ä¿¡æ¯è¿›è¡ŒåŒ¹é…验è¯ï¼Œé˜²èŒƒæ¬ºè¯ˆé£Žé™©ã€‚ + */ + mobile_no?: string; + /** + * 物å“借用地点的æè¿°ï¼Œä¾¿äºŽç”¨æˆ·çŸ¥é“ç‰©å“æ˜¯åœ¨å“ªé‡Œå€Ÿçš„。å¯ä¸ºç©º + * + */ + borrow_shop_name?: string; + /** + * 租金的结算方å¼ï¼Œéžå¿…填字段,默认是支付å®ç§Ÿé‡‘结算支付 merchantï¼šè¡¨ç¤ºå•†æˆ·è‡ªè¡Œç»“ç®—ï¼Œä¿¡ç”¨å€Ÿè¿˜ä¸æä¾›ç§Ÿé‡‘æ”¯ä»˜èƒ½åŠ›ï¼› alipayï¼šè¡¨ç¤ºä½¿ç”¨æ”¯ä»˜å®æ”¯ä»˜åŠŸèƒ½ï¼Œç»™ç”¨æˆ·æä¾›ç§Ÿé‡‘代扣åŠèµ”å¿é‡‘支付能力; + * + */ + rent_settle_type?: 'merchant' | 'alipay' | string; + /** + * 商户请求状æ€ä¸Šä¸‹æ–‡ã€‚商户å‘起借用æœåŠ¡æ—¶ï¼Œéœ€è¦åœ¨å€Ÿç”¨ç»“æŸåŽè¿”å›žç»™å•†æˆ·çš„å‚æ•°ï¼Œæ ¼å¼ï¼šjsonï¼› + * 如果jsonçš„æŸä¸€é¡¹å€¼åŒ…å«ä¸­æ–‡ï¼Œè¯·ä½¿ç”¨encodeURIComponent对该值进行编ç ï¼› + * @example + * var ext = { + * name: encodeURIComponent('åå­—') + * }; + * var obj = { + * invoke_state: JSON.stringify(ext) + * } + */ + invoke_state?: string; + /** + * ç§Ÿé‡‘ä¿¡æ¯æè¿°, 长度ä¸è¶…过14个汉字,åªç”¨äºŽé¡µé¢å±•示给C端用户,除此之外无其他æ„义。 + */ + rent_info?: string; + /** + * 借用用户的真实姓å,éžå¿…填字段。但nameå’Œcert_noå¿…é¡»åŒæ—¶éžç©ºï¼Œæˆ–è€…åŒæ—¶ä¸ºç©ºï¼Œä¸€æ—¦ä¼ å…¥ä¼šå¯¹ç”¨æˆ·èº«ä»½è¿›è¡Œæ ¡éªŒã€‚ + */ + name?: string; + /** + * 借用用户的真实身份è¯å·ï¼Œéžå¿…填字段。但nameå’Œcert_noå¿…é¡»åŒæ—¶éžç©ºï¼Œæˆ–è€…åŒæ—¶ä¸ºç©ºï¼Œä¸€æ—¦ä¼ å…¥ä¼šå¯¹ç”¨æˆ·èº«ä»½è¿›è¡Œæ ¡éªŒã€‚ + */ + cert_no?: string; + /** + * 借用用户的收货地å€ï¼Œå¯é€‰å­—段,最大长度128。推è商户传入此值,会将此手机å·ç ä¸Žç”¨æˆ·èº«ä»½ä¿¡æ¯è¿›è¡ŒåŒ¹é…验è¯ï¼Œé˜²èŒƒæ¬ºè¯ˆé£Žé™©ã€‚ + */ + address?: string; + success?(res: { + /** + * 6001 ç”¨æˆ·å–æ¶ˆäº†ä¸šåŠ¡æµç¨‹ + * 6002 网络异常 + * 9000 æˆåŠŸ + * 4000 系统异常 + */ + resultStatus: '6001' | '6002' | '9000' | '4000' | string; + result: { + /** + * 商户å‘起借用æœåŠ¡æ—¶ä¼ å…¥çš„å‚æ•°ï¼Œéœ€è¦åœ¨å€Ÿç”¨ç»“æŸåŽè¿”å›žç»™å•†æˆ·çš„å‚æ•° + * @example + * {"user_name":"john"} + */ + invoke_state: string; + /** + * 外部订å•å·ï¼Œéœ€è¦å”¯ä¸€ï¼Œç”±å•†æˆ·ä¼ å…¥ï¼ŒèŠéº»å†…部会åšå¹‚等控制,格å¼ä¸ºï¼šyyyyMMddHHmmss+4ä½éšæœºæ•° + * @example + * 201610010000283627 + */ + out_order_no: string; + /** + * èŠéº»ä¿¡ç”¨å€Ÿè¿˜è®¢å•å· + * @example + * 10020027631 + */ + order_no: string; + /** + * 是å¦å‡†å…¥:Y:准入;N:ä¸å‡†å…¥(è¯¥å­—æ®µç›®å‰æ— å®žé™…æ„义) + */ + admit_state: 'Y' | 'N' | string; + /** + * 物å“借用/ç§Ÿèµè€…的用户id + * @example + * 2088202924240029 + */ + user_id: string; + callbackData: any; // todo only in example + } + }): void; + } + function zmCreditBorrow(options: ZMCreditBorrowOptions): void; + //#endregion + + //#region 文本风险识别 https://docs.alipay.com/mini/api/text-identification + type TextRiskIdentificationType = 'keyword' | '0' | '1' | '2' | '3' | string; + interface TextRiskIdentificationOptions extends BaseOptions { + /** + * 需è¦è¿›è¡Œé£Žé™©è¯†åˆ«çš„æ–‡æœ¬å†…容 + */ + content: string; + /** + * 识别类型:keyword 表示关键è¯ã€0 表示广告ã€1表示涉政ã€2表示涉黄ã€3表示低俗辱骂 + */ + type: TextRiskIdentificationType[]; + success?(res: { + result: { + /** + * 目标内容文本识别到的类型,keyword 表示关键è¯ã€0 表示广告ã€1表示涉政ã€2表示涉黄ã€3表示低俗辱骂 + */ + type: TextRiskIdentificationType; + /** + * 仅当识别命中了 type 为 keyword 时,æ‰ä¼šè¿”回该字段 + */ + hitKeywords?: string[]; + /** + * 识别命中得分,最高分100分。仅当识别没有命中 keyword ,但入å‚中包å«äº†å¹¿å‘Šæˆ–涉政或涉黄时,æ‰ä¼šè¿”回该字段 + */ + score?: string; + }; + fail?(res: { + /** + * è¯†åˆ«é”™è¯¯ç  + */ + error: string; + /** + * è¯†åˆ«é”™è¯¯æ¶ˆæ¯ + */ + errorMessage: string; + }): void; + }): void; + } + /** + * 文本风险识别, **支付å®å®¢æˆ·ç«¯10.1.10åŠä»¥ä¸Šç‰ˆæœ¬æ”¯æŒã€‚**详细接入å‚考[指引](https://docs.alipay.com/mini/introduce/text-identification) + */ + function textRiskIdentification(options: TextRiskIdentificationOptions): void; + //#endregion + + //#region å°ç¨‹åºè·³è½¬ https://docs.alipay.com/mini/api/open-miniprogram + interface NavigateToMiniProgramOptions extends BaseOptions { + /** + * è¦è·³è½¬çš„目标å°ç¨‹åºappId + */ + appId: string; + /** + * 打开的页é¢è·¯å¾„,如果为空则打开首页 + */ + path?: string; + /** + * 需è¦ä¼ é€’给目标å°ç¨‹åºçš„æ•°æ®ï¼Œç›®æ ‡å°ç¨‹åºå¯åœ¨ App.onLaunch() ,App.onShow() 中获å–åˆ°è¿™ä»½æ•°æ® + */ + extraData?: any; + /** + * è¦æ‰“开的å°ç¨‹åºç‰ˆæœ¬ï¼Œæœ‰æ•ˆå€¼ develop(开å‘版),trial(体验版),release(正å¼ç‰ˆï¼‰ ,仅在当å‰å°ç¨‹åºä¸ºå¼€å‘ç‰ˆæˆ–ä½“éªŒç‰ˆæ—¶æ­¤å‚æ•°æœ‰æ•ˆï¼›å¦‚果当å‰å°ç¨‹åºæ˜¯æ­£å¼ç‰ˆï¼Œåˆ™æ‰“开的å°ç¨‹åºå¿…定是正å¼ç‰ˆã€‚默认值 release + */ + envVersion?: 'develop' | 'trial' | 'release' | string; + } + /** + * 跳转到其他å°ç¨‹åºã€‚详细接入å‚考[指引](https://docs.alipay.com/mini/introduce/open-miniprogram) + * @param options + */ + function navigateToMiniProgram(options: NavigateToMiniProgramOptions): void; + interface NavigateBackMiniProgramOptions extends BaseOptions { + /** + * 需è¦ä¼ é€’给目标å°ç¨‹åºçš„æ•°æ®ï¼Œç›®æ ‡å°ç¨‹åºå¯åœ¨ App.onLaunch(),App.onShow() 中获å–åˆ°è¿™ä»½æ•°æ® + */ + extraData?: any; + } + /** + * 跳转回上一个å°ç¨‹åºï¼Œåªæœ‰å½“å¦ä¸€ä¸ªå°ç¨‹åºè·³è½¬åˆ°å½“å‰å°ç¨‹åºæ—¶æ‰ä¼šèƒ½è°ƒç”¨æˆåŠŸ + */ + function navigateBackMiniProgram(options: NavigateBackMiniProgramOptions): void; + //#endregion + + //#region webview组件控制 https://docs.alipay.com/mini/api/webview-context + interface WebViewContext { + postMessage(param: any): void; + } + /** + * 创建并返回 web-view 上下文 webViewContext 对象。 + * + * @param webviewId è¦åˆ›å»ºçš„web-view所对应的id属性 + */ + function createWebViewContext(webviewId: string): WebViewContext; + //#endregion +} + +// 多媒体 +declare namespace my { + //#region 图片 https://docs.alipay.com/mini/api/media-image + type ImageSourceType = "album" | "camera"; + interface ChooseImageOptions extends BaseOptions { + /** 最大å¯é€‰ç…§ç‰‡æ•°ï¼Œé»˜è®¤1å¼  */ + count: number; + /** ç›¸å†Œé€‰å–æˆ–者æ‹ç…§ï¼Œé»˜è®¤ [‘camera’,‘album’] */ + sourceType: ImageSourceType[]; + /** æˆåŠŸåˆ™è¿”å›žå›¾ç‰‡çš„æœ¬åœ°æ–‡ä»¶è·¯å¾„åˆ—è¡¨ tempFilePaths */ + success(res: { + /** + * 图片文件æè¿° + */ + apFilePaths: string[]; + }): void; + } + /** + * 从本地相册选择图片或使用相机æ‹ç…§ã€‚ + */ + function chooseImage(options: Partial): void; + + interface PreviewImageOptions extends BaseOptions { + /** 当当剿˜¾ç¤ºå›¾ç‰‡ç´¢å¼•,默认 0 */ + current?: number; + /** è¦é¢„览的图片链接列表 */ + urls: string[]; + } + /** + * 预览图片。 + */ + function previewImage(options: PreviewImageOptions): void; + + interface SaveImageOptions extends BaseOptions { + /** + * è¦ä¿å­˜çš„图片链接 + */ + url: string; + success?(res: { errMsg: string }): void; + } + /** + * ä¿å­˜åœ¨çº¿å›¾ç‰‡åˆ°æ‰‹æœºç›¸å†Œã€‚ + */ + function saveImage(options: SaveImageOptions): void; + + interface CompressImageOptions extends BaseOptions { + /** + * è¦åŽ‹ç¼©çš„å›¾ç‰‡åœ°å€æ•°ç»„ + */ + apFilePaths: string[]; + /** + * åŽ‹ç¼©çº§åˆ«ï¼Œæ”¯æŒ 0 ~ 4 的整数,默认 4。详è§ã€ŒcompressLevel表 说明表〠+ * compressLevel表 + * compressLevel | 说明 + * --------------|----- + * 0 | ä½Žè´¨é‡ + * 1 | ä¸­ç­‰è´¨é‡ + * 2 | é«˜è´¨é‡ + * 3 | ä¸åŽ‹ç¼© + * 4 | æ ¹æ®ç½‘络适应 + */ + compressLevel?: 0 | 1 | 2 | 3 | 4; + success?(res: { + /** + * 压缩åŽçš„路径数组 + */ + apFilePaths: string[]; + }): void; + } + /** + * 压缩图片。扫ç ä½“验: + */ + function compressImage(options: CompressImageOptions): void; + + interface GetImageInfoOptions extends BaseOptions { + /** + * å›¾ç‰‡è·¯å¾„ï¼Œç›®å‰æ”¯æŒï¼š + * - 网络图片路径 + * - apFilePath路径 + * - 相对路径 + */ + src: string; + success?(res: { + width: number; // 图片宽度(å•ä½px) + height: number; // 图片高度(å•ä½px) + path: string; // 图片本地路径 + }): void; + } + /** + * 获å–å›¾ç‰‡ä¿¡æ¯ + */ + function getImageInfo(options: GetImageInfoOptions): void; + //#endregion +} + +// 缓存 +declare namespace my { + //#region 缓存 https://docs.alipay.com/mini/api/storage + interface SetStorageOptions extends BaseOptions { + /** 本地缓存中的指定的 key */ + key: string; + /** 需è¦å­˜å‚¨çš„内容 */ + data: any; + } + /** + * 将数æ®å­˜å‚¨åœ¨æœ¬åœ°ç¼“存中指定的 key 中,会覆盖掉原æ¥è¯¥ key 对应的数æ®ã€‚ + * 这是异步接å£ã€‚ + */ + function setStorage(options: SetStorageOptions): void; + + /** + * åŒæ­¥å°†æ•°æ®å­˜å‚¨åœ¨æœ¬åœ°ç¼“存中指定的 key 中。 + * è¿™æ˜¯åŒæ­¥æŽ¥å£ã€‚ + * + * @param key 本地缓存中的指定的 key + * @param data 需è¦å­˜å‚¨çš„内容 + */ + function setStorageSync(options: { key: string; data: any; }): void; + + interface GetStorageOptions extends BaseOptions { + /** 本地缓存中的指定的 key */ + key: string; + /** 接å£è°ƒç”¨çš„回调函数,res = {data: key对应的内容} */ + success(res: DataResponse): void; + } + /** + * 获å–缓存数æ®ã€‚ + * 这是异步接å£ã€‚ + */ + function getStorage(options: GetStorageOptions): void; + + /** + * åŒæ­¥èŽ·å–缓存数æ®ã€‚ + * è¿™æ˜¯åŒæ­¥æŽ¥å£ + */ + function getStorageSync(options: { key: string; }): any; + + interface RemoveStorageOptions extends BaseOptions { + key: string; + } + /** + * 删除缓存数æ®ã€‚ + * 这是异步接å£ã€‚ + */ + function removeStorage(options: RemoveStorageOptions): void; + + /** + * åŒæ­¥åˆ é™¤ç¼“存数æ®ã€‚ + * è¿™æ˜¯åŒæ­¥æŽ¥å£ã€‚ + * @param key 缓存数æ®çš„key + */ + function removeStorageSync(options: { key: string; }): void; + + /** + * 清除本地数æ®ç¼“存。 + * 这是异步接å£ã€‚ + */ + function clearStorage(): void; + + /** + * åŒæ­¥æ¸…除本地数æ®ç¼“存。 + * è¿™æ˜¯åŒæ­¥æŽ¥å£ã€‚ + */ + function clearStorageSync(): void; + + interface StorageInfo { + /** + * 当å‰storage中所有的key + */ + keys: string[]; + /** + * 当å‰å ç”¨çš„空间大å°, å•ä½kb + */ + currentSize: number; + /** + * é™åˆ¶çš„空间大å°ï¼Œå•ä½kb + */ + limitSize: number; + } + interface GetStorageInfoOptions extends BaseOptions { + success(res: StorageInfo): void; + } + /** + * 异步获å–当å‰storageçš„ç›¸å…³ä¿¡æ¯ + */ + function getStorageInfo(options: GetStorageInfoOptions): void; + + function getStorageInfoSync(): StorageInfo; + //#endregion +} + +// 文件 +declare namespace my { + //#region 文件 https://docs.alipay.com/mini/api/file + interface SavedFileData { + /** 文件ä¿å­˜è·¯å¾„ */ + apFilePath: string; + } + interface SaveFileOptions extends BaseOptions { + /** 文件路径 */ + apFilePath: string; + success?(res: SavedFileData): void; + } + /** + * ä¿å­˜æ–‡ä»¶åˆ°æœ¬åœ°ï¼ˆæœ¬åœ°æ–‡ä»¶å¤§å°æ€»å®¹é‡é™åˆ¶ï¼š10M) + */ + function saveFile(options: SaveFileOptions): void; + + interface GetFileInfoSuccess { + /** 文件大å°ï¼Œå•ä½ï¼šB */ + size: number; + /** 摘è¦ç»“æžœ */ + digest: string; + } + interface GetFileInfoOptions extends BaseOptions { + /** 文件路径 */ + apFilePath: string; + /** 摘è¦ç®—法,支æŒmd5å’Œsha1,默认为md5 */ + digestAlgorithm?: 'md5' | 'sha1'; + success?(options: GetFileInfoSuccess): void; + } + /** + * èŽ·å–æ–‡ä»¶ä¿¡æ¯ + * 基础库版本 1.4.0 开始支æŒï¼Œä½Žç‰ˆæœ¬éœ€åšå…¼å®¹å¤„ç† + */ + function getFileInfo(options: GetFileInfoOptions): void; + + interface SavedFileInfoData { + /** + * 文件大å°ï¼Œå•ä½B + */ + size: number; + /** + * 创建时间 + */ + createTime: number; + } + interface GetSavedFileInfoOptions extends BaseOptions { + /** 文件路径 */ + apFilePath: string; + /** 接å£è°ƒç”¨æˆåŠŸçš„å›žè°ƒå‡½æ•° */ + success?(res: SavedFileInfoData): void; + } + /** + * 获å–ä¿å­˜çš„æ–‡ä»¶ä¿¡æ¯ + */ + function getSavedFileInfo(options: GetSavedFileInfoOptions): void; + + interface GetSavedFileListOptions extends BaseOptions { + success?(res: { + fileList: Array<{ + /** æ–‡ä»¶å¤§å° */ + size: number; + /** 创建时间 */ + createTime: number; + /** 文件路径 */ + apFilePath: string; + }> + }): void; + } + function getSavedFileList(options: GetSavedFileListOptions): void; + + type RemoveSavedFileOptions = GetSavedFileInfoOptions; + /** + * 删除æŸä¸ªä¿å­˜çš„æ–‡ä»¶ + */ + function removeSavedFile(options: RemoveSavedFileOptions): void; + //#endregion +} + +// ä½ç½® +declare namespace my { + //#region ä½ç½® https://docs.alipay.com/mini/api/location + interface LocationData { + /** ç»åº¦ */ + longitude: string; + /** 纬度 */ + latitude: string; + /** 精确度,å•ä½m */ + accuracy: string; + /** + * 水平精确度,å•ä½m + */ + horizontalAccuracy: string; + /** + * 国家(type>0生效) + */ + country?: string; + /** + * å›½å®¶ç¼–å· (type>0生效) + */ + countryCode?: string; + /** + * çœä»½(type>0生效) + */ + province?: string; + /** + * 城市(type>0生效) + */ + city?: string; + /** + * 城市级别的地区代ç (type>0生效) + */ + cityAdcode?: string; + /** + * 区县(type>0生效) + */ + district?: string; + /** + * 区县级别的地区代ç (type>0生效) + */ + districtAdcode?: string; + /** + * 需è¦è¡—é“级别逆地ç†çš„æ‰ä¼šæœ‰çš„å­—æ®µ,è¡—é“门牌信æ¯ï¼Œç»“构是:{ street, number } (type > 1生效) + */ + streetNumber?: { + street: string; + number: string; + }; + /** + * 需è¦POI级别逆地ç†çš„æ‰ä¼šæœ‰çš„å­—æ®µ, 定ä½ç‚¹é™„è¿‘çš„ POI ä¿¡æ¯ï¼Œç»“构是:{ name, address } (type > 2生效) + */ + pois?: Array<{ + name: string; + address: string; + }>; + } + interface GetLocationOptions extends BaseOptions { + /** + * 支付å®å®¢æˆ·ç«¯ç»çº¬åº¦å®šä½ç¼“存过期时间,å•ä½ç§’。默认 30s。使用缓存会加快定ä½é€Ÿåº¦ï¼Œç¼“å­˜è¿‡æœŸä¼šé‡æ–°å®šä½ + */ + cacheTimeout: number; + /** + * 0:默认,获å–ç»çº¬åº¦ + * 1:获å–ç»çº¬åº¦å’Œè¯¦ç»†åˆ°åŒºåŽ¿çº§åˆ«çš„é€†åœ°ç†ç¼–ç æ•°æ® + * 2:获å–ç»çº¬åº¦å’Œè¯¦ç»†åˆ°è¡—é“级别的逆地ç†ç¼–ç æ•°æ®ï¼Œä¸æŽ¨è使用 + * 3:获å–ç»çº¬åº¦å’Œè¯¦ç»†åˆ°POI级别的逆地ç†ç¼–ç æ•°æ®ï¼Œä¸æŽ¨è使用 + */ + type: 0 | 1 | 2 | 3; + /** 接å£è°ƒç”¨æˆåŠŸçš„å›žè°ƒå‡½æ•°ï¼Œè¿”å›žå†…å®¹è¯¦è§è¿”å›žå‚æ•°è¯´æ˜Žã€‚ */ + success(res: LocationData): void; + } + /** + * 获å–用户当å‰çš„地ç†ä½ç½®ä¿¡æ¯ + */ + function getLocation(options: Partial): void; + + interface OpenLocationOptions extends BaseOptions { + /** ç»åº¦ */ + longitude: number | string; + /** 纬度 */ + latitude: number | string; + /** ä½ç½®åç§° */ + name: string; + /** 地å€çš„详细说明 */ + address: string; + /** 缩放比例,范围 3~19,默认为 15 */ + scale?: number; + } + /** + * 使用微信内置地图查看ä½ç½® + */ + function openLocation(options: OpenLocationOptions): void; + + interface ChooseLocationData { + /** + * ä½ç½®åç§° + */ + name: string; + /** + * è¯¦ç»†åœ°å€ + */ + address: string; + /** + * 纬度,浮点数,范围为-90~90,负数表示å—纬 + */ + latitude: number; + /** + * ç»åº¦ï¼Œæµ®ç‚¹æ•°ï¼ŒèŒƒå›´ä¸º-180~180ï¼Œè´Ÿæ•°è¡¨ç¤ºè¥¿ç» + */ + longitude: number; + } + interface ChooseLocationOptions extends BaseOptions { + success(res: ChooseLocationData): void; + } + /** + * 使用支付å®å†…置地图选择地ç†ä½ç½®ã€‚ + */ + function chooseLocation(options: ChooseLocationOptions): void; + //#endregion +} + +// 网络 +declare namespace my { + //#region 网络 https://docs.alipay.com/mini/api/network + interface RequestHeader { + [key: string]: string; + } + interface RequestOptions extends BaseOptions { + /** 目标æœåС噍url */ + url: string; + /** 设置请求的 HTTP 头,默认 {'Content-Type': 'application/x-www-form-urlencoded'} */ + header?: RequestHeader; + /** 默认GETï¼Œç›®å‰æ”¯æŒGET,POST */ + method?: "GET" | "POST"; + /** è¯·æ±‚çš„å‚æ•° */ + data?: any; + /** + * 超时时间,å•ä½ms,默认30000 + */ + timeout?: number; + /** æœŸæœ›è¿”å›žçš„æ•°æ®æ ¼å¼ï¼Œé»˜è®¤json,支æŒjson,text,base64 */ + dataType?: 'json' | 'text' | 'base64'; + /** 收到开å‘者æœåŠ¡æˆåŠŸè¿”å›žçš„å›žè°ƒå‡½æ•°ï¼Œres = {data: 'å¼€å‘者æœåŠ¡å™¨è¿”å›žçš„å†…å®¹'} */ + success?(res: DataResponse): void; + } + function httpRequest(options: RequestOptions): void; + + interface UploadFileOptions extends BaseOptions { + /** å¼€å‘者æœåŠ¡å™¨åœ°å€ */ + url: string; + /** è¦ä¸Šä¼ æ–‡ä»¶èµ„æºçš„æœ¬åœ°å®šä½ç¬¦ */ + filePath: string; + /** 文件å,å³å¯¹åº”çš„ key, å¼€å‘者在æœåŠ¡å™¨ç«¯é€šè¿‡è¿™ä¸ª key å¯ä»¥èŽ·å–到文件二进制内容 */ + fileName: string; + /** + * 文件类型 + */ + fileType: 'image' | 'video' | 'audio'; + /** HTTP 请求 Header */ + header?: RequestHeader; + /** HTTP 请求中其他é¢å¤–çš„ form æ•°æ® */ + formData?: any; + success?(res: { + /** æœåŠ¡å™¨è¿”å›žçš„æ•°æ® */ + data: string; + /** HTTP 状æ€ç  */ + statusCode: string; + header: any; + }): void; + } + /** + * 上传本地资æºåˆ°å¼€å‘者æœåŠ¡å™¨ã€‚ + */ + function uploadFile(options: UploadFileOptions): void; + + interface DownloadFileOptions extends BaseOptions { + /** ä¸‹è½½æ–‡ä»¶åœ°å€ */ + url: string; + /** HTTP 请求 Header */ + header?: RequestHeader; + /** 下载æˆåŠŸåŽä»¥ tempFilePath 的形å¼ä¼ ç»™é¡µé¢ï¼Œres = {tempFilePath: '文件的临时路径'} */ + success?(res: TempFileResponse): void; + } + /** + * 下载文件资æºåˆ°æœ¬åœ°ã€‚ + */ + function downloadFile(options: DownloadFileOptions): void; + + interface ConnectSocketOptions extends BaseOptions { + /** 目标æœåС噍url */ + url: string; + /** è¯·æ±‚çš„å‚æ•° */ + data?: any; + /** 设置请求的头部 */ + header?: RequestHeader; + method?: 'GET' | 'POST'; // todo missing in api + } + /** + * 创建一个 WebSocket 的连接; + * 一个支付å®å°ç¨‹åºåŒæ—¶åªèƒ½ä¿ç•™ä¸€ä¸ª WebSocket 连接,如果当å‰å·²å­˜åœ¨ WebSocket è¿žæŽ¥ï¼Œä¼šè‡ªåŠ¨å…³é—­è¯¥è¿žæŽ¥ï¼Œå¹¶é‡æ–°åˆ›å»ºä¸€ä¸ªæ–°çš„ WebSocket 连接。 + */ + function connectSocket(options: ConnectSocketOptions): void; + + /** + * 监å¬WebSocket连接打开事件。 + */ + function onSocketOpen(callback: () => void): void; + + /** + * 监å¬WebSocket关闭。 + */ + function onSocketClose(callback: () => void): void; + + /** + * å–æ¶ˆç›‘å¬WebSocket连接打开事件。 + */ + function offSocketOpen(callback: () => void): void; + + /** + * 监å¬WebSocket错误。 + */ + function onSocketError(callback: (error: any) => void): void; + + /** + * å–æ¶ˆç›‘å¬WebSocket错误。 + */ + function offSocketError(callback: (error: any) => void): void; + + interface SendSocketMessageOptions extends BaseOptions { + /** + * 需è¦å‘é€çš„内容:普通的文本内容 String æˆ–è€…ç» base64 ç¼–ç åŽçš„ String + */ + data: string | ArrayBuffer; + /** + * 如果需è¦å‘é€äºŒè¿›åˆ¶æ•°æ®ï¼Œéœ€è¦å°†å…¥å‚æ•°æ®ç» base64 ç¼–ç æˆ String åŽèµ‹å€¼ dataï¼ŒåŒæ—¶å°†æ­¤å­—段设置为true,å¦åˆ™å¦‚果是普通的文本内容 String,ä¸éœ€è¦è®¾ç½®æ­¤å­—段 + */ + isBuffer?: boolean; + } + /** + * 通过 WebSocket 连接å‘逿•°æ®ï¼Œéœ€è¦å…ˆä½¿ç”¨ my.connectSocket å‘起建连,并在 my.onSocketOpen 回调之åŽå†å‘逿•°æ®ã€‚ + */ + function sendSocketMessage(options: SendSocketMessageOptions): void; + + /** + * 监å¬WebSocket接å—到æœåŠ¡å™¨çš„æ¶ˆæ¯äº‹ä»¶ã€‚ + */ + function onSocketMessage(callback: (res: { + /** + * 需è¦å‘é€çš„内容:普通的文本内容 String æˆ–è€…ç» base64 ç¼–ç åŽçš„ String + */ + data: string | ArrayBuffer; + /** + * 如果需è¦å‘é€äºŒè¿›åˆ¶æ•°æ®ï¼Œéœ€è¦å°†å…¥å‚æ•°æ®ç» base64 ç¼–ç æˆ String åŽèµ‹å€¼ dataï¼ŒåŒæ—¶å°†æ­¤å­—段设置为true,å¦åˆ™å¦‚果是普通的文本内容 String,ä¸éœ€è¦è®¾ç½®æ­¤å­—段 + */ + isBuffer?: boolean; + }) => void): void; + function offSocketMessage(callback: (error: any) => void): void; + + interface CloseSocketOptions extends BaseOptions { + success?(res: any): void; + } + /** + * 监å¬WebSocket关闭。 + */ + function closeSocket(options?: CloseSocketOptions): void; + + /** + * å–æ¶ˆç›‘å¬WebSocket关闭。 + */ + function offSocketClose(callback: (error: any) => void): void; + //#endregion +} + +// 设备 +declare namespace my { + //#region canIUse https://docs.alipay.com/mini/api/can-i-use + /** + * 判断当å‰å°ç¨‹åºçš„ APIã€å…¥å‚或返回值ã€ç»„ä»¶ã€å±žæ€§ç­‰åœ¨å½“å‰ç‰ˆæœ¬æ˜¯å¦æ”¯æŒã€‚ + * 傿•°ä½¿ç”¨ ${API}.${type}.${param}.${option} 或者 ${component}.${attribute}.${option} æ–¹å¼æ¥è°ƒç”¨ + * - API 表示 api åå­— + * - type å–值 object/return/callback 表示 api 的判断类型 + * - param è¡¨ç¤ºå‚æ•°çš„æŸä¸€ä¸ªå±žæ€§å + * - option è¡¨ç¤ºå‚æ•°å±žæ€§çš„具体属性值 + * - component 表示组件åç§° + * - attribute 表示组件属性å + * - option 表示组件属性值 + */ + function canIUse(api: string): boolean; + //#endregion + + //#region 获å–åŸºç¡€åº“ç‰ˆæœ¬å· https://docs.alipay.com/mini/api/sdk-version + const SDKVersion: string; + //#endregion + //#region ç³»ç»Ÿä¿¡æ¯ https://docs.alipay.com/mini/api/system-info + interface SystemInfo { + /** + * æ‰‹æœºåž‹å· + */ + model: string; + /** + * 设备åƒç´ æ¯” + */ + pixelRatio: number; + /** + * 窗å£å®½åº¦ + */ + windowWidth: number; + /** + * 窗å£é«˜åº¦ + */ + windowHeight: number; + /** + * 支付å®è®¾ç½®çš„语言 + */ + language: string; + /** + * 支付å®ç‰ˆæœ¬å· + */ + version: string; + /** + * 设备ç£ç›˜å®¹é‡ + */ + storage: string; + /** + * 当å‰ç”µé‡ç™¾åˆ†æ¯” + */ + currentBattery: string; + /** + * 系统版本 + */ + system: string; + /** + * 系统å:Android,iOS + */ + platform: 'Android' | 'iOS' | string; + /** + * å±å¹•宽度 + */ + screenWidth: number; + /** + * å±å¹•高度 + */ + screenHeight: number; + /** + * 手机å“牌 + */ + brand: string; + /** + * ç”¨æˆ·è®¾ç½®å­—ä½“å¤§å° + */ + fontSizeSetting: number; + /** + * 当å‰è¿è¡Œçš„å®¢æˆ·ç«¯ï¼Œå½“å‰æ˜¯æ”¯ä»˜å®åˆ™æœ‰æ•ˆå€¼æ˜¯"alipay" + */ + app: 'alipay' | string; + } + interface GetSystemInfoOptions extends BaseOptions { + success?(res: SystemInfo): void; + } + function getSystemInfo(options: GetSystemInfoOptions): void; + function getSystemInfoSync(): SystemInfo; + //#endregion + + //#region ç½‘ç»œçŠ¶æ€ https://docs.alipay.com/mini/api/network-status + interface GetNetworkTypeOptions extends BaseOptions { + success?(res: { + /** 网络是å¦å¯ç”¨ */ + networkAvailable: boolean; + /** 网络类型值 UNKNOWN / NOTREACHABLE / WIFI / 3G / 2G / 4G / WWAN */ + networkType: NetworkType; + }): void; + } + type NetworkType = 'UNKNOWN' | 'NOTREACHABLE' | 'WIFI' | '3G' | '2G' | '4G' | 'WWAN'; + function getNetworkType(options: GetNetworkTypeOptions): void; + + /** + * 开始网络状æ€å˜åŒ–çš„ç›‘å¬ + */ + function onNetworkStatusChange(callback: (res: { + /** 网络是å¦å¯ç”¨ */ + isConnected: boolean; + /** 网络类型值 UNKNOWN / NOTREACHABLE / WIFI / 3G / 2G / 4G / WWAN */ + networkType: NetworkType; + }) => void): void; + + /** + * å–æ¶ˆç½‘络状æ€å˜åŒ–çš„ç›‘å¬ + */ + function offNetworkStatusChange(): void; + //#endregion + + //#region å‰ªè´´æ¿ https://docs.alipay.com/mini/api/clipboard + interface GetClipboardOptions extends BaseOptions { + success?(res: { + text: string; + }): void; + } + function getClipboard(options: GetClipboardOptions): void; + + interface SetClipboardOptions extends BaseOptions { + /** å‰ªè´´æ¿æ•°æ® */ + text: string; + } + function setClipboard(options: SetClipboardOptions): void; + //#endregion + + //#region 摇一摇 https://docs.alipay.com/mini/api/shake + function watchShake(options: BaseOptions): void; + //#endregion + + //#region 震动 https://docs.alipay.com/mini/api/vibrate + /** + * 调用震动功能。 + */ + function vibrate(options?: BaseOptions): void; + + /** + * 调用震动功能。 + */ + function vibrateLong(options?: BaseOptions): void; + + /** + * 调用震动功能。 + */ + function vibrateShort(options?: BaseOptions): void; + //#endregion + + //#region æ‹¨æ‰“ç”µè¯ https://docs.alipay.com/mini/api/macke-call + interface MakePhoneCallOptions extends BaseOptions { + /** + * éœ€è¦æ‹¨æ‰“的电è¯å·ç  + */ + number: string; + } + /** + * æ‹¨æ‰“ç”µè¯ + */ + function makePhoneCall(options: MakePhoneCallOptions): void; + //#endregion + + //#region èŽ·å–æœåŠ¡å™¨æ—¶é—´ https://docs.alipay.com/mini/api/get-server-time + interface GetServerTimeOptions extends BaseOptions { + success?(res: { + /** æœåŠ¡å™¨æ—¶é—´çš„æ¯«ç§’æ•° */ + time: number; + }): void; + } + function getServerTime(options: GetServerTimeOptions): void; + //#endregion + + //#region 用户截å±äº‹ä»¶ https://docs.alipay.com/mini/api/user-capture-screen + /** + * 监å¬ç”¨æˆ·ä¸»åŠ¨æˆªå±äº‹ä»¶ï¼Œç”¨æˆ·ä½¿ç”¨ç³»ç»Ÿæˆªå±æŒ‰é”®æˆªå±æ—¶è§¦å‘此事件 + */ + function onUserCaptureScreen(callback?: (res: any) => void): void; + + /** + * å–æ¶ˆç›‘嬿ˆªå±äº‹ä»¶ã€‚一般需è¦ä¸Ž my.onUserCaptureScreen æˆå¯¹å‡ºçŽ°ã€‚ + */ + function offUserCaptureScreen(): void; + //#endregion + + //#region å±å¹•亮度 https://docs.alipay.com/mini/api/screen-brightness + interface SetKeepScreenOnOptions extends BaseOptions { + /** 是å¦ä¿æŒå±å¹•常亮 */ + keepScreenOn: boolean; + success?(res: { errMsg: string }): void; + } + /** + * 设置是å¦ä¿æŒå¸¸äº®çжæ€ã€‚ + * 仅在当å‰å°ç¨‹åºç”Ÿæ•ˆï¼Œç¦»å¼€å°ç¨‹åºåŽè®¾ç½®å¤±æ•ˆã€‚ + */ + function setKeepScreenOn(options?: SetKeepScreenOnOptions): void; + + interface GetScreenBrightnessOptions extends BaseOptions { + /** å±å¹•亮度值,范围 0~1,0 最暗,1 最亮 */ + success(value: number): void; + } + /** + * 获å–å±å¹•亮度 + */ + function getScreenBrightness(options?: GetScreenBrightnessOptions): void; + + interface SetScreenBrightnessOptions extends BaseOptions { + /** 需è¦è®¾ç½®çš„å±å¹•亮度,å–值范围0-1 */ + brightness: number; + } + /** + * 设置å±å¹•亮度 + */ + function setScreenBrightness(options: SetScreenBrightnessOptions): void; + //#endregion + + //#region æƒé™å¼•导 https://docs.alipay.com/mini/api/show-auth-guide + interface showAuthGuideOptions extends BaseOptions { + /** + * 引导的æƒé™æ ‡è¯†ï¼Œç”¨äºŽæ ‡è¯†è¯¥æƒé™ç±»åž‹(如 LBS) + * 支æŒçš„ authType 如下: + * + * æƒé™åç§° æƒé™ç  支æŒå¹³å° + * åŽå°ä¿æ´»æƒé™ BACKGROUNDER Android + * 桌é¢å¿«æ·æƒé™ SHORTCUT Android + * 麦克风æƒé™ MICROPHONE iOS + * 通讯录æƒé™ ADDRESSBOOK iOS + * 相机æƒé™ CAMERA iOS + * 照片æƒé™ PHOTO iOS + * pushé€šçŸ¥æ æƒé™ NOTIFICATION iOS + * 自å¯åЍæƒé™ SELFSTARTING Android + * lbs总开关 LBSSERVICE iOS + * lbs开关(app) LBS iOS + */ + authType: 'BACKGROUNDER' | 'SHORTCUT' | 'MICROPHONE' | 'ADDRESSBOOK' | 'CAMERA' | 'PHOTO' | 'NOTIFICATION' | 'SELFSTARTING' | 'LBSSERVICE' | 'LBS'; + } + function showAuthGuide(options: showAuthGuideOptions): void; + //#endregion +} + +// æ‰«ç  +declare namespace my { + //#region æ‰«ç  https://docs.alipay.com/mini/api/scan + type scanType = "qr" | "bar"; + interface ScanCodeData { + /** + * 扫æäºŒç»´ç æ—¶è¿”å›žäºŒç»´ç æ•°æ® + */ + code: string; + /** + * 所扫ç çš„类型 + */ + qrCode: string; + /** + * æ‰«ææ¡å½¢ç æ—¶è¿”回æ¡å½¢ç æ•°æ® + */ + barCode: string; + } + interface ScanOptions extends BaseOptions { + /** + * æ‰«ç æ ·å¼(默认 qr): + * 1. qr,æ‰«ç æ¡†æ ·å¼ä¸ºäºŒç»´ç æ‰«ç æ¡† + * 1. barï¼Œæ‰«ç æ ·å¼ä¸ºæ¡å½¢ç æ‰«ç æ¡† + */ + type?: scanType; + /** + * 是å¦éšè—相册(ä¸å…许从相册选择图片),åªèƒ½ä»Žç›¸æœºæ‰«ç  + */ + hideAlbum?: boolean; + success?(res: ScanCodeData): void; + } + /** + * 调起客户端扫ç ç•Œé¢ï¼Œæ‰«ç æˆåŠŸåŽè¿”回对应的结果 + */ + function scan(options: ScanOptions): void; + //#endregion +} + +// è“牙 +declare namespace my { + //#region 快速接入 https://docs.alipay.com/mini/api/bluetooth-intro + //#endregion + + //#region API https://docs.alipay.com/mini/api/bluetooth-api + interface OpenBluetoothAdapterOptions extends BaseOptions { + /** ä¸ä¼ çš„è¯é»˜è®¤æ˜¯true,表示是å¦åœ¨ç¦»å¼€å½“å‰é¡µé¢æ—¶è‡ªåŠ¨æ–­å¼€è“牙(仅对android有效) */ + autoClose: boolean; + success(res: { + /** + * æ˜¯å¦æ”¯æŒ BLE + */ + isSupportBLE: boolean; + }): void; + } + /** + * åˆå§‹åŒ–å°ç¨‹åºè“牙模å—,生效周期为调用 my.openBluetoothAdapter 至调用 my.closeBluetoothAdapter 或å°ç¨‹åºè¢«é”€æ¯ä¸ºæ­¢ã€‚ 在å°ç¨‹åºè“牙适é…器模å—生效期间,开å‘者å¯ä»¥æ­£å¸¸è°ƒç”¨ä¸‹é¢çš„å°ç¨‹åºAPI,并会收到è“牙模å—相关的 on 事件回调。 + */ + function openBluetoothAdapter(options: Partial): void; + + interface CloseBluetoothAdapterOptions extends BaseOptions { + success(res: any): void; + } + /** + * 关闭本机è“ç‰™æ¨¡å— + */ + function closeBluetoothAdapter(options: CloseBluetoothAdapterOptions): void; + + interface BluetoothAdapterStateData extends ErrMsgResponse { + /** + * æ˜¯å¦æ­£åœ¨æœç´¢è®¾å¤‡ + */ + discovering: boolean; + /** + * è“ç‰™æ¨¡å—æ˜¯å¦å¯ç”¨(éœ€æ”¯æŒ BLE 并且è“牙是打开状æ€) + */ + available: boolean; + } + interface GetBluetoothAdapterStateOptions extends BaseOptions { + success(res: BluetoothAdapterStateData): void; + } + /** + * èŽ·å–æœ¬æœºè“牙适é…å™¨çŠ¶æ€ + */ + function getBluetoothAdapterState(options: GetBluetoothAdapterStateOptions): void; + + interface StartBluetoothDevicesDiscoveryOptions extends BaseOptions { + /** + * è“牙设备主 service çš„ uuid 列表 + * æŸäº›è“牙设备会广播自己的主 service çš„ uuid。如果这里传入该数组,那么根æ®è¯¥ uuid åˆ—è¡¨ï¼Œåªæœç´¢æœ‰è¿™ä¸ªä¸»æœåŠ¡çš„è®¾å¤‡ã€‚ + */ + services?: string[]; + /** + * å¦å…许é‡å¤ä¸ŠæŠ¥åŒä¸€è®¾å¤‡ï¼Œ 如果å…许é‡å¤ä¸ŠæŠ¥ï¼Œåˆ™onDeviceFound 方法会多次上报åŒä¸€è®¾å¤‡ï¼Œä½†æ˜¯ RSSI 值会有ä¸åŒ + */ + allowDuplicatesKey?: boolean; + /** + * 上报设备的间隔,默认为0ï¼Œæ„æ€æ˜¯æ‰¾åˆ°æ–°è®¾å¤‡ç«‹å³ä¸ŠæŠ¥ï¼Œå¦åˆ™æ ¹æ®ä¼ å…¥çš„间隔上报 + */ + interval?: number; + } + /** + * 开始æœå¯»é™„è¿‘çš„è“牙外围设备。æœç´¢ç»“果将在 my.onBluetoothDeviceFound 事件中返回。 + */ + function startBluetoothDevicesDiscovery(options: StartBluetoothDevicesDiscoveryOptions): void; + + interface StopBluetoothDevicesDiscoveryOptions extends BaseOptions { + success(res: ErrMsgResponse): void; + } + /** + * åœæ­¢æœå¯»é™„è¿‘çš„è“ç‰™å¤–å›´è®¾å¤‡ã€‚è¯·åœ¨ç¡®ä¿æ‰¾åˆ°éœ€è¦è¿žæŽ¥çš„设备åŽè°ƒç”¨è¯¥æ–¹æ³•åœæ­¢æœç´¢ã€‚ + */ + function stopBluetoothDevicesDiscovery(options: StopBluetoothDevicesDiscoveryOptions): void; + + /** + * è“ç‰™è®¾å¤‡ä¿¡æ¯ + */ + interface BluetoothDevice { + /** + * è“牙设备å称,æŸäº›è®¾å¤‡å¯èƒ½æ²¡æœ‰ + */ + name: string; + /** + * (兼容旧版本) 值与 name 一致 + */ + deviceName: string; + /** + * 广播设备åç§° + */ + localName: string; + /** + * 设备的 id + */ + deviceId: string; + /** + * 设备信å·å¼ºåº¦ + */ + RSSI: number; + /** + * 设备的广播内容 + */ + advertisData: ArrayBuffer; + /** + * 设备的manufacturerData + */ + manufacturerData: ArrayBuffer; + } + interface GetBluetoothDevicesOptions extends BaseOptions { + success( + res: { + devices: BluetoothDevice[]; + } & ErrMsgResponse + ): void; + } + /** + * èŽ·å–æ‰€æœ‰å·²å‘现的è“牙设备,包括已ç»å’Œæœ¬æœºå¤„于连接状æ€çš„设备。 + */ + function getBluetoothDevices(options: GetBluetoothDevicesOptions): void; + + interface GetConnectedBluetoothDevicesOptions extends BaseOptions { + services?: string[]; + success( + res: { + devices: BluetoothDevice[]; + } & ErrMsgResponse + ): void; + } + /** + * 获å–处于已连接状æ€çš„设备。 + */ + function getConnectedBluetoothDevices(options: GetConnectedBluetoothDevicesOptions): void; + + interface BLEDeviceOptions extends BaseOptions { + /** + * è“牙设备id + */ + deviceId: string; + } + /** + * 连接低功耗è“牙设备。 + */ + function connectBLEDevice(options: BLEDeviceOptions): void; + + /** + * 断开与低功耗è“牙设备的连接。 + */ + function disconnectBLEDevice(options: BLEDeviceOptions): void; + + interface WriteBLECharacteristicValueOptions extends BaseOptions { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * è“牙特å¾å€¼å¯¹åº”æœåŠ¡çš„ uuid + */ + serviceId: string; + /** + * è“牙特å¾å€¼çš„ uuid + */ + characteristicId: string; + /** + * è“牙设备特å¾å€¼å¯¹åº”的值,16进制字符串,é™åˆ¶åœ¨20字节内 + */ + value: string; + } + /** + * å‘低功耗è“牙设备特å¾å€¼ä¸­å†™å…¥æ•°æ®ã€‚ + */ + function writeBLECharacteristicValue( + options: WriteBLECharacteristicValueOptions + ): void; + + interface ReadBLECharacteristicValueOptions extends BaseOptions { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * è“牙特å¾å€¼å¯¹åº”æœåŠ¡çš„ uuid + */ + serviceId: string; + /** + * è“牙特å¾å€¼çš„ uuid + */ + characteristicId: string; + success( + res: { + characteristic: { + /** + * è“牙设备特å¾å€¼çš„ uuid + */ + characteristicId: string; + /** + * è“牙设备特å¾å€¼å¯¹åº”æœåŠ¡çš„ uuid + */ + serviceId: string; + /** + * è“牙设备特å¾å€¼å¯¹åº”的二进制值 + */ + value: ArrayBuffer; + }; + } & ErrMsgResponse + ): void; + } + + /** + * 读å–低功耗è“牙设备特å¾å€¼ä¸­çš„æ•°æ®ã€‚调用åŽåœ¨ my.onBLECharacteristicValueChange() 事件中接收数æ®è¿”回。 + */ + function readBLECharacteristicValue(options: ReadBLECharacteristicValueOptions): void; + + interface NotifyBLECharacteristicValueChangeOptions extends BaseOptions { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * è“牙特å¾å€¼å¯¹åº” service çš„ uuid + */ + serviceId: string; + /** + * è“牙特å¾å€¼çš„ uuid + */ + characteristicId: string; + /** + * notify çš„ descriptor çš„ uuid ï¼ˆåªæœ‰android 会用到,éžå¿…填,默认值00002902-0000-10008000-00805f9b34fb) + */ + descriptorId?: string; + /** + * 是å¦å¯ç”¨notify或indicate + */ + state?: boolean; + } + function notifyBLECharacteristicValueChange(optons: NotifyBLECharacteristicValueChangeOptions): void; + + interface NotifyBLECharacteristicValueChangedOptions extends BaseOptions { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * è“牙特å¾å€¼å¯¹åº”æœåŠ¡çš„ uuid + */ + serviceId: string; + /** + * è“牙特å¾å€¼çš„ uuid + */ + characteristicId: string; + /** + * notify çš„ descriptor çš„ uuid ï¼ˆåªæœ‰android 会用到,éžå¿…填,默认值00002902-0000-10008000-00805f9b34fb) + */ + descriptorId?: string; + /** + * true: å¯ç”¨ notify; false: åœç”¨ notify + */ + state: boolean; + success(res: ErrMsgResponse): void; + } + /** + * å¯ç”¨ä½ŽåŠŸè€—è“牙设备特å¾å€¼å˜åŒ–æ—¶çš„ notify 功能。注æ„:设备的特å¾å€¼å¿…é¡»æ”¯æŒ notify/indicate æ‰å¯ä»¥æˆåŠŸè°ƒç”¨ï¼Œå…·ä½“å‚ç…§ characteristic çš„ properties 属性 å¦å¤–,必须先å¯ç”¨ notify æ‰èƒ½ç›‘å¬åˆ°è®¾å¤‡ characteristicValueChange 事件。 + */ + function notifyBLECharacteristicValueChanged(options: NotifyBLECharacteristicValueChangedOptions): void; + + interface GetBLEDeviceServicesOptions extends BaseOptions { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * æˆåŠŸåˆ™è¿”å›žæœ¬æœºè“牙适é…å™¨çŠ¶æ€ + */ + success(res: { + services: Array<{ + /** + * è“牙设备æœåŠ¡çš„ uuid + */ + serviceId: string; + /** + * 该æœåŠ¡æ˜¯å¦ä¸ºä¸»æœåŠ¡ + */ + isPrimary: boolean; + }>; + } & ErrMsgResponse): void; + } + /** + * 获å–è“牙设备所有 service(æœåŠ¡ï¼‰ + */ + function getBLEDeviceServices(options: GetBLEDeviceServicesOptions): void; + + interface GetBLEDeviceCharacteristicsOptions extends BaseOptions { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * è“牙æœåŠ¡ uuid + */ + serviceId: string; + /** + * æˆåŠŸåˆ™è¿”å›žæœ¬æœºè“牙适é…å™¨çŠ¶æ€ + */ + success(res: { + characteristics: Array<{ + /** + * è“牙设备特å¾å€¼çš„ uuid + */ + characteristicId: string; + /** + * è“牙设备特å¾å€¼å¯¹åº”æœåŠ¡çš„ uuid + */ + serviceId: string; + /** + * è“牙设备特å¾å€¼å¯¹åº”çš„16进制值 + */ + value: ArrayBuffer; + /** + * 该特å¾å€¼æ”¯æŒçš„æ“ä½œç±»åž‹ + */ + properties: Array<{ + /** + * 该特å¾å€¼æ˜¯å¦æ”¯æŒ read æ“作 + */ + read: boolean; + /** + * 该特å¾å€¼æ˜¯å¦æ”¯æŒ write æ“作 + */ + write: boolean; + /** + * 该特å¾å€¼æ˜¯å¦æ”¯æŒ notify æ“作 + */ + notify: boolean; + /** + * 该特å¾å€¼æ˜¯å¦æ”¯æŒ indicate æ“作 + */ + indicate: boolean; + }>; + }>; + } & ErrMsgResponse): void; + } + /** + * 获å–è“牙设备所有 characteristic(特å¾å€¼ï¼‰ + */ + function getBLEDeviceCharacteristics(options: GetBLEDeviceCharacteristicsOptions): void; + + interface OnBluetoothDeviceFoundOptions extends BaseOptions { + success?(res: { + devices: BluetoothDevice[]; + }): void; + } + /** + * æœç´¢åˆ°æ–°çš„è“ç‰™è®¾å¤‡æ—¶è§¦å‘æ­¤äº‹ä»¶ã€‚ + */ + function onBluetoothDeviceFound(options: OnBluetoothDeviceFoundOptions): void; + + /** + * 移除寻找到新的è“牙设备事件的监å¬ã€‚ + */ + function offBluetoothDeviceFound(callback?: any): void; + + interface OnBLECharacteristicValueChangeOptions extends BaseOptions { + success?(res: { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * è“牙特å¾å€¼å¯¹åº” service çš„ uuid + */ + serviceId: string; + /** + * è“牙特å¾å€¼çš„ uuid + */ + characteristicId: string; + /** + * 特å¾å€¼æœ€æ–°çš„16进制值 + */ + value: ArrayBuffer; + }): void; + } + /** + * 监å¬ä½ŽåŠŸè€—è“牙设备的特å¾å€¼å˜åŒ–的事件。 + */ + function onBLECharacteristicValueChange(options: OnBLECharacteristicValueChangeOptions): void; + + interface OnBLEConnectionStateChangedOptions extends BaseOptions { + success?(res: { + /** + * è“牙设备 id,å‚考 device 对象 + */ + deviceId: string; + /** + * 连接目å‰çš„çŠ¶æ€ + */ + connected: boolean; + }): void; + } + /** + * 移除低功耗è“牙设备的特å¾å€¼å˜åŒ–事件的监å¬ã€‚ + */ + function offBLECharacteristicValueChange(callback?: any): void; + + /** + * 监å¬ä½ŽåŠŸè€—è“牙连接的错误事件,包括设备丢失,连接异常断开等。 + */ + function onBLEConnectionStateChanged(options: OnBLEConnectionStateChangedOptions): void; + + /** + * 移除低功耗è“牙连接状æ€å˜åŒ–事件的监å¬ã€‚ + */ + function offBLEConnectionStateChanged(): void; + + interface BluetoothAdapterState { + /** + * è“牙适é…器是å¦å¯ç”¨ + */ + available: boolean; + /** + * è“牙适é…器是å¦å¤„于æœç´¢çŠ¶æ€ + */ + discovering: boolean; + } + /** + * ç›‘å¬æœ¬æœºè“牙状æ€å˜åŒ–的事件。 + */ + function onBluetoothAdapterStateChange(callback: (res: BluetoothAdapterState) => void): void; + + /** + * 移除本机è“牙状æ€å˜åŒ–的事件的监å¬ã€‚ + */ + function offBluetoothAdapterStateChange(): void; + //#endregion +} + +// iBeacon +declare namespace my { + //#region iBeacon https://docs.alipay.com/mini/api/yqleyc + interface StartBeaconDiscoveryOptions extends BaseOptions { + /** + * iBeacon设备广播的 uuids + */ + uuids: string[]; + success?(res: ErrMsgResponse): void; + } + /** + * 开始æœç´¢é™„è¿‘çš„iBeacon设备 + */ + function startBeaconDiscovery(options: StartBeaconDiscoveryOptions): void; + + interface StopBeaconDiscoveryOptions extends BaseOptions { + success?(res: ErrMsgResponse): void; + } + /** + * åœæ­¢æœç´¢é™„è¿‘çš„iBeacon设备 + */ + function stopBeaconDiscovery(options: StopBeaconDiscoveryOptions): void; + + interface Beacon { + /** iBeacon 设备广播的 uuid */ + uuid: string; + /** iBeacon 设备的主 id */ + major: string; + /** iBeacon 设备的次 id */ + minor: string; + /** 表示设备è·ç¦»çš„æžšä¸¾å€¼(0-3åˆ†åˆ«ä»£è¡¨ï¼šæœªçŸ¥ã€æžè¿‘ã€è¿‘ã€è¿œ) */ + proximity: 0 | 1 | 2 | 3; + /** iBeacon 设备的è·ç¦» */ + accuracy: number; + /** iBeacon ä¿¡å·å¼ºåº¦ */ + rssi: number; + } + interface GetBeaconsSuccess { + beacons: Beacon[]; + /** + * errorCode=0 ,接å£è°ƒç”¨æˆåŠŸ + */ + errCode: string; + /** + * ok + */ + errMsg: string; + } + interface GetBeaconsOptions extends BaseOptions { + success?(options: GetBeaconsSuccess): void; + } + /** + * èŽ·å–æ‰€æœ‰å·²æœç´¢åˆ°çš„iBeacon设备 + */ + function getBeacons(options: GetBeaconsOptions): void; + + interface BeaconUpdateOptions extends BaseOptions { + success?(res: { + beacons: Beacon[]; + }): void; + } + /** + * ç›‘å¬ iBeacon 设备的更新事件 + */ + function onBeaconUpdate(options: BeaconUpdateOptions): void; + + interface BeaconServiceChangeOptions extends BaseOptions { + success?(res: { + /** + * æœåŠ¡ç›®å‰æ˜¯å¦å¯ç”¨ + */ + available: boolean; + /** + * ç›®å‰æ˜¯å¦å¤„于æœç´¢çŠ¶æ€ + */ + discovering: boolean; + }): void; + } + /** + * ç›‘å¬ iBeacon æœåŠ¡çš„çŠ¶æ€å˜åŒ– + */ + function onBeaconServiceChange(options: BeaconServiceChangeOptions): void; + //#endregion +} + +// æ•°æ®å®‰å…¨ +declare namespace my { + //#region æ•°æ®å®‰å…¨ https://docs.alipay.com/mini/api/data-safe + interface RsaOptions extends BaseOptions { + /** + * 使用rsa加密还是rsa解密,encrypt加密,decrypt解密 + */ + action: string; + /** + * è¦å¤„ç†çš„æ–‡æœ¬ï¼ŒåŠ å¯†ä¸ºåŽŸå§‹æ–‡æœ¬ï¼Œè§£å¯†ä¸ºBase64ç¼–ç æ ¼å¼æ–‡æœ¬ + */ + text: string; + /** + * rsa秘钥,加密使用公钥,解密使用ç§é’¥ + */ + key: string; + success?(res: { + /** + * ç»è¿‡å¤„ç†è¿‡åŽå¾—到的文本,加密为Base64ç¼–ç æ–‡æœ¬ï¼Œè§£å¯†ä¸ºåŽŸå§‹æ–‡æœ¬ + */ + text: string; + }): void; + } + /** + * éžå¯¹ç§°åŠ å¯†ã€‚ + */ + function rsa(options: RsaOptions): void; + //#endregion +} + +// 分享 +declare namespace my { + //#region 分享 https://docs.alipay.com/mini/api/share_app + //#endregion +} + +// è‡ªå®šä¹‰åˆ†æž +declare namespace my { + //#region è‡ªå®šä¹‰åˆ†æž https://docs.alipay.com/mini/api/report + /** + * è‡ªå®šä¹‰åˆ†æžæ•°æ®çš„上报接å£ã€‚使用å‰éœ€è¦åœ¨å°ç¨‹åºç®¡ç†åŽå°çš„事件管ç†ä¸­æ–°å»ºäº‹ä»¶ï¼Œå¹¶é…置好事件å和字段。 + * + * @param eventName 自定义事件å,需申请 + * @param data ä¸ŠæŠ¥çš„æ•°æ® + */ + function reportAnalytics(eventName: string, data: any): void; + + /** + * éšè—分享按钮。 + */ + function hideShareMenu(options?: BaseOptions): void; + //#endregion +} + +declare namespace my { + interface LaunchOptions { + /** + * 打开å°ç¨‹åºçš„路径 + */ + path: string; + /** + * 打开å°ç¨‹åºçš„query + */ + query: object; + /** + * 打开å°ç¨‹åºçš„[场景值] + */ + scene: number; + /** + * shareTicketï¼Œè¯¦è§ èŽ·å–æ›´å¤š[转å‘ä¿¡æ¯] + */ + shareTicket: string; + /** + * 当场景为由从å¦ä¸€ä¸ªå°ç¨‹åºæˆ–公众巿ˆ–App打开时,返回此字段 + */ + referrerInfo: object; + /** + * æ¥æºå°ç¨‹åºæˆ–公众巿ˆ–Appçš„ appId,详è§ä¸‹æ–¹è¯´æ˜Ž + */ + "referrerInfo.appId": string; + /** + * æ¥æºå°ç¨‹åºä¼ è¿‡æ¥çš„æ•°æ®ï¼Œscene=1037或1038æ—¶æ”¯æŒ + */ + "referrerInfo.extraData": object; + // #endregion + } + interface AppOptions { + /** + * 监å¬å°ç¨‹åºåˆå§‹åŒ–。 + * 当å°ç¨‹åºåˆå§‹åŒ–å®Œæˆæ—¶ï¼Œä¼šè§¦å‘ onLaunch(全局åªè§¦å‘一次) + * 生命周期函数 + */ + onLaunch?: (this: App, option: LaunchOptions) => void; + /** + * 监å¬å°ç¨‹åºæ˜¾ç¤ºã€‚ + * 当å°ç¨‹åºå¯åŠ¨ï¼Œæˆ–ä»ŽåŽå°è¿›å…¥å‰å°æ˜¾ç¤ºï¼Œä¼šè§¦å‘ onShow + * 生命周期函数 + */ + onShow?: (this: App, option: LaunchOptions) => void; + /** + * 监å¬å°ç¨‹åºéšè—。 + * 当å°ç¨‹åºä»Žå‰å°è¿›å…¥åŽå°ï¼Œä¼šè§¦å‘ onHide + * 生命周期函数 + */ + onHide?: (this: App) => void; + /** + * 错误监å¬å‡½æ•° + * 当å°ç¨‹åºå‘生脚本错误或者 api 调用失败时 + * ä¼šè§¦å‘ onError å¹¶å¸¦ä¸Šé”™è¯¯ä¿¡æ¯ + */ + onError?: (this: App, msg: string) => void; + /** + * å°ç¨‹åºé€€å‡ºæ—¶è§¦å‘ + */ + onUnlaunch?: (this: App) => void; + /** + * 全局Data + */ + globalData?: object; + [key: string]: any; + } + interface CreateIntersectionObserverOption { + thresholds?: [number, number]; + initialRatio?: number; + selectAll?: boolean; + } + + interface Margins { + left?: number; + right?: number; + top?: number; + bottom?: number; + } + interface ObserveResponse { + id: string; + dataset: any; + time: number; + intersectionRatio: number; // 相交区域å ç›®æ ‡èŠ‚ç‚¹çš„å¸ƒå±€åŒºåŸŸçš„æ¯”ä¾‹ + boundingClientRect: RectArea; + intersectionRect: RectArea; + relativeRect: RectArea; + } + interface IntersectionObserver { + relativeTo(selector?: string, margins?: Margins): IntersectionObserver; + relativeToViewport(margins?: Margins): IntersectionObserver; + observe( + selector?: string, + callback?: (response: ObserveResponse) => void + ): IntersectionObserver; + disconnect(): void; + } + interface ComponentRelation { + /** 目标组件的相对关系,å¯é€‰çš„值为 parent 〠child 〠ancestor 〠descendant */ + type: "parent" | "child" | "ancestor" | "descendant"; + /** 如果这一项被设置,则它表示关è”的目标节点所应具有的behavior,所有拥有这一behaviorçš„ç»„ä»¶èŠ‚ç‚¹éƒ½ä¼šè¢«å…³è” */ + target?: string; + /** 关系生命周期函数,当关系被建立在页é¢èŠ‚ç‚¹æ ‘ä¸­æ—¶è§¦å‘ï¼Œè§¦å‘æ—¶æœºåœ¨ç»„ä»¶attachedç”Ÿå‘½å‘¨æœŸä¹‹åŽ */ + linked?: (target: Component) => void; + /** 关系生命周期函数,当关系在页é¢èŠ‚ç‚¹æ ‘ä¸­å‘ç”Ÿæ”¹å˜æ—¶è§¦å‘ï¼Œè§¦å‘æ—¶æœºåœ¨ç»„ä»¶movedç”Ÿå‘½å‘¨æœŸä¹‹åŽ */ + linkChanged?: (target: Component) => void; + /** 关系生命周期函数,当关系脱离页é¢èŠ‚ç‚¹æ ‘æ—¶è§¦å‘ï¼Œè§¦å‘æ—¶æœºåœ¨ç»„ä»¶detachedç”Ÿå‘½å‘¨æœŸä¹‹åŽ */ + unlinked?: (target: Component) => void; + } + interface Component { + /** + * 组件的文件路径 + */ + is: string; + /** + * 节点id + */ + id: string; + /** + * 节点dataset + */ + dataset: string; + /** + * 组件数æ®ï¼ŒåŒ…括内部数æ®å’Œå±žæ€§å€¼ + */ + data: any; + + /** + * 组件数æ®ï¼ŒåŒ…括内部数æ®å’Œå±žæ€§å€¼ï¼ˆä¸Ž data 一致) + */ + properties: any; + /** + * 将数æ®ä»Žé€»è¾‘层å‘é€åˆ°è§†å›¾å±‚ï¼ŒåŒæ—¶æ”¹å˜å¯¹åº”çš„ this.data 的值 + * 1. 直接修改 this.data 而ä¸è°ƒç”¨ this.setData 是无法改å˜é¡µé¢çš„状æ€çš„ï¼Œè¿˜ä¼šé€ æˆæ•°æ®ä¸ä¸€è‡´ã€‚ + * 2. 啿¬¡è®¾ç½®çš„æ•°æ®ä¸èƒ½è¶…过1024kB,请尽é‡é¿å…一次设置过多的数æ®ã€‚ + * 3. 请ä¸è¦æŠŠ data 中任何一项的 value 设为 undefined ,å¦åˆ™è¿™ä¸€é¡¹å°†ä¸è¢«è®¾ç½®å¹¶å¯èƒ½é—留一些潜在问题 + * @param data object 以 key,value 的形å¼è¡¨ç¤ºå°† this.data 中的 key å¯¹åº”çš„å€¼æ”¹å˜æˆ value + * @param [callback] callback 是一个回调函数,在这次setDataå¯¹ç•Œé¢æ¸²æŸ“完毕åŽè°ƒç”¨ + */ + setData( + data: any, + callback?: () => void + ): void; + hasBehavior(behavior: any): boolean; + triggerEvent( + name: string, + details?: any, + options?: Partial<{ + bubbles: boolean; + composed: boolean; + capturePhase: boolean; + }> + ): void; + createSelectorQuery(): SelectorQuery; + createIntersectionObserver( + options?: CreateIntersectionObserverOption + ): IntersectionObserver; + /** + * 使用选择器选择组件实例节点 + * 返回匹é…到的第一个组件实例对象 + */ + selectComponent(selector: string): Component; + /** + * selector 使用选择器选择组件实例节点,返回匹é…到的全部组件实例对象组æˆçš„æ•°ç»„ + */ + selectAllComponents(selector: string): Component[]; + getRelationNodes(relationKey: string): ComponentRelation[]; + } + interface Page extends Component { + /** + * data + */ + data: any; + /** + * 强制更新 + */ + forceUpdate(): void; + /** + * 字段å¯ä»¥èŽ·å–到当å‰é¡µé¢çš„路径。 + */ + route(): void; + /** + * æ›´æ–° + */ + update(): void; + /** + * 将页颿»šåŠ¨åˆ°ç›®æ ‡ä½ç½®ã€‚ + * + * scrollTop 滚动到页é¢çš„目标ä½ç½®ï¼ˆå•ä½px) + * [duration] 滚动动画的时长,默认300ms,å•ä½ ms + */ + pageScrollTo(option?: PageScrollToOptions): void; + [key: string]: any; + } + interface App { + data: any; + /** + * 获å–当å‰é¡µé¢ + */ + getCurrentPage(): Page; + [key: string]: any; + } + interface EventTarget { + id: string; + tagName: string; + dataset: { [name: string]: string }; + } + type TouchEventType = + | "tap" + | "touchstart" + | "touchmove" + | "touchcancel" + | "touchend" + | "touchforcechange"; + + type TransitionEventType = + | "transitionend" + | "animationstart" + | "animationiteration" + | "animationend"; + + type EventType = + | "input" + | "form" + | "submit" + | "scroll" + | TouchEventType + | TransitionEventType + | "tap" + | "longpress"; + interface BaseEvent { + type: T; + timeStamp: number; + currentTarget: EventTarget; + target: EventTarget; + detail: Detail; + } + interface Options { + query: any; // 当å‰å°ç¨‹åºçš„ query + path: string; // 当å‰å°ç¨‹åºçš„页é¢åœ°å€ + } + interface PageOptions { + data: any; + onLaunch(this: Page, options: Options): void; + onShow(this: Page, options: Options): void; + onHide(this: Page): void; + onError(this: Page): void; + [key: string]: any; + } + function postMessage(param: any): void; + type onMessageFun = (p: any) => void; + let onMessage: onMessageFun; +} + +declare function App(app: Partial): void; + +declare function getApp(): my.App; + +declare function Behavior(options?: any): my.Component; + +declare function Component(options?: any): my.Component; + +declare function Page(options: Partial): void; + +declare function getCurrentPages(): my.Page[]; diff --git a/types/ali-app/tsconfig.json b/types/ali-app/tsconfig.json new file mode 100644 index 0000000000..a2402fac2c --- /dev/null +++ b/types/ali-app/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "esnext", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "ali-app-tests.ts" + ], + "exclude": [ + ".prettierrc" + ] +} \ No newline at end of file diff --git a/types/ali-app/tslint.json b/types/ali-app/tslint.json new file mode 100644 index 0000000000..f491d1bed9 --- /dev/null +++ b/types/ali-app/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-mergeable-namespace": false, + "no-unnecessary-generics": false + } +} \ No newline at end of file diff --git a/types/alt/tslint.json b/types/alt/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/alt/tslint.json +++ b/types/alt/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/amplitude-js/amplitude-js-tests.ts b/types/amplitude-js/amplitude-js-tests.ts index 4f3c2ea307..c5ffbe9898 100644 --- a/types/amplitude-js/amplitude-js-tests.ts +++ b/types/amplitude-js/amplitude-js-tests.ts @@ -1,85 +1,110 @@ // Tests for Amplitude SDK TypeScript definitions module Amplitude.Tests { + function all() { - amplitude.init('YOUR_API_KEY_HERE', null, { - // optional configuration options + var client: amplitude.AmplitudeClient = new amplitude.AmplitudeClient(); + var identify: amplitude.Identify = new amplitude.Identify(); + var revenue: amplitude.Revenue = new amplitude.Revenue(); + + client = amplitude.getInstance(); + client = amplitude.getInstance('some name'); + + amplitude.__VERSION__ === '1.2.3'; + amplitude.options.logLevel = 'WARN'; + + amplitude.init('API_KEY', 'USER_ID', { saveEvents: true, includeUtm: true, includeReferrer: true, batchEvents: true, eventUploadThreshold: 50 - }); - amplitude.init('YOUR_API_KEY_HERE', 'USER_ID_HERE', null, () => {}); + }, function () { }); + amplitude.init('API_KEY', 'USER_ID', { includeReferrer: true, includeUtm: true }); + amplitude.init('API_KEY', 'USER_ID'); + amplitude.init('API_KEY'); - amplitude.logEvent('EVENT_IDENTIFIER_HERE'); - amplitude.setUserId('USER_ID_HERE'); - amplitude.init('YOUR_API_KEY_HERE', 'USER_ID_HERE'); - amplitude.setUserId(null); // not string 'null' - amplitude.setVersionName('VERSION_NAME_HERE'); - - amplitude.regenerateDeviceId(); - amplitude.setDeviceId('CUSTOM_DEVICE_ID'); - - amplitude.logEvent('EVENT_IDENTIFIER_HERE', { - 'color': 'blue', - 'age': 20, - 'key': 'value' - }); + amplitude.logEvent('Clicked Homepage Button', { 'finished_flow': false, 'clicks': 15 }); + amplitude.logEvent('EVENT_IDENTIFIER_HERE', { 'color': 'blue', 'age': 20, 'key': 'value' }); amplitude.logEvent("EVENT_IDENTIFIER_HERE", null, (httpCode, response) => { }); + amplitude.logEventWithGroups('initialize_game', { 'key': 'value' }, { 'sport': 'soccer' }); + + amplitude.setDeviceId('45f0954f-eb79-4463-ac8a-233a6f45a8f0'); + amplitude.setDomain('.amplitude.com'); + amplitude.setGroup('orgId', '15'); + amplitude.setGroup('orgId', ['15', '16']); + amplitude.setUserId('joe@gmail.com'); + amplitude.setUserProperties({ 'gender': 'female', 'sign_up_complete': true }) + amplitude.setVersionName('1.12.3'); + amplitude.isNewSession(); + amplitude.getSessionId() === 123; - let identify = new amplitude.Identify().set('gender', 'female').set('age', 20); amplitude.identify(identify); + amplitude.logRevenue(3.99, 1, 'product_1234'); + amplitude.logRevenueV2(revenue); - identify = new amplitude.Identify().setOnce('sign_up_date', '08/24/2015'); - amplitude.identify(identify); - identify = new amplitude.Identify().setOnce('sign_up_date', '09/14/2015'); - amplitude.identify(identify); + client.init('API_KEY', 'USER_ID', { + saveEvents: true, + includeUtm: true, + includeReferrer: true, + batchEvents: true, + eventUploadThreshold: 50 + }, function () { }); + client.init('API_KEY', 'USER_ID', { includeReferrer: true, includeUtm: true }); + client.init('API_KEY', 'USER_ID'); + client.init('API_KEY'); - identify = new amplitude.Identify().unset('gender').unset('age'); - amplitude.identify(identify); + client.logEvent('Clicked Homepage Button', { 'finished_flow': false, 'clicks': 15 }); + client.logEvent('EVENT_IDENTIFIER_HERE', { 'color': 'blue', 'age': 20, 'key': 'value' }); + client.logEvent("EVENT_IDENTIFIER_HERE", null, (httpCode, response) => { }); + client.logEventWithGroups('initialize_game', { 'key': 'value' }, { 'sport': 'soccer' }); + client.logEventWithTimestamp('EVENT_IDENTIFIER_HERE', { 'key': 'value' }, 1505430378000, (httpCode, response) => { }); + + client.setDeviceId('45f0954f-eb79-4463-ac8a-233a6f45a8f0'); + client.setDomain('.amplitude.com'); + client.setUserId('joe@gmail.com'); + client.setOptOut(true); + client.setGroup('type', 'name'); + client.setGroup('type', ['name', 'name2']); + client.setUserProperties({ 'gender': 'female', 'sign_up_complete': true }); + client.setGlobalUserProperties({ 'gender': 'female', 'sign_up_complete': true }); + client.setVersionName('1.12.3'); + client.setSessionId(1505430378000); + + client.options.logLevel = 'WARN'; + client.getSessionId() === 123; + client.isNewSession() === true; + client.regenerateDeviceId(); + client.clearUserProperties(); + + client.identify(identify); + client.logRevenue(3.99, 1, 'product_1234'); + client.logRevenueV2(revenue); + + + identify = new amplitude.Identify().set('colors', ['rose', 'gold']).add('karma', 1).setOnce('sign_up_date', '2016-03-31'); identify = new amplitude.Identify().add('karma', 1).add('friends', 1); - amplitude.identify(identify); - - identify = new amplitude.Identify().append('ab-tests', 'new-user-test').append('some_list', [1, 2, 3, 4, 'values']); - amplitude.identify(identify); - - identify = new amplitude.Identify().prepend('ab-tests', 'new-user-test').prepend('some_list', [1, 2, 3, 4, 'values']); - amplitude.identify(identify); - - identify = new amplitude.Identify() - .set('karma', 10) - .add('karma', 1) - .unset('karma'); - amplitude.identify(identify); - + identify = new amplitude.Identify().set('karma', 10).add('karma', 1).unset('karma'); + identify = new amplitude.Identify().append('ab-tests', 'new-user-tests'); + identify.append('some_list', [1, 2, 3, 4, 'values']); + identify = new amplitude.Identify().prepend('ab-tests', 'new-user-tests'); + identify.prepend('some_list', [1, 2, 3, 4, 'values']); + identify = new amplitude.Identify().set('user_type', 'beta'); + identify.set('name', { 'first': 'John', 'last': 'Doe' }); + identify = new amplitude.Identify().setOnce('sign_up_date', '2016-04-01'); + identify = new amplitude.Identify().unset('user_type').unset('age'); identify = new amplitude.Identify() .set('colors', ['rose', 'gold']) .append('ab-tests', 'campaign_a') .append('existing_list', [4, 5]); - amplitude.identify(identify); - amplitude.setUserProperties({ - gender: 'female', - age: 20 - }); - amplitude.clearUserProperties(); - - amplitude.setOptOut(true); - amplitude.setOptOut(false); - - amplitude.setGroup('orgId', '15'); - amplitude.setGroup('sport', ['soccer', 'tennis']); - - // TODO: Implement those. - /* - var revenue = new amplitude.Revenue().setProductId('com.company.productId').setPrice(3.99).setQuantity(3); - amplitude.logRevenueV2(revenue); - - amplitude.logEventWithGroups('initialize_game', { 'key': 'value' }, { 'sport': 'soccer' }); - */ + revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99); + revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99).setEventProperties({ 'city': 'San Francisco' }); + revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99).setQuantity(5); + revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99).setRevenueType('purchase'); } + } diff --git a/types/amplitude-js/index.d.ts b/types/amplitude-js/index.d.ts index 613f5ad5d8..1cdb843589 100644 --- a/types/amplitude-js/index.d.ts +++ b/types/amplitude-js/index.d.ts @@ -1,61 +1,146 @@ -// Type definitions for Amplitude SDK 2.12.1 +// Type definitions for Amplitude SDK 4.4.0 // Project: https://github.com/amplitude/Amplitude-Javascript // Definitions by: Arvydas Sidorenko -// Definitions: https://github.com/Asido/DefinitelyTyped +// Dan Manastireanu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module amplitude { + + type Callback = (responseCode: number, responseBody: string, details?: { reason: string; }) => void; + type LogReturn = number | void; + interface Config { + apiEndpoint?: string; batchEvents?: boolean; cookieExpiration?: number; cookieName?: string; + userId?: string; deviceId?: string; + deviceIdFromUrlParam?: boolean; domain?: string; eventUploadPeriodMillis?: number; eventUploadThreshold?: number; + forceHttps?: boolean; + includeGclid?: boolean; includeReferrer?: boolean; includeUtm?: boolean; language?: string; + logLevel?: 'DISABLE' | 'ERROR' | 'WARN' | 'INFO'; optOut?: boolean; platform?: string; saveEvents?: boolean; savedMaxCount?: number; + saveParamsReferrerOncePerSession?: boolean; sessionTimeout?: number; + trackingOptions?: { + city?: boolean; + country?: boolean; + device_model?: boolean; + dma?: boolean; + ip_address?: boolean; + language?: boolean; + os_name?: boolean; + os_version?: boolean; + platform?: boolean; + region?: boolean; + version_name?: boolean; + }, + unsentKey?: string; + unsentIdentifyKey?: string; uploadBatchSize?: number; } export class Identify { set(key: string, value: any): Identify; setOnce(key: string, value: any): Identify; - add(key: string, value: number): Identify; + add(key: string, value: number | string): Identify; append(key: string, value: any): Identify; prepend(key: string, value: any): Identify; unset(key: string): Identify; } - export function init(apiKey: string): void; - export function init(apiKey: string, userId: string): void; - export function init(apiKey: string, userId: string, options: Config): void; - export function init(apiKey: string, userId: string, options: Config, callback: () => void): void; + export class Revenue { + + setProductId(productId: string): Revenue; + setQuantity(quantity: number): Revenue; + setPrice(price: number): Revenue; + setRevenueType(revenueType: string): Revenue; + setEventProperties(eventProperties: any): Revenue; + } + + export class AmplitudeClient { + + constructor(instanceName?: string); + + options: Config; + + init(apiKey: string, userId?: string, config?: Config, callback?: (client: AmplitudeClient) => void): void; + + setVersionName(versionName: string): void; + + isNewSession(): boolean; + setSessionId(sessionId: number): void; + getSessionId(): number; + + setDomain(domain: string): void; + setUserId(userId: string): void; + + setDeviceId(id: string): void; + regenerateDeviceId(): void; + + identify(identify_obj: Identify, opt_callback?: Callback): void; + + setUserProperties(properties: any): void; + setGlobalUserProperties(properties: any): void; + clearUserProperties(): void; + + setOptOut(enable: boolean): void; + + setGroup(groupType: string, groupName: string | string[]): void; + + logEvent(event: string, data?: any, callback?: Callback): LogReturn; + logEventWithGroups(event: string, data?: any, groups?: any, callback?: Callback): LogReturn; + logRevenueV2(revenue_obj: Revenue): LogReturn; + logRevenue(pric: number, quantity: number, product: string): LogReturn; + logEventWithTimestamp(event: string, data?: any, timestamp?: number, callback?: Callback): LogReturn; + } + + // Proxy methods that get executed on the default AmplitudeClient instance (not all client methods are proxied) + + export function init(apiKey: string, userId?: string, options?: Config, callback?: (client: AmplitudeClient) => void): void; export function setVersionName(version: string): void; + + export function isNewSession(): boolean; + export function getSessionId(): number; + + export function setDomain(domain: string): void; + export function setUserId(userId: string): void; export function setDeviceId(id: string): void; export function regenerateDeviceId(): void; - export function identify(identify: Identify): void; + export function identify(identify: Identify, callback?: Callback): void; - export function setUserProperties(properties: Object): void; + export function setUserProperties(properties: any): void; + export function setGlobalUserProperties(properties: any): void; export function clearUserProperties(): void; export function setOptOut(optOut: boolean): void; export function setGroup(groupType: string, groupName: string | string[]): void; - export function logEvent(event: string): void; - export function logEvent(event: string, data: Object): void; - export function logEvent(event: string, data: Object, callback: (httpCode: number, response: any) => void): void; + export function logEvent(event: string, data?: any, callback?: Callback): LogReturn; + export function logEventWithGroups(event: string, data?: any, groups?: any, callback?: Callback): LogReturn; + export function logRevenueV2(revenue_obj: Revenue): LogReturn; + export function logRevenue(pric: number, quantity: number, product: string): LogReturn; + export function logEventWithTimestamp(event: string, data?: any, timestamp?: number, callback?: Callback): LogReturn; + + + export function getInstance(instanceName?: string): AmplitudeClient; + export const __VERSION__: string; export var options: Config; } diff --git a/types/amqplib/index.d.ts b/types/amqplib/index.d.ts index 9ad6d9ceda..2ea088f841 100644 --- a/types/amqplib/index.d.ts +++ b/types/amqplib/index.d.ts @@ -8,7 +8,7 @@ import * as Promise from 'bluebird'; import * as events from 'events'; -import { Replies, Options, Message } from './properties'; +import { Replies, Options, Message, GetMessage, ConsumeMessage } from './properties'; export * from './properties'; export interface Connection extends events.EventEmitter { @@ -40,10 +40,10 @@ export interface Channel extends events.EventEmitter { publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish): boolean; sendToQueue(queue: string, content: Buffer, options?: Options.Publish): boolean; - consume(queue: string, onMessage: (msg: Message | null) => any, options?: Options.Consume): Promise; + consume(queue: string, onMessage: (msg: ConsumeMessage | null) => any, options?: Options.Consume): Promise; cancel(consumerTag: string): Promise; - get(queue: string, options?: Options.Get): Promise; + get(queue: string, options?: Options.Get): Promise; ack(message: Message, allUpTo?: boolean): void; ackAll(): void; diff --git a/types/amqplib/properties.d.ts b/types/amqplib/properties.d.ts index 9f96b14f5c..97dc8ac393 100644 --- a/types/amqplib/properties.d.ts +++ b/types/amqplib/properties.d.ts @@ -145,12 +145,32 @@ export interface Message { properties: MessageProperties; } -export interface MessageFields { +export interface GetMessage extends Message { + fields: GetMessageFields; +} + +export interface ConsumeMessage extends Message { + fields: ConsumeMessageFields; +} + +export interface CommonMessageFields { deliveryTag: number; redelivered: boolean; exchange: string; routingKey: string; - messageCount: string; +} + +export interface MessageFields extends CommonMessageFields { + messageCount?: number; + consumerTag?: string; +} + +export interface GetMessageFields extends CommonMessageFields { + messageCount: number; +} + +export interface ConsumeMessageFields extends CommonMessageFields { + deliveryTag: number; } export interface MessageProperties { diff --git a/types/amqplib/tslint.json b/types/amqplib/tslint.json index bfc9508c49..f64a783725 100644 --- a/types/amqplib/tslint.json +++ b/types/amqplib/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { // All are TODOs + "no-any-union": false, "no-empty-interface": false, "prefer-const": false } diff --git a/types/angular-bootstrap-lightbox/tslint.json b/types/angular-bootstrap-lightbox/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/angular-bootstrap-lightbox/tslint.json +++ b/types/angular-bootstrap-lightbox/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index 6885916e8a..db74c97d10 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -76,6 +76,7 @@ declare module 'angular' { interface IConfirmDialog extends IPresetDialog { cancel(cancel: string): IConfirmDialog; + multiple(multiple: boolean): IConfirmDialog; } interface IPromptDialog extends IPresetDialog { @@ -340,6 +341,7 @@ declare module 'angular' { interface IMenuService { hide(response?: any, options?: any): IPromise; + open(event?: MouseEvent): void; } interface IColorPalette { diff --git a/types/angular-meteor/tslint.json b/types/angular-meteor/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/angular-meteor/tslint.json +++ b/types/angular-meteor/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/angular-pdfjs-viewer/tsconfig.json b/types/angular-pdfjs-viewer/tsconfig.json index bdae87bf50..05a851782e 100644 --- a/types/angular-pdfjs-viewer/tsconfig.json +++ b/types/angular-pdfjs-viewer/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/angular-promise-tracker/angular-promise-tracker-tests.ts b/types/angular-promise-tracker/angular-promise-tracker-tests.ts index 0365709cf5..6b8b8abd31 100644 --- a/types/angular-promise-tracker/angular-promise-tracker-tests.ts +++ b/types/angular-promise-tracker/angular-promise-tracker-tests.ts @@ -1,5 +1,5 @@ -angular.module('promise-tracker-tests', []).run(['$q', 'promiseTracker', - ($q: angular.IQService, promiseTracker: angular.promisetracker.PromiseTrackerService) => { +angular.module('promise-tracker-tests', []).run(['$q', '$http', 'promiseTracker', + ($q: angular.IQService, $http: angular.IHttpService, promiseTracker: angular.promisetracker.PromiseTrackerService) => { const trackerWithoutOptions = promiseTracker(); const options = { @@ -19,4 +19,8 @@ angular.module('promise-tracker-tests', []).run(['$q', 'promiseTracker', const addedPromise: angular.IDeferred = trackerWithOptions.addPromise(promiseToAdd); const trackerWithSomeOptions = promiseTracker({activationDelay: 500}); + + $http.post('/foo', {}, { }); + $http.post('/foo', {}, { tracker: trackerWithOptions }); + $http.post('/foo', {}, { tracker: [trackerWithoutOptions, trackerWithOptions] }); }]); diff --git a/types/angular-promise-tracker/index.d.ts b/types/angular-promise-tracker/index.d.ts index 85a87bad63..78849fa3e1 100644 --- a/types/angular-promise-tracker/index.d.ts +++ b/types/angular-promise-tracker/index.d.ts @@ -28,4 +28,8 @@ declare module 'angular' { (options?: PromiseTrackerOptions): PromiseTracker; } } + + interface IRequestShortcutConfig { + tracker?: angular.promisetracker.PromiseTracker | angular.promisetracker.PromiseTracker[]; + } } diff --git a/types/angular-q-extras/tsconfig.json b/types/angular-q-extras/tsconfig.json index 3047a809eb..973131f033 100644 --- a/types/angular-q-extras/tsconfig.json +++ b/types/angular-q-extras/tsconfig.json @@ -6,7 +6,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/angular-toastr/angular-toastr-tests.ts b/types/angular-toastr/angular-toastr-tests.ts index 6cb4290b3c..37a9885e9c 100644 --- a/types/angular-toastr/angular-toastr-tests.ts +++ b/types/angular-toastr/angular-toastr-tests.ts @@ -16,6 +16,10 @@ angular closeButton: false, closeHtml: '', extendedTimeOut: 1000, + extraData: { + txt: "sample text", + action: () => {/* Do action */}, + }, iconClasses: { error: 'toast-error', info: 'toast-info', @@ -29,7 +33,6 @@ angular progressBar: false, tapToDismiss: true, templates: { - toast: 'directives/toast/toast.html', progressbar: 'directives/progressbar/progressbar.html' }, diff --git a/types/angular-toastr/index.d.ts b/types/angular-toastr/index.d.ts index 21cf13cce2..f264e71f46 100644 --- a/types/angular-toastr/index.d.ts +++ b/types/angular-toastr/index.d.ts @@ -24,6 +24,7 @@ declare module 'angular' { closeButton?: boolean; closeHtml?: string; extendedTimeOut?: number; + extraData?: any, messageClass?: string; onHidden?: (wasClicked: boolean, toast: angular.toastr.IToast) => void; onShown?: (toast: angular.toastr.IToast) => void; diff --git a/types/angular-ui-sortable/angular-ui-sortable-tests.ts b/types/angular-ui-sortable/angular-ui-sortable-tests.ts index 9ecde2f92a..9418b5741c 100644 --- a/types/angular-ui-sortable/angular-ui-sortable-tests.ts +++ b/types/angular-ui-sortable/angular-ui-sortable-tests.ts @@ -16,6 +16,9 @@ interface SortLogInfo { Text: string; } +// Ensure that the jQuery-ui defined `sortable()` method is not overwritten +jQuery().sortable(); // $ExpectType JQuery + myApp.controller('sortableController', function ($scope: MySortableControllerScope) { $scope.sortableOptions = { activate: function(e, ui) { @@ -84,6 +87,7 @@ myApp.controller('sortableController', function ($scope: MySortableControllerSco update: function(e, ui) { var jQueryEventObject: JQueryEventObject = e; var uiSortableUIParams: ng.ui.UISortableUIParams = ui; + ui.item.sortable; // $ExpectType UISortableProperties var voidcanceled: void = ui.item.sortable.cancel(); var isCanceled: Boolean = ui.item.sortable.isCanceled(); var isCustomHelperUsed: Boolean =ui.item.sortable.isCustomHelperUsed(); diff --git a/types/angular-ui-sortable/index.d.ts b/types/angular-ui-sortable/index.d.ts index aa81038346..9ecf06e112 100644 --- a/types/angular-ui-sortable/index.d.ts +++ b/types/angular-ui-sortable/index.d.ts @@ -2,12 +2,16 @@ // Project: https://github.com/angular-ui/ui-sortable // Definitions by: Thodoris Greasidis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 /// +/// import * as ng from 'angular'; +// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 +type Omit = Pick; + declare module 'angular' { export namespace ui { @@ -79,11 +83,11 @@ declare module 'angular' { isCustomHelperUsed(): Boolean; } - interface UISortableUIItem extends ng.IAugmentedJQuery { + interface UISortableUIItem extends Omit { sortable: UISortableProperties; } - interface UISortableUIParams extends SortableUIParams { + interface UISortableUIParams extends Omit { item: UISortableUIItem; } diff --git a/types/angular-wizard/index.d.ts b/types/angular-wizard/index.d.ts index 33fa8b2b0a..fa14a2f2f7 100644 --- a/types/angular-wizard/index.d.ts +++ b/types/angular-wizard/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mgonto/angular-wizard // Definitions by: Marko Jurisic , Ronald Wildenberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as angular from 'angular'; diff --git a/types/angular-wizard/tslint.json b/types/angular-wizard/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/angular-wizard/tslint.json +++ b/types/angular-wizard/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/animejs/index.d.ts b/types/animejs/index.d.ts index a975f59513..069187b15e 100644 --- a/types/animejs/index.d.ts +++ b/types/animejs/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 -type FunctionBasedParamter = (element: HTMLElement, index: number, length: number) => number; +type FunctionBasedParameter = (element: HTMLElement, index: number, length: number) => number; type AnimeCallbackFunction = (anim: anime.AnimeInstance) => void; // Allowing null is necessary because DOM queries may not return anything. type AnimeTarget = string | object | HTMLElement | SVGElement | NodeList | null; @@ -55,10 +55,10 @@ declare namespace anime { interface AnimeAnimParams { targets: AnimeTarget | ReadonlyArray; - duration?: number | FunctionBasedParamter; - delay?: number | FunctionBasedParamter; - elasticity?: number | FunctionBasedParamter; - round?: number | boolean | FunctionBasedParamter; + duration?: number | FunctionBasedParameter; + delay?: number | FunctionBasedParameter; + elasticity?: number | FunctionBasedParameter; + round?: number | boolean | FunctionBasedParameter; easing?: EasingOptions | string | ReadonlyArray; @@ -106,7 +106,7 @@ declare namespace anime { } interface AnimeTimelineAnimParams extends AnimeAnimParams { - offset: number | string | FunctionBasedParamter; + offset: number | string | FunctionBasedParameter; } interface AnimeTimelineInstance extends AnimeInstance { diff --git a/types/ansi-styles/index.d.ts b/types/ansi-styles/index.d.ts index a07ac962ab..b67cdada41 100644 --- a/types/ansi-styles/index.d.ts +++ b/types/ansi-styles/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: bryn austin bellomy // plylrnsdy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.1 import { EscapeCode } from './escape-code'; diff --git a/types/ansi/ansi-tests.ts b/types/ansi/ansi-tests.ts new file mode 100644 index 0000000000..b2625defa5 --- /dev/null +++ b/types/ansi/ansi-tests.ts @@ -0,0 +1,32 @@ +import ansi = require('ansi'); +const cursor = ansi(process.stdout); + +Object.keys({ + white: 37 + , black: 30 + , blue: 34 + , cyan: 36 + , green: 32 + , magenta: 35 + , red: 31 + , yellow: 33 + , grey: 90 + , brightBlack: 90 + , brightRed: 91 + , brightGreen: 92 + , brightYellow: 93 + , brightBlue: 94 + , brightMagenta: 95 + , brightCyan: 96 + , brightWhite: 97 +}).forEach((color) => { + const cname = color.replace(/([a-z])([A-Z])/g, (_: string, l: string, u: string): string => `${l} ${u.toLowerCase()}`); + + ((<(...anything: any[]) => ansi.Cursor> cursor[color])() + .bold() + .bg)[color === 'blue' || color === 'brightBlue' ? 'black' : 'blue']() + .write( + `Hello, bold ${cname} world!\n` + ) + .reset(); +}); diff --git a/types/ansi/index.d.ts b/types/ansi/index.d.ts new file mode 100644 index 0000000000..4e486d61ef --- /dev/null +++ b/types/ansi/index.d.ts @@ -0,0 +1,181 @@ +// Type definitions for ansi 0.3 +// Project: https://www.npmjs.com/package/ansi +// Definitions by: Gustavo6046 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/** + * References: + * + * - http://en.wikipedia.org/wiki/ANSI_escape_code + * - http://www.termsys.demon.co.uk/vtansi.htm + * + */ + +/// +import { Stream } from "stream"; + +interface CursorOptions { + enabled: boolean; + buffering: boolean; +} + +declare function ansi(stream: Stream, options?: CursorOptions): ansi.Cursor; + +declare namespace ansi { + class Cursor { + bg: Colorer; + fg: Colorer; + + constructor(stream: Stream, options?: CursorOptions); + + /** + * Helper function that calls `write()` on the underlying Stream. + * Returns `this` instead of the write() return value to keep + * the chaining going. + */ + write(data: string): Cursor; + + /** + * Buffer `write()` calls into memory. + * + * @api public + */ + buffer(): Cursor; + + /** + * Write out the in-memory buffer. + * + * @api public + */ + flush(): Cursor; + + /** + * Makes a beep sound! + */ + beep(): Cursor; + + /** + * Moves cursor to specific position + */ + goto(x?: number, y?: number): Cursor; + + /** + * Resets all ANSI formatting on the stream. + */ + reset(): Cursor; + + /** + * Sets the foreground color with the given RGB values. + * The closest match out of the 216 colors is picked. + */ + rgb(r: number, g: number, b: number): Cursor; + + /** + * Accepts CSS color codes for use with ANSI escape codes. + * For example: `#FF000` would be bright red. + */ + hex(color: string): Cursor; + + up(): Cursor; + down(): Cursor; + forward(): Cursor; + back(): Cursor; + nextLine(): Cursor; + previousLine(): Cursor; + horizontalAbsolute(): Cursor; + eraseData(): Cursor; + eraseLine(): Cursor; + scrollUp(): Cursor; + scrollDown(): Cursor; + savePosition(): Cursor; + restorePosition(): Cursor; + queryPosition(): Cursor; + hide(): Cursor; + show(): Cursor; + + bold(): Cursor; + italic(): Cursor; + underline(): Cursor; + inverse(): Cursor; + resetbold(): Cursor; + resetitalic(): Cursor; + resetunderline(): Cursor; + resetinverse(): Cursor; + + white(): Cursor; + black(): Cursor; + blue(): Cursor; + cyan(): Cursor; + green(): Cursor; + magenta(): Cursor; + red(): Cursor; + yellow(): Cursor; + grey(): Cursor; + brightBlack(): Cursor; + brightRed(): Cursor; + brightGreen(): Cursor; + brightYellow(): Cursor; + brightBlue(): Cursor; + brightMagenta(): Cursor; + brightCyan(): Cursor; + brightWhite(): Cursor; + } + + /** + * The `Colorer` class manages both the background and foreground colors. + */ + class Colorer { + constructor(cursor: Cursor, base: string); + + /** + * Write an ANSI color code, ensuring that the same code doesn't get rewritten. + */ + _setColorCode(code: string): Colorer; + + /** + * Resets the color. + */ + reset(): Cursor; + + /** + * Sets the foreground color with the given RGB values. + * The closest match out of the 216 colors is picked. + */ + rgb(r: number, g: number, b: number): Cursor; + + /** + * Accepts CSS color codes for use with ANSI escape codes. + * For example: `#FF000` would be bright red. + */ + hex(color: string): Cursor; + + white(): Cursor; + black(): Cursor; + blue(): Cursor; + cyan(): Cursor; + green(): Cursor; + magenta(): Cursor; + red(): Cursor; + yellow(): Cursor; + grey(): Cursor; + brightBlack(): Cursor; + brightRed(): Cursor; + brightGreen(): Cursor; + brightYellow(): Cursor; + brightBlue(): Cursor; + brightMagenta(): Cursor; + brightCyan(): Cursor; + brightWhite(): Cursor; + } + + interface Cursor { + [key: string]: ((...anything: any[]) => Cursor) | Colorer; + } + + interface Colorer { + [key: string]: (...anything: any[]) => (Cursor | Colorer); + } +} + +export = ansi; diff --git a/types/ansi/tsconfig.json b/types/ansi/tsconfig.json new file mode 100644 index 0000000000..8c698148e6 --- /dev/null +++ b/types/ansi/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts", + "ansi-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "noEmit": true, + "types": [], + "forceConsistentCasingInFileNames": true + } +} \ No newline at end of file diff --git a/types/ansi/tslint.json b/types/ansi/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/ansi/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/aos/aos-tests.ts b/types/aos/aos-tests.ts new file mode 100644 index 0000000000..3936d80499 --- /dev/null +++ b/types/aos/aos-tests.ts @@ -0,0 +1,35 @@ +import * as Aos from "aos"; + +const options: Aos.AosOptions = { + disable: () => true, + startEvent: "DOMContentLoaded", + initClassName: "aos-init", + animatedClassName: "aos-animate", + useClassNames: false, + + offset: 120, + delay: 0, + duration: 400, + easing: "ease-in-out-back", + once: false, + mirror: false, + anchorPlacement: "center-bottom" +}; + +Aos.init(); +Aos.init(options); + +Aos.refresh(); +Aos.refreshHard(); + +document.addEventListener("aos:in", event => { + event; + event.detail; +}); + +document.addEventListener("aos:out", () => {}); + +// aos also creates custom events for every unique id, which you can't cover in d.ts +document.addEventListener("aos:in:sectionId" as Aos.AosEventType, event => { + event.detail; +}); diff --git a/types/aos/global.d.ts b/types/aos/global.d.ts new file mode 100644 index 0000000000..63b6e26f9d --- /dev/null +++ b/types/aos/global.d.ts @@ -0,0 +1,7 @@ +interface Document { + addEventListener( + type: Aos.AosEventType, + listener: (event: Aos.AosEvent) => void, + options?: boolean | AddEventListenerOptions + ): void; +} diff --git a/types/aos/index.d.ts b/types/aos/index.d.ts new file mode 100644 index 0000000000..1e1a9f7cc6 --- /dev/null +++ b/types/aos/index.d.ts @@ -0,0 +1,130 @@ +// Type definitions for aos 3.0 +// Project: https://github.com/michalsnik/aos +// Definitions by: Rostislav Shermenyov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare namespace Aos { + type easingOptions = + | "linear" + | "ease" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-sine" + | "ease-out-sine" + | "ease-in-out-sine" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-in-quart" + | "ease-out-quart" + | "ease-in-out-quart"; + + type anchorPlacementOptions = + | "top-bottom" + | "top-center" + | "top-top" + | "center-bottom" + | "center-center" + | "center-top" + | "bottom-bottom" + | "bottom-center" + | "bottom-top"; + + interface Aos { + /** + * Initializing AOS + * - Create options merging defaults with user defined options + * - Set attributes on as global setting - css relies on it + * - Attach preparing elements to options.startEvent, + * window resize and orientation change + * - Attach function that handle scroll and everything connected to it + * to window scroll event and fire once document is ready to set initial state + * @param options options + */ + init(options?: AosOptions): void; + /** + * Refresh AOS + */ + refresh(): void; + /** + * Hard refresh + * create array with new elements and trigger refresh + */ + refreshHard(): void; + } + + interface AosOptions { + // #region Global settings + /** + * Class applied on animation + */ + animatedClassName?: string; + /** + * Accepts following values: 'phone', 'tablet', 'mobile', boolean, expression or function + */ + disable?: "phone" | "tablet" | "mobile" | boolean | (() => boolean); + /** + * Class applied after initialization + */ + initClassName?: string; + /** + * Name of the event dispatched on the document, that AOS should initialize on + */ + startEvent?: string; + /** + * If true, will add content of `data-aos` as classes on scroll + */ + useClassNames?: boolean; + // #endregion + + // #region Settings that can be overridden on per-element basis, by `data-aos-*` attributes + /** + * Defines which position of the element regarding to window should trigger the animation + */ + anchorPlacement?: anchorPlacementOptions; + /** + * Values from 0 to 3000, with step 50ms + */ + delay?: number; + /** + * Values from 0 to 3000, with step 50ms + */ + duration?: number; + /** + * Default easing for AOS animations + */ + easing?: easingOptions; + /** + * Whether elements should animate out while scrolling past them + */ + mirror?: boolean; + /** + * Offset (in px) from the original trigger point + */ + offset?: number; + /** + * Whether animation should happen only once - while scrolling down + */ + once?: boolean; + // #endregion + } + + interface AosEvent extends Event { + detail: Element; + } + + type AosEventType = "aos:in" | "aos:out"; +} + +declare const Aos: Aos.Aos; + +export = Aos; +export as namespace Aos; diff --git a/types/aos/tsconfig.json b/types/aos/tsconfig.json new file mode 100644 index 0000000000..9af3663613 --- /dev/null +++ b/types/aos/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "global.d.ts", + "aos-tests.ts" + ] +} diff --git a/types/mali/tslint.json b/types/aos/tslint.json similarity index 100% rename from types/mali/tslint.json rename to types/aos/tslint.json diff --git a/types/aphrodite/index.d.ts b/types/aphrodite/index.d.ts index 3e7807b6b6..f41aadec46 100644 --- a/types/aphrodite/index.d.ts +++ b/types/aphrodite/index.d.ts @@ -12,7 +12,7 @@ type FontFamily = | BaseCSSProperties['fontFamily'] | CSS.FontFace; -type Omit = Pick; +type Omit = Pick>; type CSSProperties = Omit & { fontFamily?: FontFamily | FontFamily[]; diff --git a/types/apollo-codegen/index.d.ts b/types/apollo-codegen/index.d.ts index ea5d415418..4309db4116 100644 --- a/types/apollo-codegen/index.d.ts +++ b/types/apollo-codegen/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/apollographql/apollo-codegen // Definitions by: Bradley Ayers , Maria Carrasco // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 import { Options } from 'graphql/utilities/schemaPrinter'; diff --git a/types/apollo-upload-client/index.d.ts b/types/apollo-upload-client/index.d.ts index 7c1e3cb7b6..c6476f2ae9 100644 --- a/types/apollo-upload-client/index.d.ts +++ b/types/apollo-upload-client/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/jaydenseric/apollo-upload-client#readme // Definitions by: Edward Sammut Alessi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.6 import { ApolloLink } from "apollo-link"; import { HttpOptions } from "apollo-link-http-common"; diff --git a/types/apollo-upload-client/tsconfig.json b/types/apollo-upload-client/tsconfig.json index 2a023ff111..a78e75500c 100644 --- a/types/apollo-upload-client/tsconfig.json +++ b/types/apollo-upload-client/tsconfig.json @@ -2,7 +2,9 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", "dom" + "es6", + "dom", + "esnext.asynciterable" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/apostrophe/apostrophe-tests.ts b/types/apostrophe/apostrophe-tests.ts new file mode 100644 index 0000000000..982160f274 --- /dev/null +++ b/types/apostrophe/apostrophe-tests.ts @@ -0,0 +1,27 @@ +import { AposModuleOptions } from "apostrophe"; + +type CustomModules = "first-custom-widgets"; + +const firstCustomWidgetOptions: AposModuleOptions = { + extend: "apostrophe-widgets", + label: "First Custom Widget", + addFields: [ + { + name: "title", + label: "Custom Widget Title", + type: "string" + } + ] +}; + +const secondCustomWidgetOptions: AposModuleOptions = { + extend: "first-custom-widgets", + label: "Second Custom Widget", + addFields: [ + { + name: "title", + label: "Custom Widget Title", + type: "string" + } + ] +}; diff --git a/types/apostrophe/index.d.ts b/types/apostrophe/index.d.ts new file mode 100644 index 0000000000..9c415a3931 --- /dev/null +++ b/types/apostrophe/index.d.ts @@ -0,0 +1,328 @@ +// Type definitions for apostrophe 2.67 +// Project: https://github.com/apostrophecms/apostrophe#readme +// Definitions by: Aaron Holderman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +export = apostrophe; +export as namespace apos; + +declare function apostrophe( + options: apostrophe.AposConstructor, + ...args: any[] +): any; + +declare namespace apostrophe { + const moogBundle: { + directory: string; + modules: string[]; + }; + + // Pass in custom modules as first argument + // second argument is additional custom options e.g. restApi exposed by apostrophe-headless + interface AposConstructor { + afterInit?: () => void; + afterListen?: () => void; + initFailed?: (error: any) => void; + baseUrl?: string; + modules: { [K in AposCoreModules & M]?: AposModuleOptions | O }; + prefix?: string; + root?: string; + rootDir?: string; + shortName: string; + } + + const ui: { + globalBusy: (state: any) => any; + link: ( + sel: string, + verb: string, + object: object, + callback?: () => any + ) => any; + }; + + const pages: { + page: { _id: string; type: string; _url?: string }; + }; + + const adminBar: { + link: (name: string, callback: () => any) => void; + }; + + function change(arg: object | string): any; + + function create(type: string, options: any, callback?: () => any): any; + + const contextPiece: { + _id: string; + title: string; + slug: string; + type: string; + }; + + function define( + type: string | string[], + definition: any, + extending?: any + ): any; + + const docs: { + getManager: (type: string) => void; + setManager: (type: string, manager: any) => void; + lock: (id: string, callback?: () => any) => void; + lockAndWatch: (id: string, callback?: () => any) => void; + unlock: (_id: string, sync: any, callback?: () => any) => any; + }; + + function emit(name: string, arg?: any): any; + + const modules: object; + + const modalSupport: { + stack: any[]; + initialized: boolean; + depth: number; + all: any[]; + getTopModalOrBody: () => string; + getLatestModal: () => null | string; + closeTopModal: () => void; + cancelTopModal: () => void; + }; + + function notify(message: string | object, options: AposObject): any; + + function off(eventName: string, fn?: () => any): any; + + function on(eventName: string, fn?: () => any): any; + + const schemas: { + convert: ( + $el: HTMLElement, + schema: Schema, + data: any, + options: any, + callback?: () => any + ) => any; + newInstance: (schema: Schema) => any; + populate: ( + data: any, + name: string, + $field: any, + callback?: () => void, + $el?: HTMLElement, + field?: any + ) => any; + returnToError: ( + $el: HTMLElement, + schema: Schema, + errorPath: any, + error: any, + callback: () => any + ) => void; + }; + + const utils: { + capitalizeFirst: (s: string) => string; + camelName: (s: string) => string; + error: (msg: string) => void; + generateId: () => string; + }; + + const versions: { + edit: (id: string, afterRevert?: () => void) => any; + }; + + interface AposObject { + [key: string]: any; + } + + interface Field { + name: string; + type: string; + label: string; + help?: string; + required?: boolean; + options?: AposObject; + choices?: SelectChoice[]; + widgetType?: string; + titleField?: string; + schema?: Field[]; + } + + interface SelectChoice { + label: string; + value: string; + } + + type Fields = Field[]; + + interface AposType { + name: string; + converters: { + string( + req: any, + data: any, + name: string, + object: AposObject, + field: any, + callback: () => any + ): void; + form( + req: any, + data: any, + name: string, + object: AposObject, + field: any, + callback: () => any + ): void; + }; + empty?(field: any, value: any): void; + bless?(req: any, field: any): void; + index(value: any, field: any, texts: any): void; + } + + interface Schema { + createRoutes(): any[]; + pushAssets(): void; + pushCreateSingleton(): void; + compose(options: AposObject): void; + refine(schema: Schema, options: AposObject): void; + toGroups(fields: Fields): void; + subset(schema: Schema, fields: Fields): Schema; + newInstance(schema: Schema): any; + subsetInstance(schema: Schema, instance: AposObject): any; + empty(schema: Schema, object: AposObject): void; + indexFields(schema: Schema, object: AposObject, texts: any): void; + convert( + req: any, + schema: Schema, + to: any, + object: AposObject, + output: any, + callback: () => any + ): void; + isVisible(schema: Schema, object: AposObject, name: string): void; + export( + req: any, + schema: Schema, + to: any, + object: AposObject, + output: any, + callback: () => any + ): void; + joinDriver( + req: any, + method: any, + reverse: any, + items: any, + idField: any, + relationshipsField: any, + objectField: any, + options: any, + callback: () => any + ): void; + join( + req: any, + schema: Schema, + objectOrArray: any, + withJoins: any, + callback: () => any + ): void; + addFieldType(type: AposType): void; + getFieldType(typeName: string): void; + addFilters(schema: Schema, options: any, cursor: any): void; + joinFilterChoices(field: any, cursor: any, valueField: any): void; + addJoinSlugFilter(field: any, cursor: any, suffix: any): void; + pageServe(req: any): void; + sortedDistinct(property: any, cursor: any, callback: () => any): void; + cursorFilterInterested(cursor: any, name: string): void; + afterInit(): void; + validate(schema: Schema, options: any): void; + } + + interface AposModule { + emit(name: string): void; + on(name: string, methodName: any, fn: () => any): void; + } + + type AposCoreModules = + | "apostrophe-admin-bar" + | "apostrophe-any-page-manager" + | "apostrophe-areas" + | "apostrophe-assets" + | "apostrophe-attachments" + | "apostrophe-browser-utils" + | "apostrophe-caches" + | "apostrophe-custom-pages" + | "apostrophe-db" + | "apostrophe-doc-type-manager" + | "apostrophe-docs" + | "apostrophe-email" + | "apostrophe-express" + | "apostrophe-files" + | "apostrophe-files-widgets" + | "apostrophe-global" + | "apostrophe-groups" + | "apostrophe-html-widgets" + | "apostrophe-i18n" + | "apostrophe-images" + | "apostrophe-images-widgets" + | "apostrophe-jobs" + | "apostrophe-launder" + | "apostrophe-locks" + | "apostrophe-login" + | "apostrophe-migrations" + | "apostrophe-modal" + | "apostrophe-module" + | "apostrophe-notifications" + | "apostrophe-oembed" + | "apostrophe-pager" + | "apostrophe-pages" + | "apostrophe-permissions" + | "apostrophe-pieces" + | "apostrophe-pieces-pages" + | "apostrophe-pieces-widgets" + | "apostrophe-polymorphic-manager" + | "apostrophe-push" + | "apostrophe-rich-text-widgets" + | "apostrophe-schemas" + | "apostrophe-search" + | "apostrophe-service-bridge" + | "apostrophe-soft-redirects" + | "apostrophe-tags" + | "apostrophe-tasks" + | "apostrophe-templates" + | "apostrophe-ui" + | "apostrophe-urls" + | "apostrophe-users" + | "apostrophe-utils" + | "apostrophe-versions" + | "apostrophe-video-fields" + | "apostrophe-video-widgets" + | "apostrophe-widgets"; + + // Pass in custom modules to AposModuleOptions to allow them in extend + interface AposModuleOptions { + extend: AposCoreModules | C; + name?: string; + label: string; + pluralLabel?: string; + playerData?: false | string[]; + scene?: "user"; + addFields?: Field[]; + removeFields?: Field[]; + arrangeFields?: { + name: string; + label: string; + fields: string[]; + }[]; + beforeConstruct?: (self: any, options: any) => any; + defer?: boolean; + filters?: { + projection?: { + [key: string]: number; + }; + }; + } +} diff --git a/types/apostrophe/tsconfig.json b/types/apostrophe/tsconfig.json new file mode 100644 index 0000000000..6df1f1b3b8 --- /dev/null +++ b/types/apostrophe/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "apostrophe-tests.ts" + ] +} diff --git a/types/apostrophe/tslint.json b/types/apostrophe/tslint.json new file mode 100644 index 0000000000..30332ffc41 --- /dev/null +++ b/types/apostrophe/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "array-type": [true, "array"] + } +} diff --git a/types/app-module-path/app-module-path-tests.ts b/types/app-module-path/app-module-path-tests.ts new file mode 100644 index 0000000000..5dc1012ca1 --- /dev/null +++ b/types/app-module-path/app-module-path-tests.ts @@ -0,0 +1,7 @@ +import { addPath, enableForDir, removePath } from 'app-module-path'; + +addPath('/tmp'); + +enableForDir('/tmp'); + +removePath('/tmp'); diff --git a/types/app-module-path/index.d.ts b/types/app-module-path/index.d.ts new file mode 100644 index 0000000000..00280c4191 --- /dev/null +++ b/types/app-module-path/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for app-module-path 2.2 +// Project: https://github.com/patrick-steele-idem/app-module-path-node +// Definitions by: Timur Manyanov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +export function addPath(path: string, parent?: any): void; + +export function enableForDir(dir: string): void; + +export function removePath(path: string): void; diff --git a/types/app-module-path/tsconfig.json b/types/app-module-path/tsconfig.json new file mode 100644 index 0000000000..93d4d0a365 --- /dev/null +++ b/types/app-module-path/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "app-module-path-tests.ts" + ] +} diff --git a/types/app-module-path/tslint.json b/types/app-module-path/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/app-module-path/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/arangodb/index.d.ts b/types/arangodb/index.d.ts index 32ad04210b..238cea2379 100644 --- a/types/arangodb/index.d.ts +++ b/types/arangodb/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/arangodb/arangodb // Definitions by: Alan Plum // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// @@ -1440,6 +1440,81 @@ declare module "@arangodb/foxx/router" { export = createRouter; } +declare module "@arangodb/foxx/queues" { + interface QueueItem { + name: string; + mount: string; + backOff?: ((failureCount: number) => number) | number; + maxFailures?: number; + schema?: Foxx.Schema; + preprocess?: (data: any) => any; + } + + interface Script { + name: string; + mount: string; + } + + type JobCallback = (result: any, jobData: any, job: ArangoDB.Document) => void; + + interface Job { + status: string; + queue: string; + type: Script; + failures: object[]; + runs: number; + data: any; + created: number; + modified: number; + delayUntil: number; + maxFailures: number; + repeatDelay: number; + repeatTimes: number; + repeatUntil: number; + success?: string; + failure?: string; + runFailures: number; + abort(): void; + } + + interface JobOptions { + success?: JobCallback; + failure?: JobCallback; + delayUntil?: number | Date; + backOff?: ((failureCount: number) => number) | number; + maxFailures?: number; + repeatTimes?: number; + repeatUntil?: number | Date; + repeatDelay?: number; + } + + interface Queue { + push(item: QueueItem, data: any, opts?: JobOptions): void; + get(jobId: string): ArangoDB.Document; + delete(jobId: string): boolean; + pending(script?: Script): string[]; + progress(script?: Script): string[]; + complete(script?: Script): string[]; + failed(script?: Script): string[]; + all(script?: Script): string[]; + } + + function createQueue(name: string, maxWorkers?: number): Queue; + function deleteQueue(name: string): boolean; + function get(name: string): Queue; + + export { + createQueue as create, + deleteQueue as delete, + get, + JobOptions, + Job, + Queue, + QueueItem, + Script, + }; +} + declare module "@arangodb/foxx/graphql" { import { formatError, GraphQLSchema } from "graphql"; type GraphQLModule = object; @@ -1698,7 +1773,7 @@ declare module "@arangodb/crypto" { key: string | null, token: string, noVerify?: boolean - ): string | null; + ): object | null; function md5(message: string): string; function sha1(message: string): string; function sha224(message: string): string; diff --git a/types/arangodb/tsconfig.json b/types/arangodb/tsconfig.json index f778fd7c47..d30610b604 100644 --- a/types/arangodb/tsconfig.json +++ b/types/arangodb/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": ["es6", "esnext.asynciterable"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/types/arcgis-js-api/index.d.ts b/types/arcgis-js-api/index.d.ts index 97eb679110..28e51384c9 100644 --- a/types/arcgis-js-api/index.d.ts +++ b/types/arcgis-js-api/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for ArcGIS API for JavaScript 4.8 +// Type definitions for ArcGIS API for JavaScript 4.9 // Project: http://js.arcgis.com // Definitions by: Esri // Bjorn Svensson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.7 interface HashMap { @@ -300,6 +300,14 @@ declare namespace __esri { * */ clone(): Basemap; + /** + * Loads all the externally loadable resources associated with the basemap. For the basemap this will load all the base layers and reference layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#loadAll) + * + * + */ + loadAll(): IPromise; } interface BasemapConstructor { @@ -625,7 +633,7 @@ declare namespace __esri { */ interface config { /** - * The URL for font resources used by the [Font](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#family) class with 2D WebGL enabled [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). To use your own hosted fonts, make sure to follow our naming conventions (e.g. "arial-unicode-ms-bold"). + * The URL for font resources used by the [Font](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#family) class in [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) labels. To use your own hosted fonts, you must follow the kebab-case naming convention (e.g. "arial-unicode-ms-bold"). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#fontsUrl) * @@ -686,42 +694,6 @@ declare namespace __esri { export interface configRequest extends Object { - /** - * Indicates whether the library automatically detects if [CORS](http://enable-cors.org/) (Cross-Origin Resource Sharing) specification is supported by ArcGIS Servers used in your application. Upon successful detection, the server will be added to `corsEnabledServers` list. CORS detection will not be performed for a server if it is already listed in `corsEnabledServers`. The default is `true` if your application is running in a web browser, or `false` if your application is running on [Apache Cordova](https://cordova.apache.org/) platform. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - */ - corsDetection?: boolean; - /** - * Number of seconds to wait for response from the ArcGIS Server during CORS detection. If the detection is not complete before this time expires, then it is assumed that the server does not support CORS. Applicable when `corsDetection` is true. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - * - * @default 15 - */ - corsDetectionTimeout?: number; - /** - * A list of servers known to support CORS specification. By default, this list includes many Esri hosted servers that are known to support CORS and is updated at every release as the list grows. The API is capable of automatically detecting CORS support for servers used in an application (see `corsDetection`). If you are aware that a server supports CORS, add it to this list. Since the API includes some servers by default it's important to add items onto this array rather than overwriting it. Example: - * ```js - * // Add a known server to the list. - * require(["esri/config"], function(esriConfig) { - * esriConfig.request.corsEnabledServers.push(".:"); - * }); - * ``` - * - * You can also pass objects to this property with the following specification: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - */ - corsEnabledServers?: (string | configRequestCorsEnabledServers)[]; - /** - * Indicates whether the proxy specified in `proxyUrl` is used for all AJAX requests made using [request](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html) and images added using `` element. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - * - * @default false - */ - forceProxy?: boolean; /** * List of domain suffixes known to support https. This will automatically upgrade requests made to such domains to use https instead of http when the application is not running on http. Note that port numbers should not be included in the domain suffix to be matched. If no `httpsDomains` list exists , the API redirects all calls using https. If the list exists and a domain of a required http resource is not listed, the API sends the URL as it is specified within the code. Likewise, if the list exists and the domain of a required http resource is listed in it, the API sends an https request to that resource. The list includes the following domain suffixes by default: * * `arcgis.com` @@ -769,6 +741,12 @@ declare namespace __esri { * @default 2000 */ maxUrlLength?: number; + /** + * A proxy rule defines a proxy for a set of resources with an identical URL prefix. When using [esriRequest](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html), if a target URL matches a rule, then the request will be sent to the specified proxy. Rather than populating this array directly, use the urlUtils.addProxyRule() method. Rule objects have the following properties: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + */ + proxyRules?: configRequestProxyRules[]; /** * Resource proxy for your application. It is used by the library when communicating with a web server hosted on a domain that is different from the domain where your application is hosted. The library may or may not use the proxy depending on the type of request made, whether the server support CORS, whether the application is being run on older versions of browsers etc. To keep it simple, it is recommended that you always configure a resource proxy for your application. You can download the resource proxy from this [GitHub repo](https://github.com/Esri/resource-proxy). * ```js @@ -789,13 +767,16 @@ declare namespace __esri { */ timeout?: number; /** - * Indicates whether the library will use [CORS](http://enable-cors.org/)-enabled requests when communicating with a web server hosted on a domain that is different from the domain where the application is hosted. If `true`, AJAX requests are directly made to servers that support CORS. If `with-credentials` is specified, then AJAX requests will use credentials stored in a client's cookies. If `false`, direct requests are not made. A proxy will be used if available. + * **Since:** 4.9 Indicates whether cross origin requests made to the associated server should include credentials such as cookies and authorization headers. + * ```js + * require(["esri/config"], function(esriConfig) { + * esriConfig.request.trustedServers.push("[//].[:]"); + * }); + * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - * - * @default with-credentials */ - useCors?: string | boolean; + trustedServers?: string[]; /** * **Since:** 4.5 Indicates whether `esri/request` will request a credential from `IdentityManager`. * @@ -804,30 +785,6 @@ declare namespace __esri { * @default true */ useIdentity?: boolean; - /** - * A proxy rule defines a proxy for a set of resources with an identical URL prefix. When using [esriRequest](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html), if a target URL matches a rule, then the request will be sent to the specified proxy. Rather than populating this array directly, use the urlUtils.addProxyRule() method. Rule objects have the following properties: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - */ - proxyRules?: configRequestProxyRules[]; - } - - - export interface configRequestCorsEnabledServers extends Object { - /** - * The host name of the server to add to the list of CORS-enabled servers. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - */ - host?: string | RegExp; - /** - * Indicates whether requests made to the associated server should include credentials such as cookies and authorization headers. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - * - * @default false - */ - withCredentials?: boolean; } @@ -909,7 +866,7 @@ declare namespace __esri { */ after?: AfterInterceptorCallback; /** - * Callback function that can make changes to the URL or options before the request is sent. + * Make changes to the request URL or options before the request is sent. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ @@ -921,13 +878,13 @@ declare namespace __esri { */ headers?: any; /** - * Sets or adds a query parameter into `requestOptions.query`. See also: [requestOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions). + * Sets or adds query parameters into `requestOptions.query`. See also: [requestOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ query?: any; /** - * Hardcodes the response. The request will not be sent. This is resolved as the response `data`. + * Hardcodes the [response](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse). The request will not be sent. This is resolved as the response `data`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ @@ -1000,7 +957,7 @@ declare namespace __esri { */ declared(baseClass: T, ...mixinClasses: any[]): T; /** - * This convenience decorator is used to define an [Accessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html) property. Any property defined with this decorator can now be `get` and `set`. In addition, you can [watch for any property changes](https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html). Many times this decorator is used in conjunction with the [@renderable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html) decorator. + * This convenience decorator is used to define an [Accessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html) property. Any property defined with this decorator can now be `get` and `set`. In addition, you can [watch for any property changes](https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html). Many times this decorator is used in conjunction with the [@renderable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#renderable) decorator. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) * @@ -1935,25 +1892,19 @@ declare namespace __esri { export const workers: workers; - /** - * The Connection class is used to access code loaded into a separate thread via the [workers framework](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html) - */ interface Connection { /** - * A convenient method that broadcasts a message to all workers. Use this method if it is mandatory that all workers need to have a piece of information which is critical for them to process additional requests. + * A convenient method that invokes a method on each worker. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#broadcast) * - * @param methodName The name of the method to invoke on all workers. - * @param data The object which contains all required parameters to be passed to the method. The data passed between the main thread and the workers framework are copied, not shared. Objects are serialized and de-serialized on both ends. - * @param transferList An array of [Transferable](https://developer.mozilla.org/en-US/docs/Web/API/Transferable) objects. Transferable objects are transferred from one context to another with a zero-copy operation, which results in a big performance improvement when sending large data sets. + * @param methodName The name of the remote method to invoke on all workers. + * @param data The unique parameter passed as argument of the remote method. * */ - broadcast(methodName: string, data?: any, transferList?: any[]): IPromise; + broadcast(methodName: string, data?: any): IPromise[]; /** - * Closes the existing connection instance to workers. Notify all workers to destroy the connection instance and unload the connection module. + * Closes the existing connection instance to workers. Notifies all workers to destroy the connection instance and dispose the remote module. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#close) * @@ -1961,19 +1912,30 @@ declare namespace __esri { */ close(): void; /** - * Invokes a method on the script loaded with the workers framework. + * Invokes a [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#basic-invocation) on the remote module loaded with the worker. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) * * @param methodName The name of the method to be invoked in the script. - * @param data The object which contains all required parameters to be passed to the method. The data passed between the main thread and the workers framework are copied, not shared. Objects are serialized and de-serialized on both ends. - * @param transferList An array of [Transferable](https://developer.mozilla.org/en-US/docs/Web/API/Transferable) objects. Each transferable object in the array should have a corresponding entry in the data object. Transferable objects are transferred from one context to another with a zero-copy operation, which results in a big performance improvement when sending large data sets. + * @param data The unique parameter passed as argument of the remote method. See [Passing multiple parameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#multiple-parameters) section to pass more than one parameter to the remote method. + * @param transferList An array of [Transferable](https://developer.mozilla.org/en-US/docs/Web/API/Transferable) objects. Each transferable object in the array should have a corresponding entry in the data object. See [Using transferables](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#using-transferables) section for more information. * */ invoke(methodName: string, data?: any, transferList?: any[]): IPromise; } - export const Connection: Connection; + interface ConnectionConstructor { + /** + * This class is used to execute remote methods located on the module loaded into a separate thread via the [workers framework](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html) + */ + + + new(): Connection; + } + + export const Connection: ConnectionConstructor; export interface workersOpenOptions extends Object { @@ -3642,7 +3604,7 @@ declare namespace __esri { /** - * Creates a mesh representing a box. The spatial reference of the resulting mesh is the same as the location where it is placed. **Box UV coordinate space** The box geometry will have UV coordinates generated according to the following scheme: + * Creates a mesh representing a box. The spatial reference of the resulting mesh is the same as the location where it is placed. **Box UV coordinate space** The box geometry will have UV coordinates generated according to the following scheme: * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) * @@ -3656,7 +3618,7 @@ declare namespace __esri { */ createBox(location: Point, params?: MeshCreateBoxParams): Mesh; /** - * Creates a mesh representing a cylinder. The spatial reference of the resulting mesh is the same as the location where it is placed. **Cylinder UV coordinate space** The cylinder geometry will have UV coordinates generated according to the following scheme (example is shown for 8 vertices cylinder): + * Creates a mesh representing a cylinder. The spatial reference of the resulting mesh is the same as the location where it is placed. **Cylinder UV coordinate space** The cylinder geometry will have UV coordinates generated according to the following scheme (example is shown for 8 vertices cylinder): * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) * @@ -3681,7 +3643,7 @@ declare namespace __esri { */ createFromPolygon(polygon: Polygon, params?: MeshCreateFromPolygonParams): Mesh; /** - * Creates a mesh representing a plane. The spatial reference of the resulting mesh is the same as the location where it is placed. A plane consists of two triangles and may be conveniently oriented at creation time. **Plane UV coordinate space** The plane geometry will have UV coordinates generated according to the following scheme: + * Creates a mesh representing a plane. The spatial reference of the resulting mesh is the same as the location where it is placed. A plane consists of two triangles and may be conveniently oriented at creation time. **Plane UV coordinate space** The plane geometry will have UV coordinates generated according to the following scheme: * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) * @@ -3695,7 +3657,7 @@ declare namespace __esri { */ createPlane(location: Point, params?: MeshCreatePlaneParams): Mesh; /** - * Creates a mesh representing a sphere. The spatial reference of the resulting mesh is the same as the location where it is placed. **Sphere UV coordinate space** The sphere geometry will have UV coordinates generated according to the following scheme (example is shown for 8x8 vertices sphere): + * Creates a mesh representing a sphere. The spatial reference of the resulting mesh is the same as the location where it is placed. **Sphere UV coordinate space** The sphere geometry will have UV coordinates generated according to the following scheme (example is shown for 8x8 vertices sphere): * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) * @@ -4040,11 +4002,17 @@ declare namespace __esri { */ uv?: Float32Array | number[] | Float64Array; /** - * A flat array of the vertex normals (3 elements per vertex). + * A flat array of the vertex normals (3 elements per vertex ranging from -1 to 1). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ - normal?: Float32Array | number[] | Uint32Array; + normal?: Float32Array | number[] | Float64Array; + /** + * **Since: 4.9** A flat array of the vertex colors (4 elements per vertex ranging from 0 to 255). Vertex colors are multiplied by the component material color (if any is defined). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) + */ + color?: Uint8Array | number[] | Uint8ClampedArray; } export interface MeshVertexAttributes extends AnonymousAccessor { @@ -4061,11 +4029,17 @@ declare namespace __esri { */ uv?: Float32Array; /** - * A flat array of the vertex normals (3 elements per vertex). + * A flat array of the vertex normals (3 elements per vertex ranging from -1 to 1). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ normal?: Float32Array; + /** + * **Since: 4.9** A flat array of the vertex colors (4 elements per vertex ranging from 0 to 255). Vertex colors are multiplied by the component material color (if any is defined). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) + */ + color?: Uint8Array; } interface Multipoint extends Geometry { @@ -4901,6 +4875,20 @@ declare namespace __esri { export const GeographicTransformationStep: GeographicTransformationStepConstructor; interface ImageMeshColor extends Accessor { + /** + * A direct reference to the image data. The image data can be an [image element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement), [canvas element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement) or [ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData). The data property is mutually exclusive with the url property, setting the data will clear the url (if there is one). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#data) + */ + data: HTMLImageElement | HTMLCanvasElement | ImageData; + /** + * Indicates whether the image data should be interpreted as being semi-transparent. The default value is automatically derived when the data property contains a canvas element or an ImageData object. In all other cases it defaults to `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#transparent) + * + * @default undefined + */ + transparent: boolean; /** * For ImageMeshColor the type is always `image`. * @@ -4908,7 +4896,7 @@ declare namespace __esri { */ readonly type: "image"; /** - * The url to the image resource. This can either be a remote url (absolute or relative) or a data url. + * The url to the image resource. This can either be a remote url (absolute or relative) or a data url. The url property is mutually exclusive with the data property, setting the url will clear the data (if there is one). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#url) */ @@ -4926,7 +4914,7 @@ declare namespace __esri { interface ImageMeshColorConstructor { /** - * ImageMeshColor is a type of mesh color that represents an image mapped to the mesh by its uv vertex attributes. ImageMeshColor instances can be used with the [MeshComponent.material.color](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) property. + * ImageMeshColor is a type of mesh color that represents an image mapped to the mesh by its uv vertex attributes. ImageMeshColor instances can be used with the [MeshComponent.material.color](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) property. Images can be referred to either by url or directly by data ( [image element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement), [canvas element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement) or [ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData)). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html) */ @@ -4938,7 +4926,21 @@ declare namespace __esri { interface ImageMeshColorProperties { /** - * The url to the image resource. This can either be a remote url (absolute or relative) or a data url. + * A direct reference to the image data. The image data can be an [image element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement), [canvas element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement) or [ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData). The data property is mutually exclusive with the url property, setting the data will clear the url (if there is one). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#data) + */ + data?: HTMLImageElement | HTMLCanvasElement | ImageData; + /** + * Indicates whether the image data should be interpreted as being semi-transparent. The default value is automatically derived when the data property contains a canvas element or an ImageData object. In all other cases it defaults to `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#transparent) + * + * @default undefined + */ + transparent?: boolean; + /** + * The url to the image resource. This can either be a remote url (absolute or relative) or a data url. The url property is mutually exclusive with the data property, setting the url will clear the data (if there is one). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#url) */ @@ -5081,7 +5083,7 @@ declare namespace __esri { */ createFromElevation(source: ElevationLayer | Ground | ElevationSampler, extent: Extent, params?: meshUtilsCreateFromElevationParams): IPromise; /** - * Georeferences vertices specified in a Cartesian coordinate system. This is useful when converting general 3D model meshes not typically georeferenced. This method operates on mesh vertex attributes and will convert positions and normals (if specified) from a local (0, 0, 0) Cartesian system to the properly georeferenced coordinates at the specified location. + * Georeferences vertices specified in a Cartesian coordinate system. This is useful when converting general 3D model meshes not typically georeferenced. This method operates on mesh vertex attributes and will convert positions and normals (if specified) from a local (0, 0, 0) Cartesian system to the properly georeferenced coordinates at the specified `location`. The `location`'s coordinate system determines the units of the converted positions. If the coordinate system is WGS84, metric units are used. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#georeference) * @@ -5172,9 +5174,10 @@ declare namespace __esri { * * @param geometries An array of geometries to normalize. * @param geometryService A geometry service used to perform the normalization. If this value is `null` then the default geometry service in [esriConfig.geometryServiceUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#geometryServiceUrl) is used. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request. * */ - normalizeCentralMeridian(geometries: Geometry[], geometryService?: GeometryService): IPromise; + normalizeCentralMeridian(geometries: Geometry[], geometryService?: GeometryService, requestOptions?: any): IPromise; } export const normalizeUtils: normalizeUtils; @@ -5315,7 +5318,7 @@ declare namespace __esri { */ popupTemplate: PopupTemplate; /** - * The [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the graphic. Choosing a symbol for a graphic depends on the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) type (SceneView or MapView), and the [geometry type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type) of the graphic. If the symbol is not specified for a graphic in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), it displays using the symbol defined in the layer's [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html). Each graphic may have its own symbol specified when the parent layer is a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). + * The [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the graphic. Choosing a symbol for a graphic depends on the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) type (SceneView or MapView), and the [geometry type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type) of the graphic. Each graphic may have its own symbol specified when the parent layer is a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). For a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) the symbol of each graphic should not be set by the developer since the graphics' rendering properties are determined by the layer's [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) */ @@ -5407,7 +5410,7 @@ declare namespace __esri { */ popupTemplate?: PopupTemplateProperties; /** - * The [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the graphic. Choosing a symbol for a graphic depends on the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) type (SceneView or MapView), and the [geometry type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type) of the graphic. If the symbol is not specified for a graphic in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), it displays using the symbol defined in the layer's [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html). Each graphic may have its own symbol specified when the parent layer is a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). + * The [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the graphic. Choosing a symbol for a graphic depends on the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) type (SceneView or MapView), and the [geometry type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type) of the graphic. Each graphic may have its own symbol specified when the parent layer is a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). For a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) the symbol of each graphic should not be set by the developer since the graphics' rendering properties are determined by the layer's [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) */ @@ -5424,7 +5427,7 @@ declare namespace __esri { interface Ground extends Accessor, Loadable, JSONSupport { /** - * A collection of [ElevationLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) that define the elevation or terrain that makes up the ground surface. When elevation layers are added to the ground, the topographical variations of the surface are rendered in 3D as they would appear in the real world. ![elev-default](https://developers.arcgis.com/javascript/latest/assets/img/apiref/ground/elev-default.png) When the layers collection is empty, the ground surface is flat. ![no-elev](https://developers.arcgis.com/javascript/latest/assets/img/apiref/ground/no-elev.png) + * A collection of [ElevationLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) that define the elevation or terrain that makes up the ground surface. When elevation layers are added to the ground, the topographical variations of the surface are rendered in 3D as they would appear in the real world. ![elev-default](https://developers.arcgis.com/javascript/assets/img/apiref/ground/elev-default.png) When the layers collection is empty, the ground surface is flat. ![no-elev](https://developers.arcgis.com/javascript/assets/img/apiref/ground/no-elev.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) */ @@ -5479,6 +5482,14 @@ declare namespace __esri { * */ createElevationSampler(extent: Extent, options?: GroundCreateElevationSamplerOptions): IPromise; + /** + * Loads all the externally loadable resources associated with the ground. For the ground this will load all the layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#loadAll) + * + * + */ + loadAll(): IPromise; /** * Queries the ground layer services for elevation values for the given geometry. The returned result contains a copy of the geometry with z-values sampled from elevation data from the first layer that has data available. * @@ -5509,7 +5520,7 @@ declare namespace __esri { interface GroundProperties extends LoadableProperties { /** - * A collection of [ElevationLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) that define the elevation or terrain that makes up the ground surface. When elevation layers are added to the ground, the topographical variations of the surface are rendered in 3D as they would appear in the real world. ![elev-default](https://developers.arcgis.com/javascript/latest/assets/img/apiref/ground/elev-default.png) When the layers collection is empty, the ground surface is flat. ![no-elev](https://developers.arcgis.com/javascript/latest/assets/img/apiref/ground/no-elev.png) + * A collection of [ElevationLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) that define the elevation or terrain that makes up the ground surface. When elevation layers are added to the ground, the topographical variations of the surface are rendered in 3D as they would appear in the real world. ![elev-default](https://developers.arcgis.com/javascript/assets/img/apiref/ground/elev-default.png) When the layers collection is empty, the ground surface is flat. ![no-elev](https://developers.arcgis.com/javascript/assets/img/apiref/ground/no-elev.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) */ @@ -6474,11 +6485,9 @@ declare namespace __esri { * @param extent The extent of the view. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param width The width of the view in pixels. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param height The height of the view in pixels. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). - * @param options Optional settings for the image request. The options have the following properties. - * @param options.allowImageDataAccess Indicates if access to pixels of the image is allowed. This value must be set to `true` if the layer will be drawn in 3D and [WebGL textures](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL) are required to display the layer. Loading of WebGL textures is dependent on [cross-domain access](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL#Cross-domain_textures) controls. This option allows cross-domain access to create WebGL textures. * */ - fetchImage(extent: Extent, width: number, height: number, options?: BaseDynamicLayerFetchImageOptions): IPromise; + fetchImage(extent: Extent, width: number, height: number): IPromise; /** * This method returns a URL to an image for a given extent, width, and height. Override this method to construct the URL for the image based on user interaction. * @@ -6513,16 +6522,6 @@ declare namespace __esri { } - - export interface BaseDynamicLayerFetchImageOptions extends Object { - /** - * Indicates if access to pixels of the image is allowed. This value must be set to `true` if the layer will be drawn in 3D and [WebGL textures](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL) are required to display the layer. Loading of WebGL textures is dependent on [cross-domain access](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL#Cross-domain_textures) controls. This option allows cross-domain access to create WebGL textures. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#fetchImage) - */ - allowImageDataAccess?: boolean; - } - export interface BaseDynamicLayerLayerviewCreateEvent { layerView: LayerView; @@ -6721,10 +6720,9 @@ declare namespace __esri { * @param row The row (y) position of the tile fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param col The column (x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param options Optional settings for the tile request. The options have the following properties. - * @param options.allowImageDataAccess Indicates if access to pixels of the image is allowed. This value must be set to `true` if the layer will be drawn in 3D and [WebGL textures](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL) are required to display the layer. Loading of WebGL textures is dependent on [cross-domain access](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL#Cross-domain_textures) controls. This option allows cross-domain access to create WebGL textures. * */ - fetchTile(level: number, row: number, col: number, options?: BaseTileLayerFetchTileOptions): IPromise; + fetchTile(level: number, row: number, col: number, options?: any): IPromise; /** * Returns the bounds of the tile as an array of four numbers that be readily converted to an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object. The value for each item in the array is described in the following table: * @@ -6755,7 +6753,7 @@ declare namespace __esri { * @param col Tile column. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * */ - getTileUrl(level: number, row: number, col: number): string | IPromise; + getTileUrl(level: number, row: number, col: number): string; on(name: "layerview-create", eventHandler: BaseTileLayerLayerviewCreateEventHandler): IHandle; @@ -6792,16 +6790,6 @@ declare namespace __esri { tileInfo?: TileInfoProperties; } - - export interface BaseTileLayerFetchTileOptions extends Object { - /** - * Indicates if access to pixels of the image is allowed. This value must be set to `true` if the layer will be drawn in 3D and [WebGL textures](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL) are required to display the layer. Loading of WebGL textures is dependent on [cross-domain access](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL#Cross-domain_textures) controls. This option allows cross-domain access to create WebGL textures. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#fetchTile) - */ - allowImageDataAccess?: boolean; - } - export interface BaseTileLayerLayerviewCreateEvent { layerView: LayerView; @@ -6964,7 +6952,7 @@ declare namespace __esri { */ elevationInfo: CSVLayerElevationInfo; /** - * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif) + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#featureReduction) */ @@ -6977,9 +6965,7 @@ declare namespace __esri { fields: Field[]; /** * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). - * > **Known Limitations** - * * WebGL must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. - * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) */ @@ -6987,7 +6973,6 @@ declare namespace __esri { /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) property. * > **Known Limitations** - * * WebGL must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. * @@ -7017,7 +7002,7 @@ declare namespace __esri { */ longitudeField: string; /** - * The maximum scale at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. + * The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#minScale) value, and greater than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#maxScale) * @@ -7025,7 +7010,7 @@ declare namespace __esri { */ maxScale: number; /** - * The minimum scale at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. + * The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#maxScale) value, and lesser than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#minScale) * @@ -7059,7 +7044,7 @@ declare namespace __esri { */ renderer: Renderer; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#screenSizePerspectiveEnabled) @@ -7209,7 +7194,7 @@ declare namespace __esri { */ elevationInfo?: CSVLayerElevationInfo; /** - * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif) + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#featureReduction) */ @@ -7222,9 +7207,7 @@ declare namespace __esri { fields?: FieldProperties[]; /** * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). - * > **Known Limitations** - * * WebGL must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. - * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) */ @@ -7232,7 +7215,6 @@ declare namespace __esri { /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) property. * > **Known Limitations** - * * WebGL must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. * @@ -7262,7 +7244,7 @@ declare namespace __esri { */ longitudeField?: string; /** - * The maximum scale at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. + * The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#minScale) value, and greater than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#maxScale) * @@ -7270,7 +7252,7 @@ declare namespace __esri { */ maxScale?: number; /** - * The minimum scale at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. + * The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#maxScale) value, and lesser than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#minScale) * @@ -7304,7 +7286,7 @@ declare namespace __esri { */ renderer?: RendererProperties; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#screenSizePerspectiveEnabled) @@ -7422,7 +7404,6 @@ declare namespace __esri { * @param width The width of the view in pixels. * @param height The height of the view in pixels. * @param options The parameter options is an object with the following properties. - * @param options.allowImageDataAccess Indicates if the access to the pixels of the image is required. * @param options.rotation The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. * @param options.pixelRatio The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. * @@ -7469,12 +7450,6 @@ declare namespace __esri { export interface DynamicLayerFetchImageOptions extends Object { - /** - * Indicates if the access to the pixels of the image is required. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#fetchImage) - */ - allowImageDataAccess?: boolean; /** * The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. * @@ -7585,7 +7560,7 @@ declare namespace __esri { interface ElevationLayerConstructor { /** - * ElevationLayer is a tile layer used for rendering elevations in [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A default [world elevation layer](http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer) can be added to the map by setting the [map's ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) property to `world-elevation`. + * ElevationLayer is a tile layer used for rendering elevations in [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A default [world elevation layer](https://www.arcgis.com/home/item.html?id=7029fb60158543ad845c7e1527af11e4) can be added to the map by setting the [map's ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) property to `world-elevation`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) */ @@ -7725,8 +7700,7 @@ declare namespace __esri { */ copyright: string; /** - * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when the dataset is large and you don't want to bring all features to the client for analysis. Definition expressions may be set when a layer is constructed prior to it loading in the view or after it has been added to the map. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. - * > **Known Limitations** Definition expressions will not be honored when working with FeatureLayers created from client-side graphics. + * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when the dataset is large and you don't want to bring all features to the client for analysis. Definition expressions may be set when a layer is constructed prior to it loading in the view or after it has been added to the map. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression) */ @@ -7744,19 +7718,19 @@ declare namespace __esri { */ dynamicDataSource: DynamicMapLayer | DynamicDataLayer; /** - * Specifies how graphics are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. + * Specifies how features are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ elevationInfo: FeatureLayerElevationInfo; /** - * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif) + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#featureReduction) */ featureReduction: FeatureLayerFeatureReduction; /** - * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side graphics you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. + * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side features you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) */ @@ -7768,13 +7742,13 @@ declare namespace __esri { */ readonly gdbVersion: string; /** - * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. **Possible Values:** point | mulitpoint | polyline | polygon | extent | mesh + * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). When creating a FeatureLayer from client-side features, this property is inferred by the geometryType of the features provided in the layer's [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) property. **Possible Values:** point | multipoint | polyline | polygon | extent | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) */ geometryType: string; /** - * Value is `true` if attachments are enabled on the feature layer. + * Indicates if attachments are enabled on the feature layer. Use `FeatureLayer.capabilities.data.supportsAttachment` instead. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasAttachments) * @@ -7782,19 +7756,19 @@ declare namespace __esri { */ readonly hasAttachments: boolean; /** - * Indicates if the features in the layer have M values. + * Indicates whether the client-side features in the layer have `M` (measurement) values. Use the `supportsM` property in the FeatureLayer's [capabilities.data](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) object to verify if `M` values are supported on [feature service](https://developers.arcgis.com/rest/services-reference/feature-service.htm) features. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasM) * - * @default false + * @default undefined */ readonly hasM: boolean; /** - * Indicates if the features in the layer have Z values. See [elevationInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) for details regarding placement and rendering of graphics with z-values in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * Indicates whether the client-side features in the layer have `Z` (elevation) values. Refer to [elevationInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) for details regarding placement and rendering of features with z-values in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Use the `supportsZ` property in the FeatureLayer's [capabilities.data](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) object to verify if `Z` values are supported on [feature service](https://developers.arcgis.com/rest/services-reference/feature-service.htm) features. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasZ) * - * @default false + * @default undefined */ readonly hasZ: boolean; /** @@ -7806,7 +7780,6 @@ declare namespace __esri { /** * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. The [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true` for labels to display in the view. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). * > **Known Limitations** - * * [WebGL](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-rendering) must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. Be sure to review the [WebGL limitations](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-limitations). * * Currently only FeatureLayers with point and polygon geometries are supported. * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * @@ -7816,9 +7789,8 @@ declare namespace __esri { /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) property. * > **Known Limitations** - * * [WebGL](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-rendering) must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. Be sure to review the [WebGL limitations](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-limitations). * * Currently only FeatureLayers with point and polygon geometries are supported. - * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Currently 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) only support one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) per feature. * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) @@ -7846,7 +7818,7 @@ declare namespace __esri { */ legendEnabled: boolean; /** - * The name of one of the provided [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) for each graphic containing a unique value or identifier for that graphic. This is required when constructing a FeatureLayer from a collection of client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). When creating a FeatureLayer from client-side graphics, the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. + * The name of an `oid` [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) containing a unique value or identifier for each feature in the layer. This is required when constructing a FeatureLayer from a collection of client-side [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) */ @@ -7872,7 +7844,13 @@ declare namespace __esri { */ popupTemplate: PopupTemplate; /** - * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties. + * Array of [relationships](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html) set up for the layer. Each object in the array describes the layer's [relationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html) with another layer or table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#relationships) + */ + readonly relationships: Relationship; + /** + * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. However, when creating a FeatureLayer from client-side features, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) properties. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) */ @@ -7894,7 +7872,7 @@ declare namespace __esri { */ returnZ: boolean; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#screenSizePerspectiveEnabled) @@ -7903,13 +7881,13 @@ declare namespace __esri { */ screenSizePerspectiveEnabled: boolean; /** - * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. This property should only used when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. + * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. The geometry of each feature all must have a matching [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType). This property should only be used when creating a FeatureLayer from client-side features. When creating a FeatureLayer from client-side features, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. Use [applyEdits()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) method to add, remove, and update features from a layer at runtime. Once `applyEdits()` resolves successfully, use [queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) to return updated features. The [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties are determined based on the features provided to this property. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) */ source: Collection; /** - * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. This property should be set explicitly when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. + * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. When creating a FeatureLayer from client-side features, this property is inferred from the geometries of the features provided in the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) property. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) */ @@ -7952,7 +7930,18 @@ declare namespace __esri { readonly version: number; /** - * Applies edits to features in a feature layer. New features can be created and existing features can be updated or deleted. Feature geometries and/or attributes may be modified. Only applicable to layers in a [feature service](https://developers.arcgis.com/rest/services-reference/feature-service.htm). + * Adds an attachment to a feature. This operation is available only if the layer's [capabilities.data.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#addAttachment) + * + * @param feature Feature to which the attachment is to be added. + * @param attachment HTML form that contains a file upload field pointing to the file to be added as an attachment. + * + */ + addAttachment(feature: Graphic, attachment: HTMLFormElement | FormData): IPromise; + /** + * Applies edits to features in a layer. New features can be created and existing features can be updated or deleted. Feature geometries and/or attributes may be modified. Only applicable to layers in a [feature service](https://developers.arcgis.com/rest/services-reference/feature-service.htm) and client-side features set through the layer's [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source). + * > **Known Limitations** FeatureLayer.applyEdits() is not supported for client-side features in [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) * @@ -7971,6 +7960,16 @@ declare namespace __esri { * */ createQuery(): Query; + /** + * Deletes attachments from a feature. This operation is available only if the layer's [capabilities.data.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#deleteAttachments) + * + * @param feature Feature containing attachments to be deleted. + * @param attachmentIds Ids of the attachments to be deleted. + * + */ + deleteAttachments(feature: Graphic, attachmentIds: number[]): IPromise; /** * Returns a [FeatureType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html) describing the feature's type. This is applicable if the layer containing the feature has a [typeIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#typeIdField). * @@ -7991,32 +7990,33 @@ declare namespace __esri { * */ getFieldDomain(fieldName: string, options?: FeatureLayerGetFieldDomainOptions): Domain; + /** + * Query information about attachments associated with features. It will return an error if the layer's [capabilities.data.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property is `false`. Attachments for multiple features can be queried if the layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is `true`. + * > **Known Limitations** When the layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property is `false`, [AttachmentQuery.objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds) property only accepts a single `objectId`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryAttachments) + * + * @param attachmentQuery Specifies the attachment parameters for query. + * + */ + queryAttachments(attachmentQuery: AttachmentQuery | AttachmentQueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. If no parameters are specified, then the extent and count of all features satisfying the layer's configuration/filters are returned. This is valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) on [arcgis.com](http://arcgis.com) and for ArcGIS Server 10.3.1 and later. * > To query for the extent of features/graphics available to or visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) on the client rather than making a server-side query, you must use the [FeatureLayerView.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryExtent) method. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryExtent) * - * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then the extent and count of all features satisfying the layer's configuration/filters are returned. If working with a FeatureLayer created from a FeatureCollection (via [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source)), only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. + * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then the extent and count of all features satisfying the layer's configuration/filters are returned. * */ queryExtent(params?: Query | QueryProperties): IPromise; /** - * Query information about attachments associated with a specified feature. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatureAttachments) - * - * @param feature The feature to query. - * - */ - queryFeatureAttachments(feature: Graphic): IPromise; - /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns the number of features that satisfy the query. If no parameters are specified, then the total number of features satisfying the layer's configuration/filters is returned. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns the number of features that satisfy the query. If no parameters are specified, the total number of features satisfying the layer's configuration/filters is returned. * > To query for the count of features/graphics available to or visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) on the client rather than making a server-side query, you must use the [FeatureLayerView.queryFeatureCount()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatureCount) method. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatureCount) * - * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then the total number of features satisfying the layer's configuration/filters is returned. If working with a FeatureLayer created from a FeatureCollection (via [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source)), only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. + * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, the total number of features satisfying the layer's configuration/filters is returned. * */ queryFeatureCount(params?: Query | QueryProperties): IPromise; @@ -8026,7 +8026,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) * - * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then all features satisfying the layer's configuration/filters are returned. If working with a FeatureLayer created from a FeatureCollection (via [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source)), only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. + * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then all features satisfying the layer's configuration/filters are returned. * */ queryFeatures(params?: Query | QueryProperties): IPromise; @@ -8036,10 +8036,30 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryObjectIds) * - * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. If working with a FeatureLayer created from a FeatureCollection (via [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source)), only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. + * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. * */ queryObjectIds(params?: Query | QueryProperties): IPromise; + /** + * Executes a [RelationshipQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html) against the feature service and returns [FeatureSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) grouped by source layer or table objectIds. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryRelatedFeatures) + * + * @param relationshipQuery Specifies relationship parameters for querying related features or records from a layer or a table. + * + */ + queryRelatedFeatures(relationshipQuery: RelationshipQuery | RelationshipQueryProperties): IPromise; + /** + * Updates an existing attachment for a feature. This operation is available only if the layer's [capabilities.data.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#updateAttachment) + * + * @param feature The feature containing the attachment to be updated. + * @param attachmentId Id of the attachment to be updated. + * @param attachment HTML form that contains a file upload field pointing to the file to be added as an attachment. + * + */ + updateAttachment(feature: Graphic, attachmentId: number, attachment: HTMLFormElement | FormData): IPromise; on(name: "layerview-create", eventHandler: FeatureLayerLayerviewCreateEventHandler): IHandle; @@ -8049,7 +8069,7 @@ declare namespace __esri { interface FeatureLayerConstructor { /** - * A FeatureLayer is a single layer that can be created from a [Map Service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm) or [Feature Service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-feature-service-.htm); ArcGIS Online or ArcGIS Enterprise portal items; or from an array of client-side graphics. It is composed of discrete features, each of which has a [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered in either a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) as a [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) with spatial context. Features also contain data [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) that provide additional information about the real-world feature it represents; attributes may be viewed in [popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) windows and used for [rendering](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) the layer. FeatureLayers may be [queried](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures), [analyzed](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html), and [rendered](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) to visualize data in a spatial context. + * A FeatureLayer is a single layer that can be created from a [Map Service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm) or [Feature Service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-feature-service-.htm); ArcGIS Online or ArcGIS Enterprise portal items; or from an array of client-side features. It is composed of discrete features, each of which has a [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered in either a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) as a [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) with spatial context. Features also contain data [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) that provide additional information about the real-world feature it represents; attributes may be viewed in [popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) windows and used for [rendering](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) the layer. FeatureLayers may be [queried](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures), [analyzed](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html), and [rendered](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) to visualize data in a spatial context. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) */ @@ -8069,8 +8089,7 @@ declare namespace __esri { */ copyright?: string; /** - * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when the dataset is large and you don't want to bring all features to the client for analysis. Definition expressions may be set when a layer is constructed prior to it loading in the view or after it has been added to the map. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. - * > **Known Limitations** Definition expressions will not be honored when working with FeatureLayers created from client-side graphics. + * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when the dataset is large and you don't want to bring all features to the client for analysis. Definition expressions may be set when a layer is constructed prior to it loading in the view or after it has been added to the map. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression) */ @@ -8088,25 +8107,25 @@ declare namespace __esri { */ dynamicDataSource?: DynamicMapLayer | DynamicDataLayer; /** - * Specifies how graphics are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. + * Specifies how features are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ elevationInfo?: FeatureLayerElevationInfo; /** - * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif) + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#featureReduction) */ featureReduction?: FeatureLayerFeatureReduction; /** - * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side graphics you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. + * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side features you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) */ fields?: FieldProperties[]; /** - * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. **Possible Values:** point | mulitpoint | polyline | polygon | extent | mesh + * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). When creating a FeatureLayer from client-side features, this property is inferred by the geometryType of the features provided in the layer's [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) property. **Possible Values:** point | multipoint | polyline | polygon | extent | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) */ @@ -8120,7 +8139,6 @@ declare namespace __esri { /** * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. The [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true` for labels to display in the view. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). * > **Known Limitations** - * * [WebGL](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-rendering) must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. Be sure to review the [WebGL limitations](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-limitations). * * Currently only FeatureLayers with point and polygon geometries are supported. * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * @@ -8130,9 +8148,8 @@ declare namespace __esri { /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) property. * > **Known Limitations** - * * [WebGL](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-rendering) must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. Be sure to review the [WebGL limitations](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-limitations). * * Currently only FeatureLayers with point and polygon geometries are supported. - * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Currently 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) only support one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) per feature. * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) @@ -8160,7 +8177,7 @@ declare namespace __esri { */ legendEnabled?: boolean; /** - * The name of one of the provided [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) for each graphic containing a unique value or identifier for that graphic. This is required when constructing a FeatureLayer from a collection of client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). When creating a FeatureLayer from client-side graphics, the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. + * The name of an `oid` [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) containing a unique value or identifier for each feature in the layer. This is required when constructing a FeatureLayer from a collection of client-side [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) */ @@ -8186,7 +8203,7 @@ declare namespace __esri { */ popupTemplate?: PopupTemplateProperties; /** - * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties. + * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. However, when creating a FeatureLayer from client-side features, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) properties. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) */ @@ -8208,7 +8225,7 @@ declare namespace __esri { */ returnZ?: boolean; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#screenSizePerspectiveEnabled) @@ -8217,13 +8234,13 @@ declare namespace __esri { */ screenSizePerspectiveEnabled?: boolean; /** - * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. This property should only used when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. + * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. The geometry of each feature all must have a matching [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType). This property should only be used when creating a FeatureLayer from client-side features. When creating a FeatureLayer from client-side features, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. Use [applyEdits()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) method to add, remove, and update features from a layer at runtime. Once `applyEdits()` resolves successfully, use [queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) to return updated features. The [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties are determined based on the features provided to this property. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) */ source?: CollectionProperties; /** - * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. This property should be set explicitly when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. + * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. When creating a FeatureLayer from client-side features, this property is inferred from the geometries of the features provided in the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) property. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) */ @@ -8248,52 +8265,6 @@ declare namespace __esri { url?: string; } - - export interface AttachmentInfo extends Object { - /** - * The content type of the attachment. For example, `image/jpeg`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#AttachmentInfo) - */ - contentType: string; - /** - * The identifier for the attachment. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#AttachmentInfo) - */ - id: number; - /** - * Keywords for the attachment. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#AttachmentInfo) - */ - keywords: string; - /** - * The name of the attachment. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#AttachmentInfo) - */ - name: string; - /** - * The parent object id of the attachment. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#AttachmentInfo) - */ - parentObjectId: number; - /** - * The size of the attachment. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#AttachmentInfo) - */ - size: number; - /** - * The URL of the attachment. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#AttachmentInfo) - */ - url: string; - } - /** * FeatureEditResult represents the result of adding, updating or deleting a feature. * @@ -8385,7 +8356,7 @@ declare namespace __esri { */ supportsM: boolean; /** - * Indicates if the features in the layer support Z values. Requires ArcGIS Server service 10.1 or greater. See [elevationInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) for details regarding placement and rendering of graphics with z-values in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * Indicates if the features in the layer support Z values. Requires ArcGIS Server service 10.1 or greater. See [elevationInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) for details regarding placement and rendering of features with z-values in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ @@ -8504,6 +8475,12 @@ declare namespace __esri { export interface FeatureLayerCapabilitiesQuery extends Object { + /** + * Indicates if the layer supports [queryAttachments()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryAttachments) operation. If `false`, [queryAttachments()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryAttachments) can only return attachments for one feature at a time. If `true`, `queryAttachments()` can return attachments for array of [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ + supportsAttachments: boolean; /** * Indicates if the geometry centroid associated with each polygon feature can be returned. This operation is only supported in ArcGIS Online hosted feature services. * @@ -8534,6 +8511,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsGeometryProperties: boolean; + /** + * Indicates if the layer supports the [having](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#having) clause on the service. Requires an ArcGIS Server service 10.6.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ + supportsHavingClause: boolean; /** * Indicates if features returned in the query response can be ordered by one or more fields. Requires an ArcGIS Server service 10.3 or greater. * @@ -8609,27 +8592,27 @@ declare namespace __esri { export interface FeatureLayerElevationInfo extends Object { /** - * Defines how the graphic is placed with respect to the terrain surface. If the geometry consists of multiple points (e.g. lines or polygons), the elevation is evaluated separately for each point. See the table below for a list of possible values. + * Defines how the feature is placed with respect to the terrain surface. If the geometry consists of multiple points (e.g. lines or polygons), the elevation is evaluated separately for each point. See the table below for a list of possible values. * * Mode | Description * ------|------------ - * on-the-ground | Graphics are draped on the terrain surface. This is the default value for features with [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries and features with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [ObjectSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). - * relative-to-ground | Graphics are placed at an elevation relative to the terrain surface. The graphic's elevation is determined by summing up the terrain elevation and the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry’s z-value. `relative-to-ground` is the default value for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [IconSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html). - * absolute-height | Graphics are placed at an absolute height above sea level. This height is determined by the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry’s z-value. This mode doesn't take the elevation of the terrain into account. This is the default value of features with any geometry type where [hasZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasZ) is `true`. - * relative-to-scene | Graphics are aligned to buildings and other objects part of 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html), depending on which has higher elevation. If the graphic is not directly above a building or any other feature, it is aligned to the terrain surface elevation. If defined, the result of `featureExpressionInfo` is added to the 3D Object/terrain surface elevation. In this mode z-values are ignored. + * on-the-ground | Features are draped on the terrain surface. This is the default value for features with [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries and features with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [ObjectSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). + * relative-to-ground | Features are placed at an elevation relative to the terrain surface. The feature's elevation is determined by summing up the terrain elevation and the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry’s z-value. `relative-to-ground` is the default value for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [IconSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html). + * absolute-height | Features are placed at an absolute height above sea level. This height is determined by the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry’s z-value. This mode doesn't take the elevation of the terrain into account. This is the default value of features with any geometry type where [hasZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasZ) is `true`. + * relative-to-scene | Features are aligned to buildings and other objects part of 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html), depending on which has higher elevation. If the feature is not directly above a building or any other feature, it is aligned to the terrain surface elevation. If defined, the result of `featureExpressionInfo` is added to the 3D Object/terrain surface elevation. In this mode z-values are ignored. * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ mode: string; /** - * An elevation offset, which is added to the vertical position of the graphic. If `unit` is not defined, the offset is in `meters`. When `mode = "on-the-ground"`, this property has no effect. + * An elevation offset, which is added to the vertical position of the feature. If `unit` is not defined, the offset is in `meters`. When `mode = "on-the-ground"`, this property has no effect. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ offset?: number; /** - * This object contains information about setting a custom height on the graphic. If this property is set, then z values are not considered for calculating graphic height. + * This object contains information about setting a custom height on the feature. If this property is set, then z values are not considered for calculating feature height. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ @@ -8645,7 +8628,7 @@ declare namespace __esri { export interface FeatureLayerElevationInfoFeatureExpressionInfo extends Object { /** - * An [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) evaluating to a number that determines the height of the graphic. If the geometry has z-values, they will be ignored and only `featureExpressionInfo` is used to calculate the vertical position of the graphic. When `mode = "on-the-ground"`, this property has no effect. For line and polygon geometries the result of the expression is the same for all vertices of a feature. + * An [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) evaluating to a number that determines the height of the feature. If the geometry has z-values, they will be ignored and only `featureExpressionInfo` is used to calculate the vertical position of the feature. When `mode = "on-the-ground"`, this property has no effect. For line and polygon geometries the result of the expression is the same for all vertices of a feature. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ @@ -8801,7 +8784,7 @@ declare namespace __esri { */ graphics: Collection; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#screenSizePerspectiveEnabled) @@ -8893,7 +8876,7 @@ declare namespace __esri { */ graphics?: CollectionProperties; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#screenSizePerspectiveEnabled) @@ -9317,7 +9300,7 @@ declare namespace __esri { */ title: string; /** - * The layer type provides a convenient way to check the type of the layer without the need to import specific layer modules. **Possible values:** base-dynamic | base-elevation | base-tile | elevation | feature | graphics | group | imagery | integrated-mesh | map-image | open-street-map | point-cloud | scene | stream | tile | unknown | unsupported | vector-tile | web-tile + * The layer type provides a convenient way to check the type of the layer without the need to import specific layer modules. **Possible values:** base-dynamic | base-elevation | base-tile | bing-maps | elevation | feature | graphics | group | imagery | integrated-mesh | map-image | open-street-map | point-cloud | scene | stream | tile | unknown | unsupported | vector-tile | web-tile * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#type) */ @@ -9454,7 +9437,20 @@ declare namespace __esri { portalItem: PortalItem; } - interface MapImageLayer extends Layer, ArcGISMapService, ArcGISDynamicMapService, DynamicLayer, ScaleRangeLayer, RefreshableLayer { + interface MapImageLayer extends Layer, SublayersOwner, ArcGISMapService, ArcGISDynamicMapService, DynamicLayer, ScaleRangeLayer, RefreshableLayer { + /** + * A flat [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of all the [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers) in the MapImageLayer including the sublayers of its sublayers. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#allSublayers) + */ + readonly allSublayers: Collection; + /** + * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects that allow you to alter the properties of one or more sublayers of the MapImageLayer. If this property is not specified, all the sublayers from the service are displayed as defined in the service. If an empty array is passed to this property then none of the sublayers from the service are displayed in the layer. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). They may be [added](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add), [removed](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#remove), or [reordered](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#reorder) using the [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) methods. Because [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) extends [Accessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html), its properties may be [watched](https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html#watchProperties). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers) + */ + sublayers: Collection; + on(name: "layerview-create", eventHandler: MapImageLayerLayerviewCreateEventHandler): IHandle; @@ -9476,7 +9472,12 @@ declare namespace __esri { export const MapImageLayer: MapImageLayerConstructor; interface MapImageLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISDynamicMapServiceProperties, DynamicLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { - + /** + * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects that allow you to alter the properties of one or more sublayers of the MapImageLayer. If this property is not specified, all the sublayers from the service are displayed as defined in the service. If an empty array is passed to this property then none of the sublayers from the service are displayed in the layer. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). They may be [added](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add), [removed](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#remove), or [reordered](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#reorder) using the [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) methods. Because [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) extends [Accessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html), its properties may be [watched](https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html#watchProperties). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers) + */ + sublayers?: CollectionProperties; } export interface MapImageLayerLayerviewCreateEvent { @@ -9579,12 +9580,6 @@ declare namespace __esri { } interface ArcGISDynamicMapService { - /** - * A flat [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of all the [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#sublayers) in the MapImageLayer including the sublayers of its sublayers. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#allSublayers) - */ - readonly allSublayers: Collection; /** * The output dots per inch (DPI) of the MapImageLayer. * @@ -9631,12 +9626,6 @@ declare namespace __esri { * @default true */ imageTransparency: boolean; - /** - * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects that allow you to alter the properties of one or more sublayers of the MapImageLayer. If this property is not specified, all the sublayers from the service are displayed as defined in the service. If an empty array is passed to this property then none of the sublayers from the service are displayed in the layer. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). They may be [added](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add), [removed](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#remove), or [reordered](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#reorder) using the [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) methods. Because [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) extends [Accessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html), its properties may be [watched](https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html#watchProperties). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#sublayers) - */ - sublayers: Collection; /** * Gets the parameters of the exported image to use when calling the [export REST operation](https://developers.arcgis.com/rest/services-reference/export-map.htm). @@ -9651,23 +9640,6 @@ declare namespace __esri { * */ createExportImageParameters(extent: Extent, width: number, height: number, options?: ArcGISDynamicMapServiceCreateExportImageParametersOptions): any; - /** - * Returns a deep clone of a map service's [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) as defined by the service. This is useful for scenarios when the developer is unfamiliar with the service sublayers and needs to "reset" the layer's sublayers to match those defined by the service. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#createServiceSublayers) - * - * - */ - createServiceSublayers(): Collection; - /** - * Returns the sublayer with the given layerId. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#findSublayerById) - * - * @param id The [id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#id) of the sublayer. - * - */ - findSublayerById(id: number): Sublayer; } interface ArcGISDynamicMapServiceConstructor { @@ -9725,12 +9697,6 @@ declare namespace __esri { * @default true */ imageTransparency?: boolean; - /** - * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects that allow you to alter the properties of one or more sublayers of the MapImageLayer. If this property is not specified, all the sublayers from the service are displayed as defined in the service. If an empty array is passed to this property then none of the sublayers from the service are displayed in the layer. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). They may be [added](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add), [removed](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#remove), or [reordered](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#reorder) using the [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) methods. Because [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) extends [Accessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html), its properties may be [watched](https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html#watchProperties). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#sublayers) - */ - sublayers?: CollectionProperties; } @@ -10160,7 +10126,13 @@ declare namespace __esri { export interface ArcGISMapServiceCapabilitiesExportMap extends Object { /** - * Indicates if sublayers rendering can be modifyied or added using dynamic layers. + * Indicates if sublayers can be added, removed, or reordered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) + */ + supportsSublayersChanges: boolean; + /** + * Indicates if sublayers rendering can be modified or added using dynamic layers. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ @@ -10286,7 +10258,7 @@ declare namespace __esri { interface ScaleRangeLayer { /** - * The maximum scale at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. + * The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#minScale) value, and greater than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#maxScale) * @@ -10294,7 +10266,7 @@ declare namespace __esri { */ maxScale: number; /** - * The minimum scale at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. + * The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#maxScale) value, and lesser than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#minScale) * @@ -10313,7 +10285,7 @@ declare namespace __esri { interface ScaleRangeLayerProperties { /** - * The maximum scale at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. + * The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#minScale) value, and greater than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#maxScale) * @@ -10321,7 +10293,7 @@ declare namespace __esri { */ maxScale?: number; /** - * The minimum scale at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. + * The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#maxScale) value, and lesser than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#minScale) * @@ -10438,6 +10410,34 @@ declare namespace __esri { versionString: string; } + interface SublayersOwner { + /** + * Returns a deep clone of a map service's [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) as defined by the service. This is useful for scenarios when the developer is unfamiliar with the service sublayers and needs to "reset" the layer's sublayers to match those defined by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SublayersOwner.html#createServiceSublayers) + * + * + */ + createServiceSublayers(): Collection; + /** + * Returns the sublayer with the given layerId. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SublayersOwner.html#findSublayerById) + * + * @param id The [id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#id) of the sublayer. + * + */ + findSublayerById(id: number): Sublayer; + } + + interface SublayersOwnerConstructor { + + + new(): SublayersOwner; + } + + export const SublayersOwner: SublayersOwnerConstructor; + interface OpenStreetMapLayer extends WebTileLayer { on(name: "layerview-create", eventHandler: OpenStreetMapLayerLayerviewCreateEventHandler): IHandle; @@ -10607,7 +10607,7 @@ declare namespace __esri { */ elevationInfo: SceneLayerElevationInfo; /** - * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) * > **Known Limitation** When applying featureReduction on a point SceneLayer layer updates are slow. This will be addressed in upcoming releases. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#featureReduction) @@ -10675,7 +10675,7 @@ declare namespace __esri { */ renderer: Renderer; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#screenSizePerspectiveEnabled) @@ -10780,7 +10780,7 @@ declare namespace __esri { */ elevationInfo?: SceneLayerElevationInfo; /** - * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) * > **Known Limitation** When applying featureReduction on a point SceneLayer layer updates are slow. This will be addressed in upcoming releases. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#featureReduction) @@ -10848,7 +10848,7 @@ declare namespace __esri { */ renderer?: RendererProperties; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#screenSizePerspectiveEnabled) @@ -10930,7 +10930,7 @@ declare namespace __esri { */ geometryDefinition: Extent; /** - * Maximum number of features to show per trackId + * Maximum number of features to show per [trackId](https://enterprise.arcgis.com/en/geoevent/latest/get-started/essential-geoevent-server-vocabulary.htm#ESRI_SECTION1_F45BBCE9ADFA4E57AF38DD225921EFCD). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#maximumTrackPoints) */ @@ -10943,7 +10943,7 @@ declare namespace __esri { purgeOptions: StreamLayerPurgeOptions; /** - * Updates the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) on the layer. The filter is updated on all views that contain the layer. If the input `filterChanges` object is `undefined` or `null`, the spatial and attribute filters are removed. To update the filter on a single layer view associated with the layer, use the [StreamLayerView.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) method after getting the layer view object. Filter changes only apply to incoming features. Features already displayed in the view are not filtered. Therefore, you may want to clear the graphics in the layer view prior to applying a new filter. To do so, get the layer view then call [removeAll()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#removeAll) on the [StreamLayerView.graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#graphics). You may also filter features already present in the view using the [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) methods. See the examples below. + * Updates the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) on the layer. The filter is updated on all views that contain the layer. If the input `filterChanges` object is `undefined` or `null`, the spatial and attribute filters are removed. To update the filter on a single layer view associated with the layer, use the [StreamLayerView.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) method after getting the layer view object. Filter changes only apply to incoming features. Features already displayed in the view will be removed automatically. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) * @@ -10988,7 +10988,7 @@ declare namespace __esri { */ geometryDefinition?: ExtentProperties; /** - * Maximum number of features to show per trackId + * Maximum number of features to show per [trackId](https://enterprise.arcgis.com/en/geoevent/latest/get-started/essential-geoevent-server-vocabulary.htm#ESRI_SECTION1_F45BBCE9ADFA4E57AF38DD225921EFCD). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#maximumTrackPoints) */ @@ -11070,6 +11070,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#codedValues) */ codedValues: CodedValueDomainCodedValues[]; + /** + * The domain type. This value is always `coded-value`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#type) + */ + readonly type: "coded-value"; /** * Returns the name of the coded-value associated with the specified code. @@ -11418,45 +11424,67 @@ declare namespace __esri { interface Field extends Accessor, JSONSupport { /** - * The alias name for the field. + * The display name for the field. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias) + * + * @default null */ alias: string; + /** + * The default value set for the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#defaultValue) + * + * @default undefined + */ + defaultValue: number | string | any | any; /** * The domain associated with the field. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#domain) + * + * @default null */ domain: Domain; /** * Indicates whether the field is editable. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#editable) + * + * @default true */ editable: boolean; /** * The field length. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#length) + * + * @default -1 */ length: number; /** * The name of the field. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#name) + * + * @default null */ name: string; /** * Indicates if the field can accept `null` values. *Requires ArcGIS Server version 10.1 or greater.* * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#nullable) + * + * @default true */ nullable: boolean; /** * The data type of the field. **Possible Values:** small-integer | integer | single | double | long | string | date | oid | geometry | blob | raster | guid | global-id | xml * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type) + * + * @default null */ type: string; } @@ -11473,45 +11501,67 @@ declare namespace __esri { interface FieldProperties { /** - * The alias name for the field. + * The display name for the field. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias) + * + * @default null */ alias?: string; + /** + * The default value set for the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#defaultValue) + * + * @default undefined + */ + defaultValue?: number | string | any | any; /** * The domain associated with the field. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#domain) + * + * @default null */ domain?: DomainProperties; /** * Indicates whether the field is editable. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#editable) + * + * @default true */ editable?: boolean; /** * The field length. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#length) + * + * @default -1 */ length?: number; /** * The name of the field. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#name) + * + * @default null */ name?: string; /** * Indicates if the field can accept `null` values. *Requires ArcGIS Server version 10.1 or greater.* * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#nullable) + * + * @default true */ nullable?: boolean; /** * The data type of the field. **Possible Values:** small-integer | integer | single | double | long | string | date | oid | geometry | blob | raster | guid | global-id | xml * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type) + * + * @default null */ type?: string; } @@ -11672,6 +11722,12 @@ declare namespace __esri { } interface InheritedDomain extends Domain { + /** + * The domain type. This value is always `inherited`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-InheritedDomain.html#type) + */ + readonly type: "inherited"; } interface InheritedDomainConstructor { @@ -11806,7 +11862,7 @@ declare namespace __esri { * > **Known Limitations** * * Currently, if the label has a [line callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) in a 3D SceneView, then only `above-center` is supported. * * Label placement only applies to [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) layers in 3D SceneViews. - * * FeatureLayers only support labeling for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries rendered with WebGL. + * * FeatureLayers only support labeling for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelPlacement) * @@ -11814,7 +11870,7 @@ declare namespace __esri { */ labelPlacement: string; /** - * The maximum scale to show labels. The value of maxScale should always be less than the value of [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale). If the value is `0`, then the label's visibility isn't dependent on maximum scale. + * The maximum scale (most zoomed in) at which labels are visible in the view. A value of `0` means the label's visibility does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale) value, and greater than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale) * @@ -11822,7 +11878,7 @@ declare namespace __esri { */ maxScale: number; /** - * The minimum scale to show labels. The value of minScale should always be greater than the value of [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale). If the value of this property is `0`, then the visibility of labels isn't dependent on minimum scale. + * The minimum scale (most zoomed out) at which labels are visible in the view. A value of `0` means the label's visibility does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale) value, and lesser than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale) * @@ -11891,7 +11947,7 @@ declare namespace __esri { * > **Known Limitations** * * Currently, if the label has a [line callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) in a 3D SceneView, then only `above-center` is supported. * * Label placement only applies to [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) layers in 3D SceneViews. - * * FeatureLayers only support labeling for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries rendered with WebGL. + * * FeatureLayers only support labeling for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelPlacement) * @@ -11899,7 +11955,7 @@ declare namespace __esri { */ labelPlacement?: string; /** - * The maximum scale to show labels. The value of maxScale should always be less than the value of [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale). If the value is `0`, then the label's visibility isn't dependent on maximum scale. + * The maximum scale (most zoomed in) at which labels are visible in the view. A value of `0` means the label's visibility does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale) value, and greater than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale) * @@ -11907,7 +11963,7 @@ declare namespace __esri { */ maxScale?: number; /** - * The minimum scale to show labels. The value of minScale should always be greater than the value of [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale). If the value of this property is `0`, then the visibility of labels isn't dependent on minimum scale. + * The minimum scale (most zoomed out) at which labels are visible in the view. A value of `0` means the label's visibility does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale) value, and lesser than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale) * @@ -12388,6 +12444,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#minValue) */ minValue: number; + /** + * The domain type. This value is always `range`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#type) + */ + readonly type: "range"; } interface RangeDomainConstructor { @@ -12489,49 +12551,33 @@ declare namespace __esri { interface Relationship extends Accessor { /** - * The cardinality which specifies the number of objects in the origin [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) related to the number of objects in the destination [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). A relationship can have one of three cardinalities: - * * "one-to-one" - * * "one-to-many" - * * "many-to-many" - * - * - * Please see the [Desktop help](http://desktop.arcgis.com/en/arcmap/10.3/manage-data/relationships/relationship-class-properties.htm#GUID-989CB1D1-AC51-4A4C-8D9D-0AB9E647FFFD) for additional information on cardinality. + * The cardinality which specifies the number of objects in the origin [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) related to the number of objects in the destination [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Please see the [Desktop help](http://desktop.arcgis.com/en/arcmap/10.3/manage-data/relationships/relationship-class-properties.htm#GUID-989CB1D1-AC51-4A4C-8D9D-0AB9E647FFFD) for additional information on cardinality. **Possible values:** one-to-one | one-to-many | many-to-many * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#cardinality) - * - * @default null */ cardinality: string; /** * The unique ID for the relationship. These ids for the relationships the [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) participates in are listed in the ArcGIS Services directory. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#id) - * - * @default null */ id: number; /** * The field used to establish the relate within the [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#keyField) - * - * @default null */ keyField: string; /** * The name of the relationship. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#name) - * - * @default null */ name: string; /** * The unique ID of the related [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#relatedTableId) - * - * @default null */ relatedTableId: number; } @@ -12546,49 +12592,33 @@ declare namespace __esri { interface RelationshipProperties { /** - * The cardinality which specifies the number of objects in the origin [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) related to the number of objects in the destination [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). A relationship can have one of three cardinalities: - * * "one-to-one" - * * "one-to-many" - * * "many-to-many" - * - * - * Please see the [Desktop help](http://desktop.arcgis.com/en/arcmap/10.3/manage-data/relationships/relationship-class-properties.htm#GUID-989CB1D1-AC51-4A4C-8D9D-0AB9E647FFFD) for additional information on cardinality. + * The cardinality which specifies the number of objects in the origin [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) related to the number of objects in the destination [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Please see the [Desktop help](http://desktop.arcgis.com/en/arcmap/10.3/manage-data/relationships/relationship-class-properties.htm#GUID-989CB1D1-AC51-4A4C-8D9D-0AB9E647FFFD) for additional information on cardinality. **Possible values:** one-to-one | one-to-many | many-to-many * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#cardinality) - * - * @default null */ cardinality?: string; /** * The unique ID for the relationship. These ids for the relationships the [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) participates in are listed in the ArcGIS Services directory. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#id) - * - * @default null */ id?: number; /** * The field used to establish the relate within the [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#keyField) - * - * @default null */ keyField?: string; /** * The name of the relationship. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#name) - * - * @default null */ name?: string; /** * The unique ID of the related [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#relatedTableId) - * - * @default null */ relatedTableId?: number; } @@ -12621,11 +12651,11 @@ declare namespace __esri { */ labelsVisible: boolean; /** - * The [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) to which the sublayer belongs. + * The [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) or [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html) to which the sublayer belongs. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#layer) */ - layer: MapImageLayer; + layer: MapImageLayer | TileLayer; /** * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. * @@ -12635,37 +12665,13 @@ declare namespace __esri { */ legendEnabled: boolean; /** - * The maximum scale at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The user or developer can only set `minScale` and `maxScale` if the new values are within the scale range defined in the map service. - * ```js - * // the service specifies minScale = 10000 and maxScale = 500000 - * - * // this is valid - * sublayer.minScale = 30000; - * sublayer.maxScale = 100000; - * - * // this is not valid because the values are - * // outside the range specified by the service - * sublayer.minScale = 5000; - * sublayer.maxScale = 1000000; - * ``` + * The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#minScale) value, and greater than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#maxScale) */ maxScale: number; /** - * The minimum scale at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The user or developer can only set `minScale` and `maxScale` if the new values are within the scale range defined in the map service. - * ```js - * // the service specifies minScale = 10000 and maxScale = 500000 - * - * // this is valid - * sublayer.minScale = 30000; - * sublayer.maxScale = 100000; - * - * // this is not valid because the values are - * // outside the range specified by the service - * sublayer.minScale = 5000; - * sublayer.maxScale = 1000000; - * ``` + * The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#maxScale) value, and lesser than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#minScale) */ @@ -12687,7 +12693,7 @@ declare namespace __esri { /** * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when the user clicks the image. Sublayers with a [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) cannot be queried and therefore do not support [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). * > **Known Limitations** - * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. + * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers or TileLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupTemplate) */ @@ -12695,7 +12701,7 @@ declare namespace __esri { /** * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. * > **Known Limitations** - * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not currently supported in renderers set on MapImageLayer sublayers. + * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not currently supported in renderers set on sublayers. * * [Visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) and [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in renderers set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#renderer) @@ -12724,7 +12730,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#url) */ - url: string; + readonly url: string; /** * Indicates if the layer is visible in the view. * @@ -12769,7 +12775,7 @@ declare namespace __esri { interface SublayerConstructor { /** - * Represents a sublayer in a [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). MapImageLayer allows you to display, query, and analyze layers from data defined in a [map service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm). Map services contain sublayers with properties such as [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#renderer), [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelingInfo), and [definitionExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression), and others that are defined on the server. The properties of each sublayer on the map service may be dynamically changed by the user or developer. + * Represents a sublayer in a [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) or a [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html). MapImageLayer allows you to display, query, and analyze layers from data defined in a [map service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm). Map services contain sublayers with properties such as [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#renderer), [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelingInfo), and [definitionExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression), and others that are defined on the server. The properties of each MapImageLayer sublayer on the map service may be dynamically changed by the user or developer. The properties of each TileLayer sublayer are read-only, and cannot be modified. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) */ @@ -12807,11 +12813,11 @@ declare namespace __esri { */ labelsVisible?: boolean; /** - * The [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) to which the sublayer belongs. + * The [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) or [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html) to which the sublayer belongs. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#layer) */ - layer?: MapImageLayerProperties; + layer?: MapImageLayerProperties | TileLayerProperties; /** * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. * @@ -12821,37 +12827,13 @@ declare namespace __esri { */ legendEnabled?: boolean; /** - * The maximum scale at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The user or developer can only set `minScale` and `maxScale` if the new values are within the scale range defined in the map service. - * ```js - * // the service specifies minScale = 10000 and maxScale = 500000 - * - * // this is valid - * sublayer.minScale = 30000; - * sublayer.maxScale = 100000; - * - * // this is not valid because the values are - * // outside the range specified by the service - * sublayer.minScale = 5000; - * sublayer.maxScale = 1000000; - * ``` + * The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#minScale) value, and greater than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#maxScale) */ maxScale?: number; /** - * The minimum scale at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The user or developer can only set `minScale` and `maxScale` if the new values are within the scale range defined in the map service. - * ```js - * // the service specifies minScale = 10000 and maxScale = 500000 - * - * // this is valid - * sublayer.minScale = 30000; - * sublayer.maxScale = 100000; - * - * // this is not valid because the values are - * // outside the range specified by the service - * sublayer.minScale = 5000; - * sublayer.maxScale = 1000000; - * ``` + * The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#maxScale) value, and lesser than or equal to the service specification. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#minScale) */ @@ -12873,7 +12855,7 @@ declare namespace __esri { /** * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when the user clicks the image. Sublayers with a [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) cannot be queried and therefore do not support [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). * > **Known Limitations** - * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. + * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers or TileLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupTemplate) */ @@ -12881,7 +12863,7 @@ declare namespace __esri { /** * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. * > **Known Limitations** - * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not currently supported in renderers set on MapImageLayer sublayers. + * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not currently supported in renderers set on sublayers. * * [Visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) and [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in renderers set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#renderer) @@ -12905,12 +12887,6 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#title) */ title?: string; - /** - * The URL to the REST endpoint of the sublayer. This allows you to view the schema of fields and query tables located in registered workspaces. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#url) - */ - url?: string; /** * Indicates if the layer is visible in the view. * @@ -13802,13 +13778,35 @@ declare namespace __esri { title?: string; } - interface TileLayer extends Layer, ArcGISMapService, ArcGISCachedService, RefreshableLayer, ScaleRangeLayer, PortalLayer { + interface TileLayer extends Layer, SublayersOwner, ArcGISMapService, ArcGISCachedService, RefreshableLayer, ScaleRangeLayer, PortalLayer { + /** + * A flat [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of all the [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#sublayers) in the TileLayer including the sublayers of its sublayers. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#allSublayers) + */ + readonly allSublayers: Collection; /** * The URL that points to the location of the layer's attribution data. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#attributionDataUrl) */ readonly attributionDataUrl: string; + /** + * Indicates if the layer has attribution data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#hasAttributionData) + */ + readonly hasAttributionData: boolean; + /** + * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). Sublayer properties on TileLayer are read-only, with the following exceptions: + * * [legendEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#legendEnabled) + * * [popupEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupEnabled) + * * [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupTemplate) + * * [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#title) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#sublayers) + */ + readonly sublayers: Collection; /** * An array of tile servers used for changing map tiles. * @@ -13837,7 +13835,6 @@ declare namespace __esri { * @param row The row(y) position of the tile fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param col The column(x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param options Optional settings for the tile request. The options have the following properties. - * @param options.allowImageDataAccess Indicates if the access to pixels of the image is allowed. * @param options.timestamp Number to append to the tile request to prevent fetching the tile from the browser cache. * */ @@ -13905,12 +13902,6 @@ declare namespace __esri { export interface TileLayerFetchTileOptions extends Object { - /** - * Indicates if the access to pixels of the image is allowed. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#fetchTile) - */ - allowImageDataAccess?: boolean; /** * Number to append to the tile request to prevent fetching the tile from the browser cache. * @@ -14181,7 +14172,7 @@ declare namespace __esri { */ styleUrl: string; /** - * Asbolute URL for sprites included in a style. + * Absolute URL for sprites included in a style. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ @@ -14261,7 +14252,6 @@ declare namespace __esri { * @param row The row(y) position of the tile fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param column The column(x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param options Optional settings for the tile request. The options have the following properties. - * @param options.allowImageDataAccess Indicates if the access to pixels of the image is allowed. * @param options.timestamp A timestamp to append to the tile url to avoid loading a cached version of the tile. * */ @@ -14339,12 +14329,6 @@ declare namespace __esri { export interface WebTileLayerFetchTileOptions extends Object { - /** - * Indicates if the access to pixels of the image is allowed. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#fetchTile) - */ - allowImageDataAccess?: boolean; /** * A timestamp to append to the tile url to avoid loading a cached version of the tile. * @@ -14474,7 +14458,6 @@ declare namespace __esri { * @param width The width of the view in pixels. * @param height The height of the view in pixels. * @param options The parameter options is an object with the following properties. - * @param options.allowImageDataAccess Indicates if the access to the pixels of the image is required. * @param options.pixelRatio The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. * @param options.rotation The rotation in degrees of the exported image. * @@ -14635,12 +14618,6 @@ declare namespace __esri { export interface WMSLayerFetchImageOptions extends Object { - /** - * Indicates if the access to the pixels of the image is required. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fetchImage) - */ - allowImageDataAccess?: boolean; /** * The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. * @@ -14812,30 +14789,35 @@ declare namespace __esri { * * Value | Description * ------|------------ - * streets | ![basemap-streets](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets.jpg) - * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/satellite.jpg) - * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/hybrid.jpg) - * topo | ![basemap-topo](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/topo.jpg) - * gray | ![basemap-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/gray.jpg) - * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/dark-gray.jpg) - * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/oceans.jpg) - * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/national-geographic.jpg) - * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/terrain.jpg) - * osm | ![basemap-osm](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/osm.jpg) - * dark-gray-vector | ![dark-gray-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/dark-gray.jpg) - * gray-vector | ![gray-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/gray.jpg) - * streets-vector | ![streets-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets.jpg) - * topo-vector | ![topo-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/topo.jpg) - * streets-night-vector | ![streets-night-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets-night.jpg) - * streets-relief-vector | ![streets-relief-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets-relief.jpg) - * streets-navigation-vector | ![streets-navigation-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets-navigation.jpg) + * streets | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) + * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/satellite.jpg) + * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/hybrid.jpg) + * topo | ![basemap-topo](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) + * gray | ![basemap-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) + * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) + * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/oceans.jpg) + * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/national-geographic.jpg) + * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/terrain.jpg) + * osm | ![basemap-osm](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/osm.jpg) + * dark-gray-vector | ![dark-gray-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) + * gray-vector | ![gray-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) + * streets-vector | ![streets-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) + * topo-vector | ![topo-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) + * streets-night-vector | ![streets-night-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-night.jpg) + * streets-relief-vector | ![streets-relief-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-relief.jpg) + * streets-navigation-vector | ![streets-navigation-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-navigation.jpg) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) */ basemap: Basemap; /** - * Specifies the surface properties for the map. This property is only relevant when adding the map to a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It renders the terrain or topographical variations in the real world on the map's surface with a collection of [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html). This value can be an instance of [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html), or the string `world-elevation` for a default instance of ground using the [World Elevation Service](https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer). The ground may not be set to `null` or `undefined`, it is guaranteed to always contain an instance of type [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html). The elevation can be removed from the ground by setting the ground property to a new empty [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) instance or by removing all the ground layers. + * Specifies the surface properties for the map. This property is only relevant when adding the map to a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It renders the terrain or topographical variations in the real world on the map's surface with a collection of [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html). This value can be an instance of [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html), or one of the following strings: + * * `world-elevation` for a default instance of ground using the [Terrain3D Service](https://www.arcgis.com/home/item.html?id=7029fb60158543ad845c7e1527af11e4). + * * `world-topobathymetry` for an instance of ground that combines surface elevation and bathymetry using the [TopoBathy3D Service](https://www.arcgis.com/home/item.html?id=0c69ba5a5d254118841d43f03aa3e97d). + * + * + * The ground may not be set to `null` or `undefined`, it is guaranteed to always contain an instance of type [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html). The elevation can be removed from the ground by setting the ground property to a new empty [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) instance or by removing all the ground layers. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) */ @@ -14860,30 +14842,35 @@ declare namespace __esri { * * Value | Description * ------|------------ - * streets | ![basemap-streets](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets.jpg) - * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/satellite.jpg) - * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/hybrid.jpg) - * topo | ![basemap-topo](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/topo.jpg) - * gray | ![basemap-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/gray.jpg) - * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/dark-gray.jpg) - * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/oceans.jpg) - * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/national-geographic.jpg) - * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/terrain.jpg) - * osm | ![basemap-osm](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/osm.jpg) - * dark-gray-vector | ![dark-gray-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/dark-gray.jpg) - * gray-vector | ![gray-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/gray.jpg) - * streets-vector | ![streets-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets.jpg) - * topo-vector | ![topo-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/topo.jpg) - * streets-night-vector | ![streets-night-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets-night.jpg) - * streets-relief-vector | ![streets-relief-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets-relief.jpg) - * streets-navigation-vector | ![streets-navigation-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets-navigation.jpg) + * streets | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) + * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/satellite.jpg) + * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/hybrid.jpg) + * topo | ![basemap-topo](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) + * gray | ![basemap-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) + * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) + * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/oceans.jpg) + * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/national-geographic.jpg) + * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/terrain.jpg) + * osm | ![basemap-osm](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/osm.jpg) + * dark-gray-vector | ![dark-gray-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) + * gray-vector | ![gray-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) + * streets-vector | ![streets-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) + * topo-vector | ![topo-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) + * streets-night-vector | ![streets-night-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-night.jpg) + * streets-relief-vector | ![streets-relief-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-relief.jpg) + * streets-navigation-vector | ![streets-navigation-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-navigation.jpg) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) */ basemap?: BasemapProperties | string; /** - * Specifies the surface properties for the map. This property is only relevant when adding the map to a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It renders the terrain or topographical variations in the real world on the map's surface with a collection of [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html). This value can be an instance of [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html), or the string `world-elevation` for a default instance of ground using the [World Elevation Service](https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer). The ground may not be set to `null` or `undefined`, it is guaranteed to always contain an instance of type [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html). The elevation can be removed from the ground by setting the ground property to a new empty [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) instance or by removing all the ground layers. + * Specifies the surface properties for the map. This property is only relevant when adding the map to a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It renders the terrain or topographical variations in the real world on the map's surface with a collection of [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html). This value can be an instance of [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html), or one of the following strings: + * * `world-elevation` for a default instance of ground using the [Terrain3D Service](https://www.arcgis.com/home/item.html?id=7029fb60158543ad845c7e1527af11e4). + * * `world-topobathymetry` for an instance of ground that combines surface elevation and bathymetry using the [TopoBathy3D Service](https://www.arcgis.com/home/item.html?id=0c69ba5a5d254118841d43f03aa3e97d). + * + * + * The ground may not be set to `null` or `undefined`, it is guaranteed to always contain an instance of type [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html). The elevation can be removed from the ground by setting the ground property to a new empty [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) instance or by removing all the ground layers. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) */ @@ -14902,7 +14889,7 @@ declare namespace __esri { interface PopupTemplate extends Accessor, JSONSupport { /** - * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. + * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#actions) */ @@ -14953,6 +14940,14 @@ declare namespace __esri { * @default null */ layerOptions: PopupTemplateLayerOptions; + /** + * An array of fields used in the PopupTemplate. Use this property to indicate what fields are required to fully render the PopupTemplate. To fetch the values from all fields, use `["*"]`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#outFields) + * + * @default null + */ + outFields: string[]; /** * Indicates whether actions should replace existing [popup actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions). * @@ -14985,7 +14980,7 @@ declare namespace __esri { interface PopupTemplateProperties { /** - * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. + * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#actions) */ @@ -15036,6 +15031,14 @@ declare namespace __esri { * @default null */ layerOptions?: PopupTemplateLayerOptions; + /** + * An array of fields used in the PopupTemplate. Use this property to indicate what fields are required to fully render the PopupTemplate. To fetch the values from all fields, use `["*"]`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#outFields) + * + * @default null + */ + outFields?: string[]; /** * Indicates whether actions should replace existing [popup actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions). * @@ -15053,7 +15056,7 @@ declare namespace __esri { } /** - * Attachments are a type of popup element. Similar to text and media elements, attachments can only be set within the content. ![popuptemplate-attachments-element](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-attachments-element.png) The object specification for the fields popup element is provided below. + * Attachments are a type of popup element. Similar to text and media elements, attachments can only be set within the content. ![popuptemplate-attachments-element](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-attachments-element.png) The object specification for the fields popup element is provided below. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#attachments) */ @@ -15067,7 +15070,7 @@ declare namespace __esri { } /** - * It is possible to set the fieldInfos directly within the PopupTemplate's content. If the fieldInfos is not set within the content, it will revert to whatever may be set within the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. ![popuptemplate-fields-element](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-fields-element.png) The object specification for the fields popup element is provided below. + * It is possible to set the fieldInfos directly within the PopupTemplate's content. If the fieldInfos is not set within the content, it will revert to whatever may be set within the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. ![popuptemplate-fields-element](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-fields-element.png) The object specification for the fields popup element is provided below. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields) */ @@ -15087,7 +15090,7 @@ declare namespace __esri { } /** - * It is possible to set media elements such as charts and/or images within the PopupTemplate's content. This content is set within the mediaInfos. ![popuptemplate-media-element](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-media-element.png) The object specification for the media popup element is provided below. + * It is possible to set media elements such as charts and/or images within the PopupTemplate's content. This content is set within the mediaInfos. ![popuptemplate-media-element](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-media-element.png) The object specification for the media popup element is provided below. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) */ @@ -15207,7 +15210,7 @@ declare namespace __esri { } /** - * An object used to define descriptive text as an element within the PopupTemplate's content. The text may reference values returned from a field attribute or an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression. ![popuptemplate-text-element](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-text-element.png) The object specification for the text popup element is provided below. + * An object used to define descriptive text as an element within the PopupTemplate's content. The text may reference values returned from a field attribute or an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression. ![popuptemplate-text-element](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-text-element.png) The object specification for the text popup element is provided below. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text) */ @@ -15368,6 +15371,8 @@ declare namespace __esri { * When `true`, the organization's public items, groups and users are included in search queries. When `false`, no public items outside of the organization are included. However, public items which are part of the organization are included. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSearchPublic) + * + * @default true */ canSearchPublic: boolean; /** @@ -15849,6 +15854,8 @@ declare namespace __esri { * When `true`, the organization's public items, groups and users are included in search queries. When `false`, no public items outside of the organization are included. However, public items which are part of the organization are included. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSearchPublic) + * + * @default true */ canSearchPublic?: boolean; /** @@ -17573,19 +17580,11 @@ declare namespace __esri { */ defaultSymbol: Symbol; /** - * The name of the attribute field the renderer uses to render data. A function may also be used to return a numeric value if the data does not already explicitly exist in a field. + * The name of a numeric attribute field whose data determines the symbol of each feature based on the class breaks defined in [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field) */ - field: string | Function; - /** - * If `true`, graphics with attribute values equal to the max value of a class will be included in that class. Set this property to `false` if the desired behavior is to make a class include values less than, but not equal to the max value. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#isMaxInclusive) - * - * @default true - */ - isMaxInclusive: boolean; + field: string; /** * An object providing options for displaying the renderer in the Legend. * @@ -17712,19 +17711,11 @@ declare namespace __esri { */ defaultSymbol?: SymbolProperties; /** - * The name of the attribute field the renderer uses to render data. A function may also be used to return a numeric value if the data does not already explicitly exist in a field. + * The name of a numeric attribute field whose data determines the symbol of each feature based on the class breaks defined in [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field) */ - field?: string | Function; - /** - * If `true`, graphics with attribute values equal to the max value of a class will be included in that class. Set this property to `false` if the desired behavior is to make a class include values less than, but not equal to the max value. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#isMaxInclusive) - * - * @default true - */ - isMaxInclusive?: boolean; + field?: string; /** * An object providing options for displaying the renderer in the Legend. * @@ -18550,17 +18541,11 @@ declare namespace __esri { */ maxDataValue: number; /** - * Indicates the source of the data values used to determine the size of each feature. - * - * Value Type | Description - * ------|----------- - * String | The name of the numeric attribute field that contains the data values used to determine the size of each feature. - * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html), which includes the feature's attributes, and returns the value used to determine the size of the given feature. - * + * The name of the numeric attribute field that contains the data values used to determine the size of each feature. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) */ - field?: string | Function; + field?: string; /** * The minimum data value used in the size ramp. Features with this value or lower will be rendered at the size defined in `minSize`. * @@ -18605,7 +18590,7 @@ declare namespace __esri { } /** - * The **color** visual variable defines how a continuous color ramp is applied to features based on the values of a numeric attribute field. The minimum and maximum values of the data should be indicated along with their respective color values. You must specify `stops` to construct the color ramp, and either `field` or `valueExpression` to define the driving value. [![renderer-vv-color](https://developers.arcgis.com/javascript/latest/assets/img/samples/7-vv-color.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-color/index.html) The object specification for color is provided below. + * The **color** visual variable defines how a continuous color ramp is applied to features based on the values of a numeric attribute field. The minimum and maximum values of the data should be indicated along with their respective color values. You must specify `stops` to construct the color ramp, and either `field` or `valueExpression` to define the driving value. [![renderer-vv-color](https://developers.arcgis.com/javascript/assets/img/samples/7-vv-color.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-color/index.html) The object specification for color is provided below. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) */ @@ -18617,41 +18602,35 @@ declare namespace __esri { */ type: string; /** - * Indicates the source of the data values used to determine the color of each feature. - * - * Value Type | Description - * ------|----------- - * String | The name of the numeric attribute field that contains the data values used to determine the color of each feature. - * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) including a feature's attributes and returns the value used to determine the color of the given feature. - * + * The name of the numeric attribute field that contains the data values used to determine the color of each feature. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) */ - field: string | Function; + field?: string; /** * Name of the numeric attribute field by which to normalize the data. If this field is used, then the values in `stops` should be normalized as percentages or ratios. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) */ - normalizationField: string; + normalizationField?: string; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) */ - valueExpression: string; + valueExpression?: string; /** * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding color ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) */ - valueExpressionTitle: string; + valueExpressionTitle?: string; /** * An object providing options for displaying the color ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) */ - legendOptions: ColorVisualVariableLegendOptions; + legendOptions?: ColorVisualVariableLegendOptions; /** * An array of objects that defines the color ramp in a sequence of stops. At least two stops are required. Features with values between the given stops will be assigned colors along the ramp proportional to the minimum and maximum values used. The stops must be listed in ascending order based on the value of the `value` property in each stop. Each stop object has the following specification: * @@ -18661,7 +18640,7 @@ declare namespace __esri { } /** - * The **opacity** visual variable defines the opacity of each feature's symbol based on a numeric attribute field value. The minimum and maximum values of the data should be indicated along with their respective opacity values. The specification for this object is provided below. You must specify `stops` to construct the opacity ramp, and either `field` or `valueExpression` to define the driving value. [![renderer-vv-opacity](https://developers.arcgis.com/javascript/latest/assets/img/samples/12-vv-transparency.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-opacity/index.html) + * The **opacity** visual variable defines the opacity of each feature's symbol based on a numeric attribute field value. The minimum and maximum values of the data should be indicated along with their respective opacity values. The specification for this object is provided below. You must specify `stops` to construct the opacity ramp, and either `field` or `valueExpression` to define the driving value. [![renderer-vv-opacity](https://developers.arcgis.com/javascript/assets/img/samples/12-vv-transparency.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-opacity/index.html) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) */ @@ -18673,41 +18652,35 @@ declare namespace __esri { */ type: string; /** - * Indicates the source of the data values used to determine the opacity of each feature. - * - * Value Type | Description - * ------|----------- - * String | The name of the numeric attribute field that contains the data values used to determine the opacity of each feature. - * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) including the attributes of the feature and returns the value used to determine the opacity of the given feature. - * + * The name of the numeric attribute field that contains the data values used to determine the opacity of each feature. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) */ - field: string | Function; + field?: string; /** * Name of the attribute field by which to normalize the data. If this field is used, then the values in `stops` should be normalized as percentages or ratios. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) */ - normalizationField: string; + normalizationField?: string; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) */ - valueExpression: string; + valueExpression?: string; /** * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding opacity ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) */ - valueExpressionTitle: string; + valueExpressionTitle?: string; /** * An object providing options for displaying the opacity ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) */ - legendOptions: OpacityVisualVariableLegendOptions; + legendOptions?: OpacityVisualVariableLegendOptions; /** * An array of objects that defines the thematic opacity ramp in a sequence of stops. At least two stops are required. The stops must be listed in ascending order based on the value of the `value` property in each stop. Each stop object has the following specification: * @@ -18717,7 +18690,7 @@ declare namespace __esri { } /** - * Defines a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) where data values are interpreted as real-world sizes based on a given unit. Features are then sized according to the real-world measurements, not thematic values and screen units. [![renderer-vv-rw](https://developers.arcgis.com/javascript/latest/assets/img/samples/2-extrude-height.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-buildings-3d/index.html) The object specification for this object is provided below. + * Defines a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) where data values are interpreted as real-world sizes based on a given unit. Features are then sized according to the real-world measurements, not thematic values and screen units. [![renderer-vv-rw](https://developers.arcgis.com/javascript/assets/img/samples/2-extrude-height.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-buildings-3d/index.html) The object specification for this object is provided below. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) */ @@ -18729,17 +18702,11 @@ declare namespace __esri { */ type: string; /** - * Indicates the source of the data values used to determine the size of each feature. - * - * Value Type | Description - * ------|----------- - * String | The name of the numeric attribute field that contains the data values used to determine the size of each feature. - * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html), which includes the feature's attributes, and returns the value used to determine the size of the given feature. - * + * The name of the numeric attribute field that contains the data values used to determine the size of each feature. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) */ - field?: string | Function; + field?: string; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. * @@ -18772,7 +18739,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) */ - valueRepresentation: string; + valueRepresentation?: string; /** * An object providing options for displaying the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @@ -18803,7 +18770,7 @@ declare namespace __esri { } /** - * The **rotation** visual variable defines how features rendered with [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html) or [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) in a MapView or [3D object symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html) in a SceneView are rotated. The rotation value is determined by mapping the values to data in a field, or by other arithmetic means with a function. This object may be used to depict variables such as wind direction, vehicle heading, etc. [![renderer-vv-rotation](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/renderer-vv-rotation.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-rotation/index.html) + * The **rotation** visual variable defines how features rendered with [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html) or [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) in a MapView or [3D object symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html) in a SceneView are rotated. The rotation value is determined by mapping the values to data in a field, or by other arithmetic means with an Arcade expression. This object may be used to depict variables such as wind direction, vehicle heading, etc. [![renderer-vv-rotation](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/renderer-vv-rotation.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-rotation/index.html) * > **Known Limitations** In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) rotation visual variables are not currently supported with [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html), [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html), [3D icon symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) and [3D text symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) @@ -18816,23 +18783,17 @@ declare namespace __esri { */ type: string; /** - * Indicates the source of the rotation angle of each feature. - * - * Value Type | Description - * ------|----------- - * String | The name of the numeric attribute field that contains the rotation angle of each feature. - * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html), which includes the feature's attributes, and returns the rotation angle of the given feature. - * + * The name of the numeric attribute field that contains the rotation angle of each feature. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) */ - field: string | Function; + field?: string; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) */ - valueExpression: string; + valueExpression?: string; /** * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the rotation visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then the following rotation axis will rotate the symbol as indicated by their name. * @@ -18873,17 +18834,11 @@ declare namespace __esri { */ type: string; /** - * Indicates the source of the data values used to determine the size of each feature. - * - * Value Type | Description - * ------|----------- - * String | The name of the numeric attribute field that contains the data values used to determine the size of each feature. - * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html), which includes the feature's attributes, and returns the value used to determine the size of the given feature. - * + * The name of the numeric attribute field that contains the data values used to determine the size of each feature. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) */ - field?: string | Function; + field?: string; /** * The name of the numeric attribute field used to normalize the data in `field`. If this field is used, then the values in `maxDataValue` and `minDataValue` should be normalized as percentages or ratios. * @@ -18987,7 +18942,7 @@ declare namespace __esri { * * **[RealWorldSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize)** - Feature sizes are determined based on real-world measurements and units, not thematic values and screen units. * * - * [![renderer-unique-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) + * [![renderer-unique-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) */ @@ -19007,17 +18962,11 @@ declare namespace __esri { */ type: string; /** - * Indicates the source of the data values used to determine the size of each feature. - * - * Value Type | Description - * ------|----------- - * String | The name of the numeric attribute field that contains the data values used to determine the size of each feature. - * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html), which includes the feature's attributes, and returns the value used to determine the size of the given feature. - * + * The name of the numeric attribute field that contains the data values used to determine the size of each feature. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) */ - field?: string | Function; + field?: string; /** * The name of the numeric attribute field used to normalize the data in `field`. If this field is used, then the values in `stops` should be normalized as percentages or ratios. * @@ -19094,13 +19043,13 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) */ - title: string; + title?: string; /** * Indicates whether to show the color ramp in the legend. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) */ - showLegend: boolean; + showLegend?: boolean; } @@ -19122,7 +19071,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) */ - label: string; + label?: string; } @@ -19132,13 +19081,13 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) */ - title: string; + title?: string; /** * Indicates whether to show the opacity ramp in the legend. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) */ - showLegend: boolean; + showLegend?: boolean; } @@ -19160,7 +19109,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) */ - label: string; + label?: string; } @@ -19314,6 +19263,50 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html) */ interface color { + /** + * Generates a continuous color [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) representing the age of features based on one or more fields. The age of a feature is calculated based on a given `startTime` and `endTime`, one of which must be a date field in the input `layer`. This method generates an Arcade expression and calculates statistics on the output of the expression to accomplish this. The resulting renderer contains a continuous color visual variable that maps optimal colors based on the indicated basemap to data values based on the resulting statistics of the expression. You are required to provide a `layer`, `view`, `startTime`, and `endTime` to generate this renderer. Optionally, you can set a `unit` and a `theme` for the visualization. Other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the statistics object to the `statistics` parameter to avoid making an extra call to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + * + * @param params Input parameters for generating a continuous color visualization of age for time data returned from start and/or end date field(s). See the table below for details of each parameter. + * @param params.layer The layer for which the visualization is generated. + * @param params.view The view instance in which the visualization will be rendered. + * @param params.startTime The name of the field, or a date value representing the start time in the age calculation. If a date value is specified, then the `endTime` paramter must reference a Date field in the layer. + * @param params.endTime The name of the field, or a date value representing the end time in the age calculation. If a date value is specified, then the `startTime` paramter must reference a Date field in the layer. + * @param params.unit The time unit used to calculate the difference between `endTime` and `startTime`. If a unit is not specified, then a suggested unit is determined based on the spread and distribution of the data. **Possible Values:** years | months | days | hours | minutes | seconds + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. + * @param params.theme + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | + * @param params.legendOptions Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. + * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. The `createAgeRenderer()` method generates an Arcade expression and executes a statistics query against the layer for the result of the expression. If statistics for the expression have already been generated, then pass the object here to avoid making a second statistics query. + * @param params.colorScheme In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value. + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + */ + createAgeRenderer(params: colorCreateAgeRendererParams): IPromise; /** * Generates a [ClassBreaksRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html) that may be applied directly to the layer used to call this method. The resulting renderer defines the symbol color of each feature based on the value of the given `field` value. A default color scheme is determined based on the given `basemap`. Depending on the `classificationMethod`, class breaks (or data ranges) are generated based on the statistics of the data. Each feature is assigned a color based on the class break in which the value of the `field` falls. In most cases you will provide a `layer`, `basemap`, `field`, and `classificationMethod` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what colors to use in the visualization. You can also use a `valueExpression` instead of a `field` to visualize features based on a value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. * @@ -19348,7 +19341,7 @@ declare namespace __esri { * @param params.colorScheme In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @param params.valueExpressionTitle Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * @param params.sqlExpression A SQL expression evaluating to a number. This option only applies to service-based FeatureLayers. + * @param params.sqlExpression A SQL expression evaluating to a number. * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.legendOptions Provides options for setting a title to describe a field instead of using the field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @param params.minValue A minimum value set by the user. Use this in conjunction with `maxValue` to generate class breaks between lower and upper bounds. This will be the lower bound of the lowest class break. @@ -19389,14 +19382,14 @@ declare namespace __esri { * * | Value | Description | Example | * | ----- | ----------- | ------- | - * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | - * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | - * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | - * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | * @param params.colorScheme In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @param params.valueExpressionTitle Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * @param params.sqlExpression A SQL expression evaluating to a number. This parameter is only supported for service-based FeatureLayers. + * @param params.sqlExpression A SQL expression evaluating to a number. * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.legendOptions Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. @@ -19466,14 +19459,14 @@ declare namespace __esri { * * | Value | Description | Example | * | ----- | ----------- | ------- | - * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | - * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | - * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | - * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | * @param params.colorScheme In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @param params.valueExpressionTitle Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * @param params.sqlExpression A SQL expression evaluating to a number. This parameter only applies to service-based FeatureLayers. + * @param params.sqlExpression A SQL expression evaluating to a number. * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.legendOptions Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. @@ -19488,6 +19481,56 @@ declare namespace __esri { export const color: color; + /** + * The result object of the [createAgeRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) + */ + export interface AgeRendererResult extends Object { + /** + * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) + */ + renderer: ClassBreaksRenderer; + /** + * A color visual variable configured based on the statistics of the data and the given basemap and scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) + */ + visualVariable: ColorVisualVariable; + /** + * The time unit used to represent age in the output `renderer`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) + */ + unit: string; + /** + * The color scheme used by the visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) + */ + colorScheme: ColorScheme; + /** + * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) + */ + defaultValuesUsed: boolean; + /** + * Basic statistics returned from a query to the service for data from the given field name or expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) + */ + statistics: SummaryStatisticsResult; + /** + * The ID of the basemap used to determine the optimal fill color of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) + */ + basemapId: string; + } + /** * The result object of the [createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) method. See the table below for details of each property. * @@ -19527,6 +19570,134 @@ declare namespace __esri { } + export interface colorCreateAgeRendererParams extends Object { + /** + * The layer for which the visualization is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + */ + layer: FeatureLayer | SceneLayer | CSVLayer; + /** + * The view instance in which the visualization will be rendered. + * + * [Read more...](global.html) + */ + view: View; + /** + * The name of the field, or a date value representing the start time in the age calculation. If a date value is specified, then the `endTime` paramter must reference a Date field in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + */ + startTime: Date | string | number; + /** + * The name of the field, or a date value representing the end time in the age calculation. If a date value is specified, then the `startTime` paramter must reference a Date field in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + */ + endTime: Date | string | number; + /** + * The time unit used to calculate the difference between `endTime` and `startTime`. If a unit is not specified, then a suggested unit is determined based on the spread and distribution of the data. **Possible Values:** years | months | days | hours | minutes | seconds + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + */ + unit?: string; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + * + * @default gray + */ + basemap?: string | Basemap; + /** + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + */ + theme?: string; + /** + * Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + */ + legendOptions?: colorCreateAgeRendererParamsLegendOptions; + /** + * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. The `createAgeRenderer()` method generates an Arcade expression and executes a statistics query against the layer for the result of the expression. If statistics for the expression have already been generated, then pass the object here to avoid making a second statistics query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + */ + statistics?: SummaryStatisticsResult; + /** + * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + */ + colorScheme?: ColorScheme; + /** + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + * + * @default 2d + */ + symbolType?: string; + /** + * Enables the `defaultSymbol` on the renderer and assigns it to features with no value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + * + * @default true + */ + defaultSymbolEnabled?: boolean; + /** + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + * + * @default replace + */ + colorMixMode?: string; + } + + + export interface colorCreateAgeRendererParamsLegendOptions extends Object { + /** + * The title used to represent the age color ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + */ + title?: string; + /** + * Indicates whether to include the age renderer in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) + */ + showLegend?: boolean; + } + + export interface colorCreateClassBreaksRendererParams extends Object { /** * The layer for which the visualization is generated. @@ -19625,7 +19796,7 @@ declare namespace __esri { */ valueExpressionTitle?: string; /** - * A SQL expression evaluating to a number. This option only applies to service-based FeatureLayers. + * A SQL expression evaluating to a number. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ @@ -19743,10 +19914,10 @@ declare namespace __esri { * * | Value | Description | Example | * | ----- | ----------- | ------- | - * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | - * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | - * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | - * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) @@ -19771,7 +19942,7 @@ declare namespace __esri { */ valueExpressionTitle?: string; /** - * A SQL expression evaluating to a number. This parameter is only supported for service-based FeatureLayers. + * A SQL expression evaluating to a number. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ @@ -19979,10 +20150,10 @@ declare namespace __esri { * * | Value | Description | Example | * | ----- | ----------- | ------- | - * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | - * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | - * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | - * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) @@ -20007,7 +20178,7 @@ declare namespace __esri { */ valueExpressionTitle?: string; /** - * A SQL expression evaluating to a number. This parameter only applies to service-based FeatureLayers. + * A SQL expression evaluating to a number. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ @@ -20272,7 +20443,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) */ - locationScheme?: PointLocationScheme | PolylineLocationScheme | PolygonLocationScheme; + locationScheme?: LocationScheme; /** * The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric"`, except for layers with a `mesh` geometryType. * @@ -20328,7 +20499,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#RendererResult) */ - locationScheme: PointLocationScheme | PolylineLocationScheme | PolygonLocationScheme; + locationScheme: LocationScheme; /** * The ID of the basemap used to determine the optimal fill color of the features. * @@ -20354,7 +20525,7 @@ declare namespace __esri { * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @param params.valueExpressionTitle Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * @param params.sqlExpression A SQL expression evaluating to a number. This parameter is only supported for service-based FeatureLayers. + * @param params.sqlExpression A SQL expression evaluating to a number. * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.legendOptions Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. @@ -20401,7 +20572,7 @@ declare namespace __esri { */ valueExpressionTitle?: string; /** - * A SQL expression evaluating to a number. This parameter is only supported for service-based FeatureLayers. + * A SQL expression evaluating to a number. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ @@ -20486,6 +20657,578 @@ declare namespace __esri { authoringInfo: AuthoringInfo; } + /** + * This object contains a helper method for generating a predominance visualization. Visualizing predominance involves coloring a [layer’s](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) features based on which attribute among a set of competing numeric attributes wins or beats the others in total count. Common applications of this include visualizing election results, survey results, and demographic majorities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html) + */ + interface predominance { + /** + * Generates a predominance renderer based on a set of competing numeric fields. Visualizing predominance involves coloring a [layer’s](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) features based on which attribute among a set of competing numeric attributes wins or beats the others in total count. Common applications of this include visualizing election results, survey results, and demographic majorities. For example, suppose you have a layer of U.S. counties with fields containing the total sales of various crops: wheat, soybeans, corn, cotton, and vegetables. If a feature has the following values for each field: + * + * Field Name | Count | Color + * -----------|-------|------ + * Wheat | 130 | purple + * Soybeans | 2000 | blue + * Corn | 0 | yellow + * Cotton | 300 | green + * Vegetables | 120 | red + * + * Then the renderer symbolizes the feature with a blue color since Soybeans is the predominant crop. The predominant field of a feature is determined based on the result of an Arcade expression generated by this method. You are required to provide a `layer`, `view`, and list of `fields` to generate this renderer. Optionally, you can set `includeSizeVariable` to `true` to change the size of each feature to indicate how influential the feature is compared to the entire layer as a whole. You can also set `includeOpacityVariable` to `true` to add opacity to each feature depending on how strong the predominant field is compared to all the other fields. For the example above, the feature would likely be opaque since Soybeans beats all other features combined by a wide margin. If the Soybean total were still the highest, but only 301, then the feature would be very transparent, indicating the Soybean total wins, but not by a wide margin. Other options are provided for convenience for more involved custom visualization authoring applications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + * + * @param params Input parameters for generating a predominance visualization based on a set of competing field(s). See the table below for details of each parameter. + * @param params.layer The layer for which the visualization is generated. + * @param params.view The view instance in which the visualization will be rendered. + * @param params.fields A set of competing numeric fields used as the basis of the predominance visualization. For example, if creating an election map, you would indicate the names of each field representing the candidate or political party where total votes are stored. + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. + * @param params.includeOpacityVariable Indicates whether to include data-driven opacity in the final renderer. If `true`, features where the predominant value beats all others by a large margin are given a high opacity. Features where the predominant value beats others by a small margin will be assigned a low opacity, indicating that while the feature has a winning value, it doesn't win by much. ![predominance-opacity](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/predominance-opacity.png) + * @param params.includeSizeVariable Indicates whether to include data-driven size in the final renderer. If `true`, features will be assigned a sized based on the sum of all competing values in the `fields` param. Features with small total counts will be sized with small icons or lines depending on the geometry type of the layer, and features with large total counts will be sized with large icons or lines. Enabling this option is good for visualizing how influential a particular feature is compared to the dataset as a whole. It removes bias introduced by features with large geographic areas, but relatively small data values. ![predominance-size](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/predominance-size.png) + * @param params.legendOptions Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. + * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. The `createAgeRenderer()` method generates an Arcade expression and executes a statistics query against the layer for the result of the expression. If statistics for the expression have already been generated, then pass the object here to avoid making a second statistics query. + * @param params.sortBy + * Indicates how values should be sorted in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). See the table below for information about values that may be passed to this parameter. + * + * Possible Value | Description + * ---------------|------------ + * count | Unique values/types will be sorted from highest to lowest based on the count of features that fall in each category. + * value | Unique values/types will be sorted in the order they were specified in the `fields` parameter. + * + * **Possible Values:** count | value + * @param params.predominanceScheme In authoring apps, the user may select a pre-defined predominance scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value. + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + */ + createRenderer(params: predominanceCreateRendererParams): IPromise; + } + + export const predominance: predominance; + + + export interface predominanceCreateRendererParams extends Object { + /** + * The layer for which the visualization is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + */ + layer: FeatureLayer | SceneLayer | CSVLayer; + /** + * The view instance in which the visualization will be rendered. + * + * [Read more...](global.html) + */ + view: View; + /** + * A set of competing numeric fields used as the basis of the predominance visualization. For example, if creating an election map, you would indicate the names of each field representing the candidate or political party where total votes are stored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + */ + fields: predominanceCreateRendererParamsFields[]; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + * + * @default gray + */ + basemap?: string | Basemap; + /** + * Indicates whether to include data-driven opacity in the final renderer. If `true`, features where the predominant value beats all others by a large margin are given a high opacity. Features where the predominant value beats others by a small margin will be assigned a low opacity, indicating that while the feature has a winning value, it doesn't win by much. ![predominance-opacity](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/predominance-opacity.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + */ + includeOpacityVariable?: boolean; + /** + * Indicates whether to include data-driven size in the final renderer. If `true`, features will be assigned a sized based on the sum of all competing values in the `fields` param. Features with small total counts will be sized with small icons or lines depending on the geometry type of the layer, and features with large total counts will be sized with large icons or lines. Enabling this option is good for visualizing how influential a particular feature is compared to the dataset as a whole. It removes bias introduced by features with large geographic areas, but relatively small data values. ![predominance-size](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/predominance-size.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + */ + includeSizeVariable?: boolean; + /** + * Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + */ + legendOptions?: predominanceCreateRendererParamsLegendOptions; + /** + * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. The `createAgeRenderer()` method generates an Arcade expression and executes a statistics query against the layer for the result of the expression. If statistics for the expression have already been generated, then pass the object here to avoid making a second statistics query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + */ + statistics?: SummaryStatisticsResult; + /** + * Indicates how values should be sorted in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). See the table below for information about values that may be passed to this parameter. + * + * Possible Value | Description + * ---------------|------------ + * count | Unique values/types will be sorted from highest to lowest based on the count of features that fall in each category. + * value | Unique values/types will be sorted in the order they were specified in the `fields` parameter. + * + * **Possible Values:** count | value + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + * + * @default count + */ + sortBy?: string; + /** + * In authoring apps, the user may select a pre-defined predominance scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + */ + predominanceScheme?: PredominanceScheme; + /** + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + * + * @default 2d + */ + symbolType?: string; + /** + * Enables the `defaultSymbol` on the renderer and assigns it to features with no value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + * + * @default true + */ + defaultSymbolEnabled?: boolean; + /** + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + * + * @default replace + */ + colorMixMode?: string; + } + + + export interface predominanceCreateRendererParamsFields extends Object { + /** + * The name of a numeric field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + */ + name: string; + /** + * The label describing the field name (or category) in the legend. This is should be used if the given field doesn't have an intuitive field name. For example, for a field named `dem` representing the total vote count for the Democratic party, you can set the label to `Democrat` to clarify the name of the category in the final visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + */ + label?: string; + } + + + export interface predominanceCreateRendererParamsLegendOptions extends Object { + /** + * The title used to describe the renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + */ + title?: string; + /** + * Indicates whether to include the renderer in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) + */ + showLegend?: boolean; + } + + /** + * The result object of the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) + */ + export interface predominanceRendererResult extends Object { + /** + * The unique value renderer object representing the predominance visualization. Set this on a layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) + */ + renderer: UniqueValueRenderer; + /** + * An array of objects describing the value, symbol, and count of each unique type or category represented in the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) + */ + predominantCategoryInfos: UniqueValueInfo[]; + /** + * An array of objects describing the values or categories excluded from consideration in visualizing data from the given fields. The specification of each object matches that of the objects specified in the `predominantCategoryInfos` property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) + */ + excludedCategoryInfos: any[]; + /** + * A size visual variable representing the total count of all fields included in the predominance visualization. This is included if the `includeSizeVariable` parameter is true. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) + */ + size?: sizeVisualVariableResult; + /** + * An opacity visual variable representing the percentage of the total count comprised by the predominant value of all fields. This variable indicates the strength of a particular value's predominance compared to the other values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) + */ + opacity?: opacityVisualVariableResult; + /** + * The predominance scheme used by the renderer based on the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) + */ + predominanceScheme: PredominanceScheme; + /** + * The ID of the basemap used to determine the optimal fill color of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) + */ + basemapId: string; + } + + /** + * This object contains a helper method for creating a renderer for exploring the relationship between two numeric attributes. This is commonly known as a [bivariate choropleth](http://www.joshuastevens.net/cartography/make-a-bivariate-choropleth-map/) visualization. This renderer classifies each variable in either 2, 3, or 4 classes along separate color ramps. One of those ramps is rotated 90 degrees and overlaid on the other to create a 2x2, 3x3, or 4x4 square grid. The x-axis indicates the range of values for one variable, and the y-axis indicates the range for the second variable. The squares running diagonal from the lower left corner to the upper right corner indicate features where the two variables may be related or in agreement with one another. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html) + */ + interface relationship { + /** + * Generates a relationship renderer (bivariate choropleth) based on a set of competing numeric fields. Each feature's category is determined based on the result of an Arcade expression generated internally by this method. You are required provide a `layer`, `view`, `field1` name, and `field2` name to generate this renderer. Optionally, you can set the `focus` to change the rotation of the legend and the `numClasses` parameter to change the grid size of the legend. Other options are provided for convenience for more involved custom visualization authoring applications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + * + * @param params Input parameters for generating a relationship visualization based on a pair of numeric field(s). See the table below for details of each parameter. + * @param params.layer The layer for which the visualization is generated. + * @param params.view The view instance in which the visualization will be rendered. + * @param params.field1 A numeric field that will be used to explore its relationship with `field2`. In the default visualization, the values of this field are rendered along the vertical axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * @param params.field2 A numeric field that will be used to explore its relationship with `field1`. In the default visualization, the values of this field are rendered along the horizontal axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * @param params.classificationMethod The method for classifying each field's data values. See [classBreaks](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) for more information about each classification type. **Possible Values:** quantile | equal-interval | natural-breaks + * @param params.focus + * Determines the orientation of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This value does not change the renderer or symbology of any features in the layer. This affects the legend only. See the table below for a description of the possible values. See the class description at the top of this page for a more thorough explanation of how to read the legend. + * + * Value | Example | Description + * ------|-------------|-------- + * null | ![relationship-legend-null](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-null.png) | The legend renders as a square. The top right corner of the legend indicates that values from both `field1` and `field2` are considered high. | + * HH | ![relationship-legend-hh](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-hh.png) | The legend renders as a diamond with the focus on the top corner where values from both `field1` and `field2` are considered high. | + * HL | ![relationship-legend-hl](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-hl.png) | The legend renders as a diamond with the focus on the top corner where values from `field1` are high and values from `field2` are low. | + * LH | ![relationship-legend-lh](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-lh.png) | The legend renders as a diamond with the focus on the top corner where values from `field1` are low and values from `field2` are high. | + * LL | ![relationship-legend-ll](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-ll.png) | The legend renders as a diamond with the focus on the top corner where values from both `field1` and `field2` are considered low. | + * @param params.numClasses + * Indicates the number of classes by which to break up the values of each field. More classes give you more detail, but more colors, making the visualization more difficult to understand. There are only three possible values. + * + * 2 classes | 3 classes | 4 classes + * --|--|--- + * ![relationship-breaks-2](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-2.png) | ![relationship-breaks-3](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-3.png) | ![relationship-breaks-4](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-4.png) + * + * **Possible Values:** 2 | 3 | 4 + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. + * @param params.legendOptions Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. + * @param params.relationshipScheme In authoring apps, the user may select a pre-defined relationship scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value or that fall outside of the prescribed class breaks. + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + */ + createRenderer(params: relationshipCreateRendererParams): IPromise; + } + + export const relationship: relationship; + + + export interface relationshipCreateRendererParams extends Object { + /** + * The layer for which the visualization is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + layer: FeatureLayer | SceneLayer | CSVLayer; + /** + * The view instance in which the visualization will be rendered. + * + * [Read more...](global.html) + */ + view: View; + /** + * A numeric field that will be used to explore its relationship with `field2`. In the default visualization, the values of this field are rendered along the vertical axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + field1: relationshipCreateRendererParamsField1; + /** + * A numeric field that will be used to explore its relationship with `field1`. In the default visualization, the values of this field are rendered along the horizontal axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + field2: relationshipCreateRendererParamsField2; + /** + * The method for classifying each field's data values. See [classBreaks](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) for more information about each classification type. **Possible Values:** quantile | equal-interval | natural-breaks + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + * + * @default quantile + */ + classificationMethod?: string; + /** + * Determines the orientation of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This value does not change the renderer or symbology of any features in the layer. This affects the legend only. See the table below for a description of the possible values. See the class description at the top of this page for a more thorough explanation of how to read the legend. + * + * Value | Example | Description + * ------|-------------|-------- + * null | ![relationship-legend-null](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-null.png) | The legend renders as a square. The top right corner of the legend indicates that values from both `field1` and `field2` are considered high. | + * HH | ![relationship-legend-hh](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-hh.png) | The legend renders as a diamond with the focus on the top corner where values from both `field1` and `field2` are considered high. | + * HL | ![relationship-legend-hl](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-hl.png) | The legend renders as a diamond with the focus on the top corner where values from `field1` are high and values from `field2` are low. | + * LH | ![relationship-legend-lh](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-lh.png) | The legend renders as a diamond with the focus on the top corner where values from `field1` are low and values from `field2` are high. | + * LL | ![relationship-legend-ll](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-ll.png) | The legend renders as a diamond with the focus on the top corner where values from both `field1` and `field2` are considered low. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + focus?: string; + /** + * Indicates the number of classes by which to break up the values of each field. More classes give you more detail, but more colors, making the visualization more difficult to understand. There are only three possible values. + * + * 2 classes | 3 classes | 4 classes + * --|--|--- + * ![relationship-breaks-2](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-2.png) | ![relationship-breaks-3](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-3.png) | ![relationship-breaks-4](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-4.png) + * + * **Possible Values:** 2 | 3 | 4 + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + * + * @default 3 + */ + numClasses?: number; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + * + * @default gray + */ + basemap?: string | Basemap; + /** + * Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + legendOptions?: relationshipCreateRendererParamsLegendOptions; + /** + * In authoring apps, the user may select a pre-defined relationship scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + relationshipScheme?: RelationshipScheme; + /** + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + * + * @default 2d + */ + symbolType?: string; + /** + * Enables the `defaultSymbol` on the renderer and assigns it to features with no value or that fall outside of the prescribed class breaks. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + * + * @default true + */ + defaultSymbolEnabled?: boolean; + /** + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + * + * @default replace + */ + colorMixMode?: string; + } + + + export interface relationshipCreateRendererParamsField1 extends Object { + /** + * The name of a numeric field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + field: string; + /** + * The name of a numeric field used to normalize the given `field`. In choropleth visualizations it is best practice to normalize your data values if they haven't already been normalized. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + normalizationField?: string; + /** + * The maximum bound of values to visualize in the given field. If a feature's value is greater than this value, then it will be assigned the default symbol of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + maxValue?: number; + /** + * The minimum bound of values to visualize in the given field. If a feature's value is less than this value, then it will be assigned the default symbol of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + minValue?: number; + } + + + export interface relationshipCreateRendererParamsField2 extends Object { + /** + * The name of a numeric field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + field: string; + /** + * The name of a numeric field used to normalize the given `field`. In choropleth visualizations it is best practice to normalize your data values if they haven't already been normalized. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + normalizationField?: string; + /** + * The maximum bound of values to visualize in the given field. If a feature's value is greater than this value, then it will be assigned the default symbol of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + maxValue?: number; + /** + * The minimum bound of values to visualize in the given field. If a feature's value is less than this value, then it will be assigned the default symbol of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + minValue?: number; + } + + + export interface relationshipCreateRendererParamsLegendOptions extends Object { + /** + * The title used to describe the renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + title?: string; + /** + * Indicates whether to include the renderer in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) + */ + showLegend?: boolean; + } + + /** + * The result object of the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) + */ + export interface relationshipRendererResult extends Object { + /** + * The renderer object representing the relationship visualization. Set this on a layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) + */ + renderer: UniqueValueRenderer; + /** + * Describes each class break for both fields considered in the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) + */ + classBreaks: RendererResultClassBreaks; + /** + * Describes each container or bin used in the visualization. Each unique value info object describes a class break for `field1` and `field2`. Therefore, features with the same color fall share will have values that fall in the same class break for `field1` and the same class break for `field2`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) + */ + uniqueValueInfos: UniqueValueInfo[]; + /** + * The relationship scheme used by the renderer based on the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) + */ + relationshipScheme: RelationshipScheme; + /** + * The ID of the basemap used to determine the optimal fill colors of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) + */ + basemapId: string; + } + + + export interface RendererResultClassBreaks extends Object { + /** + * The class breaks generated for values in the `field1` parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) + */ + field1: ClassBreaksResult; + /** + * The class breaks generated for values in the `field2` parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) + */ + field2: ClassBreaksResult; + } + /** * This object contains helper methods for generating data-driven visualizations with continuous size or class breaks based on a field value or expression from features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The methods in this module generate renderer or visual variable objects that may be applied directly to a supported layer. The renderers specify how features should be visualized based on data values and sizes optimized based on the indicated basemap. * @@ -20493,7 +21236,34 @@ declare namespace __esri { */ interface size { /** - * Generates a [ClassBreaksRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html) that may be applied directly to the layer used to call this method. The resulting renderer defines the symbol size of each feature based on the value of the given `field` value. A default size scheme is determined based on the given `basemap`. Depending on the `classificationMethod`, class breaks (or data ranges) are generated based on the statistics of the data. Each feature is assigned a color based on the class break in which the value of the `field` falls. In most cases you will provide a `layer`, `basemap`, `field`, and `classificationMethod` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what sizes to use in the visualization. You can also use a `valueExpression` instead of a `field` to visualize features based on a value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. + * Generates a continuous size [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) representing the age of features based on one or more fields. The age of a feature is calculated based on a given `startTime` and `endTime`, one of which must be a date field in the input `layer`. This method generates an Arcade expression and calculates statistics on the output of the expression to accomplish this. The resulting renderer contains a continuous size visual variable that maps optimal sizes based on the indicated basemap to data values based on the resulting statistics of the expression. You are required to provide a `layer`, `view`, `startTime`, and `endTime` to generate this renderer. Optionally, you can set a `unit` for the visualization. Other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the statistics object to the `statistics` parameter to avoid making an extra call to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) + * + * @param params Input parameters for generating a continuous size visualization of age for time data returned from start and/or end date field(s). See the table below for details of each parameter. + * @param params.layer The layer for which the visualization is generated. + * @param params.view The view instance in which the visualization will be rendered. + * @param params.startTime The name of the field, or a date value representing the start time in the age calculation. If a date value is specified, then the `endTime` paramter must reference a Date field in the layer. + * @param params.endTime The name of the field, or a date value representing the end time in the age calculation. If a date value is specified, then the `startTime` paramter must reference a Date field in the layer. + * @param params.unit The time unit used to calculate the difference between `endTime` and `startTime`. If a unit is not specified, then a suggested unit is determined based on the spread and distribution of the data. **Possible Values:** years | months | days | hours | minutes | seconds + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. + * @param params.legendOptions Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. + * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. The `createAgeRenderer()` method generates an Arcade expression and executes a statistics query against the layer for the result of the expression. If statistics for the expression have already been generated, then pass the object here to avoid making a second statistics query. + * @param params.sizeScheme In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value. + * + */ + createAgeRenderer(params: sizeCreateAgeRendererParams): IPromise; + /** + * Generates a [ClassBreaksRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html) that may be applied directly to the layer used to call this method. The resulting renderer defines the symbol size of each feature based on the value of the given `field` value. A default size scheme is determined based on the given `basemap`. Depending on the `classificationMethod`, class breaks (or data ranges) are generated based on the statistics of the data. Each feature is assigned a size based on the class break in which the value of the `field` falls. In most cases you will provide a `layer`, `basemap`, `field`, and `classificationMethod` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what sizes to use in the visualization. You can also use a `valueExpression` instead of a `field` to visualize features based on a value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) * @@ -20526,7 +21296,7 @@ declare namespace __esri { * @param params.sizeScheme In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @param params.valueExpressionTitle Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * @param params.sqlExpression A SQL expression evaluating to a number. This parameter is only supported for service-based FeatureLayers. + * @param params.sqlExpression A SQL expression evaluating to a number. * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.legendOptions Provides options for setting a title to describe a field instead of using the field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @param params.minValue A minimum value set by the user. Use this in conjunction with `maxValue` to generate class breaks between lower and upper bounds. This will be the lower bound of the lowest class break. @@ -20546,7 +21316,7 @@ declare namespace __esri { */ createClassBreaksRenderer(params: sizeCreateClassBreaksRendererParams): IPromise; /** - * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to the layer used to call this method. The renderer contains a continuous size visual variable that maps marker sizes to specific stop values based on queried statistics from the indicated field or expression. In most cases you will provide a `layer`, `basemap`, and `field` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what colors to use in the visualization. You can also use a `valueExpression` instead of a `field` to visualize features based on a value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the statistics object to the `statistics` parameter to avoid making an extra call to the server. + * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to the layer used to call this method. The renderer contains a continuous size visual variable that maps marker sizes to specific stop values based on queried statistics from the indicated field or expression. In most cases you will provide a `layer`, `basemap`, and `field` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what sizes to use in the visualization. You can also use a `valueExpression` instead of a `field` to visualize features based on a value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the statistics object to the `statistics` parameter to avoid making an extra call to the server. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) * @@ -20558,7 +21328,7 @@ declare namespace __esri { * @param params.sizeScheme In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @param params.valueExpressionTitle Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * @param params.sqlExpression A SQL expression evaluating to a number. This parameter is only supported for service-based FeatureLayers. + * @param params.sqlExpression A SQL expression evaluating to a number. * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.legendOptions Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. @@ -20579,7 +21349,7 @@ declare namespace __esri { */ createContinuousRenderer(params: sizeCreateContinuousRendererParams): IPromise; /** - * This method generates an array of size visual variables with default stops that are optimally chosen based on the statistics queried for the indicated field or expression and mapped to appropriate sizes. There are two different ways this method may be called. The most common case is by providing a `layer`, `basemap`, and `field`. This is the scenario where the statistics of the data aren't well known and the user doesn't know what colors to use. You can optionally use a `valueExpression` instead of a field to visualize features based on a numeric value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the object in the `statistics` parameter to avoid making an extra call to the server. You can also provide a `colorScheme` if you don't want one picked for you. In this case the `basemap` and `theme` options would be ignored. The resulting array of visual variables will contain exactly one size visual variable unless the `axis` parameter is set to "height". + * This method generates an array of size visual variables with default stops that are optimally chosen based on the statistics queried for the indicated field or expression and mapped to appropriate sizes. There are two different ways this method may be called. The most common case is by providing a `layer`, `basemap`, and `field`. This is the scenario where the statistics of the data aren't well known and the user doesn't know what sizes to use. You can optionally use a `valueExpression` instead of a field to visualize features based on a numeric value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the object in the `statistics` parameter to avoid making an extra call to the server. You can also provide a `sizeScheme` if you don't want one picked for you. In this case the `basemap` and `theme` options would be ignored. The resulting array of visual variables will contain exactly one size visual variable unless the `axis` parameter is set to "height". * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) * @@ -20591,7 +21361,7 @@ declare namespace __esri { * @param params.sizeScheme In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @param params.valueExpressionTitle Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * @param params.sqlExpression A SQL expression evaluating to a number. This parameter is only supported for service-based FeatureLayers. + * @param params.sqlExpression A SQL expression evaluating to a number. * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.legendOptions Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. @@ -20607,6 +21377,56 @@ declare namespace __esri { export const size: size; + /** + * The result object of the [createAgeRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) + */ + export interface sizeAgeRendererResult extends Object { + /** + * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) + */ + renderer: ClassBreaksRenderer; + /** + * Size visual variables configured based on the statistics of the data and the given basemap and scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) + */ + visualVariables: SizeVisualVariable[]; + /** + * The time unit used to represent age in the output `renderer`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) + */ + unit: string; + /** + * The size scheme used by the visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) + */ + sizeScheme: SizeScheme; + /** + * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) + */ + defaultValuesUsed: boolean; + /** + * Basic statistics returned from a query for the generated expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) + */ + statistics: SummaryStatisticsResult; + /** + * The ID of the basemap used to determine the optimal fill color of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) + */ + basemapId: string; + } + /** * The result object of the [createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) method. See the table below for details of each property. * @@ -20630,7 +21450,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) */ - sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + sizeScheme: SizeScheme; /** * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. * @@ -20668,7 +21488,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) */ - sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + sizeScheme: SizeScheme; /** * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. * @@ -20690,6 +21510,105 @@ declare namespace __esri { } + export interface sizeCreateAgeRendererParams extends Object { + /** + * The layer for which the visualization is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) + */ + layer: FeatureLayer | SceneLayer | CSVLayer; + /** + * The view instance in which the visualization will be rendered. + * + * [Read more...](global.html) + */ + view: View; + /** + * The name of the field, or a date value representing the start time in the age calculation. If a date value is specified, then the `endTime` paramter must reference a Date field in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) + */ + startTime: Date | string | number; + /** + * The name of the field, or a date value representing the end time in the age calculation. If a date value is specified, then the `startTime` paramter must reference a Date field in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) + */ + endTime: Date | string | number; + /** + * The time unit used to calculate the difference between `endTime` and `startTime`. If a unit is not specified, then a suggested unit is determined based on the spread and distribution of the data. **Possible Values:** years | months | days | hours | minutes | seconds + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) + */ + unit?: string; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) + * + * @default gray + */ + basemap?: string | Basemap; + /** + * Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) + */ + legendOptions?: sizeCreateAgeRendererParamsLegendOptions; + /** + * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. The `createAgeRenderer()` method generates an Arcade expression and executes a statistics query against the layer for the result of the expression. If statistics for the expression have already been generated, then pass the object here to avoid making a second statistics query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) + */ + statistics?: SummaryStatisticsResult; + /** + * In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) + */ + sizeScheme?: SizeScheme; + /** + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) + * + * @default 2d + */ + symbolType?: string; + /** + * Enables the `defaultSymbol` on the renderer and assigns it to features with no value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) + * + * @default true + */ + defaultSymbolEnabled?: boolean; + } + + + export interface sizeCreateAgeRendererParamsLegendOptions extends Object { + /** + * The title used to represent the age size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) + */ + title?: string; + /** + * Indicates whether to include the age renderer in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) + */ + showLegend?: boolean; + } + + export interface sizeCreateClassBreaksRendererParams extends Object { /** * The layer for which the visualization is generated. @@ -20774,7 +21693,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ - sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + sizeScheme?: SizeScheme; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @@ -20788,7 +21707,7 @@ declare namespace __esri { */ valueExpressionTitle?: string; /** - * A SQL expression evaluating to a number. This parameter is only supported for service-based FeatureLayers. + * A SQL expression evaluating to a number. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ @@ -20892,7 +21811,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ - sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + sizeScheme?: SizeScheme; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @@ -20906,7 +21825,7 @@ declare namespace __esri { */ valueExpressionTitle?: string; /** - * A SQL expression evaluating to a number. This parameter is only supported for service-based FeatureLayers. + * A SQL expression evaluating to a number. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ @@ -21022,7 +21941,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ - sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + sizeScheme?: SizeScheme; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @@ -21036,7 +21955,7 @@ declare namespace __esri { */ valueExpressionTitle?: string; /** - * A SQL expression evaluating to a number. This parameter is only supported for service-based FeatureLayers. + * A SQL expression evaluating to a number. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ @@ -21090,7 +22009,7 @@ declare namespace __esri { * * @default all */ - axis?: boolean; + axis?: string; } @@ -21126,7 +22045,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) */ - sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + sizeScheme: SizeScheme; /** * Indicates whether default values were used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. * @@ -21255,7 +22174,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) */ - uniqueValueInfos: RendererResultUniqueValueInfos[]; + uniqueValueInfos: UniqueValueInfo[]; /** * An array of objects describing the values or categories excluded from consideration in visualizing data from the given field. The specification of each object matches that of the objects specified in the `uniqueValueInfos` property. * @@ -21267,7 +22186,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) */ - typeScheme: PointTypeScheme | PolylineTypeScheme | PolygonTypeScheme | MeshTypeScheme; + typeScheme: TypeScheme; /** * The ID of the basemap used to determine the optimal color scheme to represent the categorical variable. * @@ -21311,7 +22230,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) */ - typeScheme?: PointTypeScheme; + typeScheme?: TypeSchemeForPoint; /** * A statistics object generated from the [uniqueValues](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. * @@ -21371,7 +22290,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ - typeScheme?: PointTypeScheme | PolylineTypeScheme | PolygonTypeScheme | MeshTypeScheme; + typeScheme?: TypeScheme; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number or a string. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @@ -21451,30 +22370,34 @@ declare namespace __esri { title: string; } - - export interface RendererResultUniqueValueInfos extends Object { + /** + * Describes the symbol, label, and value of a unique value generated by the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#UniqueValueInfo) + */ + export interface UniqueValueInfo extends Object { /** - * A unique value representing a type or category of features in the layer. + * A unique value representing a type or category of features in a layer. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#UniqueValueInfo) */ value: string | number; /** - * The number of features assigned the given `value` (or belonging to the given category). + * The number of features with the given `value` (or belonging to the given category). * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#UniqueValueInfo) */ count: number; /** * The label describing the value or category in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#UniqueValueInfo) */ label: string; /** * The symbol used to represent features belonging to the given category. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#UniqueValueInfo) */ symbol: Symbol; } @@ -21497,7 +22420,7 @@ declare namespace __esri { * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @param params.valueExpressionTitle Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * @param params.sqlExpression A SQL expression evaluating to a number. This parameter is only supported for service-based FeatureLayers. + * @param params.sqlExpression A SQL expression evaluating to a number. * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. * @param params.minValue A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned visual variables. @@ -21530,7 +22453,7 @@ declare namespace __esri { * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @param params.valueExpressionTitle Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * @param params.sqlExpression A SQL expression evaluating to a number. This parameter is only supported for service based FeatureLayers. + * @param params.sqlExpression A SQL expression evaluating to a number. * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. * @param params.minValue A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned visual variables. @@ -21631,7 +22554,7 @@ declare namespace __esri { */ valueExpressionTitle?: string; /** - * A SQL expression evaluating to a number. This parameter is only supported for service-based FeatureLayers. + * A SQL expression evaluating to a number. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ @@ -21709,10 +22632,10 @@ declare namespace __esri { * * | Value | Description | Example | * | ----- | ----------- | ------- | - * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | - * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | - * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | - * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) @@ -21749,7 +22672,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ - sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + sizeScheme?: SizeScheme; /** * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @@ -21809,7 +22732,7 @@ declare namespace __esri { */ valueExpressionTitle?: string; /** - * A SQL expression evaluating to a number. This parameter is only supported for service based FeatureLayers. + * A SQL expression evaluating to a number. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ @@ -21871,10 +22794,10 @@ declare namespace __esri { * * | Value | Description | Example | * | ----- | ----------- | ------- | - * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | - * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | - * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | - * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) @@ -21919,7 +22842,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ - sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + sizeScheme?: SizeScheme; /** * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @@ -22011,7 +22934,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ - sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + sizeScheme: SizeScheme; } @@ -22043,7 +22966,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ - sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + sizeScheme: SizeScheme; } /** @@ -22075,7 +22998,7 @@ declare namespace __esri { * @param params.maxValue The maximum bounding value for the class breaks definition. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. * @param params.numClasses Indicates the number of classes to generate for the class breaks definition. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * @param params.sqlExpression A SQL expression evaluating to a number. This parameter only applies to service-based FeatureLayers. + * @param params.sqlExpression A SQL expression evaluating to a number. * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.view A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. * @param params.features A subset of features for which to generate the class breaks. @@ -22153,7 +23076,7 @@ declare namespace __esri { */ valueExpression?: string; /** - * A SQL expression evaluating to a number. This parameter only applies to service-based FeatureLayers. + * A SQL expression evaluating to a number. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ @@ -22261,7 +23184,7 @@ declare namespace __esri { * @param params.maxValue The maximum bounding value for the histogram. Use this in conjunction with `minValue` to generate a histogram between custom lower and upper bounds. * @param params.numBins Indicates the number of classes to generate for the histogram. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * @param params.sqlExpression A SQL expression evaluating to a number. This parameter only applies to service-based FeatureLayers. + * @param params.sqlExpression A SQL expression evaluating to a number. * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.view A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. * @param params.features A subset of features for which to generate the histogram. @@ -22341,7 +23264,7 @@ declare namespace __esri { */ valueExpression?: string; /** - * A SQL expression evaluating to a number. This parameter only applies to service-based FeatureLayers. + * A SQL expression evaluating to a number. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ @@ -22429,7 +23352,7 @@ declare namespace __esri { * @param params.layer The layer from which to generate statistics for the given `field`. * @param params.field The name of the numeric field for which the summary statistics will be generated. This property is ignored if a `valueExpression` is used. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * @param params.sqlExpression A SQL expression evaluating to a number. This parameter only applies to service-based FeatureLayers. + * @param params.sqlExpression A SQL expression evaluating to a number. * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.normalizationField The field by which to normalize the values returned from the given `field`. * @param params.minValue The minimum bounding value for the statistics calculation. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. @@ -22516,7 +23439,7 @@ declare namespace __esri { */ valueExpression?: string; /** - * A SQL expression evaluating to a number. This parameter only applies to service-based FeatureLayers. + * A SQL expression evaluating to a number. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ @@ -22574,7 +23497,7 @@ declare namespace __esri { * @param params.layer The layer from which to query for unique values. * @param params.field The name of the numeric or string field from which the unique values will be obtained. This property is ignored if a `valueExpression` is used. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number or string. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * @param params.sqlExpression A SQL expression evaluating to a number or string. This parameter only applies to service-based FeatureLayers. + * @param params.sqlExpression A SQL expression evaluating to a number or string. * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.returnAllCodedValues Indicates that all domain codes should be returned if the given field has domain values. * @param params.view A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. @@ -22595,7 +23518,7 @@ declare namespace __esri { */ export interface UniqueValuesResult extends Object { /** - * An array of objects, each containing a unique value/type/category present in the field specifed in the [uniqueValues()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) query. See table below for the specification of each object. + * An array of objects, each containing a unique value/type/category present in the field specified in the [uniqueValues()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) query. See table below for the specification of each object. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#UniqueValuesResult) */ @@ -22623,7 +23546,7 @@ declare namespace __esri { */ valueExpression?: string; /** - * A SQL expression evaluating to a number or string. This parameter only applies to service-based FeatureLayers. + * A SQL expression evaluating to a number or string. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ @@ -22690,6 +23613,19 @@ declare namespace __esri { * */ flipColors(scheme: ColorScheme): ColorScheme; + /** + * Returns all schemes matching the given color ramp. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getMatchingSchemes) + * + * @param theme The name of the theme from which to get color schemes. + * @param colors An array of colors used to match with schemes for the given theme. + * @param geometryType The geometry type of the layer for which the color scheme will be applied. + * @param worldScale Indicates whether 3D volumetric symbols will be used in the visualization. + * @param view The [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance used to calculate the suggested sizes of the symbols. This is required for 3D visualizations. + * + */ + getMatchingSchemes(theme: string, colors: Color[], geometryType: string, worldScale?: boolean, view?: SceneView): ColorScheme[]; /** * Returns a primary scheme and secondary schemes defining symbol properties for data-driven color visualizions in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). The `basemap` parameter determines the color schemes of the graphics used to visualize each feature. The `geometryType` determines which type of symbol to return. * @@ -22703,15 +23639,15 @@ declare namespace __esri { * * | Value | Description | Example | * | ----- | ----------- | ------- | - * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | - * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | - * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | - * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. * */ - getSchemes(params: colorGetSchemesParams): any; + getSchemes(params: colorGetSchemesParams): ColorSchemes; /** * Returns metadata for the available themes. If a `basemap` is provided, returns themes that look best with the given basemap. * @@ -22744,10 +23680,10 @@ declare namespace __esri { * * | Value | Description | Example | * | ----- | ----------- | ------- | - * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | - * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | - * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | - * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) @@ -22772,11 +23708,18 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) */ - export interface ColorScheme extends Object { + export type ColorScheme = ColorSchemeForPoint | ColorSchemeForPolyline | ColorSchemeForPolygon | ColorSchemeForMesh; + + /** + * Properties defining the symbology scheme used to visualize mesh features with attribute data-driven color. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) + */ + export interface ColorSchemeForMesh extends Object { /** * The unique id of the color scheme to usee in the visualization. The id is assigned based on the following template: `//`. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ id: string; /** @@ -22784,92 +23727,344 @@ declare namespace __esri { * * | Value | Description | Example | * | ----- | ----------- | ------- | - * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | - * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | - * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | - * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | * * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ theme: string; /** * The continuous color ramp that will be applied to the visualization. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ colors: Color[]; /** * The color of the symbol used to indicate features with no data and features that are out of range. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ noDataColor: Color; /** * Predefined classed color schemes to use for the visualization. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ - colorsForClassBreaks: ColorSchemeColorsForClassBreaks[]; + colorsForClassBreaks: ColorSchemeForMeshColorsForClassBreaks[]; + /** + * The opacity of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) + */ + opacity: number; + } + + /** + * Properties defining the symbology scheme used to visualize point features with attribute data-driven color. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) + */ + export interface ColorSchemeForPoint extends Object { + /** + * The unique id of the color scheme to usee in the visualization. The id is assigned based on the following template: `//`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) + */ + id: string; + /** + * Indicates which values will be emphasized in the continuous ramp and the map. Possible values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) + */ + theme: string; + /** + * The continuous color ramp that will be applied to the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) + */ + colors: Color[]; + /** + * The color of the symbol used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) + */ + noDataColor: Color; + /** + * Predefined classed color schemes to use for the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) + */ + colorsForClassBreaks: ColorSchemeForPointColorsForClassBreaks[]; /** * Properties for defining the outline of the symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ - outline: ColorSchemeOutline; + outline: ColorSchemeForPointOutline; /** - * The default size of the symbol in pixels or points if the geometry type is `point`. + * The default size of the symbol in pixels or points. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ size: number; /** - * The default width of the symbol in pixels or points if the geometry type is `polyline`. + * The opacity of the symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) + */ + opacity: number; + } + + /** + * Properties defining the symbology scheme used to visualize polygon features with attribute data-driven color. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) + */ + export interface ColorSchemeForPolygon extends Object { + /** + * The unique id of the color scheme to usee in the visualization. The id is assigned based on the following template: `//`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) + */ + id: string; + /** + * Indicates which values will be emphasized in the continuous ramp and the map. Possible values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) + */ + theme: string; + /** + * The continuous color ramp that will be applied to the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) + */ + colors: Color[]; + /** + * The color of the symbol used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) + */ + noDataColor: Color; + /** + * Predefined classed color schemes to use for the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) + */ + colorsForClassBreaks: ColorSchemeForPolygonColorsForClassBreaks[]; + /** + * Properties for defining the outline of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) + */ + outline: ColorSchemeForPolygonOutline; + /** + * The opacity of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) + */ + opacity: number; + } + + /** + * Properties defining the symbology scheme used to visualize polyline features with attribute data-driven color. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) + */ + export interface ColorSchemeForPolyline extends Object { + /** + * The unique id of the color scheme to usee in the visualization. The id is assigned based on the following template: `//`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) + */ + id: string; + /** + * Indicates which values will be emphasized in the continuous ramp and the map. Possible values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) + */ + theme: string; + /** + * The continuous color ramp that will be applied to the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) + */ + colors: Color[]; + /** + * The color of the symbol used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) + */ + noDataColor: Color; + /** + * Predefined classed color schemes to use for the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) + */ + colorsForClassBreaks: ColorSchemeForPolylineColorsForClassBreaks[]; + /** + * The default width of the symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) */ width: number; /** * The opacity of the symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) */ opacity: number; } + /** + * The return object of the [getSchemes()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemes) + */ + export interface ColorSchemes extends Object { + /** + * The color scheme best suited for the given basemap and geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemes) + */ + primaryScheme: ColorScheme; + /** + * Additional color schemes that may be used to visualize data of the given geometry type overlaid on the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemes) + */ + secondarySchemes: ColorScheme[]; + /** + * The ID of the basemap associated with the given schemes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemes) + */ + basemapId: string; + } - export interface ColorSchemeColorsForClassBreaks extends Object { + + export interface ColorSchemeForMeshColorsForClassBreaks extends Object { /** * An array of hex color strings. Each color is assigned to a specific break in classed color visualizations. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ colors: Color[]; /** * The number of classes used in the classed color visualization. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ numClasses: number; } - export interface ColorSchemeOutline extends Object { + export interface ColorSchemeForPointColorsForClassBreaks extends Object { + /** + * An array of hex color strings. Each color is assigned to a specific break in classed color visualizations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) + */ + colors: Color[]; + /** + * The number of classes used in the classed color visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) + */ + numClasses: number; + } + + + export interface ColorSchemeForPointOutline extends Object { /** * The outline color of the symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ color: Color; /** * The width of the symbol in pixels or points. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ width: number; } + export interface ColorSchemeForPolygonColorsForClassBreaks extends Object { + /** + * An array of hex color strings. Each color is assigned to a specific break in classed color visualizations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) + */ + colors: Color[]; + /** + * The number of classes used in the classed color visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) + */ + numClasses: number; + } + + + export interface ColorSchemeForPolygonOutline extends Object { + /** + * The outline color of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) + */ + color: Color; + /** + * The width of the symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) + */ + width: number; + } + + + export interface ColorSchemeForPolylineColorsForClassBreaks extends Object { + /** + * An array of hex color strings. Each color is assigned to a specific break in classed color visualizations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) + */ + colors: Color[]; + /** + * The number of classes used in the classed color visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) + */ + numClasses: number; + } + + interface symbologyLocation { /** * Clones a location scheme object. @@ -22879,7 +24074,7 @@ declare namespace __esri { * @param scheme The location scheme object to clone. * */ - cloneScheme(scheme: PointLocationScheme | PolylineLocationScheme | PolygonLocationScheme): PointLocationScheme | PolylineLocationScheme | PolygonLocationScheme; + cloneScheme(scheme: LocationScheme): LocationScheme; /** * Returns a primary scheme and secondary schemes defining symbol properties for location-only visualizions in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html). The `basemap` parameter determines the color of the graphics used to visualize each feature. The `geometryType` determines which type of symbol to return. * @@ -22892,7 +24087,7 @@ declare namespace __esri { * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. * */ - getSchemes(params: locationGetSchemesParams): any; + getSchemes(params: locationGetSchemesParams): LocationSchemes; } export const symbologyLocation: symbologyLocation; @@ -22926,59 +24121,86 @@ declare namespace __esri { } /** - * Properties defining the location-only symbology scheme used to visualize point features. + * Defines the symbology scheme used to visualize default location-based symbols depending on the layer's geometry type. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationScheme) */ - export interface PointLocationScheme extends Object { + export type LocationScheme = LocationSchemeForPoint | LocationSchemeForPolyline | LocationSchemeForPolygon | LocationSchemeForMesh; + + /** + * Properties defining the location-only symbology scheme used to visualize mesh features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForMesh) + */ + export interface LocationSchemeForMesh extends Object { /** - * The fill color of the marker symbol. + * The color of the fill symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForMesh) */ color: Color; /** - * Properties for defining the outline of the marker symbol. + * The opacity of the fill symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) - */ - outline: PointLocationSchemeOutline; - /** - * The size of the marker symbol in pixels or points. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) - */ - size: number; - /** - * The opacity of the marker symbol. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForMesh) */ opacity: number; } /** - * Properties defining the location-only symbology scheme used to visualize polygon features driven by attribute data. + * Properties defining the location-only symbology scheme used to visualize point features. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolygonLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) */ - export interface PolygonLocationScheme extends Object { + export interface LocationSchemeForPoint extends Object { + /** + * The fill color of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) + */ + color: Color; + /** + * Properties for defining the outline of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) + */ + outline: LocationSchemeForPointOutline; + /** + * The size of the marker symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) + */ + size: number; + /** + * The opacity of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) + */ + opacity: number; + } + + /** + * Properties defining the location-only symbology scheme used to visualize polygon features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolygon) + */ + export interface LocationSchemeForPolygon extends Object { /** * The color of the fill symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolygonLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolygon) */ color: Color; /** * Properties for defining the outline of the fill symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolygonLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolygon) */ - outline: PolygonLocationSchemeOutline; + outline: LocationSchemeForPolygonOutline; /** * The opacity of the fill symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolygonLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolygon) */ opacity: number; } @@ -22986,62 +24208,711 @@ declare namespace __esri { /** * Properties defining the location-only symbology scheme used to visualize polyline features. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolylineLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolyline) */ - export interface PolylineLocationScheme extends Object { + export interface LocationSchemeForPolyline extends Object { /** * The color of the line symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolylineLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolyline) */ color: Color; /** * The width of the line symbol in pixels or points. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolylineLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolyline) */ width: number; /** * The opacity of the line symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolylineLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolyline) */ opacity: number; } + /** + * The return object of the [getSchemes()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemes) + */ + export interface LocationSchemes extends Object { + /** + * The location scheme best suited for the given basemap and geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemes) + */ + primaryScheme: LocationScheme; + /** + * Additional location schemes that may be used to visualize data of the given geometry type overlaid on the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemes) + */ + secondarySchemes: LocationScheme[]; + /** + * The ID of the basemap associated with the given schemes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemes) + */ + basemapId: string; + } - export interface PointLocationSchemeOutline extends Object { + + export interface LocationSchemeForPointOutline extends Object { /** * The outline color of the marker symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) */ color: Color; /** * The width of the marker symbol in pixels or points. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) */ width: number; } - export interface PolygonLocationSchemeOutline extends Object { + export interface LocationSchemeForPolygonOutline extends Object { /** * The outline color of the fill symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolygonLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolygon) */ color: Color; /** * The width of the fill symbol in pixels or points. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolygonLocationScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolygon) */ width: number; } + interface symbologyPredominance { + /** + * Clones a predominance scheme object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#cloneScheme) + * + * @param scheme The predominance scheme object to clone. + * + */ + cloneScheme(scheme: PredominanceScheme): PredominanceScheme; + /** + * Returns a primary scheme and secondary schemes defining symbol properties for predominance-based data-driven visualizations in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The `basemap` parameter determines the color of the symbols used to visualize each feature. The `geometryType` determines which type of symbol to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) + * + * @param params See the table below for details of each parameter that may be passed to this function. + * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features with the given basemap. + * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh + * @param params.numColors The number of unique values to include in the predominance visualization. + * @param params.theme Determines which set of primary and secondary color schemes to return **Possible Values:** default + * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. + * + */ + getSchemes(params: predominanceGetSchemesParams): PredominanceSchemes; + } + + export const symbologyPredominance: symbologyPredominance; + + + export interface predominanceGetSchemesParams extends Object { + /** + * The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features with the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) + */ + basemap: string | Basemap; + /** + * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) + */ + geometryType: string; + /** + * The number of unique values to include in the predominance visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) + */ + numColors: number; + /** + * Determines which set of primary and secondary color schemes to return **Possible Values:** default + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) + * + * @default default + */ + theme?: string; + /** + * Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) + */ + worldScale?: boolean; + /** + * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. + * + * [Read more...](global.html) + */ + view?: SceneView; + } + + /** + * Defines the symbology scheme used to visualize predominance based on the layer's geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceScheme) + */ + export type PredominanceScheme = PredominanceSchemeForPoint | PredominanceSchemeForPolyline | PredominanceSchemeForPolygon | PredominanceSchemeForMesh; + + /** + * Properties defining the symbology scheme used to visualize predominance for mesh features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForMesh) + */ + export interface PredominanceSchemeForMesh extends Object { + /** + * The fill colors of the mesh symbols used for each category. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForMesh) + */ + colors: Color[]; + /** + * The color of the fill symbol used to indicate features with no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForMesh) + */ + noDataColor: Color; + /** + * The opacity of the symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForMesh) + */ + opacity: number; + } + + /** + * Properties defining the symbology scheme used to visualize predominance for point features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) + */ + export interface PredominanceSchemeForPoint extends Object { + /** + * The fill colors of the point symbols used for each category. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) + */ + colors: Color[]; + /** + * The color of the point symbol used to indicate features with no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) + */ + noDataColor: Color; + /** + * Properties for defining the outline of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) + */ + outline: PredominanceSchemeForPointOutline; + /** + * The opacity of the point symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) + */ + opacity: number; + /** + * The scheme defining the size visual variable if included in a predominance visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) + */ + sizeScheme: SizeSchemeForPoint; + } + + /** + * Properties defining the symbology scheme used to visualize predominance for polygon features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) + */ + export interface PredominanceSchemeForPolygon extends Object { + /** + * The fill colors of the polygon symbols used for each category. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) + */ + colors: Color[]; + /** + * The color of the fill symbol used to indicate features with no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) + */ + noDataColor: Color; + /** + * Properties for defining the outline of the fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) + */ + outline: PredominanceSchemeForPolygonOutline; + /** + * The opacity of the symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) + */ + opacity: number; + /** + * The scheme defining the size visual variable if included in a predominance visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) + */ + sizeScheme: SizeSchemeForPolygon; + } + + /** + * Properties defining the symbology scheme used to visualize predominance for polyline features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolyline) + */ + export interface PredominanceSchemeForPolyline extends Object { + /** + * The colors of the line symbols used for each category. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolyline) + */ + colors: Color[]; + /** + * The color of the line symbol used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolyline) + */ + noDataColor: Color; + /** + * The default width of the line symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolyline) + */ + width: number; + /** + * The opacity of the line symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolyline) + */ + opacity: number; + /** + * The scheme defining the size visual variable if included in a predominance visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolyline) + */ + sizeScheme: SizeSchemeForPolyline; + } + + /** + * The return object of the [getSchemes()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemes) + */ + export interface PredominanceSchemes extends Object { + /** + * The predominance scheme best suited for the given basemap and geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemes) + */ + primaryScheme: PredominanceScheme; + /** + * Additional predominance schemes that may be used to visualize data of the given geometry type overlaid on the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemes) + */ + secondarySchemes: PredominanceScheme[]; + /** + * The ID of the basemap associated with the given schemes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemes) + */ + basemapId: string; + } + + + export interface PredominanceSchemeForPointOutline extends Object { + /** + * The outline color of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) + */ + color: Color; + /** + * The width of the marker symbol in points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) + */ + width: number; + } + + + export interface PredominanceSchemeForPolygonOutline extends Object { + /** + * The outline color of the fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) + */ + color: Color; + /** + * The width of the fill symbol's outline in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) + */ + width: number; + } + + + interface symbologyRelationship { + /** + * Clones a relationship (bivariate color) scheme object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#cloneScheme) + * + * @param scheme The relationship scheme object to clone. + * + */ + cloneScheme(scheme: RelationshipScheme): RelationshipScheme; + /** + * Returns a primary scheme and secondary schemes defining symbol properties for relationship-based (bivariate choropleth) data-driven visualizations in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The `basemap` parameter determines the color of the symbols used to visualize each feature. The `geometryType` determines which type of symbol to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#getSchemes) + * + * @param params See the table below for details of each parameter that may be passed to this function. + * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features with the given basemap. + * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh + * @param params.theme Determines which set of primary and secondary color schemes to return **Possible Values:** default + * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. + * + */ + getSchemes(params: relationshipGetSchemesParams): RelationshipSchemes; + } + + export const symbologyRelationship: symbologyRelationship; + + + export interface relationshipGetSchemesParams extends Object { + /** + * The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features with the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#getSchemes) + */ + basemap: string | Basemap; + /** + * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#getSchemes) + */ + geometryType: string; + /** + * Determines which set of primary and secondary color schemes to return **Possible Values:** default + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#getSchemes) + * + * @default default + */ + theme?: string; + /** + * Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#getSchemes) + */ + worldScale?: boolean; + /** + * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. + * + * [Read more...](global.html) + */ + view?: SceneView; + } + + /** + * Defines the symbology scheme used to visualize relationship renderers (bivariate color) based on the layer's geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipScheme) + */ + export type RelationshipScheme = RelationshipSchemeForPoint | RelationshipSchemeForPolyline | RelationshipSchemeForPolygon | RelationshipSchemeForMesh; + + /** + * Properties defining the symbology scheme used to visualize relationship renderers (bivariate color) for mesh features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) + */ + export interface RelationshipSchemeForMesh extends Object { + /** + * The ID uniquely identifying the color scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) + */ + id: string; + /** + * Defines the colors to use in each bin of the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) + */ + colorsForClassBreaks: RelationshipSchemeForMeshColorsForClassBreaks[]; + /** + * The color of the fill symbol used to indicate features with no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) + */ + noDataColor: Color; + /** + * The opacity of the fill symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) + */ + opacity: number; + } + + /** + * Properties defining the symbology scheme used to visualize relationship renderers (bivariate color) for point features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) + */ + export interface RelationshipSchemeForPoint extends Object { + /** + * The ID uniquely identifying the color scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) + */ + id: string; + /** + * Defines the colors to use in each bin of the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) + */ + colorsForClassBreaks: RelationshipSchemeForPointColorsForClassBreaks[]; + /** + * The color of the point symbol used to indicate features with no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) + */ + noDataColor: Color; + /** + * Properties for defining the outline of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) + */ + outline: RelationshipSchemeForPointOutline; + /** + * The opacity of the point symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) + */ + opacity: number; + /** + * The size of the point symbol in points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) + */ + size: number; + } + + /** + * Properties defining the symbology scheme used to visualize relationship renderers (bivariate color) for polygon features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) + */ + export interface RelationshipSchemeForPolygon extends Object { + /** + * The ID uniquely identifying the color scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) + */ + id: string; + /** + * Defines the colors to use in each bin of the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) + */ + colorsForClassBreaks: RelationshipSchemeForPolygonColorsForClassBreaks[]; + /** + * The color of the fill symbol used to indicate features with no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) + */ + noDataColor: Color; + /** + * Properties for defining the outline of the fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) + */ + outline: RelationshipSchemeForPolygonOutline; + /** + * The opacity of the fill symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) + */ + opacity: number; + } + + /** + * Properties defining the symbology scheme used to visualize relationship renderers (bivariate color) for polyline features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) + */ + export interface RelationshipSchemeForPolyline extends Object { + /** + * The ID uniquely identifying the color scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) + */ + id: string; + /** + * Defines the colors to use in each bin of the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) + */ + colorsForClassBreaks: RelationshipSchemeForPolylineColorsForClassBreaks[]; + /** + * The color of the line symbol used to indicate features with no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) + */ + noDataColor: Color; + /** + * The opacity of the line symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) + */ + opacity: number; + /** + * The width of the line symbol in points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) + */ + width: number; + } + + /** + * The return object of the [getSchemes()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#getSchemes) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemes) + */ + export interface RelationshipSchemes extends Object { + /** + * The relationship scheme best suited for the given basemap and geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemes) + */ + primaryScheme: RelationshipScheme; + /** + * Additional relationship schemes that may be used to visualize data of the given geometry type overlaid on the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemes) + */ + secondarySchemes: RelationshipScheme[]; + /** + * The ID of the basemap associated with the given schemes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemes) + */ + basemapId: string; + } + + + export interface RelationshipSchemeForMeshColorsForClassBreaks extends Object { + /** + * The colors of the fill symbols used for each bin in the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) + */ + colors: Color[][]; + /** + * The number of breaks (rows/columns) for each variable in the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) + */ + numClasses: number; + } + + + export interface RelationshipSchemeForPointColorsForClassBreaks extends Object { + /** + * The fill colors of the point symbols used for each bin in the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) + */ + colors: Color[][]; + /** + * The number of breaks (rows/columns) for each variable in the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) + */ + numClasses: number; + } + + + export interface RelationshipSchemeForPointOutline extends Object { + /** + * The outline color of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) + */ + color: Color; + /** + * The width of the outline in points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) + */ + width: number; + } + + + export interface RelationshipSchemeForPolygonColorsForClassBreaks extends Object { + /** + * The colors of the fill symbols used for each bin in the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) + */ + colors: Color[][]; + /** + * The number of breaks (rows/columns) for each variable in the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) + */ + numClasses: number; + } + + + export interface RelationshipSchemeForPolygonOutline extends Object { + /** + * The outline color of the fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) + */ + color: Color; + /** + * The width of the outline in points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) + */ + width: number; + } + + + export interface RelationshipSchemeForPolylineColorsForClassBreaks extends Object { + /** + * The colors of the line symbols used for each bin in the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) + */ + colors: Color[][]; + /** + * The number of breaks (rows/columns) for each variable in the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) + */ + numClasses: number; + } + + interface symbologySize { /** * Clones a size scheme object. @@ -23051,7 +24922,7 @@ declare namespace __esri { * @param scheme The SizeScheme object to clone. * */ - cloneScheme(scheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme): any; + cloneScheme(scheme: SizeScheme): SizeScheme; /** * Returns a primary scheme and secondary schemes defining symbol properties for size-based data-driven visualizions in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). The `basemap` parameter determines the color of the graphics used to visualize each feature. The `geometryType` determines which type of symbol to return. * @@ -23059,148 +24930,16 @@ declare namespace __esri { * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. - * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon + * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. * */ - getSchemes(params: sizeGetSchemesParams): any; + getSchemes(params: sizeGetSchemesParams): SizeSchemes; } export const symbologySize: symbologySize; - /** - * Properties defining the symbology scheme used to visualize point features driven by attribute data. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) - */ - export interface PointSizeScheme extends Object { - /** - * The fill color of the marker symbol. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) - */ - color: Color; - /** - * The color of the marker symbol used to indicate features with no data and features that are out of range. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) - */ - noDataColor: Color; - /** - * Properties for defining the outline of the marker symbol. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) - */ - outline: PointSizeSchemeOutline; - /** - * The default size of the marker symbol in pixels or points. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) - */ - size: number; - /** - * The size of the marker symbol (in pixels or points) used to indicate features with no data and features that are out of range. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) - */ - noDataSize: number; - /** - * The minimum size of a marker symbol in pixels or points representing features with low data values. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) - */ - minSize: number; - /** - * The maximum size of a marker symbol in pixels or points representing features with high data values. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) - */ - maxSize: number; - /** - * The opacity of the marker symbol. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) - */ - opacity: number; - } - - /** - * Properties defining the symbology scheme used to visualize polygon features driven by attribute data. When visualized by size, polygons are represented with marker symbols. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) - */ - export interface PolygonSizeScheme extends Object { - /** - * The scheme defining the symbology of the marker symbol used to represent polygon features by size. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) - */ - marker: PointSizeScheme; - /** - * The schema defining the backgound symbol of the feature. This is a fill symbol. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) - */ - background: PolygonSizeSchemeBackground; - /** - * The opacity of the symbol. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) - */ - opacity: number; - } - - /** - * Properties defining the symbology scheme used to visualize polyline features driven by attribute data. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) - */ - export interface PolylineSizeScheme extends Object { - /** - * The color of the line symbol. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) - */ - color: Color; - /** - * The color of the line symbol used to indicate features with no data and features that are out of range. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) - */ - noDataColor: Color; - /** - * The default width of the line symbol in pixels or points. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) - */ - width: number; - /** - * The width of the line symbol in pixels or points used to indicate features with no data and features that are out of range. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) - */ - noDataWidth: number; - /** - * The minimum width of a line symbol in pixels or points representing features with low data values. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) - */ - minWidth: number; - /** - * The maximum width of a line symbol in pixels or points representing features with high data values. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) - */ - maxWidth: number; - /** - * The opacity of the line symbol. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) - */ - opacity: number; - } - export interface sizeGetSchemesParams extends Object { /** @@ -23210,7 +24949,7 @@ declare namespace __esri { */ basemap: string | Basemap; /** - * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon + * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) */ @@ -23229,50 +24968,215 @@ declare namespace __esri { worldScale?: boolean; } + /** + * Properties defining the symbology scheme used to visualize features with attribute data-driven size. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeScheme) + */ + export type SizeScheme = SizeSchemeForPoint | SizeSchemeForPolyline | SizeSchemeForPolygon; - export interface PointSizeSchemeOutline extends Object { + /** + * Properties defining the symbology scheme used to visualize point features driven by attribute data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) + */ + export interface SizeSchemeForPoint extends Object { + /** + * The fill color of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) + */ + color: Color; + /** + * The color of the marker symbol used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) + */ + noDataColor: Color; + /** + * Properties for defining the outline of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) + */ + outline: SizeSchemeForPointOutline; + /** + * The default size of the marker symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) + */ + size: number; + /** + * The size of the marker symbol (in pixels or points) used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) + */ + noDataSize: number; + /** + * The minimum size of a marker symbol in pixels or points representing features with low data values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) + */ + minSize: number; + /** + * The maximum size of a marker symbol in pixels or points representing features with high data values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) + */ + maxSize: number; + /** + * The opacity of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) + */ + opacity: number; + } + + /** + * Properties defining the symbology scheme used to visualize polygon features driven by attribute data. When visualized by size, polygons are represented with marker symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) + */ + export interface SizeSchemeForPolygon extends Object { + /** + * The scheme defining the symbology of the marker symbol used to represent polygon features by size. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) + */ + marker: SizeSchemeForPoint; + /** + * The schema defining the backgound symbol of the feature. This is a fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) + */ + background: SizeSchemeForPolygonBackground; + /** + * The opacity of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) + */ + opacity: number; + } + + /** + * Properties defining the symbology scheme used to visualize polyline features driven by attribute data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) + */ + export interface SizeSchemeForPolyline extends Object { + /** + * The color of the line symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) + */ + color: Color; + /** + * The color of the line symbol used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) + */ + noDataColor: Color; + /** + * The default width of the line symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) + */ + width: number; + /** + * The width of the line symbol in pixels or points used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) + */ + noDataWidth: number; + /** + * The minimum width of a line symbol in pixels or points representing features with low data values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) + */ + minWidth: number; + /** + * The maximum width of a line symbol in pixels or points representing features with high data values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) + */ + maxWidth: number; + /** + * The opacity of the line symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) + */ + opacity: number; + } + + /** + * The return object of the [getSchemes()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemes) + */ + export interface SizeSchemes extends Object { + /** + * The size scheme best suited for the given basemap and geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemes) + */ + primaryScheme: SizeScheme; + /** + * Additional size schemes that may be used to visualize data of the given geometry type overlaid on the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemes) + */ + secondarySchemes: SizeScheme[]; + /** + * The ID of the basemap associated with the given schemes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemes) + */ + basemapId: string; + } + + + export interface SizeSchemeForPointOutline extends Object { /** * The outline color of the marker symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) */ color: Color; /** * The width of the marker symbol in pixels or points. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) */ width: number; } - export interface PolygonSizeSchemeBackground extends Object { + export interface SizeSchemeForPolygonBackground extends Object { /** * The color of the fill symbol representing the polygon. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) */ color: Color; /** * Properties for defining the outline of the background fill symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) */ - outline: PolygonSizeSchemeBackgroundOutline; + outline: SizeSchemeForPolygonBackgroundOutline; } - export interface PolygonSizeSchemeBackgroundOutline extends Object { + export interface SizeSchemeForPolygonBackgroundOutline extends Object { /** * The outline color of the background fill symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) */ color: Color; /** * The width of the background fill symbol's outline in pixels or points. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) */ width: number; } @@ -23287,163 +25191,35 @@ declare namespace __esri { * @param scheme The type scheme object to clone. * */ - cloneScheme(scheme: PointTypeScheme | PolylineTypeScheme | PolygonTypeScheme | MeshTypeScheme): any; + cloneScheme(scheme: TypeScheme): TypeScheme; /** - * Returns a primary scheme and secondary schemes defining symbol properties for type-based data-driven visualizions in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The `basemap` parameter determines the color of the graphics used to visualize each feature. The `geometryType` determines which type of symbol to return. + * Returns a primary scheme and secondary schemes defining symbol properties for type-based data-driven visualizations in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The `basemap` parameter determines the color of the graphics used to visualize each feature. The `geometryType` determines which type of symbol to return. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) * * @param params See the table below for details of each parameter that may be passed to this function. - * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. - * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh + * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features with the given basemap. + * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * @param params.theme Determines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the `CLASS_CODE` field is driving the visualization in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html)), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types. **Possible Values:** point-cloud-class | default * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * */ - getSchemes(params: typeGetSchemesParams): any; + getSchemes(params: typeGetSchemesParams): TypeSchemes; } export const symbologyType: symbologyType; - /** - * Properties defining the symbology scheme used to visualize mesh features driven by type-based attribute data. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#MeshTypeScheme) - */ - export interface MeshTypeScheme extends Object { - /** - * The fill colors of the symbols comprising the theme. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#MeshTypeScheme) - */ - colors: Color[]; - /** - * The color of the fill symbol used to indicate features with no data. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#MeshTypeScheme) - */ - noDataColor: Color; - /** - * The opacity of the symbol (0 - 1). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#MeshTypeScheme) - */ - opacity: number; - } - - /** - * Properties defining the symbology scheme used to visualize point features driven by type-based attribute data. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) - */ - export interface PointTypeScheme extends Object { - /** - * The fill colors of the point symbols comprising the theme. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) - */ - colors: Color[]; - /** - * The color of the point symbol used to indicate features with no data. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) - */ - noDataColor: Color; - /** - * Properties for defining the outline of the marker symbol. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) - */ - outline: PointTypeSchemeOutline; - /** - * The default size of the point symbol in pixels, points, or real-world units. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) - */ - size: number; - /** - * The opacity of the point symbol. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) - */ - opacity: number; - } - - /** - * Properties defining the symbology scheme used to visualize polygon features driven by type-based attribute data. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) - */ - export interface PolygonTypeScheme extends Object { - /** - * The fill colors of the symbols comprising the theme. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) - */ - colors: Color[]; - /** - * The color of the fill symbol used to indicate features with no data. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) - */ - noDataColor: Color; - /** - * Properties for defining the outline of the fill symbol. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) - */ - outline: PolygonTypeSchemeOutline; - /** - * The opacity of the symbol (0 - 1). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) - */ - opacity: number; - } - - /** - * Properties defining the symbology scheme used to visualize polyline features driven by type-based attribute data. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolylineTypeScheme) - */ - export interface PolylineTypeScheme extends Object { - /** - * The colors of the line symbols comprising the theme. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolylineTypeScheme) - */ - colors: Color[]; - /** - * The color of the line symbol used to indicate features with no data and features that are out of range. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolylineTypeScheme) - */ - noDataColor: Color; - /** - * The default width of the line symbol in pixels or points. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolylineTypeScheme) - */ - width: number; - /** - * The opacity of the line symbol (0 - 1). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolylineTypeScheme) - */ - opacity: number; - } - export interface typeGetSchemesParams extends Object { /** - * The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. + * The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features with the given basemap. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) */ basemap: string | Basemap; /** - * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh + * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) */ @@ -23470,34 +25246,195 @@ declare namespace __esri { view?: SceneView; } + /** + * Properties defining the symbology scheme used to visualize features with attribute data-driven types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeScheme) + */ + export type TypeScheme = TypeSchemeForPoint | TypeSchemeForPolyline | TypeSchemeForPolygon | TypeSchemeForMesh; - export interface PointTypeSchemeOutline extends Object { + /** + * Properties defining the symbology scheme used to visualize mesh features driven by type-based attribute data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForMesh) + */ + export interface TypeSchemeForMesh extends Object { + /** + * The fill colors of the symbols comprising the theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForMesh) + */ + colors: Color[]; + /** + * The color of the fill symbol used to indicate features with no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForMesh) + */ + noDataColor: Color; + /** + * The opacity of the symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForMesh) + */ + opacity: number; + } + + /** + * Properties defining the symbology scheme used to visualize point features driven by type-based attribute data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) + */ + export interface TypeSchemeForPoint extends Object { + /** + * The fill colors of the point symbols comprising the theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) + */ + colors: Color[]; + /** + * The color of the point symbol used to indicate features with no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) + */ + noDataColor: Color; + /** + * Properties for defining the outline of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) + */ + outline: TypeSchemeForPointOutline; + /** + * The default size of the point symbol in pixels, points, or real-world units. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) + */ + size: number; + /** + * The opacity of the point symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) + */ + opacity: number; + } + + /** + * Properties defining the symbology scheme used to visualize polygon features driven by type-based attribute data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) + */ + export interface TypeSchemeForPolygon extends Object { + /** + * The fill colors of the symbols comprising the theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) + */ + colors: Color[]; + /** + * The color of the fill symbol used to indicate features with no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) + */ + noDataColor: Color; + /** + * Properties for defining the outline of the fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) + */ + outline: TypeSchemeForPolygonOutline; + /** + * The opacity of the symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) + */ + opacity: number; + } + + /** + * Properties defining the symbology scheme used to visualize polyline features driven by type-based attribute data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolyline) + */ + export interface TypeSchemeForPolyline extends Object { + /** + * The colors of the line symbols comprising the theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolyline) + */ + colors: Color[]; + /** + * The color of the line symbol used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolyline) + */ + noDataColor: Color; + /** + * The default width of the line symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolyline) + */ + width: number; + /** + * The opacity of the line symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolyline) + */ + opacity: number; + } + + /** + * The return object of the [getSchemes()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemes) + */ + export interface TypeSchemes extends Object { + /** + * The type scheme best suited for the given basemap and geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemes) + */ + primaryScheme: TypeScheme; + /** + * Additional type schemes that may be used to visualize data of the given geometry type overlaid on the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemes) + */ + secondarySchemes: TypeScheme[]; + /** + * The ID of the basemap associated with the given schemes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemes) + */ + basemapId: string; + } + + + export interface TypeSchemeForPointOutline extends Object { /** * The outline color of the marker symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) */ color: Color; /** * The width of the marker symbol in pixels or points. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) */ width: number; } - export interface PolygonTypeSchemeOutline extends Object { + export interface TypeSchemeForPolygonOutline extends Object { /** * The outline color of the fill symbol. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) */ color: Color; /** * The width of the fill symbol's outline in pixels or points. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) */ width: number; } @@ -23510,25 +25447,25 @@ declare namespace __esri { */ classificationMethod: string; /** - * field for relationship. + * A numeric field used for generating a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html) along with [field2](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2). In the default visualization, the values of this field are rendered along the vertical axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) */ - field1: any; + field1: AuthoringInfoField1; /** - * field for relationship. + * A numeric field used for generating a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html) along with [field1](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1). In the default visualization, the values of this field are rendered along the horizontal axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) */ - field2: any; + field2: AuthoringInfoField2; /** - * An array of string values representing field names used for creating predominance renderers. + * An array of string values representing field names used for creating a [predominance renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#fields) */ fields: string[]; /** - * focus for relationship. + * The focus of a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html). This determines the orientation of the legend. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#focus) */ @@ -23540,7 +25477,7 @@ declare namespace __esri { */ lengthUnit: string; /** - * numClasses for relationship. + * The number of classes used to classify each field of a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html). This determines the number of categories in the legend. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#numClasses) */ @@ -23552,7 +25489,7 @@ declare namespace __esri { */ standardDeviationInterval: number; /** - * Indicates the renderer type generated from one of the Smart Mapping functions. **Possible Values:** class-breaks-size | class-breaks-color | predominance | univariate-color-size + * Indicates the renderer type generated from one of the Smart Mapping functions. **Possible Values:** class-breaks-size | class-breaks-color | classed-color | classed-size | predominance | relationship | univariate-color-size * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#type) */ @@ -23592,25 +25529,25 @@ declare namespace __esri { */ classificationMethod?: string; /** - * field for relationship. + * A numeric field used for generating a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html) along with [field2](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2). In the default visualization, the values of this field are rendered along the vertical axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) */ - field1?: any; + field1?: AuthoringInfoField1; /** - * field for relationship. + * A numeric field used for generating a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html) along with [field1](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1). In the default visualization, the values of this field are rendered along the horizontal axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) */ - field2?: any; + field2?: AuthoringInfoField2; /** - * An array of string values representing field names used for creating predominance renderers. + * An array of string values representing field names used for creating a [predominance renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#fields) */ fields?: string[]; /** - * focus for relationship. + * The focus of a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html). This determines the orientation of the legend. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#focus) */ @@ -23622,7 +25559,7 @@ declare namespace __esri { */ lengthUnit?: string; /** - * numClasses for relationship. + * The number of classes used to classify each field of a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html). This determines the number of categories in the legend. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#numClasses) */ @@ -23634,7 +25571,7 @@ declare namespace __esri { */ standardDeviationInterval?: number; /** - * Indicates the renderer type generated from one of the Smart Mapping functions. **Possible Values:** class-breaks-size | class-breaks-color | predominance | univariate-color-size + * Indicates the renderer type generated from one of the Smart Mapping functions. **Possible Values:** class-breaks-size | class-breaks-color | classed-color | classed-size | predominance | relationship | univariate-color-size * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#type) */ @@ -23647,6 +25584,62 @@ declare namespace __esri { visualVariables?: AuthoringInfoVisualVariableProperties[]; } + + export interface AuthoringInfoField1 extends Object { + /** + * The name of a numeric field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) + */ + field: string; + /** + * The name of a numeric field used to normalize the given `field`. In choropleth visualizations it is best practice to normalize your data values if they haven't already been normalized. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) + */ + normalizationField?: string; + /** + * The maximum bound of values to visualize in the given field. If a feature's value is greater than this value, then it will be assigned the default symbol of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) + */ + maxValue?: number; + /** + * The minimum bound of values to visualize in the given field. If a feature's value is less than this value, then it will be assigned the default symbol of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) + */ + minValue?: number; + } + + + export interface AuthoringInfoField2 extends Object { + /** + * The name of a numeric field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) + */ + field: string; + /** + * The name of a numeric field used to normalize the given `field`. In choropleth visualizations it is best practice to normalize your data values if they haven't already been normalized. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) + */ + normalizationField?: string; + /** + * The maximum bound of values to visualize in the given field. If a feature's value is greater than this value, then it will be assigned the default symbol of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) + */ + maxValue?: number; + /** + * The minimum bound of values to visualize in the given field. If a feature's value is less than this value, then it will be assigned the default symbol of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) + */ + minValue?: number; + } + interface AuthoringInfoVisualVariable extends Accessor, JSONSupport { /** * If an age or timeline renderer was generated, indicates the end time of the visualization. @@ -23863,11 +25856,11 @@ declare namespace __esri { */ defaultSymbol: Symbol; /** - * The name of the attribute field the renderer uses to match unique values or types. A function may also be used to return a string value representing unique types if the desired type does not already explicitly exist in a field. + * The name of the attribute field the renderer uses to match unique values or types. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) */ - field: string | Function; + field: string; /** * If needed, specifies the name of an additional attribute field the renderer will use to match values. For example, if you specify two fields: * ```js @@ -24033,11 +26026,11 @@ declare namespace __esri { */ defaultSymbol?: SymbolProperties; /** - * The name of the attribute field the renderer uses to match unique values or types. A function may also be used to return a string value representing unique types if the desired type does not already explicitly exist in a field. + * The name of the attribute field the renderer uses to match unique values or types. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) */ - field?: string | Function; + field?: string; /** * If needed, specifies the name of an additional attribute field the renderer will use to match values. For example, if you specify two fields: * ```js @@ -24159,16 +26152,17 @@ declare namespace __esri { interface VisualVariablesMixin { /** - * Visual variables define the parameters for data-driven geographic visualizations of numeric data. They allow you to easily map continuous ramps of [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable), [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable), [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable), and/or [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) to minimum and maximum data values of one of the layer's numeric attribute fields. Visual variables can primarily be used in two ways. **1**. Thematic mapping Visual variables allow you to easily create stunning visualizations based on thematic attributes (e.g. population, education, rank, money, magnitude, etc.) in either 2D or 3D. This is accomplished by mapping data values from a numeric field attribute to color, size, and/or opacity values. The renderer then takes over and re-sizes or shades features based on the value of the given field and its position relative to the minimum and maximum values. The sample below uses three visual variables (size, color, and opacity). [![renderer-unique-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) **2**. Mapping real-world sizes The [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) visual variable can be used to visualize the true sizes of features (e.g. tree canopy, road width, building height, etc.) based on their size in the real world. This can be particularly powerful when working in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). The image below shows a layer of building footprints that uses visual variables to extrude each feature to the true height of the buildings based on data stored in an attribute field. [![renderer-vv-rw](https://developers.arcgis.com/javascript/latest/assets/img/samples/2-extrude-height.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-buildings-3d/index.html) The `visualVariables` property of the renderer is an array of objects called "visual variables". Each object must indicate the type of visual variable to apply (e.g. color, size, opacity, rotation), the numeric field from which to drive the visualization, and the ramp of visual values to map to the data. The following list identifies each visual variable type and provides a link to the specification table of each. + * Visual variables define the parameters for data-driven geographic visualizations of numeric data. They allow you to easily map continuous ramps of [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable), [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable), [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable), and/or [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) to minimum and maximum data values of one of the layer's numeric attribute fields. Visual variables can primarily be used in two ways. **1**. Thematic mapping Visual variables allow you to easily create stunning visualizations based on thematic attributes (e.g. population, education, rank, money, magnitude, etc.) in either 2D or 3D. This is accomplished by mapping data values from a numeric field attribute to color, size, and/or opacity values. The renderer then takes over and re-sizes or shades features based on the value of the given field and its position relative to the minimum and maximum values. The sample below uses three visual variables (size, color, and opacity). [![renderer-unique-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) **2**. Mapping real-world sizes The [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) visual variable can be used to visualize the true sizes of features (e.g. tree canopy, road width, building height, etc.) based on their size in the real world. This can be particularly powerful when working in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). The image below shows a layer of building footprints that uses visual variables to extrude each feature to the true height of the buildings based on data stored in an attribute field. [![renderer-vv-rw](https://developers.arcgis.com/javascript/assets/img/samples/2-extrude-height.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-buildings-3d/index.html) The `visualVariables` property of the renderer is an array of objects called "visual variables". Each object must indicate the type of visual variable to apply (e.g. color, size, opacity, rotation), the numeric field from which to drive the visualization, and the ramp of visual values to map to the data. The following list identifies each visual variable type and provides a link to the specification table of each. * * Type | Object Specification | Legend Example * -----|----------------------|--------------- - * color | [ColorVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/legend-color-vv.png) - * size | [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/legend-size-vv.png) - * opacity | [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/legend-opacity-vv.png) + * color | [ColorVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-color-vv.png) + * size | [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-size-vv.png) + * opacity | [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-opacity-vv.png) * rotation | [RotationVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) | - * - * See the [Visualize features with realistic 3D symbols](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) for an example of using multiple visual variables to visualize your data. + * See the [Visualize features with realistic 3D symbols](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) for an example of using multiple visual variables to visualize your data. + * > **Known Limitations** Color and opacity visual variables must not have more than 8 stops and size visual variables must not have more than 6 stops. This does not apply to variables driven by view scale. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-VisualVariablesMixin.html#visualVariables) */ @@ -24185,16 +26179,17 @@ declare namespace __esri { interface VisualVariablesMixinProperties { /** - * Visual variables define the parameters for data-driven geographic visualizations of numeric data. They allow you to easily map continuous ramps of [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable), [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable), [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable), and/or [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) to minimum and maximum data values of one of the layer's numeric attribute fields. Visual variables can primarily be used in two ways. **1**. Thematic mapping Visual variables allow you to easily create stunning visualizations based on thematic attributes (e.g. population, education, rank, money, magnitude, etc.) in either 2D or 3D. This is accomplished by mapping data values from a numeric field attribute to color, size, and/or opacity values. The renderer then takes over and re-sizes or shades features based on the value of the given field and its position relative to the minimum and maximum values. The sample below uses three visual variables (size, color, and opacity). [![renderer-unique-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) **2**. Mapping real-world sizes The [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) visual variable can be used to visualize the true sizes of features (e.g. tree canopy, road width, building height, etc.) based on their size in the real world. This can be particularly powerful when working in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). The image below shows a layer of building footprints that uses visual variables to extrude each feature to the true height of the buildings based on data stored in an attribute field. [![renderer-vv-rw](https://developers.arcgis.com/javascript/latest/assets/img/samples/2-extrude-height.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-buildings-3d/index.html) The `visualVariables` property of the renderer is an array of objects called "visual variables". Each object must indicate the type of visual variable to apply (e.g. color, size, opacity, rotation), the numeric field from which to drive the visualization, and the ramp of visual values to map to the data. The following list identifies each visual variable type and provides a link to the specification table of each. + * Visual variables define the parameters for data-driven geographic visualizations of numeric data. They allow you to easily map continuous ramps of [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable), [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable), [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable), and/or [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) to minimum and maximum data values of one of the layer's numeric attribute fields. Visual variables can primarily be used in two ways. **1**. Thematic mapping Visual variables allow you to easily create stunning visualizations based on thematic attributes (e.g. population, education, rank, money, magnitude, etc.) in either 2D or 3D. This is accomplished by mapping data values from a numeric field attribute to color, size, and/or opacity values. The renderer then takes over and re-sizes or shades features based on the value of the given field and its position relative to the minimum and maximum values. The sample below uses three visual variables (size, color, and opacity). [![renderer-unique-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) **2**. Mapping real-world sizes The [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) visual variable can be used to visualize the true sizes of features (e.g. tree canopy, road width, building height, etc.) based on their size in the real world. This can be particularly powerful when working in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). The image below shows a layer of building footprints that uses visual variables to extrude each feature to the true height of the buildings based on data stored in an attribute field. [![renderer-vv-rw](https://developers.arcgis.com/javascript/assets/img/samples/2-extrude-height.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-buildings-3d/index.html) The `visualVariables` property of the renderer is an array of objects called "visual variables". Each object must indicate the type of visual variable to apply (e.g. color, size, opacity, rotation), the numeric field from which to drive the visualization, and the ramp of visual values to map to the data. The following list identifies each visual variable type and provides a link to the specification table of each. * * Type | Object Specification | Legend Example * -----|----------------------|--------------- - * color | [ColorVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/legend-color-vv.png) - * size | [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/legend-size-vv.png) - * opacity | [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/legend-opacity-vv.png) + * color | [ColorVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-color-vv.png) + * size | [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-size-vv.png) + * opacity | [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-opacity-vv.png) * rotation | [RotationVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) | - * - * See the [Visualize features with realistic 3D symbols](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) for an example of using multiple visual variables to visualize your data. + * See the [Visualize features with realistic 3D symbols](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) for an example of using multiple visual variables to visualize your data. + * > **Known Limitations** Color and opacity visual variables must not have more than 8 stops and size visual variables must not have more than 6 stops. This does not apply to variables driven by view scale. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-VisualVariablesMixin.html#visualVariables) */ @@ -24209,7 +26204,7 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) * * @param url The request URL. - * @param options An object with the following properties that describe the request. + * @param options The options specified by the user in the data request. See [RequestOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) for available properties. * */ esriRequest(url: string, options?: RequestOptions): IPromise; @@ -24284,25 +26279,44 @@ declare namespace __esri { */ export interface RequestOptions extends Object { /** - * Indicates if the request should be made using the HTTP POST method. By default, this is determined automatically based on the request size. This option is ignored when `responseType = "image"`. **Possible Values:** auto | post + * If the request URL points to a web server that requires parameters, specify them here. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ - method?: string; + query?: any; /** - * Name of the callback parameter (a special service parameter) to be specified when requesting data in JSONP format. It is ignored for all other data formats. For ArcGIS services the value is always `callback`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) - */ - callbackParamName?: string; - /** - * Response format. When this value is `image` the `method` and `timeout` options are ignored. **Possible Values:** json | xml | text | blob | array-buffer | document | image + * Response format. When this value is `image` the `headers` and `timeout` options are ignored. **Possible Values:** json | xml | text | blob | array-buffer | document | image * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ responseType?: string; /** - * Headers to use for the request. This is an object whose property names are header names. This is not applicable for non-XHR requests. + * [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) allows for cancelable requests. If canceled, the promise will be rejected with an error named `AbortError`. See also [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController). Example: + * ```js + * const controller = new AbortController(); + * const signal = controller.signal; + * + * esriRequest(url, { signal }) + * .then((response) => { + * // The request went OK + * }) + * .catch((err) => { + * if (err.name === 'AbortError') { + * console.log('Request aborted'); + * } else { + * console.error('Error encountered', err); + * } + * }); + * + * // Abort requests that are aware of the controller's signal + * controller.abort(); + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) + */ + signal?: AbortSignal; + /** + * Headers to use for the request. This is an object whose property names are header names. This option is ignored when `responseType = "image"`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ @@ -24314,11 +26328,11 @@ declare namespace __esri { */ timeout?: number; /** - * If the request URL points to a web server that requires parameters, specify them here. + * Indicates if the request should be made using the HTTP POST method. By default, this is determined automatically based on the request size. **Possible Values:** auto | post * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ - query?: any; + method?: string; /** * If uploading a file, specify the form data or element used to submit the file here. If a form element is specified, the parameters of the `query` will be added to the URL. If not specified, then query parameters will only be added to the URL when a GET request is used. If POST is used, then query parameters will be added to the body. * @@ -24337,12 +26351,6 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ cacheBust?: boolean; - /** - * Indicates whether apps are allowed to read image data (when used with Canvas) from images hosted on third-party sites. Only applicable when `responseType = "image"`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) - */ - allowImageDataAccess?: boolean; /** * Indicates if and how requests to ArcGIS Services are authenticated. Only applicable when [`esriConfig.request.useIdentity = true`](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request). * @@ -24378,7 +26386,7 @@ declare namespace __esri { */ requestOptions?: RequestOptions; /** - * If ssl is enabled or not. + * Indicates if the request required https. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) */ @@ -24460,7 +26468,7 @@ declare namespace __esri { interface ActionButton extends ActionBase { /** - * The URL to an image that will be used to represent the action. This property will be used as a background image for the node. It may be used in conjunction with the `className` property or by itself. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/latest/assets/img/guide/whats-new/41/default-action.png) will display. + * The URL to an image that will be used to represent the action. This property will be used as a background image for the node. It may be used in conjunction with the `className` property or by itself. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/assets/img/guide/whats-new/41/default-action.png) will display. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html#image) */ @@ -25018,7 +27026,7 @@ declare namespace __esri { interface FillSymbol3DLayer extends Symbol3DLayer { /** - * Sets the contour edges on 3D Objects. This is only applicable for [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html). ![symbol3D-edges-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbol3d-edges-solid-2.png) + * Sets the contour edges on 3D Objects. This is only applicable for [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html). ![symbol3D-edges-solid](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbol3d-edges-solid-2.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#edges) */ @@ -25062,7 +27070,7 @@ declare namespace __esri { interface FillSymbol3DLayerProperties extends Symbol3DLayerProperties { /** - * Sets the contour edges on 3D Objects. This is only applicable for [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html). ![symbol3D-edges-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbol3d-edges-solid-2.png) + * Sets the contour edges on 3D Objects. This is only applicable for [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html). ![symbol3D-edges-solid](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbol3d-edges-solid-2.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#edges) */ @@ -25134,7 +27142,7 @@ declare namespace __esri { size: number; /** * The text style. Specifies whether a font should be styled: normal, italic, or oblique. **Possible Values:** normal | italic | oblique - * > **Known Limitations** `oblique` is not supported in 2D WebGL enabled [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). + * > **Known Limitations** `oblique` is not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) labels. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#style) * @@ -25143,7 +27151,7 @@ declare namespace __esri { style: "normal" | "italic" | "oblique"; /** * The text weight. Specifies the level of boldness. **Possible Values:** normal | bold | bolder | lighter - * > **Known Limitations** `bolder` and `lighter` are not supported in 2D WebGL enabled [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). + * > **Known Limitations** `bolder` and `lighter` are not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) labels. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#weight) * @@ -25199,7 +27207,7 @@ declare namespace __esri { size?: number | string; /** * The text style. Specifies whether a font should be styled: normal, italic, or oblique. **Possible Values:** normal | italic | oblique - * > **Known Limitations** `oblique` is not supported in 2D WebGL enabled [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). + * > **Known Limitations** `oblique` is not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) labels. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#style) * @@ -25208,7 +27216,7 @@ declare namespace __esri { style?: "normal" | "italic" | "oblique"; /** * The text weight. Specifies the level of boldness. **Possible Values:** normal | bold | bolder | lighter - * > **Known Limitations** `bolder` and `lighter` are not supported in 2D WebGL enabled [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). + * > **Known Limitations** `bolder` and `lighter` are not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) labels. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#weight) * @@ -25358,11 +27366,11 @@ declare namespace __esri { * * Value | Description * ------|------------ - * circle | ![s3d-icon-circle](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-icon-circle.png) - * square | ![s3d-icon-square](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-icon-square.png) - * cross | ![s3d-icon-cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-icon-cross.png) - * x | ![s3d-icon-x](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-icon-x.png) - * kite | ![s3d-icon-kite](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-icon-kite.png) + * circle | ![s3d-icon-circle](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-circle.png) + * square | ![s3d-icon-square](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-square.png) + * cross | ![s3d-icon-cross](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-cross.png) + * x | ![s3d-icon-x](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-x.png) + * kite | ![s3d-icon-kite](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-kite.png) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) @@ -25444,13 +27452,13 @@ declare namespace __esri { */ screenLength?: number; /** - * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid the vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) + * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid the vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ minWorldLength?: number; /** - * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) + * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ @@ -25465,13 +27473,13 @@ declare namespace __esri { */ screenLength: number; /** - * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid the vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) + * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid the vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ minWorldLength?: number; /** - * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) + * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ @@ -25897,13 +27905,13 @@ declare namespace __esri { * * Value | Description * ------|------------ - * sphere | ![s3d-object-sphere](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-sphere.png) - * cylinder | ![s3d-object-cylinder](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-cylinder.png) - * cube | ![s3d-object-cube](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-cube.png) - * cone | ![s3d-object-cone](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-cone.png) - * inverted-cone | ![s3d-object-inverted-cone](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-inverted-cone.png) - * diamond | ![s3d-object-diamond](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-diamond.png) - * tetrahedron | ![s3d-object-tetrahedron](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-tetrahedron.png) + * sphere | ![s3d-object-sphere](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-object-sphere.png) + * cylinder | ![s3d-object-cylinder](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-object-cylinder.png) + * cube | ![s3d-object-cube](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-object-cube.png) + * cone | ![s3d-object-cone](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-object-cone.png) + * inverted-cone | ![s3d-object-inverted-cone](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-object-inverted-cone.png) + * diamond | ![s3d-object-diamond](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-object-diamond.png) + * tetrahedron | ![s3d-object-tetrahedron](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-object-tetrahedron.png) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) @@ -26128,8 +28136,8 @@ declare namespace __esri { readonly type: "picture-marker"; /** * The URL to the image. To avoid CORS issues with this symbol, do one of the following: - * * Use an image hosted on the same domain as the application. - * * If the image is on a different domain and that server is CORS enabled, add the domain to the [corsEnabledServers](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) array. + * * Make certain that the [image](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) is hosted on a [CORS enabled server](https://enable-cors.org/server.html). + * * Use an [image](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) hosted on the same domain as the application. * * Install a proxy. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) @@ -26179,8 +28187,8 @@ declare namespace __esri { height?: number | string; /** * The URL to the image. To avoid CORS issues with this symbol, do one of the following: - * * Use an image hosted on the same domain as the application. - * * If the image is on a different domain and that server is CORS enabled, add the domain to the [corsEnabledServers](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) array. + * * Make certain that the [image](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) is hosted on a [CORS enabled server](https://enable-cors.org/server.html). + * * Use an [image](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) hosted on the same domain as the application. * * Install a proxy. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) @@ -26264,13 +28272,13 @@ declare namespace __esri { */ screenLength?: number; /** - * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) + * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ minWorldLength?: number; /** - * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) + * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ @@ -26285,13 +28293,13 @@ declare namespace __esri { */ screenLength: number; /** - * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) + * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ minWorldLength?: number; /** - * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) + * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ @@ -26348,14 +28356,14 @@ declare namespace __esri { * * Value | Description * ------|------------- - * backward-diagonal | ![sfs-backward-diagonal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-backward-diagonal.png) - * cross | ![sfs-cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-cross.png) - * diagonal-cross | ![sfs-diagonal-cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-diagonal-cross.png) - * forward-diagonal | ![sfs-forward-diagonal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-forward-diagonal.png) - * horizontal | ![sfs-horizontal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-horizontal.png) + * backward-diagonal | ![sfs-backward-diagonal](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-backward-diagonal.png) + * cross | ![sfs-cross](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-cross.png) + * diagonal-cross | ![sfs-diagonal-cross](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-diagonal-cross.png) + * forward-diagonal | ![sfs-forward-diagonal](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-forward-diagonal.png) + * horizontal | ![sfs-horizontal](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-horizontal.png) * none | The polygon has no fill. - * solid | ![sfs-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-solid.png) - * vertical | ![sfs-vertical](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-vertical.png) + * solid | ![sfs-solid](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-solid.png) + * vertical | ![sfs-vertical](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-vertical.png) * * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * @@ -26409,14 +28417,14 @@ declare namespace __esri { * * Value | Description * ------|------------- - * backward-diagonal | ![sfs-backward-diagonal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-backward-diagonal.png) - * cross | ![sfs-cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-cross.png) - * diagonal-cross | ![sfs-diagonal-cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-diagonal-cross.png) - * forward-diagonal | ![sfs-forward-diagonal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-forward-diagonal.png) - * horizontal | ![sfs-horizontal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-horizontal.png) + * backward-diagonal | ![sfs-backward-diagonal](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-backward-diagonal.png) + * cross | ![sfs-cross](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-cross.png) + * diagonal-cross | ![sfs-diagonal-cross](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-diagonal-cross.png) + * forward-diagonal | ![sfs-forward-diagonal](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-forward-diagonal.png) + * horizontal | ![sfs-horizontal](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-horizontal.png) * none | The polygon has no fill. - * solid | ![sfs-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-solid.png) - * vertical | ![sfs-vertical](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-vertical.png) + * solid | ![sfs-solid](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-solid.png) + * vertical | ![sfs-vertical](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-vertical.png) * * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * @@ -26433,9 +28441,9 @@ declare namespace __esri { * * Possible Value | Example * ---------------|--------- - * butt | ![sls-cap-butt](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-butt.png) - * round | ![sls-cap-round](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-round.png) - * square | ![sls-cap-square](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-square.png) + * butt | ![sls-cap-butt](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-cap-butt.png) + * round | ![sls-cap-round](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-cap-round.png) + * square | ![sls-cap-square](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-cap-square.png) * * > **Known Limitations** * * This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). @@ -26451,9 +28459,9 @@ declare namespace __esri { * * Possible Value | Example * ---------------|--------- - * bevel | ![sls-join-bevel](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-bevel.png) - * miter | ![sls-join-miter](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-miter.png) - * round | ![sls-join-round](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-round.png) + * bevel | ![sls-join-bevel](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-join-bevel.png) + * miter | ![sls-join-miter](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-join-miter.png) + * round | ![sls-join-round](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-join-round.png) * * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * @@ -26476,18 +28484,18 @@ declare namespace __esri { * * Value | Description * ------|------------- - * dash | ![sls-dash](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dash.png) - * dash-dot | ![sls-dash-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dash-dot.png) - * dot | ![sls-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dot.png) - * long-dash | ![sls-long-dash](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-long-dash.png) - * long-dash-dot | ![sls-long-dash-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-long-dash-dot.png) - * long-dash-dot-dot | ![sls-dash-dot-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dash-dot-dot.png) + * dash | ![sls-dash](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-dash.png) + * dash-dot | ![sls-dash-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-dash-dot.png) + * dot | ![sls-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-dot.png) + * long-dash | ![sls-long-dash](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-long-dash.png) + * long-dash-dot | ![sls-long-dash-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-long-dash-dot.png) + * long-dash-dot-dot | ![sls-dash-dot-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-dash-dot-dot.png) * none | The line has no symbol. - * short-dash | ![sls-short-dash](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dash.png) - * short-dash-dot | ![sls-short-dash-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dash-dot.png) - * short-dash-dot-dot | ![sls-short-dash-dot-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dash-dot-dot.png) - * short-dot | ![sls-short-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dot.png) - * solid | ![sls-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-solid.png) + * short-dash | ![sls-short-dash](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-short-dash.png) + * short-dash-dot | ![sls-short-dash-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-short-dash-dot.png) + * short-dash-dot-dot | ![sls-short-dash-dot-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-short-dash-dot-dot.png) + * short-dot | ![sls-short-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-short-dot.png) + * solid | ![sls-solid](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-solid.png) * * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * @@ -26533,9 +28541,9 @@ declare namespace __esri { * * Possible Value | Example * ---------------|--------- - * butt | ![sls-cap-butt](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-butt.png) - * round | ![sls-cap-round](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-round.png) - * square | ![sls-cap-square](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-square.png) + * butt | ![sls-cap-butt](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-cap-butt.png) + * round | ![sls-cap-round](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-cap-round.png) + * square | ![sls-cap-square](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-cap-square.png) * * > **Known Limitations** * * This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). @@ -26551,9 +28559,9 @@ declare namespace __esri { * * Possible Value | Example * ---------------|--------- - * bevel | ![sls-join-bevel](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-bevel.png) - * miter | ![sls-join-miter](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-miter.png) - * round | ![sls-join-round](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-round.png) + * bevel | ![sls-join-bevel](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-join-bevel.png) + * miter | ![sls-join-miter](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-join-miter.png) + * round | ![sls-join-round](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-join-round.png) * * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * @@ -26576,18 +28584,18 @@ declare namespace __esri { * * Value | Description * ------|------------- - * dash | ![sls-dash](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dash.png) - * dash-dot | ![sls-dash-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dash-dot.png) - * dot | ![sls-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dot.png) - * long-dash | ![sls-long-dash](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-long-dash.png) - * long-dash-dot | ![sls-long-dash-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-long-dash-dot.png) - * long-dash-dot-dot | ![sls-dash-dot-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dash-dot-dot.png) + * dash | ![sls-dash](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-dash.png) + * dash-dot | ![sls-dash-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-dash-dot.png) + * dot | ![sls-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-dot.png) + * long-dash | ![sls-long-dash](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-long-dash.png) + * long-dash-dot | ![sls-long-dash-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-long-dash-dot.png) + * long-dash-dot-dot | ![sls-dash-dot-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-dash-dot-dot.png) * none | The line has no symbol. - * short-dash | ![sls-short-dash](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dash.png) - * short-dash-dot | ![sls-short-dash-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dash-dot.png) - * short-dash-dot-dot | ![sls-short-dash-dot-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dash-dot-dot.png) - * short-dot | ![sls-short-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dot.png) - * solid | ![sls-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-solid.png) + * short-dash | ![sls-short-dash](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-short-dash.png) + * short-dash-dot | ![sls-short-dash-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-short-dash-dot.png) + * short-dash-dot-dot | ![sls-short-dash-dot-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-short-dash-dot-dot.png) + * short-dot | ![sls-short-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-short-dot.png) + * solid | ![sls-solid](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-solid.png) * * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * @@ -26634,11 +28642,11 @@ declare namespace __esri { * * Value | Description * ------|------------ - * circle | ![sms_circle](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-circle.png) - * cross | ![sms_cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-cross.png) - * diamond | ![sms_diamond](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-diamond.png) - * square | ![sms_square](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-square.png) - * x | ![sms_x](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-x.png) + * circle | ![sms_circle](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-circle.png) + * cross | ![sms_cross](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-cross.png) + * diamond | ![sms_diamond](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-diamond.png) + * square | ![sms_square](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-square.png) + * x | ![sms_x](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-x.png) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style) @@ -26713,11 +28721,11 @@ declare namespace __esri { * * Value | Description * ------|------------ - * circle | ![sms_circle](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-circle.png) - * cross | ![sms_cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-cross.png) - * diamond | ![sms_diamond](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-diamond.png) - * square | ![sms_square](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-square.png) - * x | ![sms_x](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-x.png) + * circle | ![sms_circle](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-circle.png) + * cross | ![sms_cross](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-cross.png) + * diamond | ![sms_diamond](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-diamond.png) + * square | ![sms_square](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-square.png) + * x | ![sms_x](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-x.png) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style) @@ -26822,7 +28830,7 @@ declare namespace __esri { interface SymbolConstructor { /** - * Symbol is the base class for all symbols. Symbols represent point, line, polygon, and mesh geometries as vector graphics within a [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). They can be set on individual [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) or in a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that is applied to a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). + * Symbol is the base class for all symbols. Symbols represent point, line, polygon, and mesh geometries as vector graphics within a [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Symbols can only be set directly on individual [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) in a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) or in [View.graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics). Otherwise they are assigned to a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that is applied to a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or a [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) */ @@ -26916,13 +28924,13 @@ declare namespace __esri { * * Value | Description * ------|------------ - * icon | ![s3d-icon](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-icon-circle.png) - * object | ![s3d-object](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-sphere.png) - * line | ![s3d-line](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-line-line.png) - * path | ![s3d-path](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-path-tube.png) - * fill | ![s3d-fill](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-fill-solid.png) - * extrusion | ![s3d-extrusion](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-extrude-solid.png) - * text | ![s3d-text](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-label-text.png) + * icon | ![s3d-icon](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-circle.png) + * object | ![s3d-object](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-object-sphere.png) + * line | ![s3d-line](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-line-line.png) + * path | ![s3d-path](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-path-tube.png) + * fill | ![s3d-fill](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-fill-solid.png) + * extrusion | ![s3d-extrusion](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-extrude-solid.png) + * text | ![s3d-text](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-label-text.png) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html#type) @@ -28380,7 +30388,7 @@ declare namespace __esri { updateDelay: number; /** - * Sends a request to the print service to create a print page using the options specified in the [PrintParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html). + * Sends a request to the print service to create a printable static image of the map using the options specified in the [PrintParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#execute) * @@ -28388,7 +30396,7 @@ declare namespace __esri { * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). * */ - execute(params: PrintParameters, requestOptions?: any): IPromise; + execute(params: PrintParameters, requestOptions?: any): IPromise; } interface PrintTaskConstructor { @@ -28414,16 +30422,30 @@ declare namespace __esri { updateDelay?: number; } + /** + * Represents the reponse of the [execute()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#execute) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#PrintResponse) + */ + export interface PrintResponse extends Object { + /** + * URL pointing to the location of the generated printout of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#PrintResponse) + */ + url: string; + } + interface QueryTask extends Task { /** - * Specify the geodatabase version to display. Requires ArcGIS Server service 10.1 or greater. + * Specify the geodatabase version to query. Requires ArcGIS Server service 10.1 or greater. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#gdbVersion) */ gdbVersion: string; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against an ArcGIS Server map layer. The result is returned as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method. A [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) contains an array of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) features, which can be added to the map. This array will not be populated if no results are found. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the layer specified in the [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#url). The result is returned as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method. A [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) contains an array of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) features, which can be added to the map. This array will not be populated if no results are found. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#execute) * @@ -28433,7 +30455,17 @@ declare namespace __esri { */ execute(query: Query | QueryProperties, requestOptions?: any): IPromise; /** - * Gets a count of the number of features that satisfy the input query. Valid only for layers published using ArcGIS Server 10 SP1 or greater. Layers published with earlier versions of ArcGIS Server return an error to the `errback` param of `.then()`. + * Query information about attachments associated with features from a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) specified in the [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#url). It will return an error if the layer does not support [attachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeAttachmentQuery) + * + * @param attachmentQuery Specifies the attachment parameters for query. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ + executeAttachmentQuery(attachmentQuery: AttachmentQuery | AttachmentQueryProperties, requestOptions?: any): IPromise; + /** + * Gets a count of the number of features that satisfy the input query. Valid for layers published with 10.0 SP1. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeForCount) * @@ -28443,7 +30475,7 @@ declare namespace __esri { */ executeForCount(query: Query | QueryProperties, requestOptions?: any): IPromise; /** - * Gets the extent of the features that satisfy the input query. The count of features that satisfy the input query is returned upon resolution as well. Valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) on [arcgis.com](http://arcgis.com) and for ArcGIS Server 10.3.1 and later. + * Gets the extent of the features that satisfy the input query. The count of features that satisfy the input query is returned upon resolution as well. At 10.3, this option is only available for [hosted feature services](https://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm). At 10.3.1, this option is available for all feature services and map service layers. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeForExtent) * @@ -28453,7 +30485,7 @@ declare namespace __esri { */ executeForExtent(params: Query, requestOptions?: any): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against an ArcGIS Server map layer. The result is an array of the object IDs of features that satisfy the input query. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the layer specified in the [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#url). The result is an array of the object IDs of features that satisfy the input query. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeForIds) * @@ -28463,11 +30495,11 @@ declare namespace __esri { */ executeForIds(query: Query | QueryProperties, requestOptions?: any): IPromise; /** - * Executes a [RelationshipQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html) against an ArcGIS Server map layer (or table). If the query is successful, the result is returned as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method. + * Executes a [RelationshipQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html) against the layer or table specified in the [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#url). If the query is successful, the returned results are [FeatureSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) grouped by source layer or table objectIds. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeRelationshipQuery) * - * @param relationshipQuery Specifies the attributes and spatial filter of the query. + * @param relationshipQuery Specifies relationship parameters for querying related features or records from a layer or a table. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). * */ @@ -28476,7 +30508,7 @@ declare namespace __esri { interface QueryTaskConstructor { /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) operation on a layer. The most common method used in this class is [execute()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#execute), which executes the query as defined in the [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) object that is passed as a parameter to the function. `QueryTask.execute()` returns a Promise that resolves to a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which contains the features in the layer that satisfy the [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html). + * Executes different types of query operations on a layer. The most common method used in this class is [execute()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#execute), which executes the query as defined in the [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) object that is passed as a parameter to the function. `QueryTask.execute()` returns a Promise that resolves to a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which contains the features in the layer that satisfy the [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html) */ @@ -28488,13 +30520,57 @@ declare namespace __esri { interface QueryTaskProperties extends TaskProperties { /** - * Specify the geodatabase version to display. Requires ArcGIS Server service 10.1 or greater. + * Specify the geodatabase version to query. Requires ArcGIS Server service 10.1 or greater. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#gdbVersion) */ gdbVersion?: string; } + /** + * The AttachmentInfo returns information about attachments associated with a feature. This resource is available only if the [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) has attachments. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) + */ + export interface AttachmentInfo extends Object { + /** + * The content type of the attachment. For example, `image/jpeg`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-attachments-feature-service-layer-.htm) for more information on supported attachment types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) + */ + contentType: string; + /** + * The identifier for the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) + */ + id: number; + /** + * The name of the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) + */ + name: string; + /** + * The parent or the feature object id of the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) + */ + parentObjectId: number; + /** + * The size of the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) + */ + size: number; + /** + * The URL of the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) + */ + url: string; + } + interface RouteTask extends Task { /** * Solves the route against the route layer with the route parameters. @@ -28714,6 +30790,119 @@ declare namespace __esri { polygons?: PolygonProperties[]; } + interface AttachmentQuery extends Accessor, JSONSupport { + /** + * The file format that is supported by query attachment. For example, `image/jpeg`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-attachments-feature-service-layer-.htm) for more information on supported attachment types. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#attachmentTypes) + */ + attachmentTypes: string[]; + /** + * The definition expression to be applied to the layer. Only features that satisfy the definition expression and are in the list of [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds) will be returned. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#definitionExpression) + */ + definitionExpression: string; + /** + * An array of globalIds for the features in the layer being queried. The query results will return attachments only for specified global ids. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#globalIds) + */ + globalIds: number[]; + /** + * The number of features to retrieve. This option should be used in conjunction with the [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). Default Value is `10`. If not provided, but an instance of AttachmentQuery has a `start` property, then the default value of `num` is `maxRecordCount`. The maximum value for this parameter is the value of the layer's `maxRecordCount` of the service, which can be found at the REST endpoint of the feature layer. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#num) + */ + num: number; + /** + * An array of objectIds of the features to be queried for attachments. When the feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property is `false`, it only accepts a single `objectId`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds) + */ + objectIds: number[]; + /** + * The file size of the attachment is specified in bytes. You can enter a file size range [1000,15000] to query for attachments. The query result will return all attachments within the specified file size range (1000 - 15000). Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#size) + */ + size: number[]; + /** + * This option fetches query results by skipping a specified number of records. The query results start from the next record. The default value is `0`. This parameter only applies when the feature layer's [capabilities.query.supportsPagination](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is `true`. You can use this option to fetch records that are beyond `maxRecordCount`. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#start) + */ + start: number; + + /** + * Creates a deep clone of AttachmentQuery object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#clone) + * + * + */ + clone(): AttachmentQuery; + } + + interface AttachmentQueryConstructor { + /** + * This class defines parameters for executing queries for feature attachments from a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Once an AttachmentQuery object's properties are defined, it can then be passed into the [QueryTask.executeAttachmentQuery()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeAttachmentQuery) or [FeatureLayer.queryAttachments()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryAttachments) methods, which will return attachmentInfos grouped by the source feature objectIds. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html) + */ + + new(properties?: AttachmentQueryProperties): AttachmentQuery; + + fromJSON(json: any): AttachmentQuery; + } + + export const AttachmentQuery: AttachmentQueryConstructor; + + interface AttachmentQueryProperties { + /** + * The file format that is supported by query attachment. For example, `image/jpeg`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-attachments-feature-service-layer-.htm) for more information on supported attachment types. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#attachmentTypes) + */ + attachmentTypes?: string[]; + /** + * The definition expression to be applied to the layer. Only features that satisfy the definition expression and are in the list of [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds) will be returned. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#definitionExpression) + */ + definitionExpression?: string; + /** + * An array of globalIds for the features in the layer being queried. The query results will return attachments only for specified global ids. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#globalIds) + */ + globalIds?: number[]; + /** + * The number of features to retrieve. This option should be used in conjunction with the [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). Default Value is `10`. If not provided, but an instance of AttachmentQuery has a `start` property, then the default value of `num` is `maxRecordCount`. The maximum value for this parameter is the value of the layer's `maxRecordCount` of the service, which can be found at the REST endpoint of the feature layer. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#num) + */ + num?: number; + /** + * An array of objectIds of the features to be queried for attachments. When the feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property is `false`, it only accepts a single `objectId`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds) + */ + objectIds?: number[]; + /** + * The file size of the attachment is specified in bytes. You can enter a file size range [1000,15000] to query for attachments. The query result will return all attachments within the specified file size range (1000 - 15000). Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#size) + */ + size?: number[]; + /** + * This option fetches query results by skipping a specified number of records. The query results start from the next record. The default value is `0`. This parameter only applies when the feature layer's [capabilities.query.supportsPagination](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is `true`. You can use this option to fetch records that are beyond `maxRecordCount`. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#start) + */ + start?: number; + } + interface BufferParameters extends Accessor { /** * The spatial reference in which the geometries are buffered. If `bufferSpatialReference` is not specified, the geometries are buffered in the spatial reference specified by `outSpatialReference`. If `outSpatialReference` is also not specified, they are buffered in the spatial reference of the features. @@ -31588,7 +33777,7 @@ declare namespace __esri { */ scalebarUnit?: string; /** - * An array of [LegendLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html) containing the id's of the layers that will be included in the legend. If `legendLayers` is not specified, all operational layers will be present in the legend. To specify that no layers will be included in the legend set `legendLayer = []`. + * An array of [LegendLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html) containing the id's of the layers that will be included in the legend. If `legendLayers` is not specified, all operational layers (non-tiled layers) will be present in the legend. To specify that no layers will be included in the legend set `legendLayer = []`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ @@ -31733,11 +33922,17 @@ declare namespace __esri { */ geometryPrecision: number; /** - * One or more field names that will be used to group the statistics. This is only valid when [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) has been defined. + * Used only in [statistical queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#statistic). When one or more field names are provided in this property, the output statisics will be grouped based on unique values from those fields. This is only valid when [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) has been defined. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) */ groupByFieldsForStatistics: string[]; + /** + * A condition used with [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) and [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) to limit query results to groups that satisfy the aggregation function(s). The following aggregation functions are supported in this clause: `MIN` | `MAX` | `AVG` | `SUM` | `STDDEV` | `COUNT` | `VAR` Aggregation functions used in `having` must be included in the `outStatistics` as well. See the snippet below for an example of how this works. For service-based layer queries, this parameter applies only if the [supportsHavingClause](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property of the layer is `true`. This property is supported on all [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) queries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#having) + */ + having: string; /** * The historic moment to query. This parameter applies only if the `supportsQueryWithHistoricMoment` capability of the service being queried is `true`. This setting is provided in the layer resource. * @@ -31745,8 +33940,8 @@ declare namespace __esri { */ historicMoment: Date; /** - * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference). If `outSpatialReference` is not defined, the spatial reference of the view is used. - * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. + * The maximum distance in units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) used for generalizing geometries returned by the query operation. It limits how far any part of the generalized geometry can be from the original geometry. If `outSpatialReference` is not defined, the spatialReference of the data is used. + * > **Known Limitations** This property does not apply to [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxAllowableOffset) */ @@ -32007,11 +34202,17 @@ declare namespace __esri { */ geometryPrecision?: number; /** - * One or more field names that will be used to group the statistics. This is only valid when [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) has been defined. + * Used only in [statistical queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#statistic). When one or more field names are provided in this property, the output statisics will be grouped based on unique values from those fields. This is only valid when [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) has been defined. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) */ groupByFieldsForStatistics?: string[]; + /** + * A condition used with [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) and [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) to limit query results to groups that satisfy the aggregation function(s). The following aggregation functions are supported in this clause: `MIN` | `MAX` | `AVG` | `SUM` | `STDDEV` | `COUNT` | `VAR` Aggregation functions used in `having` must be included in the `outStatistics` as well. See the snippet below for an example of how this works. For service-based layer queries, this parameter applies only if the [supportsHavingClause](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property of the layer is `true`. This property is supported on all [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) queries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#having) + */ + having?: string; /** * The historic moment to query. This parameter applies only if the `supportsQueryWithHistoricMoment` capability of the service being queried is `true`. This setting is provided in the layer resource. * @@ -32019,8 +34220,8 @@ declare namespace __esri { */ historicMoment?: DateProperties; /** - * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference). If `outSpatialReference` is not defined, the spatial reference of the view is used. - * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. + * The maximum distance in units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) used for generalizing geometries returned by the query operation. It limits how far any part of the generalized geometry can be from the original geometry. If `outSpatialReference` is not defined, the spatialReference of the data is used. + * > **Known Limitations** This property does not apply to [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxAllowableOffset) */ @@ -32444,13 +34645,13 @@ declare namespace __esri { interface RelationshipQuery extends Accessor, JSONSupport { /** - * The definition expression to be applied to the related table or layer. Only records that fit the definition expression and are in the list of `objectIds` will be returned. + * The definition expression to be applied to the related table or layer. Only records in the list of [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#objectIds) that satisfy the definition expression are queried for related records. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#definitionExpression) */ definitionExpression: string; /** - * Specify the geodatabase version to display. + * Specify the geodatabase version to query. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#gdbVersion) */ @@ -32462,37 +34663,37 @@ declare namespace __esri { */ geometryPrecision: number; /** - * The historic moment to query. This parameter applies only if the `supportsHistoricMoment` property of the layers being queried is set to `true`. + * The historic moment to query. This parameter applies only if the `supportsHistoricMoment` on [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property of the layer is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#historicMoment) */ historicMoment: Date; /** - * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of `outSpatialReference`. If `outSpatialReference` is not defined, the spatial reference of the map is used. + * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of `outSpatialReference`. If `outSpatialReference` is not defined, the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) of the view is used. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#maxAllowableOffset) */ maxAllowableOffset: number; /** - * A comma delimited list of ObjectIds for the features in the layer/table being queried. + * An array of objectIds for the features in the layer/table being queried. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#objectIds) */ objectIds: number[]; /** - * Attribute fields to include in the FeatureSet. Fields must exist in the map layer. You must list actual field names rather than the alias names. You are, however, able to use the alias names when you display the results. You can set field alias names in the map document. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer. However, your list of fields does not need to include these two fields. + * Attribute fields to include in the FeatureSet. Fields must exist in the map layer. You must list actual field names rather than the alias names. You are, however, able to use the alias names when you display the results. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer. However, your list of fields does not need to include these two fields. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#outFields) */ outFields: string[]; /** - * The spatial reference for the returned geometry. If not specified, the geometry is returned in the spatial reference of the map. + * The spatial reference for the returned geometry. If `outSpatialReference` is not defined, the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) of the view is used. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** - * The ID of the relationship to test. The ids for the relationships the table or layer participates in are listed in the ArcGIS Services directory. + * The ID of the relationship to be queried. The ids for the relationships the table or layer participates in are listed in the ArcGIS Services directory. The ID of the relationship to be queried. The relationships that this layer/table participates in are included in the Feature Service Layer resource response. Records in tables/layers corresponding to the related table/layer of the relationship are queried. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#relationshipId) */ @@ -32528,13 +34729,13 @@ declare namespace __esri { interface RelationshipQueryProperties { /** - * The definition expression to be applied to the related table or layer. Only records that fit the definition expression and are in the list of `objectIds` will be returned. + * The definition expression to be applied to the related table or layer. Only records in the list of [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#objectIds) that satisfy the definition expression are queried for related records. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#definitionExpression) */ definitionExpression?: string; /** - * Specify the geodatabase version to display. + * Specify the geodatabase version to query. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#gdbVersion) */ @@ -32546,37 +34747,37 @@ declare namespace __esri { */ geometryPrecision?: number; /** - * The historic moment to query. This parameter applies only if the `supportsHistoricMoment` property of the layers being queried is set to `true`. + * The historic moment to query. This parameter applies only if the `supportsHistoricMoment` on [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property of the layer is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#historicMoment) */ historicMoment?: DateProperties; /** - * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of `outSpatialReference`. If `outSpatialReference` is not defined, the spatial reference of the map is used. + * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of `outSpatialReference`. If `outSpatialReference` is not defined, the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) of the view is used. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#maxAllowableOffset) */ maxAllowableOffset?: number; /** - * A comma delimited list of ObjectIds for the features in the layer/table being queried. + * An array of objectIds for the features in the layer/table being queried. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#objectIds) */ objectIds?: number[]; /** - * Attribute fields to include in the FeatureSet. Fields must exist in the map layer. You must list actual field names rather than the alias names. You are, however, able to use the alias names when you display the results. You can set field alias names in the map document. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer. However, your list of fields does not need to include these two fields. + * Attribute fields to include in the FeatureSet. Fields must exist in the map layer. You must list actual field names rather than the alias names. You are, however, able to use the alias names when you display the results. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer. However, your list of fields does not need to include these two fields. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#outFields) */ outFields?: string[]; /** - * The spatial reference for the returned geometry. If not specified, the geometry is returned in the spatial reference of the map. + * The spatial reference for the returned geometry. If `outSpatialReference` is not defined, the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) of the view is used. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** - * The ID of the relationship to test. The ids for the relationships the table or layer participates in are listed in the ArcGIS Services directory. + * The ID of the relationship to be queried. The ids for the relationships the table or layer participates in are listed in the ArcGIS Services directory. The ID of the relationship to be queried. The relationships that this layer/table participates in are included in the Feature Service Layer resource response. Records in tables/layers corresponding to the related table/layer of the relationship are queried. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#relationshipId) */ @@ -33789,7 +35990,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#statisticType) */ - statisticType: string; + statisticType: "count" | "sum" | "min" | "max" | "avg" | "stddev" | "var"; } interface StatisticDefinitionConstructor { @@ -33820,7 +36021,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#statisticType) */ - statisticType?: string; + statisticType?: "count" | "sum" | "min" | "max" | "avg" | "stddev" | "var"; } interface TrimExtendParameters extends Accessor { @@ -39521,7 +41722,7 @@ declare namespace __esri { * * Z: Elevation * * - * ![externalRenderers-renderCoordinateTransformAt](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/3d/externalRenderers-renderCoordinateTransformAt.png) When [view.viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) is `global`, a linear transformation does not take the curvature of the globe or other non-linear projection aspects into account. Thus, the resulting coordinates will only appear correct within a small region around the origin of the local Cartesian system. The allowable spatial reference of `origin` depends on the [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode): + * ![externalRenderers-renderCoordinateTransformAt](https://developers.arcgis.com/javascript/assets/img/apiref/views/3d/externalRenderers-renderCoordinateTransformAt.png) When [view.viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) is `global`, a linear transformation does not take the curvature of the globe or other non-linear projection aspects into account. Thus, the resulting coordinates will only appear correct within a small region around the origin of the local Cartesian system. The allowable spatial reference of `origin` depends on the [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode): * * In `global` mode, it can either be Web Mercator or WGS84. * * In `local` mode, it has to match [view.spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#spatialReference). * @@ -39924,7 +42125,7 @@ declare namespace __esri { */ readonly height: number; /** - * A Popup object that displays general content or attributes from [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#map). The view has a default instance of [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) with predefined styles and a template for defining content. The content in this default instance may be modified directly in the [popup's content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) or in a layer's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). You may create a new [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) instance and set it to this property to customize the style, positioning, and content of the popup in favor of using the default popup instance on the view. + * A Popup object that displays general content or attributes from [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#map). The view has a default instance of [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) with predefined styles and a template for defining content. The content in this default instance may be modified directly in the [popup's content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) or in a layer's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). You may create a new [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) instance and set it to this property to customize the style, positioning, and content of the popup in favor of using the default popup instance on the view. In addition, if wanting to prevent any popups from opening, use the syntax below: * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#popup) */ @@ -39983,7 +42184,7 @@ declare namespace __esri { */ container?: HTMLDivElement | string; /** - * A Popup object that displays general content or attributes from [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#map). The view has a default instance of [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) with predefined styles and a template for defining content. The content in this default instance may be modified directly in the [popup's content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) or in a layer's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). You may create a new [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) instance and set it to this property to customize the style, positioning, and content of the popup in favor of using the default popup instance on the view. + * A Popup object that displays general content or attributes from [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#map). The view has a default instance of [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) with predefined styles and a template for defining content. The content in this default instance may be modified directly in the [popup's content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) or in a layer's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). You may create a new [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) instance and set it to this property to customize the style, positioning, and content of the popup in favor of using the default popup instance on the view. In addition, if wanting to prevent any popups from opening, use the syntax below: * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#popup) */ @@ -40031,10 +42232,105 @@ declare namespace __esri { } + interface GamepadInputDevice extends Accessor { + /** + * The native Gamepad object exposed by the browser. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-input-gamepad-GamepadInputDevice.html#native) + */ + readonly native: Gamepad; + } + + interface GamepadInputDeviceConstructor { + /** + * Properties and configuration of a gamepad. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-input-gamepad-GamepadInputDevice.html) + */ + + new(properties?: GamepadInputDeviceProperties): GamepadInputDevice; + } + + export const GamepadInputDevice: GamepadInputDeviceConstructor; + + interface GamepadInputDeviceProperties { + + } + + interface GamepadSettings extends Accessor { + /** + * A readonly collection of all gamepads detected. Can be watched for gamepads to be connected or disconnected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-input-gamepad-GamepadSettings.html#devices) + */ + readonly devices: Collection; + /** + * Determines what focus is required for gamepad events to be dispatched. Possible values: document | view | none + * + * Possible Value | Description + * ---------------|------------ + * document | Gamepad events are emitted when any part of the current webpage has focus. This allows for gamepad events being emitted even while a UI element is focused. + * view | Gamepad events are emitted when the view [container element](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#container) has browser focus. This is useful when multiple views might be present on a single webpage. + * none | Gamepad events are emitted independently of focus. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-input-gamepad-GamepadSettings.html#enabledFocusMode) + * + * @default document + */ + enabledFocusMode: "document" | "view" | "none"; + } + + interface GamepadSettingsConstructor { + + + new(properties?: GamepadSettingsProperties): GamepadSettings; + } + + export const GamepadSettings: GamepadSettingsConstructor; + + interface GamepadSettingsProperties { + /** + * Determines what focus is required for gamepad events to be dispatched. Possible values: document | view | none + * + * Possible Value | Description + * ---------------|------------ + * document | Gamepad events are emitted when any part of the current webpage has focus. This allows for gamepad events being emitted even while a UI element is focused. + * view | Gamepad events are emitted when the view [container element](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#container) has browser focus. This is useful when multiple views might be present on a single webpage. + * none | Gamepad events are emitted independently of focus. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-input-gamepad-GamepadSettings.html#enabledFocusMode) + * + * @default document + */ + enabledFocusMode?: "document" | "view" | "none"; + } + + interface Input extends Accessor { + /** + * Gamepad input specific configuration settings. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-input-Input.html#gamepad) + */ + readonly gamepad: GamepadSettings; + } + + interface InputConstructor { + + + new(properties?: InputProperties): Input; + } + + export const Input: InputConstructor; + + interface InputProperties { + + } + interface CSVLayerView extends LayerView { /** - * Highlights the given feature(s). - * > **Known Limitations** In 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) this method is only supported for [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) that have opted in to [WebGL rendering](esri-layers-FeatureLayer.html#webgl-rendering). + * Highlights the given feature(s). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#highlight) * @@ -40044,7 +42340,8 @@ declare namespace __esri { highlight(target?: Graphic | Graphic[] | number | number[]): any; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not currently supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * > **Known Limitations** + * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): * * GDM 2000 (4742) – Malaysia @@ -40060,7 +42357,8 @@ declare namespace __esri { queryExtent(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all features available for drawing is returned. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * > **Known Limitations** + * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): * * GDM 2000 (4742) – Malaysia @@ -40076,7 +42374,8 @@ declare namespace __esri { queryFeatureCount(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all features available for drawing are returned. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * > **Known Limitations** + * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): * * GDM 2000 (4742) – Malaysia @@ -40092,7 +42391,8 @@ declare namespace __esri { queryFeatures(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all features available for drawing are returned. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * > **Known Limitations** + * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): * * GDM 2000 (4742) – Malaysia @@ -40129,8 +42429,7 @@ declare namespace __esri { readonly layer: FeatureLayer; /** - * Highlights the given feature(s). - * > **Known Limitations** In 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) this method is only supported for [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) that have opted in to [WebGL rendering](esri-layers-FeatureLayer.html#webgl-rendering). + * Highlights the given feature(s). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlight) * @@ -40140,10 +42439,11 @@ declare namespace __esri { highlight(target?: Graphic | Graphic[] | number | number[]): any; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. Valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) on [arcgis.com](http://arcgis.com) and for ArcGIS Server 10.3.1 and later. If query parameters are not provided, the extent and count of all features available for drawing are returned. To query for the extent of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryExtent) method. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * > **Known Limitations** + * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. - * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * Spatial queries are not currently supported if the FeatureLayerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): * * GDM 2000 (4742) – Malaysia * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland @@ -40157,10 +42457,11 @@ declare namespace __esri { queryExtent(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all features available for drawing is returned. To query for the count of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryFeatureCount()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatureCount) method. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * > **Known Limitations** + * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. - * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * Spatial queries are not currently supported if the FeatureLayerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): * * GDM 2000 (4742) – Malaysia * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland @@ -40174,10 +42475,11 @@ declare namespace __esri { queryFeatureCount(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all features available for drawing are returned. To execute a query against all the features in a Feature Service rather than only those in the client, you must use the [FeatureLayer.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) method. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * > **Known Limitations** + * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. - * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * Spatial queries are not currently supported if the FeatureLayerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): * * GDM 2000 (4742) – Malaysia * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland @@ -40191,10 +42493,11 @@ declare namespace __esri { queryFeatures(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all features available for drawing are returned. To query for ObjectIDs of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryObjectIds()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryObjectIds) method. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * > **Known Limitations** + * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. - * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * Spatial queries are not currently supported if the FeatureLayerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): * * GDM 2000 (4742) – Malaysia * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland @@ -40531,7 +42834,7 @@ declare namespace __esri { */ connect(): IPromise; /** - * Closes the web socket connection with the stream service. This is called internally when the StreamLayer is removed from a view. To verify when the connection is closed, watch the [connectionStatus](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#property:connectionStatus) property. + * Closes the web socket connection with the stream service. This is called internally when the StreamLayer is removed from a view. To verify when the connection is closed, watch the [connectionStatus](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connectionStatus) property. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#disconnect) * @@ -40539,7 +42842,7 @@ declare namespace __esri { */ disconnect(): void; /** - * Updates the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) on the StreamLayerView. The filter is updated only on the layer view from which it is called. To update the filter on all layer views generated from a common layer, use the [StreamLayer.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method. If the input `filter` object is `undefined` or `null`, the spatial and attribute filters are removed. Filter changes only apply to incoming features. Features already displayed in the view are not filtered. Therefore, you may want to clear the graphics in the layer view prior to applying a new filter. To do so, get the layer view then call [removeAll()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#removeAll) on the [StreamLayerView.graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#graphics). You may also filter features already present in the view using the [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) methods. See the examples below. + * Updates the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) on the StreamLayerView. The filter is updated only on the layer view from which it is called. To update the filter on all layer views generated from a common layer, use the [StreamLayer.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method. If the input `filter` object is `undefined` or `null`, the spatial and attribute filters are removed. Filter changes only apply to incoming features. Features already displayed in the view will be removed automatically. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) * @@ -40556,7 +42859,7 @@ declare namespace __esri { interface StreamLayerViewConstructor { /** - * The StreamLayerView provides methods for connecting, disconnecting, and filtering data received from a stream service for a layer view associated with a [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html). + * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of a [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html) */ @@ -40632,8 +42935,7 @@ declare namespace __esri { */ extent: Extent; /** - * Options for configuring the highlight. Use the highlight method on the appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature. - * > **Known Limitations** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. See [FeatureLayerView.highlight()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlight) for details of how to highlight features. + * Options for configuring the highlight. Use the highlight method on the appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) */ @@ -40700,9 +43002,9 @@ declare namespace __esri { * @param target.scale The [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) to go to. * @param target.zoom The [MapView.zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) to go to. * @param options Animation options. See properties below for object specifications. - * @param options.animate Indicates if the transition to the new view should be animated. + * @param options.animate Indicates if the transition to the new view should be animated. If set to false, `duration` and `easing` properties are ignored. * @param options.duration The duration of the animation in milliseconds. - * @param options.easing The easing function used for the animation. **Possible Values:** linear | ease | ease-in | ease-out | ease-in-out + * @param options.easing The easing function used for the animation. See [easing functions](https://easings.net/) for graphical representations of these functions. **Possible Values:** linear | ease | ease-in | ease-out | ease-in-out * */ goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | MapViewGoToTarget, options?: MapViewGoToOptions): IPromise; @@ -40730,9 +43032,9 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#on) * - * @param type The name of the event or the events to listen for. - * @param modifiersOrHandler Additional modifier keys to filter the events by. Alternatively, if no modifiers are required, the function to call when the event is fired. - * @param handler? The function to call when the event is fired, if modifiers were specified. + * @param type The name of the event or events to listen for. + * @param modifiersOrHandler Additional modifier keys to filter events. Please see [Key Values](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values) for possible values. All the standard key values are supported. Alternatively, if no modifiers are required, the function will call when the event fires. The following events don't support modifier keys: `blur`, `focus`, `layerview-create`, `layerview-destroy`, `resize`. + * @param handler The function to call when the event is fired, if modifiers were specified. * */ on(type: string | string[], modifiersOrHandler: string[] | EventHandler, handler?: EventHandler): IHandle; @@ -40866,8 +43168,7 @@ declare namespace __esri { */ extent?: ExtentProperties; /** - * Options for configuring the highlight. Use the highlight method on the appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature. - * > **Known Limitations** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. See [FeatureLayerView.highlight()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlight) for details of how to highlight features. + * Options for configuring the highlight. Use the highlight method on the appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) */ @@ -41170,7 +43471,7 @@ declare namespace __esri { export interface MapViewGoToOptions extends Object { /** - * Indicates if the transition to the new view should be animated. + * Indicates if the transition to the new view should be animated. If set to false, `duration` and `easing` properties are ignored. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) * @@ -41181,10 +43482,12 @@ declare namespace __esri { * The duration of the animation in milliseconds. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) + * + * @default 200 */ duration?: number; /** - * The easing function used for the animation. **Possible Values:** linear | ease | ease-in | ease-out | ease-in-out + * The easing function used for the animation. See [easing functions](https://easings.net/) for graphical representations of these functions. **Possible Values:** linear | ease | ease-in | ease-out | ease-in-out * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) * @@ -41475,6 +43778,105 @@ declare namespace __esri { mapPoint: Point; } + interface gamepadGamepadSettings extends Accessor { + /** + * Use this property to explicitly select the gamepad device for map and scene navigation. If unspecified then all connected gamepads will be able to navigate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#device) + * + * @default null + */ + device: GamepadInputDevice; + /** + * Whether gamepad navigation is enabled on the View. If this is enabled, but no `device` is specified, the first supported one will be selected automatically. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#enabled) + * + * @default true + */ + enabled: boolean; + /** + * This setting controls the behavior of forward and back movement of the left stick. If set to `pan`, movement will be at a constant altitude (panning the view forward and backward) whereas `zoom` will move the view in the viewing direction. Pan is best suited for exploring a scene as if on foot or in a car. Zoom mode provides great control to navigate the scene similar to a flight simulator. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#mode) + * + * @default pan + */ + mode: "pan" | "zoom"; + /** + * Determines whether pressing the tilt axis forwards make the view tilt down (towards the nadir), or up (towards the zenith). The default behavior is to tilt the view down when pressing the stick that controls tilt forwards. **Possible Values:** forward-down | forward-up + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#tiltDirection) + * + * @default forward-down + */ + tiltDirection: "forward-down" | "forward-up"; + } + + interface gamepadGamepadSettingsConstructor { + + + new(properties?: gamepadGamepadSettingsProperties): gamepadGamepadSettings; + } + + export const gamepadGamepadSettings: gamepadGamepadSettingsConstructor; + + interface gamepadGamepadSettingsProperties { + /** + * Use this property to explicitly select the gamepad device for map and scene navigation. If unspecified then all connected gamepads will be able to navigate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#device) + * + * @default null + */ + device?: GamepadInputDeviceProperties; + /** + * Whether gamepad navigation is enabled on the View. If this is enabled, but no `device` is specified, the first supported one will be selected automatically. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#enabled) + * + * @default true + */ + enabled?: boolean; + /** + * This setting controls the behavior of forward and back movement of the left stick. If set to `pan`, movement will be at a constant altitude (panning the view forward and backward) whereas `zoom` will move the view in the viewing direction. Pan is best suited for exploring a scene as if on foot or in a car. Zoom mode provides great control to navigate the scene similar to a flight simulator. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#mode) + * + * @default pan + */ + mode?: "pan" | "zoom"; + /** + * Determines whether pressing the tilt axis forwards make the view tilt down (towards the nadir), or up (towards the zenith). The default behavior is to tilt the view down when pressing the stick that controls tilt forwards. **Possible Values:** forward-down | forward-up + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#tiltDirection) + * + * @default forward-down + */ + tiltDirection?: "forward-down" | "forward-up"; + } + + interface Navigation extends Accessor { + /** + * Gamepad navigation specific configuration settings. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-Navigation.html#gamepad) + */ + readonly gamepad: gamepadGamepadSettings; + } + + interface NavigationConstructor { + + + new(properties?: NavigationProperties): Navigation; + } + + export const Navigation: NavigationConstructor; + + interface NavigationProperties { + + } + interface SceneView extends View, BreakpointsOwner { /** * Allows the view to be partially or fully transparent when composited with the webpage elements behind it. This property can only be set once at construction time. When alpha compositing is enabled, web scenes are less performant. It's important to set this property to `true` only when you need to apply transparency on the view. @@ -41499,7 +43901,7 @@ declare namespace __esri { */ center: Point; /** - * Represents an optional clipping area used to define the visible [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of a local scene. If defined, only data (including the basemap) within the area will be displayed. The `clippingArea` property only applies to [local](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) scenes. ![scene-clipping-area](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-clipping-area.png%20%22Local%20scene%20with%20clippingArea%22) The clippingArea property contains an internal reference which may be modified in the future. To persist or modify the clippingArea, create a clone using [clippingArea.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). + * Represents an optional clipping area used to define the visible [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of a local scene. If defined, only data (including the basemap) within the area will be displayed. The `clippingArea` property only applies to [local](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) scenes. ![scene-clipping-area](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-clipping-area.png%20%22Local%20scene%20with%20clippingArea%22) The clippingArea property contains an internal reference which may be modified in the future. To persist or modify the clippingArea, create a clone using [clippingArea.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) */ @@ -41585,8 +43987,8 @@ declare namespace __esri { * * Value | Example | Description * ------|-------|------------ - * global | ![scene-global](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-global.png) | Global scenes allow the entire globe to render in the view, showing the curvature of the earth. - * local | ![scene-local](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-local.png) | Local scenes render the earth on a flat surface. They can be constrained to only show a "local" area by setting the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clipplingArea) property. Local scenes also allow for displaying and exploring data that would otherwise be hidden by the surface of the earth. + * global | ![scene-global](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-global.png) | Global scenes allow the entire globe to render in the view, showing the curvature of the earth. + * local | ![scene-local](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-local.png) | Local scenes render the earth on a flat surface. They can be constrained to only show a "local" area by setting the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clipplingArea) property. Local scenes also allow for displaying and exploring data that would otherwise be hidden by the surface of the earth. * * Depending on the viewing mode different [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. * @@ -41639,11 +44041,11 @@ declare namespace __esri { * @param target.tilt The [Camera.tilt](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) to go to. * @param target.position The [Camera.position](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) to go to. * @param options View transition options. - * @param options.animate Indicates if the transition to the new view should be animated. + * @param options.animate Indicates if the transition to the new view should be animated. If set to false, `speedFactor`, `duration`, `maxDuration`, and `easing` properties are ignored. * @param options.speedFactor Increases or decreases the animation speed by the specified factor. A speedFactor of 2 will make the animation twice as fast, while a speedFactor of 0.5 will make the animation half as fast. Setting the speed factor will automatically adapt the default maxDuration accordingly. * @param options.duration Set the exact duration (in milliseconds) of the animation. Note that by default, animation duration is calculated based on the time required to reach the target at a constant speed. Setting duration overrides the speedFactor option. Note that the resulting duration is still limited to the maxDuration. * @param options.maxDuration The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account. - * @param options.easing The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: `linear`, `in-cubic`, `out-cubic`, `in-out-cubic`, `in-expo`, `out-expo`, `in-out-expo` By default, animations that are less than 1000 ms use an out easing function; longer animations use an in-out function. + * @param options.easing The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: `linear`, `in-cubic`, `out-cubic`, `in-out-cubic`, `in-expo`, `out-expo`, `in-out-expo`, `in-out-coast-quadratic`. See [easing functions](https://easings.net/) for graphical representations of these functions. By default, animations that are less than 1000 ms use the `out-expo` easing function; longer animations use the `in-out-coast-quadratic` easing function. * */ goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera | SceneViewGoToTarget, options?: SceneViewGoToOptions): IPromise; @@ -41671,12 +44073,26 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#on) * - * @param type The name of the event or the events to listen for. - * @param modifiersOrHandler Additional modifier keys to filter the events by. Alternatively, if no modifiers are required, the function to call when the event is fired. - * @param handler? The function to call when the event is fired, if modifiers were specified. + * @param type The name of the event or events to listen for. + * @param modifiersOrHandler Additional modifier keys to filter events. Please see [Key Values](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values) for possible values. All the standard key values are supported. Alternatively, if no modifiers are required, the function will call when the event fires. The following events don't support modifier keys: `blur`, `focus`, `layerview-create`, `layerview-destroy`, `resize`. + * @param handler The function to call when the event is fired, if modifiers were specified. * */ on(type: string | string[], modifiersOrHandler: string[] | EventHandler, handler?: EventHandler): IHandle; + /** + * Create a screenshot of the current view. Screenshots include only elements that are rendered on the canvas (all geographical elements), but excludes overlayed DOM elements (UI, popups, measurement labels, etc.). By default, a screenshot of the whole view is created. Different options allow for creating different types of screenshots, including taking screenshots at different aspect ratios, different resolutions and creating thumbnails. Screenshots are always taken inside the padded area of the view (see [padding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#padding)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) + * + * @param options Screenshot options. + * @param options.format The format of the resulting encoded data url. **Possible values**: jpg | png. + * @param options.quality The quality (0 to 100) of the encoded image when encoding as `jpg`. + * @param options.width The width of the screenshot (defaults to the area width). The height will be derived automatically if left unspecified, according to the aspect ratio of the of the screenshot area. + * @param options.height The height of the screenshot (defaults to the area height). The width will be derived automatically if left unspecified, according to the aspect ratio of the screenshot area. + * @param options.area Specifies whether to take a screenshot of a specific area of the view. The area coordinates are relative to the origin of the padded view (see [padding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#padding)) and will be clipped to the view size. Defaults to the whole view (padding excluded). + * + */ + takeScreenshot(options?: SceneViewTakeScreenshotOptions): IPromise; /** * Converts the given screen point to a [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). * @@ -41810,7 +44226,7 @@ declare namespace __esri { */ center?: PointProperties | number[]; /** - * Represents an optional clipping area used to define the visible [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of a local scene. If defined, only data (including the basemap) within the area will be displayed. The `clippingArea` property only applies to [local](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) scenes. ![scene-clipping-area](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-clipping-area.png%20%22Local%20scene%20with%20clippingArea%22) The clippingArea property contains an internal reference which may be modified in the future. To persist or modify the clippingArea, create a clone using [clippingArea.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). + * Represents an optional clipping area used to define the visible [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of a local scene. If defined, only data (including the basemap) within the area will be displayed. The `clippingArea` property only applies to [local](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) scenes. ![scene-clipping-area](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-clipping-area.png%20%22Local%20scene%20with%20clippingArea%22) The clippingArea property contains an internal reference which may be modified in the future. To persist or modify the clippingArea, create a clone using [clippingArea.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) */ @@ -41896,8 +44312,8 @@ declare namespace __esri { * * Value | Example | Description * ------|-------|------------ - * global | ![scene-global](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-global.png) | Global scenes allow the entire globe to render in the view, showing the curvature of the earth. - * local | ![scene-local](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-local.png) | Local scenes render the earth on a flat surface. They can be constrained to only show a "local" area by setting the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clipplingArea) property. Local scenes also allow for displaying and exploring data that would otherwise be hidden by the surface of the earth. + * global | ![scene-global](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-global.png) | Global scenes allow the entire globe to render in the view, showing the curvature of the earth. + * local | ![scene-local](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-local.png) | Local scenes render the earth on a flat surface. They can be constrained to only show a "local" area by setting the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clipplingArea) property. Local scenes also allow for displaying and exploring data that would otherwise be hidden by the surface of the earth. * * Depending on the viewing mode different [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. * @@ -42510,8 +44926,8 @@ declare namespace __esri { * * Known Value | Example * ------------|--------- - * low | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-atmosphere.png) - * high | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-atmosphere-realistic.png) + * low | ![scene-atmosphere](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-atmosphere.png) + * high | ![scene-atmosphere](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-atmosphere-realistic.png) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) @@ -42527,8 +44943,8 @@ declare namespace __esri { * * Known Value | Example * ------------|--------- - * low | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-atmosphere.png) - * high | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-atmosphere-realistic.png) + * low | ![scene-atmosphere](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-atmosphere.png) + * high | ![scene-atmosphere](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-atmosphere-realistic.png) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) @@ -42612,7 +45028,7 @@ declare namespace __esri { export interface SceneViewGoToOptions extends Object { /** - * Indicates if the transition to the new view should be animated. + * Indicates if the transition to the new view should be animated. If set to false, `speedFactor`, `duration`, `maxDuration`, and `easing` properties are ignored. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) * @@ -42642,7 +45058,7 @@ declare namespace __esri { */ maxDuration?: number; /** - * The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: `linear`, `in-cubic`, `out-cubic`, `in-out-cubic`, `in-expo`, `out-expo`, `in-out-expo` By default, animations that are less than 1000 ms use an out easing function; longer animations use an in-out function. + * The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: `linear`, `in-cubic`, `out-cubic`, `in-out-cubic`, `in-expo`, `out-expo`, `in-out-expo`, `in-out-coast-quadratic`. See [easing functions](https://easings.net/) for graphical representations of these functions. By default, animations that are less than 1000 ms use the `out-expo` easing function; longer animations use the `in-out-coast-quadratic` easing function. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ @@ -42767,6 +45183,72 @@ declare namespace __esri { } + export interface SceneViewTakeScreenshotOptions extends Object { + /** + * The format of the resulting encoded data url. **Possible values**: jpg | png. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) + * + * @default jpg + */ + format?: string; + /** + * The quality (0 to 100) of the encoded image when encoding as `jpg`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) + * + * @default 98 + */ + quality?: number; + /** + * The width of the screenshot (defaults to the area width). The height will be derived automatically if left unspecified, according to the aspect ratio of the of the screenshot area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) + */ + width?: number; + /** + * The height of the screenshot (defaults to the area height). The width will be derived automatically if left unspecified, according to the aspect ratio of the screenshot area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) + */ + height?: number; + /** + * Specifies whether to take a screenshot of a specific area of the view. The area coordinates are relative to the origin of the padded view (see [padding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#padding)) and will be clipped to the view size. Defaults to the whole view (padding excluded). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) + */ + area?: SceneViewTakeScreenshotOptionsArea; + } + + + export interface SceneViewTakeScreenshotOptionsArea extends Object { + /** + * The x coordinate of the area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) + */ + x?: number; + /** + * The y coordinate of the area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) + */ + y?: number; + /** + * The width of the area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) + */ + width?: number; + /** + * The height of the area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) + */ + height?: number; + } + + export interface SceneViewToMapScreenPoint extends Object { /** * The horizontal screen coordinate to convert. @@ -42782,6 +45264,26 @@ declare namespace __esri { y: number; } + /** + * Object returned when [takeScreenshot()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) promise resolves: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#Screenshot) + */ + export interface Screenshot extends Object { + /** + * A data url representing the screenshot. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#Screenshot) + */ + dataUrl: string; + /** + * The raw RGBA image data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#Screenshot) + */ + data: ImageData; + } + export interface SceneViewDragEventOrigin extends Object { @@ -43033,6 +45535,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#groundView) */ readonly groundView: GroundView; + /** + * Options to configure input handling of the View. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#input) + */ + readonly input: Input; /** * Indication whether the view is being interacted with (for example when panning). * @@ -43053,6 +45561,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) */ map: Map; + /** + * Options to configure the navigation behavior of the View. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#navigation) + */ + readonly navigation: Navigation; /** * Use the padding property to make the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center), and [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent), etc. work off a subsection of the full view. This is particularly useful when layering UI elements or semi-transparent content on top of portions of the view. See the [view padding sample](https://developers.arcgis.com/javascript/latest/sample-code/view-padding/index.html) for an example of how this works. * @@ -43075,6 +45589,12 @@ declare namespace __esri { * @default false */ readonly ready: boolean; + /** + * Represents the current value of one pixel in the unit of the view's [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference). The value of resolution is calculated by dividing the view's [extent width](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#width) by [its width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#width). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#resolution) + */ + readonly resolution: number; /** * The spatial reference of the view. This indicates the [Projected Coordinate System](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) or the [Geographic Coordinate System](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) used to locate geographic features in the map. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) the following [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. The spatial reference can either be set explicitly or automatically derived from the following: * * In the case of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), if the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#map) is a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) instance, the [WebScene.initialViewProperties.spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#initialViewProperties) is used. @@ -43289,7 +45809,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#bookmarks) */ - bookmarks: any[]; + bookmarks: Collection; /** * The initial view of the WebMap. This object contains properties such as [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#viewpoint), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#spatialReference), that should be applied to the view when the WebMap loads. * @@ -43367,6 +45887,14 @@ declare namespace __esri { * */ load(): IPromise; + /** + * Loads all the externally loadable resources associated with the webmap. For the webmap this will load the ground, basemap and layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loadAll) + * + * + */ + loadAll(): IPromise; } interface WebMapConstructor { @@ -43393,7 +45921,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#bookmarks) */ - bookmarks?: any[]; + bookmarks?: CollectionProperties; /** * The initial view of the WebMap. This object contains properties such as [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#viewpoint), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#spatialReference), that should be applied to the view when the WebMap loads. * @@ -43426,6 +45954,66 @@ declare namespace __esri { widgets?: any; } + interface Bookmark extends Accessor { + /** + * The extent of the specified bookmark item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#extent) + */ + extent: Extent; + /** + * The name of the bookmark item. Used as a label in the [Bookmarks](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html) widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#name) + */ + name: string; + /** + * The URL for a thumbnail image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#thumbnail) + */ + thumbnail: BookmarkThumbnail; + } + + interface BookmarkConstructor { + + + new(properties?: BookmarkProperties): Bookmark; + } + + export const Bookmark: BookmarkConstructor; + + interface BookmarkProperties { + /** + * The extent of the specified bookmark item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#extent) + */ + extent?: ExtentProperties; + /** + * The name of the bookmark item. Used as a label in the [Bookmarks](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html) widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#name) + */ + name?: string; + /** + * The URL for a thumbnail image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#thumbnail) + */ + thumbnail?: BookmarkThumbnail; + } + + + export interface BookmarkThumbnail extends Object { + /** + * URL to a thumbnail to display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#thumbnail) + */ + url?: string; + } + interface InitialViewProperties extends Accessor, corePromise { /** * The spatial reference of the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html). This indicates the [Projected Coordinate System](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) or the [Geographic Coordinate System](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) used to locate geographic features in the map. @@ -43572,6 +46160,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#sourceVersion) */ readonly sourceVersion: WebSceneSourceVersion; + /** + * The URL to the thumbnail used for the web scene. The thumbnail will by default be the thumbnail URL from the portal item associated to the web scene. The thumbnail of the web scene may be updated by changing the thumbnail URL and saving the web scene. Use #updateFrom to update the thumbnail automatically from a specified view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#thumbnailUrl) + */ + thumbnailUrl: string; /** * Triggers the loading of the WebScene instance. A WebScene is considered [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loaded) when its [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers), [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#basemap) and [ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#ground) are fully created. When created with a [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#portalItem), `load()` will first fetch its data to create the content, otherwise it resolves immediately. The [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) automatically calls the `load()` method when a WebScene instance is added to its [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#map) property so it can display in the view and load each individual layer. If the WebScene is used outside of a view, for example to preload it, you must call `load()` explicitly to interact with its resources. @@ -43581,6 +46175,14 @@ declare namespace __esri { * */ load(): IPromise; + /** + * Loads all the externally loadable resources associated with the webscene. For the webscene this will load the ground, basemap, layers and slide basemaps. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loadAll) + * + * + */ + loadAll(): IPromise; /** * Saves the webscene to its associated portal item. The portal item to save to must already exist and be valid. This is a convenience method that will use [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#update) to store the webscene in the item. The web scene is saved according to [web scene specification](https://developers.arcgis.com/web-scene-specification/) standards. Use [updateFrom](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) to store the current view properties in the webscene before saving it. Note that this saves the webscene to its existing item. Depending on how the scene is shared, users that do not own the scene may modify it. To save an existing scene as a new item owned by the user signed into the portal instance, use [saveAs()](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#saveAs). The webscene will be automatically loaded if it is not already before saving. * @@ -43612,17 +46214,19 @@ declare namespace __esri { */ toJSON(): any; /** - * Update properties of the WebScene related to the view. This should usually be called just before saving a scene. The following properties are updated from the view: 1. `initialViewProperties.spatialReference` 2. `initialViewProperties.viewingMode` 3. `clippingArea` 4. `heightModelInfo` Depending on the provided options, the following properties are also updated: 1. `initialViewProperties.environment` 1. `initialViewProperties.viewpoint` + * Update properties of the WebScene related to the view. This should usually be called just before saving a scene. The following properties are updated from the view: 1. `initialViewProperties.spatialReference` 2. `initialViewProperties.viewingMode` 3. `clippingArea` 4. `heightModelInfo` Depending on the provided options, the following properties are also updated: 1. `initialViewProperties.environment` 2. `initialViewProperties.viewpoint` 3. `thumbnail` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) * * @param view the view to update from. * @param options update options. - * @param options.environmentExcluded update the initial environment from the view, defaults to false. - * @param options.viewpointExcluded update the initial viewpoint from the view, defaults to false. + * @param options.environmentExcluded do not update the initial environment from the view, defaults to false. + * @param options.viewpointExcluded do not update the initial viewpoint from the view, defaults to false. + * @param options.thumbnailExcluded do not update the thumbnail from the view, defaults to viewpointExcluded. + * @param options.thumbnailSize the size of the thumbnail. Defaults to 600x400 (ratio 1.5:1). Note that the thumbnail size may currently not be larger than the size of the view. * */ - updateFrom(view: SceneView, options?: WebSceneUpdateFromOptions): void; + updateFrom(view: SceneView, options?: WebSceneUpdateFromOptions): IPromise; } interface WebSceneConstructor { @@ -43693,6 +46297,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#presentation) */ presentation?: PresentationProperties; + /** + * The URL to the thumbnail used for the web scene. The thumbnail will by default be the thumbnail URL from the portal item associated to the web scene. The thumbnail of the web scene may be updated by changing the thumbnail URL and saving the web scene. Use #updateFrom to update the thumbnail automatically from a specified view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#thumbnailUrl) + */ + thumbnailUrl?: string; } interface ApplicationProperties extends Accessor { @@ -44026,7 +46636,7 @@ declare namespace __esri { */ atmosphereEnabled: boolean; /** - * Specifies how the background of the scene (which lies behind sky, stars and atmosphere) should be displayed. By default this is simply a single, fully opaque, black color. + * Specifies how the background of the scene (which lies behind sky, stars and atmosphere) should be displayed. The default value of `null` displays a single, fully opaque, black color. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#background) * @@ -44076,7 +46686,7 @@ declare namespace __esri { */ atmosphereEnabled?: boolean; /** - * Specifies how the background of the scene (which lies behind sky, stars and atmosphere) should be displayed. By default this is simply a single, fully opaque, black color. + * Specifies how the background of the scene (which lies behind sky, stars and atmosphere) should be displayed. The default value of `null` displays a single, fully opaque, black color. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#background) * @@ -44286,16 +46896,16 @@ declare namespace __esri { * * Value | Description * ------|------------ - * streets | ![basemap-streets](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets.jpg) - * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/satellite.jpg) - * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/hybrid.jpg) - * topo | ![basemap-topo](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/topo.jpg) - * gray | ![basemap-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/gray.jpg) - * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/dark-gray.jpg) - * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/oceans.jpg) - * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/national-geographic.jpg) - * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/terrain.jpg) - * osm | ![basemap-osm](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/osm.jpg) + * streets | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) + * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/satellite.jpg) + * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/hybrid.jpg) + * topo | ![basemap-topo](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) + * gray | ![basemap-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) + * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) + * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/oceans.jpg) + * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/national-geographic.jpg) + * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/terrain.jpg) + * osm | ![basemap-osm](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/osm.jpg) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#basemap) @@ -44422,16 +47032,16 @@ declare namespace __esri { * * Value | Description * ------|------------ - * streets | ![basemap-streets](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets.jpg) - * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/satellite.jpg) - * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/hybrid.jpg) - * topo | ![basemap-topo](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/topo.jpg) - * gray | ![basemap-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/gray.jpg) - * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/dark-gray.jpg) - * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/oceans.jpg) - * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/national-geographic.jpg) - * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/terrain.jpg) - * osm | ![basemap-osm](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/osm.jpg) + * streets | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) + * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/satellite.jpg) + * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/hybrid.jpg) + * topo | ![basemap-topo](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) + * gray | ![basemap-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) + * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) + * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/oceans.jpg) + * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/national-geographic.jpg) + * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/terrain.jpg) + * osm | ![basemap-osm](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/osm.jpg) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#basemap) @@ -44565,7 +47175,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) * - * @default 112 + * @default 120 */ width?: number; /** @@ -44573,7 +47183,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) * - * @default 61 + * @default 75 */ height?: number; } @@ -44764,17 +47374,45 @@ declare namespace __esri { export interface WebSceneUpdateFromOptions extends Object { /** - * update the initial environment from the view, defaults to false. + * do not update the initial environment from the view, defaults to false. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) */ environmentExcluded?: boolean; /** - * update the initial viewpoint from the view, defaults to false. + * do not update the initial viewpoint from the view, defaults to false. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) */ viewpointExcluded?: boolean; + /** + * do not update the thumbnail from the view, defaults to viewpointExcluded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) + */ + thumbnailExcluded?: boolean; + /** + * the size of the thumbnail. Defaults to 600x400 (ratio 1.5:1). Note that the thumbnail size may currently not be larger than the size of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) + */ + thumbnailSize?: WebSceneUpdateFromOptionsThumbnailSize; + } + + + export interface WebSceneUpdateFromOptionsThumbnailSize extends Object { + /** + * the width of the thumbnail. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) + */ + width: number; + /** + * the height of the thumbnail. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) + */ + height: number; } interface AreaMeasurement3D extends Widget { @@ -44853,10 +47491,10 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#viewModel) */ - viewModel?: AreaMeasurement3DViewModel; + viewModel?: AreaMeasurement3DViewModelProperties; } - interface AreaMeasurement3DViewModel { + interface AreaMeasurement3DViewModel extends Accessor { /** * The current measurement of the area. * @@ -44912,12 +47550,34 @@ declare namespace __esri { interface AreaMeasurement3DViewModelConstructor { - - new(properties?: any): AreaMeasurement3DViewModel; + new(properties?: AreaMeasurement3DViewModelProperties): AreaMeasurement3DViewModel; } export const AreaMeasurement3DViewModel: AreaMeasurement3DViewModelConstructor; + interface AreaMeasurement3DViewModelProperties { + /** + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | square-inches | square-feet | square-yards | square-miles | square-meters | square-kilometers | square-us-feet | acres | ares | hectares + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#unit) + */ + unit?: string; + /** + * List of unit systems (imperial, metric) and specific units for displaying the area values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#unitOptions) + * + * @default ["metric", "imperial", "square-inches", "square-feet", "square-yards", "square-miles", "square-us-feet", "square-meters", "square-kilometers", "acres", "ares", "hectares"] + */ + unitOptions?: string[]; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#view) + */ + view?: SceneViewProperties; + } + export interface AreaMeasurement3DViewModelMeasurement extends Object { /** @@ -45049,10 +47709,10 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#viewModel) */ - viewModel?: AttributionViewModel; + viewModel?: AttributionViewModelProperties; } - interface AttributionViewModel { + interface AttributionViewModel extends Accessor { /** * A collection of [AttributionItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#AttributionItem)s. * @@ -45082,12 +47742,20 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html) */ - - new(properties?: any): AttributionViewModel; + new(properties?: AttributionViewModelProperties): AttributionViewModel; } export const AttributionViewModel: AttributionViewModelConstructor; + interface AttributionViewModelProperties { + /** + * The view from which the view model will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#view) + */ + view?: MapViewProperties | SceneViewProperties; + } + /** * The following properties define an attribution item that contains the attribution text for a layer. * @@ -45612,11 +48280,11 @@ declare namespace __esri { interface Bookmarks extends Widget, GoTo { /** - * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html)s. + * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html)s. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#bookmarks) */ - bookmarks: Collection; + readonly bookmarks: Collection; /** * The widget's default CSS icon class. * @@ -45663,7 +48331,7 @@ declare namespace __esri { interface BookmarksConstructor { /** - * The Bookmarks widget allows end users to quickly navigate to a particular area of interest. It displays a list of bookmarks, which typically are defined inside the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#bookmarks). + * The Bookmarks widget allows end users to quickly navigate to a particular area of interest. It displays a list of [bookmarks](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html), which typically are defined inside the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#bookmarks). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html) */ @@ -45674,12 +48342,6 @@ declare namespace __esri { export const Bookmarks: BookmarksConstructor; interface BookmarksProperties extends WidgetProperties, GoToProperties { - /** - * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html)s. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#bookmarks) - */ - bookmarks?: CollectionProperties; /** * The view from which the widget will operate. * @@ -45694,61 +48356,19 @@ declare namespace __esri { viewModel?: BookmarksViewModelProperties; } - interface Bookmark { - /** - * The `active` property is true while goTo() is animating. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#active) - * - * @default false - */ - active: boolean; - /** - * The extent of the specified bookmark item. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#extent) - */ - extent: Extent; - /** - * The name of the bookmark item. Used as a label in the [Bookmarks](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html) widget. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#name) - */ - name: string; - /** - * The URL for a thumbnail image. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#thumbnail) - */ - thumbnail: BookmarkThumbnail; - } - - interface BookmarkConstructor { - - - - new(properties?: any): Bookmark; - } - - export const Bookmark: BookmarkConstructor; - - - export interface BookmarkThumbnail extends Object { - /** - * URL to a thumbnail to display. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#thumbnail) - */ - url?: string; - } - interface BookmarksViewModel extends Accessor, GoTo { /** - * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html)s. + * The [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html) that is being navigated to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#activeBookmark) + */ + readonly activeBookmark: Bookmark; + /** + * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html)s. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#bookmarks) */ - bookmarks: Collection; + readonly bookmarks: Collection; /** * The view model's state. **Possible Values:** loading | disabled * @@ -45784,12 +48404,6 @@ declare namespace __esri { export const BookmarksViewModel: BookmarksViewModelConstructor; interface BookmarksViewModelProperties extends GoToProperties { - /** - * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html)s. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#bookmarks) - */ - bookmarks?: CollectionProperties; /** * The view from which the widget will operate. * @@ -47399,7 +50013,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ - sources?: Collection; + sources?: Collection; /** * Indicates whether to display suggestions as the user enters input text in the widget. * @@ -47496,10 +50110,10 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#viewModel) */ - viewModel?: DirectLineMeasurement3DViewModel; + viewModel?: DirectLineMeasurement3DViewModelProperties; } - interface DirectLineMeasurement3DViewModel { + interface DirectLineMeasurement3DViewModel extends Accessor { /** * The current measurement calculated between the two points. * @@ -47555,12 +50169,34 @@ declare namespace __esri { interface DirectLineMeasurement3DViewModelConstructor { - - new(properties?: any): DirectLineMeasurement3DViewModel; + new(properties?: DirectLineMeasurement3DViewModelProperties): DirectLineMeasurement3DViewModel; } export const DirectLineMeasurement3DViewModel: DirectLineMeasurement3DViewModelConstructor; + interface DirectLineMeasurement3DViewModelProperties { + /** + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | inches | feet | yards | miles | nautical-miles | meters | kilometers | us-feet + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#unit) + */ + unit?: string; + /** + * List of unit systems (imperial, metric) and specific units for displaying the distance values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#unitOptions) + * + * @default ["metric", "imperial", "inches", "feet", "yards", "miles", "nautical-miles", "us-feet", "meters", "kilometers"] + */ + unitOptions?: string[]; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#view) + */ + view?: SceneViewProperties; + } + export interface DirectLineMeasurement3DViewModelMeasurement extends Object { /** @@ -47645,13 +50281,13 @@ declare namespace __esri { */ content: Node | string | Widget; /** - * Whether the widget is currently expanded or not. + * Indicates whether the widget is currently expanded or not. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expanded) * * @default false */ - readonly expanded: boolean; + expanded: boolean; /** * Icon font used to style the Expand button. Will automatically use the [content's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) iconClass if it has one. * @@ -47673,7 +50309,7 @@ declare namespace __esri { */ group: string; /** - * A number to display at the corner of the widget to indicate the number of, for example, open issues or unread notices. ![expand widget icon number](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/expand-with-iconnumber.png) + * A number to display at the corner of the widget to indicate the number of, for example, open issues or unread notices. ![expand widget icon number](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/expand-with-iconnumber.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#iconNumber) */ @@ -47777,6 +50413,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) */ content?: Node | string | WidgetProperties; + /** + * Indicates whether the widget is currently expanded or not. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expanded) + * + * @default false + */ + expanded?: boolean; /** * Icon font used to style the Expand button. Will automatically use the [content's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) iconClass if it has one. * @@ -47798,7 +50442,7 @@ declare namespace __esri { */ group?: string; /** - * A number to display at the corner of the widget to indicate the number of, for example, open issues or unread notices. ![expand widget icon number](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/expand-with-iconnumber.png) + * A number to display at the corner of the widget to indicate the number of, for example, open issues or unread notices. ![expand widget icon number](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/expand-with-iconnumber.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#iconNumber) */ @@ -48101,6 +50745,513 @@ declare namespace __esri { content?: any; } + interface FeatureForm extends Widget { + /** + * The associated feature containing the editable attributes. A common way to access this is via the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) or [SceneView's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) `hitTest()` method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#feature) + */ + feature: Graphic; + /** + * Array of field configuration objects. This is where you specify what fields to display and how you wish to display them. + * > When not set, all fields except for `editor`, `globalID`, and `objectID` fields will be included, otherwise it is up to the developer to set the right field(s) to override and display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#fieldConfig) + */ + fieldConfig: FieldConfig[]; + /** + * Layer containing the editable feature attributes. If this layer is not specified, it is the same as the [graphic's layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#layer) + */ + layer: FeatureLayer; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [FeatureFormViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#viewModel) + */ + viewModel: FeatureFormViewModel; + + /** + * Returns all of the field values, regardless of whether or not they were updated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#getValues) + * + * + */ + getValues(): any; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#render) + * + * + */ + render(): any; + /** + * Fires the [submit](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#event:submit) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#submit) + * + * + */ + submit(): void; + } + + interface FeatureFormConstructor { + /** + * The FeatureForm widget displays attributes of a feature. This widget renders input fields based on the feature's attributes and whether the field allows editing. Use this widget, in combination with [FeatureLayer.applyEdits](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits), to enable an end user to update a feature's attribute on a specified editable feature layer(s). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) + */ + + new(properties?: FeatureFormProperties): FeatureForm; + } + + export const FeatureForm: FeatureFormConstructor; + + interface FeatureFormProperties extends WidgetProperties { + /** + * The associated feature containing the editable attributes. A common way to access this is via the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) or [SceneView's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) `hitTest()` method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#feature) + */ + feature?: GraphicProperties; + /** + * Array of field configuration objects. This is where you specify what fields to display and how you wish to display them. + * > When not set, all fields except for `editor`, `globalID`, and `objectID` fields will be included, otherwise it is up to the developer to set the right field(s) to override and display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#fieldConfig) + */ + fieldConfig?: FieldConfigProperties[]; + /** + * Layer containing the editable feature attributes. If this layer is not specified, it is the same as the [graphic's layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#layer) + */ + layer?: FeatureLayerProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [FeatureFormViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#viewModel) + */ + viewModel?: FeatureFormViewModelProperties; + } + + interface FeatureFormViewModel extends Accessor, Evented { + /** + * The associated feature containing the editable attributes. A common way to access this is via the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) or [SceneView's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) `hitTest()` method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#feature) + */ + feature: Graphic; + /** + * Array of field configuration objects. This is where you specify what fields to display and how you wish to display them. + * > When not set, all fields except for `editor`, `globalID`, and `objectID` fields will be included, otherwise it is up to the developer to set the right field(s) to override and display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#fieldConfig) + */ + fieldConfig: FieldConfig[]; + /** + * The input fields to be rendered by the [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#inputField) + */ + readonly inputField: InputField[]; + /** + * Layer containing the editable feature attributes. If this layer is not specified, it is the same as the [graphic's layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#layer) + */ + layer: FeatureLayer; + /** + * The widget's state. Possible values are in the table below. + * + * Value | Description + * ------|------------ + * ready | Dependencies are met and has valid property values. + * disabled | Dependencies are missing and cannot provide valid inputs. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + + /** + * Returns all of the field values, regardless of whether or not they were updated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#getValues) + * + * + */ + getValues(): any; + /** + * Fires the [submit](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#event:submit) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#submit) + * + * + */ + submit(): void; + } + + interface FeatureFormViewModelConstructor { + /** + * Provides the logic for the [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html) + */ + + new(properties?: FeatureFormViewModelProperties): FeatureFormViewModel; + } + + export const FeatureFormViewModel: FeatureFormViewModelConstructor; + + interface FeatureFormViewModelProperties { + /** + * The associated feature containing the editable attributes. A common way to access this is via the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) or [SceneView's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) `hitTest()` method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#feature) + */ + feature?: GraphicProperties; + /** + * Array of field configuration objects. This is where you specify what fields to display and how you wish to display them. + * > When not set, all fields except for `editor`, `globalID`, and `objectID` fields will be included, otherwise it is up to the developer to set the right field(s) to override and display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#fieldConfig) + */ + fieldConfig?: FieldConfigProperties[]; + /** + * Layer containing the editable feature attributes. If this layer is not specified, it is the same as the [graphic's layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#layer) + */ + layer?: FeatureLayerProperties; + } + + interface FieldConfig extends Accessor { + /** + * The field name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#name) + */ + name: string; + /** + * The field options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#options) + */ + options: FieldOptions; + } + + interface FieldConfigConstructor { + + + new(properties?: FieldConfigProperties): FieldConfig; + } + + export const FieldConfig: FieldConfigConstructor; + + interface FieldConfigProperties { + /** + * The field name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#name) + */ + name?: string; + /** + * The field options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#options) + */ + options?: FieldOptionsProperties; + } + + interface FieldOptions extends Accessor { + /** + * The field's description. The description is shown below the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#description) + */ + description: string; + /** + * The field's domain. This is used to constrain the allowable values of the layer. + * > This only applies to relevant field types. For example, [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html) only applies to `numeric` and `date` field types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#domain) + */ + domain: CodedValueDomain | RangeDomain; + /** + * Indicates whether the field is editable. + * > This does not change the underlying service's field and whether it is editable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#editable) + * + * @default true + */ + editable: boolean; + /** + * The type of editor to use for `string` field types. Possible values are in the table below. + * + * Value | Description + * ------|------------ + * text-box | An HTML textbox will be used to capture input. + * text-area | An HTML textarea will be used to capture input. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#editorType) + * + * @default "text-box" + */ + editorType: string; + /** + * This property is rendered as a tooltip in the [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) widget. It displays a hint for the attribute field's value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#hint) + */ + hint: string; + /** + * The field's label. The label is shown above the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#label) + */ + label: string; + /** + * Restricts the input length. + * > This only applies to `numeric` and `text` field types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#maxLength) + * + * @default -1 + */ + maxLength: number; + /** + * Indicates whether the field is required. + * > This cannot change the underlying service's field requirements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#required) + * + * @default false + */ + required: boolean; + /** + * When `true`, the field is displayed. Otherwise, it is hidden. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#visible) + * + * @default true + */ + visible: boolean; + } + + interface FieldOptionsConstructor { + + + new(properties?: FieldOptionsProperties): FieldOptions; + } + + export const FieldOptions: FieldOptionsConstructor; + + interface FieldOptionsProperties { + /** + * The field's description. The description is shown below the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#description) + */ + description?: string; + /** + * The field's domain. This is used to constrain the allowable values of the layer. + * > This only applies to relevant field types. For example, [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html) only applies to `numeric` and `date` field types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#domain) + */ + domain?: CodedValueDomainProperties | RangeDomainProperties; + /** + * Indicates whether the field is editable. + * > This does not change the underlying service's field and whether it is editable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#editable) + * + * @default true + */ + editable?: boolean; + /** + * The type of editor to use for `string` field types. Possible values are in the table below. + * + * Value | Description + * ------|------------ + * text-box | An HTML textbox will be used to capture input. + * text-area | An HTML textarea will be used to capture input. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#editorType) + * + * @default "text-box" + */ + editorType?: string; + /** + * This property is rendered as a tooltip in the [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) widget. It displays a hint for the attribute field's value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#hint) + */ + hint?: string; + /** + * The field's label. The label is shown above the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#label) + */ + label?: string; + /** + * Restricts the input length. + * > This only applies to `numeric` and `text` field types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#maxLength) + * + * @default -1 + */ + maxLength?: number; + /** + * Indicates whether the field is required. + * > This cannot change the underlying service's field requirements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#required) + * + * @default false + */ + required?: boolean; + /** + * When `true`, the field is displayed. Otherwise, it is hidden. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#visible) + * + * @default true + */ + visible?: boolean; + } + + interface InputField extends Accessor { + /** + * The field's description. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#description) + */ + readonly description: string; + /** + * The input value's domain. This is used to constrain the allowable values of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#domain) + */ + readonly domain: CodedValueDomain | RangeDomain; + /** + * When true, the field is editable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#editable) + */ + readonly editable: boolean; + /** + * The type of editor used when working with `string` fields. Possible values are in the table below. + * + * Value | Description + * ------|------------ + * text-box | An HTML textbox used to capture input. + * text-area | An HTML textarea used to capture input. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#editorType) + * + * @default "text-box" + */ + readonly editorType: string; + /** + * If the input field's value is invalid, this property returns validation error code. Otherwise, it is `null`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#error) + */ + readonly error: string; + /** + * A user-friendly formatted error message based on the [validation error code](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#error). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#errorMessage) + */ + readonly errorMessage: string; + /** + * A hint for the field's value. This property is rendered as a tooltip. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#hint) + */ + readonly hint: string; + /** + * The field's label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#label) + */ + readonly label: string; + /** + * Restricts the input length. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#maxLength) + */ + readonly maxLength: number; + /** + * The associated field name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#name) + */ + readonly name: string; + /** + * Indicates whether the field is required. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#required) + */ + readonly required: boolean; + /** + * The type of input field. Possible values are listed below. + * + * Value | Description + * ------|------------ + * number | Input represents a number. + * text | Input represents text. + * date | Input represents a date. + * unsupported | The field represents an unsupported value. A `blob` field type is an example of this. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#type) + */ + readonly type: string; + /** + * When `true`, the input value is invalid. Otherwise, it is valid. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#valid) + */ + readonly valid: boolean; + /** + * The input's value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#value) + */ + readonly value: number | string | any; + /** + * When `true`, the field is displayed. Otherwise, it is hidden. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#visible) + */ + readonly visible: boolean; + } + + interface InputFieldConstructor { + + + new(properties?: InputFieldProperties): InputField; + } + + export const InputField: InputFieldConstructor; + + interface InputFieldProperties { + + } + interface Fullscreen extends Widget { /** * The [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) to present in fullscreen mode. @@ -48270,6 +51421,14 @@ declare namespace __esri { */ viewpoint: Viewpoint; + /** + * This function provides the ability to interrupt and cancel the process of navigating the view back to the view's initial extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#cancelGo) + * + * + */ + cancelGo(): void; /** * Animates the view to the initial Viewpoint of the view or the value of [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewpoint). * @@ -48351,6 +51510,14 @@ declare namespace __esri { */ viewpoint: Viewpoint; + /** + * This function provides the ability to interrupt and cancel the process of navigating the view back to the view's initial extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#cancelGo) + * + * + */ + cancelGo(): void; /** * Animates the view to the initial [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) of the view or the value of [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#viewpoint). * @@ -48413,7 +51580,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#operationalItems) */ - operationalItems: Collection; + readonly operationalItems: Collection; /** * Option for enabling status indicators, which indicate whether or not each layer is loading resources. * @@ -48470,12 +51637,6 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) */ listItemCreatedFunction?: ListItemCreatedHandler; - /** - * A collection of [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html)s representing operational layers. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#operationalItems) - */ - operationalItems?: CollectionProperties; /** * Option for enabling status indicators, which indicate whether or not each layer is loading resources. * @@ -48702,7 +51863,7 @@ declare namespace __esri { */ content: Widget | HTMLElement | string | any[]; /** - * The URL or data URI of an image used to represent the panel. This property will be used as a background image for the node. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/latest/assets/img/guide/whats-new/41/default-action.png) will display. + * The URL or data URI of an image used to represent the panel. This property will be used as a background image for the node. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/assets/img/guide/whats-new/41/default-action.png) will display. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#image) */ @@ -48772,19 +51933,13 @@ declare namespace __esri { */ layerInfos: LegendLayerInfos[]; /** - * Indicates the style of the legend. The style determines the legend's layout and behavior. See the table below for a list of possible values. - * - * Value | Description - * ------|------------ - * classic | The legend has a portrait orientation. The user can scroll vertically when many elements are included in the legend's content. - * card | In wide views, the legend has a landscape orientation that allows users to scroll horizontally to view all legend elements. This style is responsive, making it ideal for mobile web apps. In smaller views, the legend collapses to occupy less space. One element is shown at a time in a card-style layout, which the user can navigate horizontally. - * + * Indicates the style of the legend. The style determines the legend's layout and behavior. You can either specify a string or an object to indicate the style. The known string values are the same values listed in the table within the `type` property. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style) * * @default classic */ - style: string; + style: string | LegendStyle; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. * @@ -48822,19 +51977,13 @@ declare namespace __esri { */ layerInfos?: LegendLayerInfos[]; /** - * Indicates the style of the legend. The style determines the legend's layout and behavior. See the table below for a list of possible values. - * - * Value | Description - * ------|------------ - * classic | The legend has a portrait orientation. The user can scroll vertically when many elements are included in the legend's content. - * card | In wide views, the legend has a landscape orientation that allows users to scroll horizontally to view all legend elements. This style is responsive, making it ideal for mobile web apps. In smaller views, the legend collapses to occupy less space. One element is shown at a time in a card-style layout, which the user can navigate horizontally. - * + * Indicates the style of the legend. The style determines the legend's layout and behavior. You can either specify a string or an object to indicate the style. The known string values are the same values listed in the table within the `type` property. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style) * * @default classic */ - style?: string; + style?: string | LegendStyle; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. * @@ -48859,6 +52008,37 @@ declare namespace __esri { layer: Layer; } + + export interface LegendStyle extends Object { + /** + * Specifies the style of the legend. There are two possible values listed in the table below: + * + * Value | Description + * ------|------------ + * classic | The legend has a portrait orientation. The user can scroll vertically when many elements are included in the legend's content. + * card | In wide views, the legend has a landscape orientation that allows users to scroll horizontally to view all legend elements. This style can be responsive, making it ideal for mobile web apps. In smaller views, the legend collapses to occupy less space. One element is shown at a time in a card-style layout, which the user can navigate horizontally. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style) + */ + type: string; + /** + * When a `card` type is specified, you can specify one of the following layout options. + * + * Value | Description + * ------|------------ + * auto | This layout is responsive so that in wide views the legend has a `side-by-side` layout, and a `stack` layout in smaller (mobile) views. + * side-by-side | The legend has a landscape orientation that allows users to scroll horizontally to view multiple legend cards at a time. + * stack | The legend cards are stacked, which conserves space, but restricts the user to seeing only one card at a time. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style) + * + * @default stack + */ + layout?: string; + } + interface Locate extends Widget, GoTo { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. @@ -48923,6 +52103,14 @@ declare namespace __esri { */ viewModel: LocateViewModel; + /** + * This function provides the ability to interrupt and cancel the process of programmatically obtaining the location of the user's device. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#cancelLocate) + * + * + */ + cancelLocate(): void; /** * Animates the view to the user's location. * @@ -49022,6 +52210,14 @@ declare namespace __esri { */ readonly state: string; + /** + * This function provides the ability to interrupt and cancel the process of programmatically obtaining the location of the user's device. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#cancelLocate) + * + * + */ + cancelLocate(): void; /** * Animates the view to the user's location. * @@ -49066,8 +52262,8 @@ declare namespace __esri { * * Possible Value | Example * ---------------|-------- - * vertical | ![navigation-toggle](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/navigation-toggle.png) - * horizontal | ![navigation-toggle-horizontal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/navigation-toggle-horizontal.png) + * vertical | ![navigation-toggle](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/navigation-toggle.png) + * horizontal | ![navigation-toggle-horizontal](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/navigation-toggle-horizontal.png) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#layout) @@ -49124,8 +52320,8 @@ declare namespace __esri { * * Possible Value | Example * ---------------|-------- - * vertical | ![navigation-toggle](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/navigation-toggle.png) - * horizontal | ![navigation-toggle-horizontal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/navigation-toggle-horizontal.png) + * vertical | ![navigation-toggle](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/navigation-toggle.png) + * horizontal | ![navigation-toggle-horizontal](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/navigation-toggle-horizontal.png) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#layout) @@ -49224,7 +52420,7 @@ declare namespace __esri { interface Popup extends Widget, GoTo, Evented { /** - * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) classes. + * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) classes. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) */ @@ -49296,7 +52492,7 @@ declare namespace __esri { */ readonly featureCount: number; /** - * Shows pagination for the popup if available. This allows the user to scroll through various [selected features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) using either arrows ![popup-pagination-arrows](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popup-pagination-arrows.png) or a menu. ![popup-feature-menu](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popup-pagination-menu.png) + * Shows pagination for the popup if available. This allows the user to scroll through various [selected features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) using either arrows ![popup-pagination-arrows](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popup-pagination-arrows.png) or a menu. ![popup-feature-menu](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popup-pagination-menu.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#featureNavigationEnabled) */ @@ -49308,8 +52504,7 @@ declare namespace __esri { */ features: Graphic[]; /** - * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * > **Known Limitation** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabled) * @@ -49477,7 +52672,7 @@ declare namespace __esri { interface PopupProperties extends WidgetProperties, GoToProperties { /** - * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) classes. + * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) classes. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) */ @@ -49535,7 +52730,7 @@ declare namespace __esri { */ dockOptions?: PopupDockOptions; /** - * Shows pagination for the popup if available. This allows the user to scroll through various [selected features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) using either arrows ![popup-pagination-arrows](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popup-pagination-arrows.png) or a menu. ![popup-feature-menu](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popup-pagination-menu.png) + * Shows pagination for the popup if available. This allows the user to scroll through various [selected features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) using either arrows ![popup-pagination-arrows](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popup-pagination-arrows.png) or a menu. ![popup-feature-menu](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popup-pagination-menu.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#featureNavigationEnabled) */ @@ -49547,8 +52742,7 @@ declare namespace __esri { */ features?: GraphicProperties[]; /** - * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * > **Known Limitation** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabled) * @@ -49607,7 +52801,7 @@ declare namespace __esri { interface PopupViewModel extends Accessor, Evented, GoTo { /** - * [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. + * [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) */ @@ -49647,8 +52841,7 @@ declare namespace __esri { */ features: Graphic[]; /** - * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * > **Known Limitation** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#highlightEnabled) * @@ -49774,7 +52967,7 @@ declare namespace __esri { interface PopupViewModelProperties extends GoToProperties { /** - * [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. + * [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) */ @@ -49800,8 +52993,7 @@ declare namespace __esri { */ features?: GraphicProperties[]; /** - * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * > **Known Limitation** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#highlightEnabled) * @@ -50436,13 +53628,13 @@ declare namespace __esri { interface widgetsSearch extends Widget, GoTo { /** - * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) object currently selected. Can be either a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or a [locator task](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). + * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) object currently selected. Can be either a [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) or a module:esri/widget/Search/LocatorSearchSource. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#activeSource) * * @default null */ - readonly activeSource: FeatureLayer | Locator; + readonly activeSource: FeatureLayerSearchSource | LocatorSearchSource; /** * The selected source's index. This value is `-1` when all sources are selected. * @@ -50452,7 +53644,7 @@ declare namespace __esri { */ activeSourceIndex: number; /** - * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-allplaceholder.png) + * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-allplaceholder.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#allPlaceholder) * @@ -50488,7 +53680,7 @@ declare namespace __esri { */ readonly label: string; /** - * Enables location services within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-locationEnabled.png) + * Enables location services within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-locationEnabled.png) * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#locationEnabled) @@ -50521,21 +53713,13 @@ declare namespace __esri { */ minSuggestCharacters: number; /** - * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). This is not the same as using [popupOpenOnSelect](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupOpenOnSelect) which opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but it is not opened by default. + * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupEnabled) * * @default true */ popupEnabled: boolean; - /** - * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. Using `popupOpenOnSelect` opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but not opened by default. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupOpenOnSelect) - * - * @default true - */ - popupOpenOnSelect: boolean; /** * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. * @@ -50551,7 +53735,8 @@ declare namespace __esri { */ portal: Portal; /** - * The graphic used to highlight the resulting feature or location. + * The graphic used to highlight the resulting feature or location. + * A graphic will be placed in the View's [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics) for [layer views](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) that do not support the `highlight` method. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic) */ @@ -50571,7 +53756,7 @@ declare namespace __esri { */ readonly results: any[]; /** - * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) + * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-false](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-false.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#searchAllEnabled) * @@ -50592,23 +53777,23 @@ declare namespace __esri { readonly selectedResult: SearchResult; /** * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) specified by the Search widget instance. There are two types of sources: - * * [LocatorSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - * * [FeatureLayerSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + * * [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) + * * [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html) * * - * Any combination of one or more [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) sources may be used together in the same instance of the Search widget. + * Any combination of these sources may be used together in the same instance of the Search widget. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) */ - sources: Collection; + sources: Collection; /** - * An array of results from the [suggest method](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest). This is available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * An array of results from the [suggest method](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest). This is available if working with a 10.3 or greater geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggestions) */ readonly suggestions: SuggestResult[]; /** - * Enable suggestions for the widget. This is only available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * Enable suggestions for the widget. This is only available if working with a 10.3 or greater geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggestionsEnabled) * @@ -50670,7 +53855,7 @@ declare namespace __esri { */ search(searchTerm?: string | Geometry | SuggestResult | number[][]): IPromise; /** - * Performs a suggest() request on the active Locator. It also uses the current value of the widget or one that is passed in. Suggestions are available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * Performs a suggest() request on the active Locator. It also uses the current value of the widget or one that is passed in. Suggestions are available if working with a 10.3 or greater geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest) * @@ -50702,7 +53887,7 @@ declare namespace __esri { */ activeSourceIndex?: number; /** - * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-allplaceholder.png) + * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-allplaceholder.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#allPlaceholder) * @@ -50726,7 +53911,7 @@ declare namespace __esri { */ includeDefaultSources?: boolean | Function; /** - * Enables location services within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-locationEnabled.png) + * Enables location services within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-locationEnabled.png) * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#locationEnabled) @@ -50759,21 +53944,13 @@ declare namespace __esri { */ minSuggestCharacters?: number; /** - * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). This is not the same as using [popupOpenOnSelect](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupOpenOnSelect) which opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but it is not opened by default. + * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupEnabled) * * @default true */ popupEnabled?: boolean; - /** - * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. Using `popupOpenOnSelect` opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but not opened by default. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupOpenOnSelect) - * - * @default true - */ - popupOpenOnSelect?: boolean; /** * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. * @@ -50797,7 +53974,7 @@ declare namespace __esri { */ resultGraphicEnabled?: boolean; /** - * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) + * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-false](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-false.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#searchAllEnabled) * @@ -50812,17 +53989,17 @@ declare namespace __esri { searchTerm?: string; /** * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) specified by the Search widget instance. There are two types of sources: - * * [LocatorSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - * * [FeatureLayerSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + * * [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) + * * [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html) * * - * Any combination of one or more [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) sources may be used together in the same instance of the Search widget. + * Any combination of these sources may be used together in the same instance of the Search widget. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) */ - sources?: CollectionProperties; + sources?: CollectionProperties; /** - * Enable suggestions for the widget. This is only available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * Enable suggestions for the widget. This is only available if working with a 10.3 or greater geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggestionsEnabled) * @@ -50843,13 +54020,517 @@ declare namespace __esri { viewModel?: SearchViewModelProperties; } + interface FeatureLayerSearchSource extends SearchSource, JSONSupport { + /** + * The results are displayed using this field. Defaults to the layer's `displayField` or the first string field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#displayField) + */ + displayField: string; + /** + * Indicates to only return results that match the search value exactly. This property only applies to `string` field searches. `exactMatch` is always `true` when searching fields of type `number`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#exactMatch) + * + * @default false + */ + exactMatch: boolean; + /** + * The feature layer queried in the search. This is **required**. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#featureLayer) + */ + featureLayer: FeatureLayer; + /** + * The name of the source for display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#name) + */ + name: string; + /** + * An array of string values representing the names of fields in the feature layer to search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#searchFields) + */ + searchFields: string[]; + /** + * A template string used to display multiple fields in a defined order when results are displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#searchTemplate) + */ + searchTemplate: string; + /** + * A template string used to display multiple fields in a defined order when suggestions are displayed. This takes precedence over `displayField`. Field names in the template must have the following format: `{FieldName}`. An example suggestionTemplate could look something like: `Name: {OWNER}, Parcel: {PARCEL_ID}`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#suggestionTemplate) + */ + suggestionTemplate: string; + + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#clone) + * + * + */ + clone(): FeatureLayerSearchSource; + } + + interface FeatureLayerSearchSourceConstructor { + + + new(properties?: FeatureLayerSearchSourceProperties): FeatureLayerSearchSource; + + fromJSON(json: any): FeatureLayerSearchSource; + } + + export const FeatureLayerSearchSource: FeatureLayerSearchSourceConstructor; + + interface FeatureLayerSearchSourceProperties extends SearchSourceProperties { + /** + * The results are displayed using this field. Defaults to the layer's `displayField` or the first string field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#displayField) + */ + displayField?: string; + /** + * Indicates to only return results that match the search value exactly. This property only applies to `string` field searches. `exactMatch` is always `true` when searching fields of type `number`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#exactMatch) + * + * @default false + */ + exactMatch?: boolean; + /** + * The feature layer queried in the search. This is **required**. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#featureLayer) + */ + featureLayer?: FeatureLayerProperties; + /** + * The name of the source for display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#name) + */ + name?: string; + /** + * An array of string values representing the names of fields in the feature layer to search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#searchFields) + */ + searchFields?: string[]; + /** + * A template string used to display multiple fields in a defined order when results are displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#searchTemplate) + */ + searchTemplate?: string; + /** + * A template string used to display multiple fields in a defined order when suggestions are displayed. This takes precedence over `displayField`. Field names in the template must have the following format: `{FieldName}`. An example suggestionTemplate could look something like: `Name: {OWNER}, Parcel: {PARCEL_ID}`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#suggestionTemplate) + */ + suggestionTemplate?: string; + } + + interface LocatorSearchSource extends SearchSource, JSONSupport { + /** + * A string array which limits the results to one or more categories. For example, `Populated Place` or `airport`. Only applicable when using the World Geocode Service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#categories) + */ + categories: string[]; + /** + * Constricts search results to a specified country code. For example, `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#countryCode) + */ + countryCode: string; + /** + * Sets the sources for local `distance` and `minScale` for searching. See the object specification table below for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#localSearchOptions) + */ + localSearchOptions: LocatorSearchSourceLocalSearchOptions; + /** + * When reverse geocoding a result, use this distance in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#locationToAddressDistance) + * + * @default 1500 + */ + locationToAddressDistance: number; + /** + * The locator task used to search. This is **required** and defaults to the [World Geocoding Service](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#locator) + */ + locator: Locator; + /** + * The name of the source for display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#name) + */ + name: string; + /** + * A template string used to display multiple fields in a defined order when results are displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#searchTemplate) + */ + searchTemplate: string; + /** + * The field name of the Single Line Address Field in the REST services directory for the locator service. Common values are `SingleLine` and `SingleLineFieldName`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#singleLineFieldName) + */ + singleLineFieldName: string; + + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#clone) + * + * + */ + clone(): LocatorSearchSource; + } + + interface LocatorSearchSourceConstructor { + + + new(properties?: LocatorSearchSourceProperties): LocatorSearchSource; + + fromJSON(json: any): LocatorSearchSource; + } + + export const LocatorSearchSource: LocatorSearchSourceConstructor; + + interface LocatorSearchSourceProperties extends SearchSourceProperties { + /** + * A string array which limits the results to one or more categories. For example, `Populated Place` or `airport`. Only applicable when using the World Geocode Service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#categories) + */ + categories?: string[]; + /** + * Constricts search results to a specified country code. For example, `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#countryCode) + */ + countryCode?: string; + /** + * Sets the sources for local `distance` and `minScale` for searching. See the object specification table below for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#localSearchOptions) + */ + localSearchOptions?: LocatorSearchSourceLocalSearchOptions; + /** + * When reverse geocoding a result, use this distance in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#locationToAddressDistance) + * + * @default 1500 + */ + locationToAddressDistance?: number; + /** + * The locator task used to search. This is **required** and defaults to the [World Geocoding Service](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#locator) + */ + locator?: LocatorProperties; + /** + * The name of the source for display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#name) + */ + name?: string; + /** + * A template string used to display multiple fields in a defined order when results are displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#searchTemplate) + */ + searchTemplate?: string; + /** + * The field name of the Single Line Address Field in the REST services directory for the locator service. Common values are `SingleLine` and `SingleLineFieldName`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#singleLineFieldName) + */ + singleLineFieldName?: string; + } + + + export interface LocatorSearchSourceLocalSearchOptions extends Object { + /** + * The distance to search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#localSearchOptions) + */ + distance?: number; + /** + * The minimum scale used to search locally. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#localSearchOptions) + */ + minScale?: number; + } + + interface SearchSource extends JSONSupport { + /** + * Indicates whether to automatically navigate to the selected result once selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#autoNavigate) + * + * @default true + */ + autoNavigate: boolean; + /** + * This property replaces the now deprecated `searchQueryParams`, `suggestQueryParams`, and `searchExtent` properties. Please see the object specification table below for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#filter) + */ + filter: SearchSourceFilter; + /** + * Indicates the maximum number of search results to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#maxResults) + * + * @default 6 + */ + maxResults: number; + /** + * Indicates the maximum number of suggestions to return for the widget's input. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#maxSuggestions) + * + * @default 6 + */ + maxSuggestions: number; + /** + * Indicates the minimum number of characters required before querying for a suggestion. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#minSuggestCharacters) + * + * @default 1 + */ + minSuggestCharacters: number; + /** + * Specifies the fields returned with the search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#outFields) + */ + outFields: string[]; + /** + * Used as a hint for the source input text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#placeholder) + */ + placeholder: string; + /** + * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#popupEnabled) + */ + popupEnabled: boolean; + /** + * The popup template used to display search results. If no popup is needed, set the source's popupTemplate to `null`. + * > This property should be set in instances where there is no existing [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) configured. For example, [feature sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) will default to any existing [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) configured on the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#popupTemplate) + */ + popupTemplate: PopupTemplate; + /** + * Specify this to prefix the user's input of the search text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#prefix) + */ + prefix: string; + /** + * Indicates whether to show a graphic on the map for the selected source using the [resultSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#resultSymbol). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#resultGraphicEnabled) + */ + resultGraphicEnabled: boolean; + /** + * The symbol used to display the result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#resultSymbol) + */ + resultSymbol: Symbol; + /** + * Specify this to add a suffix to the user's input for the search value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#suffix) + */ + suffix: string; + /** + * Indicates whether to display suggestions as the user enters input text in the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#suggestionsEnabled) + * + * @default true + */ + suggestionsEnabled: boolean; + /** + * Indicates whether to constrain the search results to the view's extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#withinViewEnabled) + * + * @default false + */ + withinViewEnabled: boolean; + /** + * The set zoom scale for the resulting search result. This scale is automatically honored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#zoomScale) + */ + zoomScale: number; + } + + interface SearchSourceConstructor { + + + new(properties?: SearchSourceProperties): SearchSource; + + fromJSON(json: any): SearchSource; + } + + export const SearchSource: SearchSourceConstructor; + + interface SearchSourceProperties { + /** + * Indicates whether to automatically navigate to the selected result once selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#autoNavigate) + * + * @default true + */ + autoNavigate?: boolean; + /** + * This property replaces the now deprecated `searchQueryParams`, `suggestQueryParams`, and `searchExtent` properties. Please see the object specification table below for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#filter) + */ + filter?: SearchSourceFilter; + /** + * Indicates the maximum number of search results to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#maxResults) + * + * @default 6 + */ + maxResults?: number; + /** + * Indicates the maximum number of suggestions to return for the widget's input. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#maxSuggestions) + * + * @default 6 + */ + maxSuggestions?: number; + /** + * Indicates the minimum number of characters required before querying for a suggestion. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#minSuggestCharacters) + * + * @default 1 + */ + minSuggestCharacters?: number; + /** + * Specifies the fields returned with the search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#outFields) + */ + outFields?: string[]; + /** + * Used as a hint for the source input text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#placeholder) + */ + placeholder?: string; + /** + * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#popupEnabled) + */ + popupEnabled?: boolean; + /** + * The popup template used to display search results. If no popup is needed, set the source's popupTemplate to `null`. + * > This property should be set in instances where there is no existing [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) configured. For example, [feature sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) will default to any existing [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) configured on the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#popupTemplate) + */ + popupTemplate?: PopupTemplateProperties; + /** + * Specify this to prefix the user's input of the search text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#prefix) + */ + prefix?: string; + /** + * Indicates whether to show a graphic on the map for the selected source using the [resultSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#resultSymbol). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#resultGraphicEnabled) + */ + resultGraphicEnabled?: boolean; + /** + * The symbol used to display the result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#resultSymbol) + */ + resultSymbol?: SymbolProperties; + /** + * Specify this to add a suffix to the user's input for the search value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#suffix) + */ + suffix?: string; + /** + * Indicates whether to display suggestions as the user enters input text in the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#suggestionsEnabled) + * + * @default true + */ + suggestionsEnabled?: boolean; + /** + * Indicates whether to constrain the search results to the view's extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#withinViewEnabled) + * + * @default false + */ + withinViewEnabled?: boolean; + /** + * The set zoom scale for the resulting search result. This scale is automatically honored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#zoomScale) + */ + zoomScale?: number; + } + + + export interface SearchSourceFilter extends Object { + /** + * The where clause specified for filtering suggests or search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#filter) + */ + where?: string; + /** + * The filter geometry for suggests or search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#filter) + */ + geometry?: Geometry; + } + interface SearchViewModel extends Accessor, Evented, GoTo { /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) object currently selected. Can be either a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or a [locator task](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#activeSource) */ - readonly activeSource: FeatureLayer | Locator; + readonly activeSource: FeatureLayerSearchSource | LocatorSearchSource; /** * The selected source's index. This value is `-1` when all sources are selected. * @@ -50859,7 +54540,7 @@ declare namespace __esri { */ activeSourceIndex: number; /** - * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-allplaceholder.png) + * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-allplaceholder.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#allPlaceholder) * @@ -50871,7 +54552,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#allSources) */ - readonly allSources: Collection; + readonly allSources: Collection; /** * Indicates whether to automatically select and zoom to the first geocoded result. If `false`, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation will still geocode the input string, but the top result will not be selected. To work with the geocoded results, you can set up a [search-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#event:search-complete) event handler and get the results through the event object. * @@ -50881,11 +54562,11 @@ declare namespace __esri { */ autoSelect: boolean; /** - * A read-only property that is a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [FeaturelayerSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) and/or [LocatorSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource). This property may contain [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) [locators](http://enterprise.arcgis.com/en/server/latest/publish-services/windows/geocode-services.htm) and any web map or web scene [configurable search sources](http://doc.arcgis.com/en/arcgis-online/create-maps/configure-feature-search.htm). This property is used to populate the Search UI if the [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) property is not set. + * A read-only property that is a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of module:esri/widgets/Search/FeaturelayerSource and/or [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html). This property may contain [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) [locators](http://enterprise.arcgis.com/en/server/latest/publish-services/windows/geocode-services.htm) and any web map or web scene [configurable search sources](http://doc.arcgis.com/en/arcgis-online/create-maps/configure-feature-search.htm). This property is used to populate the Search UI if the [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) property is not set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) */ - readonly defaultSources: Collection; + readonly defaultSources: Collection; /** * The default [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the search result. * @@ -50903,7 +54584,7 @@ declare namespace __esri { */ includeDefaultSources: boolean | Function; /** - * Indicates whether location services are enabled within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-locationEnabled.png) + * Indicates whether location services are enabled within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-locationEnabled.png) * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#locationEnabled) @@ -50948,21 +54629,13 @@ declare namespace __esri { */ readonly placeholder: string; /** - * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). This is not the same as using [popupOpenOnSelect](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) which opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but it is not opened by default. + * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupEnabled) * * @default true */ popupEnabled: boolean; - /** - * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. Using `popupOpenOnSelect` opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but not opened by default. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) - * - * @default true - */ - popupOpenOnSelect: boolean; /** * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. * @@ -50986,7 +54659,8 @@ declare namespace __esri { */ readonly resultGraphic: Graphic; /** - * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) will display at the location of the selected feature. + * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) will display at the location of the selected feature. + * A graphic will be placed in the View's [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics) for [layer views](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) that do not support the `highlight` method. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphicEnabled) * @@ -51002,7 +54676,7 @@ declare namespace __esri { */ readonly results: any[]; /** - * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-true-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) + * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-true-false](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-false.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchAllEnabled) * @@ -51033,15 +54707,15 @@ declare namespace __esri { readonly selectedSuggestion: Geometry | SearchViewModelSuggestResult; /** * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) specified by the Search widget instance. There are two types of sources: - * * [LocatorSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - * * [FeatureLayerSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + * * [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) + * * [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html) * * - * Any combination of one or more [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) sources may be used together in the same instance of the Search widget. + * Any combination of these sources may be used together in the same instance of the Search widget. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) */ - sources: Collection; + sources: Collection; /** * The current state of the widget. This property was removed from [Search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html) and should now be accessed within the [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html). **Possible Values:** ready | disabled | searching * @@ -51059,7 +54733,7 @@ declare namespace __esri { */ suggestionDelay: number; /** - * An array of results from the [suggest method](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest). This is available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * An array of results from the [suggest method](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest). This is available if working with a 10.3 or greater geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestions) * @@ -51067,7 +54741,7 @@ declare namespace __esri { */ readonly suggestions: SearchViewModelSuggestResult[]; /** - * Enable suggestions for the widget. This is only available if working with a 10.3 geocoding service that has [suggest capability loaded] (https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * Enable suggestions for the widget. This is only available if working with a 10.3 or greater geocoding service that has [suggest capability loaded] (https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionsEnabled) * @@ -51109,7 +54783,7 @@ declare namespace __esri { */ searchNearby(): IPromise; /** - * Performs a suggest() request on the active Locator. It also uses the current value of the widget or one that is passed in. Suggestions are available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e.`supportsPagination = true`. + * Performs a suggest() request on the active Locator. It also uses the current value of the widget or one that is passed in. Suggestions are available if working with a 10.3 or greater geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e.`supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest) * @@ -51150,7 +54824,7 @@ declare namespace __esri { */ activeSourceIndex?: number; /** - * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-allplaceholder.png) + * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-allplaceholder.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#allPlaceholder) * @@ -51182,7 +54856,7 @@ declare namespace __esri { */ includeDefaultSources?: boolean | Function; /** - * Indicates whether location services are enabled within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-locationEnabled.png) + * Indicates whether location services are enabled within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-locationEnabled.png) * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#locationEnabled) @@ -51221,21 +54895,13 @@ declare namespace __esri { */ minSuggestCharacters?: number; /** - * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). This is not the same as using [popupOpenOnSelect](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) which opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but it is not opened by default. + * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupEnabled) * * @default true */ popupEnabled?: boolean; - /** - * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. Using `popupOpenOnSelect` opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but not opened by default. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) - * - * @default true - */ - popupOpenOnSelect?: boolean; /** * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. * @@ -51251,7 +54917,8 @@ declare namespace __esri { */ portal?: PortalProperties; /** - * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) will display at the location of the selected feature. + * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) will display at the location of the selected feature. + * A graphic will be placed in the View's [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics) for [layer views](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) that do not support the `highlight` method. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphicEnabled) * @@ -51259,7 +54926,7 @@ declare namespace __esri { */ resultGraphicEnabled?: boolean; /** - * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-true-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) + * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-true-false](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-false.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchAllEnabled) * @@ -51274,15 +54941,15 @@ declare namespace __esri { searchTerm?: string; /** * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) specified by the Search widget instance. There are two types of sources: - * * [LocatorSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - * * [FeatureLayerSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + * * [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) + * * [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html) * * - * Any combination of one or more [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) sources may be used together in the same instance of the Search widget. + * Any combination of these sources may be used together in the same instance of the Search widget. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) */ - sources?: CollectionProperties; + sources?: CollectionProperties; /** * The millisecond delay after keyup and before making a [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest) network request. * @@ -51292,7 +54959,7 @@ declare namespace __esri { */ suggestionDelay?: number; /** - * Enable suggestions for the widget. This is only available if working with a 10.3 geocoding service that has [suggest capability loaded] (https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * Enable suggestions for the widget. This is only available if working with a 10.3 or greater geocoding service that has [suggest capability loaded] (https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionsEnabled) * @@ -51309,310 +54976,6 @@ declare namespace __esri { view?: MapViewProperties | SceneViewProperties; } - /** - * The following properties define a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html)-based [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) whose features may be searched by the Search widget. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - export interface SearchViewModelFeatureLayerSource extends Object { - /** - * The Popup instance used for the selected result. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - popup: Popup; - /** - * Indicates whether to automatically navigate to the selected result once selected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - autoNavigate?: boolean; - /** - * Indicates to only return results that match the search value exactly. This property only applies to `string` field searches. `exactMatch` is always `true` when searching fields of type `number`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - exactMatch?: boolean; - /** - * The feature layer queried in the search. This is **required**. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - featureLayer: FeatureLayer; - /** - * As of version 4.4, this property replaces the now deprecated `searchQueryParams`, `suggestQueryParams`, and `searchExtent` properties. Please see the object specification table below for details. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - filter: SearchViewModelFeatureLayerSourceFilter; - /** - * Indicates the maximum number of search results to return. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - maxResults?: number; - /** - * Indicates the maximum number of suggestions to return for the widget's input. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - maxSuggestions?: number; - /** - * Indicates the minimum number of characters required before querying for a suggestion. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - minSuggestCharacters?: number; - /** - * The name of the source for display. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - name: string; - /** - * Specifies the fields returned with the search results. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - outFields: string[]; - /** - * Used as a hint for the source input text. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - placeholder: string; - /** - * The results are displayed using this field. Defaults to the layer's `displayField` or the first string field. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - displayField: string; - /** - * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - popupEnabled?: boolean; - /** - * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - popupOpenOnSelect?: boolean; - /** - * Specify this to prefix the input for the search text. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - prefix: string; - /** - * Indicates whether to show a graphic on the map for the selected source using the [resultSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultSymbol). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - resultGraphicEnabled?: boolean; - /** - * The symbol used for the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - resultSymbol: Symbol; - /** - * An array of string values representing the names of fields in the feature layer to search. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - searchFields: string[]; - /** - * Specify this to suffix the input for the search value. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - suffix: string; - /** - * Indicates whether to display suggestions as the user enters input text in the widget. The default value is `true`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - suggestionsEnabled: boolean; - /** - * A template string used to display multiple fields in a defined order when suggestions are displayed. This takes precedence over `displayField`. Field names in the template must have the following format: `{FieldName}`. An example suggestionTemplate could look something like: `Name: {OWNER}, Parcel: {PARCEL_ID}`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - suggestionTemplate: string; - /** - * Indicates whether to constrain the search results to the view's extent. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - withinViewEnabled: boolean; - /** - * Applicable to the specified source. If the result does not have an associated extent, specify this number to use as the zoom scale for the result. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - zoomScale: number; - } - - /** - * The following properties define a [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) pointing to a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) that may be used to geocode locations with the Search widget. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - export interface SearchViewModelLocatorSource extends Object { - /** - * Used as a hint for the source input text. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - placeholder: string; - /** - * Indicates whether to automatically navigate to the selected result once selected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - autoNavigate?: boolean; - /** - * Constricts search results to a specified country code. For example, `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. View the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - countryCode: string; - /** - * As of version 4.4, this property replaces the now deprecated `searchQueryParams`, `suggestQueryParams`, and `searchExtent` properties. Please see the object specification table below for details. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - filter: SearchViewModelLocatorSourceFilter; - /** - * Sets the sources for local `distance` and `minScale` for searching. See the object specification table below for details. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - localSearchOptions: SearchViewModelLocatorSourceLocalSearchOptions; - /** - * When reverse geocoding a result, use this distance in meters. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - locationToAddressDistance?: number; - /** - * The locator task used to search. This is **required** and defaults to the [World Geocoding Service](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - locator: Locator; - /** - * Indicates the maximum number of search results to return. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - maxResults?: number; - /** - * Indicates the maximum number of suggestions to return for the widget's input. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - maxSuggestions?: number; - /** - * Indicates the minimum number of characters required before querying for a suggestion. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - minSuggestCharacters?: number; - /** - * The name of the source for display. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - name: string; - /** - * Specifies the fields returned with the search results. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - outFields: string[]; - /** - * A string array which limits the results to one or more categories. For example "Populated Place" or "airport". Only applicable when using the World Geocode Service. View the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - categories: string[]; - /** - * The Popup instance used for the selected result. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - popup: Popup; - /** - * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - popupEnabled?: boolean; - /** - * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - popupOpenOnSelect?: boolean; - /** - * Specify this to prefix the input for the search text. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - prefix: string; - /** - * Indicates whether to show a graphic on the map for the selected source using the [resultSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultSymbol). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - resultGraphicEnabled?: boolean; - /** - * The symbol used for the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - resultSymbol: Symbol; - /** - * A template string used to display multiple fields in a defined order when results are displayed, e.g. `"{Street}, {City}, {ZIP}"`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - searchTemplate: string; - /** - * The field name of the Single Line Address Field in the REST services directory for the locator service. Common values are `SingleLine` and `SingleLineFieldName`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - singleLineFieldName: string; - /** - * Indicates whether to display suggestions as the user enters input text in the widget. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - suggestionsEnabled?: boolean; - /** - * Specify this to suffix the input for the search value. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - suffix: string; - /** - * Indicates whether to constrain the search results to the view's extent. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - withinViewEnabled: boolean; - /** - * Applicable to the specified source. If the result does not have an associated extent, specify this number to use as the zoom scale for the result. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - zoomScale: number; - } - export interface SearchViewModelSearchClearEvent { } @@ -51786,54 +55149,6 @@ declare namespace __esri { } - export interface SearchViewModelFeatureLayerSourceFilter extends Object { - /** - * The where clause specified for filtering suggests or search results. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - where: string; - /** - * The filter geometry for suggests or search results. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) - */ - geometry: Geometry; - } - - - export interface SearchViewModelLocatorSourceFilter extends Object { - /** - * The where clause specified for filtering suggests or search results. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - where: string; - /** - * The filter geometry for suggests or search results. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - geometry: Geometry; - } - - - export interface SearchViewModelLocatorSourceLocalSearchOptions extends Object { - /** - * The distance to search. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - distance: number; - /** - * The minimum scale used to search locally. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) - */ - minScale: number; - } - - export interface SearchViewModelSearchCompleteEventResults extends Object { results: SearchResult[]; @@ -51907,310 +55222,6 @@ declare namespace __esri { source: any; } - /** - * The following properties define a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html)-based [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) whose features may be searched by the Search widget. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - export interface FeatureLayerSource extends Object { - /** - * The Popup instance used for the selected result. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - popup: Popup; - /** - * Indicates whether to automatically navigate to the selected result once selected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - autoNavigate?: boolean; - /** - * Indicates to only return results that match the search value exactly. This property only applies to `string` field searches. `exactMatch` is always `true` when searching fields of type `number`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - exactMatch?: boolean; - /** - * The feature layer queried in the search. This is **required**. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - featureLayer: FeatureLayer; - /** - * As of version 4.4, this property replaces the now deprecated `searchQueryParams`, `suggestQueryParams`, and `searchExtent` properties. Please see the object specification table below for details. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - filter: FeatureLayerSourceFilter; - /** - * Indicates the maximum number of search results to return. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - maxResults?: number; - /** - * Indicates the maximum number of suggestions to return for the widget's input. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - maxSuggestions?: number; - /** - * Indicates the minimum number of characters required before querying for a suggestion. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - minSuggestCharacters?: number; - /** - * The name of the source for display. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - name: string; - /** - * Specifies the fields returned with the search results. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - outFields: string[]; - /** - * Used as a hint for the source input text. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - placeholder: string; - /** - * The results are displayed using this field. Defaults to the layer's `displayField` or the first string field. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - displayField: string; - /** - * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - popupEnabled?: boolean; - /** - * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - popupOpenOnSelect?: boolean; - /** - * Specify this to prefix the input for the search text. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - prefix: string; - /** - * Indicates whether to show a graphic on the map for the selected source using the [resultSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultSymbol). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - resultGraphicEnabled?: boolean; - /** - * The symbol used for the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - resultSymbol: Symbol; - /** - * An array of string values representing the names of fields in the feature layer to search. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - searchFields: string[]; - /** - * Specify this to suffix the input for the search value. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - suffix: string; - /** - * Indicates whether to display suggestions as the user enters input text in the widget. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - suggestionsEnabled?: boolean; - /** - * A template string used to display multiple fields in a defined order when suggestions are displayed. This takes precedence over `displayField`. Field names in the template must have the following format: `{FieldName}`. An example suggestionTemplate could look something like: `Name: {OWNER}, Parcel: {PARCEL_ID}`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - suggestionTemplate: string; - /** - * Indicates whether to constrain the search results to the view's extent. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - withinViewEnabled: boolean; - /** - * The set zoom scale for the resulting search result. This scale is automatically honored. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - zoomScale: number; - } - - /** - * The following properties define a [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) pointing to a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) that may be used to geocode locations with the Search widget. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - export interface LocatorSource extends Object { - /** - * Used as a hint for the source input text. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - placeholder: string; - /** - * Indicates whether to automatically navigate to the selected result once selected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - autoNavigate?: boolean; - /** - * Constricts search results to a specified country code. For example, `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. View the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - countryCode: string; - /** - * As of version 4.4, this property replaces the now deprecated `searchQueryParams`, `suggestQueryParams`, and `searchExtent` properties. Please see the object specification table below for details. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - filter: LocatorSourceFilter; - /** - * Sets the sources for local `distance` and `minScale` for searching. See the object specification table below for details. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - localSearchOptions: LocatorSourceLocalSearchOptions; - /** - * When reverse geocoding a result, use this distance in meters. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - locationToAddressDistance?: number; - /** - * The locator task used to search. This is **required** and defaults to the [World Geocoding Service](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - locator: Locator; - /** - * Indicates the maximum number of search results to return. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - maxResults?: number; - /** - * Indicates the maximum number of suggestions to return for the widget's input. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - maxSuggestions?: number; - /** - * Indicates the minimum number of characters required before querying for a suggestion. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - minSuggestCharacters?: number; - /** - * The name of the source for display. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - name: string; - /** - * Specifies the fields returned with the search results. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - outFields: string[]; - /** - * A string array which limits the results to one or more categories. For example "Populated Place" or "airport". Only applicable when using the World Geocode Service. View the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - categories: string[]; - /** - * The Popup instance used for the selected result. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - popup: Popup; - /** - * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - popupEnabled?: boolean; - /** - * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - popupOpenOnSelect?: boolean; - /** - * Specify this to prefix the input for the search text. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - prefix: string; - /** - * Indicates whether to show a graphic on the map for the selected source using the [resultSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultSymbol). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - resultGraphicEnabled?: boolean; - /** - * The symbol used for the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - resultSymbol?: Symbol; - /** - * A template string used to display multiple fields in a defined order when results are displayed, e.g. `"{Street}, {City}, {ZIP}"`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - searchTemplate?: string; - /** - * The field name of the Single Line Address Field in the REST services directory for the locator service. Common values are `SingleLine` and `SingleLineFieldName`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - singleLineFieldName: string; - /** - * Indicates whether to display suggestions as the user enters input text in the widget. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - suggestionsEnabled?: boolean; - /** - * Specify this to suffix the input for the search value. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - suffix?: string; - /** - * Indicates whether to constrain the search results to the view's extent. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - withinViewEnabled?: boolean; - /** - * The set zoom scale for the resulting search result. This scale is automatically honored. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - zoomScale?: number; - } - /** * When resolved, returns this response after calling [search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#search). * @@ -52340,54 +55351,6 @@ declare namespace __esri { } - export interface FeatureLayerSourceFilter extends Object { - /** - * The where clause specified for filtering suggests or search results. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - where: string; - /** - * The filter geometry for suggests or search results. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) - */ - geometry: Geometry; - } - - - export interface LocatorSourceFilter extends Object { - /** - * The where clause specified for filtering suggests or search results. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - where: string; - /** - * The filter geometry for suggests or search results. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - geometry: Geometry; - } - - - export interface LocatorSourceLocalSearchOptions extends Object { - /** - * The distance to search. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - distance: number; - /** - * The minimum scale used to search locally. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) - */ - minScale: number; - } - - export interface SearchResponseResults extends Object { /** * An array of search results. @@ -52659,7 +55622,7 @@ declare namespace __esri { interface SketchViewModel extends Accessor, Evented { /** - * Graphic representing the sketch that is being drawn on the view. + * Graphic representing the sketch that is being drawn or updated on the view. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#graphic) */ @@ -52731,7 +55694,7 @@ declare namespace __esri { view: MapView; /** - * Completes the active drawing and fires the [create-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:create-complete) event. If called mid-drawing, `complete()` finishes the active drawing and keeps the valid geometry. + * Completes the active drawing and fires the [create-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:create-complete) or [update-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:update-complete) event depending on the draw operation. If called mid-drawing, `complete()` finishes the active drawing and keeps the valid geometry. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#complete) * @@ -52756,6 +55719,14 @@ declare namespace __esri { * */ create(drawAction: string, drawOptions?: SketchViewModelCreateDrawOptions): void; + /** + * Incrementally redo actions recorded in the stack. Calling this method will fire the [redo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:redo) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#redo) + * + * + */ + redo(): void; /** * Resets SketchViewModel to prepare for another create operation. Reset discards the current drawing, if called mid drawing. * @@ -52764,6 +55735,14 @@ declare namespace __esri { * */ reset(): void; + /** + * Incrementally undo actions recorded in the stack. Calling this method will fire the [undo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:undo) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#undo) + * + * + */ + undo(): void; /** * Initializes an update operation for the selected geometry and fires [update-init](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:update-init) event. * @@ -53528,7 +56507,7 @@ declare namespace __esri { /** * A utility method used for building the value for a widget's `class` property. This aids in simplifying CSS class setup. - * > Prior to version 4.7, there were various approaches towards setting CSS classes. These were dependant upon variables, such as whether the classes were: + * > Prior to version 4.7, there were various approaches towards setting CSS classes. These were dependent upon variables, such as whether the classes were: * * a single static class, * * multiple static classes, or * * dynamic classes. @@ -54024,6 +57003,11 @@ declare module "esri/core/HandleOwner" { export = HandleOwner; } +declare module "esri/core/workers/Connection" { + import Connection = __esri.Connection; + export = Connection; +} + declare module "esri/geometry/Circle" { import Circle = __esri.Circle; export = Circle; @@ -54724,6 +57708,11 @@ declare module "esri/tasks/support/AreasAndLengthsParameters" { export = AreasAndLengthsParameters; } +declare module "esri/tasks/support/AttachmentQuery" { + import AttachmentQuery = __esri.AttachmentQuery; + export = AttachmentQuery; +} + declare module "esri/tasks/support/BufferParameters" { import BufferParameters = __esri.BufferParameters; export = BufferParameters; @@ -54969,6 +57958,31 @@ declare module "esri/views/ViewAnimation" { export = ViewAnimation; } +declare module "esri/views/input/Input" { + import Input = __esri.Input; + export = Input; +} + +declare module "esri/views/input/gamepad/GamepadInputDevice" { + import GamepadInputDevice = __esri.GamepadInputDevice; + export = GamepadInputDevice; +} + +declare module "esri/views/input/gamepad/GamepadSettings" { + import GamepadSettings = __esri.GamepadSettings; + export = GamepadSettings; +} + +declare module "esri/views/navigation/Navigation" { + import Navigation = __esri.Navigation; + export = Navigation; +} + +declare module "esri/views/navigation/gamepad/GamepadSettings" { + import gamepadGamepadSettings = __esri.gamepadGamepadSettings; + export = gamepadGamepadSettings; +} + declare module "esri/views/layers/LayerView" { import LayerView = __esri.LayerView; export = LayerView; @@ -55064,6 +58078,11 @@ declare module "esri/views/2d/layers/BaseLayerView2D" { export = BaseLayerView2D; } +declare module "esri/webmap/Bookmark" { + import Bookmark = __esri.Bookmark; + export = Bookmark; +} + declare module "esri/webmap/InitialViewProperties" { import InitialViewProperties = __esri.InitialViewProperties; export = InitialViewProperties; @@ -55189,6 +58208,11 @@ declare module "esri/widgets/Feature" { export = Feature; } +declare module "esri/widgets/FeatureForm" { + import FeatureForm = __esri.FeatureForm; + export = FeatureForm; +} + declare module "esri/widgets/Fullscreen" { import Fullscreen = __esri.Fullscreen; export = Fullscreen; @@ -55299,11 +58323,6 @@ declare module "esri/widgets/BasemapToggle/BasemapToggleViewModel" { export = BasemapToggleViewModel; } -declare module "esri/widgets/Bookmarks/Bookmark" { - import Bookmark = __esri.Bookmark; - export = Bookmark; -} - declare module "esri/widgets/Bookmarks/BookmarksViewModel" { import BookmarksViewModel = __esri.BookmarksViewModel; export = BookmarksViewModel; @@ -55339,6 +58358,26 @@ declare module "esri/widgets/Feature/FeatureViewModel" { export = FeatureViewModel; } +declare module "esri/widgets/FeatureForm/FeatureFormViewModel" { + import FeatureFormViewModel = __esri.FeatureFormViewModel; + export = FeatureFormViewModel; +} + +declare module "esri/widgets/FeatureForm/FieldConfig" { + import FieldConfig = __esri.FieldConfig; + export = FieldConfig; +} + +declare module "esri/widgets/FeatureForm/FieldOptions" { + import FieldOptions = __esri.FieldOptions; + export = FieldOptions; +} + +declare module "esri/widgets/FeatureForm/InputField" { + import InputField = __esri.InputField; + export = InputField; +} + declare module "esri/widgets/Fullscreen/FullscreenViewModel" { import FullscreenViewModel = __esri.FullscreenViewModel; export = FullscreenViewModel; @@ -55394,6 +58433,21 @@ declare module "esri/widgets/ScaleBar/ScaleBarViewModel" { export = ScaleBarViewModel; } +declare module "esri/widgets/Search/FeatureLayerSearchSource" { + import FeatureLayerSearchSource = __esri.FeatureLayerSearchSource; + export = FeatureLayerSearchSource; +} + +declare module "esri/widgets/Search/LocatorSearchSource" { + import LocatorSearchSource = __esri.LocatorSearchSource; + export = LocatorSearchSource; +} + +declare module "esri/widgets/Search/SearchSource" { + import SearchSource = __esri.SearchSource; + export = SearchSource; +} + declare module "esri/widgets/Search/SearchViewModel" { import SearchViewModel = __esri.SearchViewModel; export = SearchViewModel; @@ -55479,6 +58533,11 @@ declare module "esri/layers/mixins/SceneService" { export = SceneService; } +declare module "esri/layers/mixins/SublayersOwner" { + import SublayersOwner = __esri.SublayersOwner; + export = SublayersOwner; +} + declare module "esri/renderers/VisualVariablesMixin" { import VisualVariablesMixin = __esri.VisualVariablesMixin; export = VisualVariablesMixin; @@ -55574,11 +58633,6 @@ declare module "esri/core/workers" { export = workers; } -declare module "esri/core/workers/Connection" { - import Connection = __esri.Connection; - export = Connection; -} - declare module "esri/core/accessorSupport/decorators" { import decorators = __esri.decorators; export = decorators; @@ -55639,6 +58693,16 @@ declare module "esri/renderers/smartMapping/creators/opacity" { export = opacity; } +declare module "esri/renderers/smartMapping/creators/predominance" { + import predominance = __esri.predominance; + export = predominance; +} + +declare module "esri/renderers/smartMapping/creators/relationship" { + import relationship = __esri.relationship; + export = relationship; +} + declare module "esri/renderers/smartMapping/creators/size" { import size = __esri.size; export = size; @@ -55684,6 +58748,16 @@ declare module "esri/renderers/smartMapping/symbology/location" { export = symbologyLocation; } +declare module "esri/renderers/smartMapping/symbology/predominance" { + import symbologyPredominance = __esri.symbologyPredominance; + export = symbologyPredominance; +} + +declare module "esri/renderers/smartMapping/symbology/relationship" { + import symbologyRelationship = __esri.symbologyRelationship; + export = symbologyRelationship; +} + declare module "esri/renderers/smartMapping/symbology/size" { import symbologySize = __esri.symbologySize; export = symbologySize; diff --git a/types/arcgis-js-api/v3/index.d.ts b/types/arcgis-js-api/v3/index.d.ts index 5ce4cfa06c..a42c651068 100644 --- a/types/arcgis-js-api/v3/index.d.ts +++ b/types/arcgis-js-api/v3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript 3.25 +// Type definitions for ArcGIS API for JavaScript 3.26 // Project: https://developers.arcgis.com/javascript/3/ // Definitions by: Esri // Bjorn Svensson @@ -1897,6 +1897,8 @@ declare module "esri" { export interface ReportPlayerOptions { /** Indicates whether left and right arrows key can be used to paginate when viewMode is set to PlayerViewModes.PANELS_IN_SLIDES. */ allowKeyboardNavigation?: boolean; + /** As of version 3.26 Configuration to specify the location of the JavaScript API to use when exporting an Infographic to Dynamic HTML. */ + config?: any; /** Specifies which export options are available for the report. */ dataProvider?: DataProviderGE; /** Specifies how the ReportPlayer should zoom by default. */ @@ -3506,7 +3508,7 @@ declare module "esri/dijit/Attribution" { /** * Creates a new Attribution object. * @param options An object that defines the attribution options. - * @param srcNodeRef HTML element where the time slider should be rendered. + * @param srcNodeRef HTML element where the attribution widget should be rendered. */ constructor(options: esri.AttributionOptions, srcNodeRef: Node | string); /** Destroy the attribution widget. */ @@ -7584,6 +7586,8 @@ declare module "esri/dijit/geoenrichment/ReportPlayer/ReportPlayer" { class ReportPlayer { /** Indicates whether left and right arrows key can be used to paginate when viewMode is set to PlayerViewModes.PANELS_IN_SLIDES. */ allowKeyboardNavigation: boolean; + /** Configuration to specify the location of the JavaScript API to use when exporting an Infographic to Dynamic HTML. */ + config: any; /** Data Provider for the ReportPlayer which allows you to specify which export options are available when running the report. */ dataProvider: DataProviderGE; /** Specifies how the ReportPlayer should zoom by default. */ @@ -7607,7 +7611,7 @@ declare module "esri/dijit/geoenrichment/ReportPlayer/ReportPlayer" { * @param params Various parameters that can be used to configure the ReportPlayer. * @param srcNode Reference or id of the HTML element where the widget should be rendered. */ - constructor(params: esri.ReportPlayerOptions, srcNode?: Node | string); + constructor(params?: esri.ReportPlayerOptions, srcNode?: Node | string); /** * Generates the report for the supplied parameters. * @param dataProviderParams See the object specifications table below for the structure of the dataProviderParams object. diff --git a/types/argparse/index.d.ts b/types/argparse/index.d.ts index cf4d1f648e..3330055b1f 100644 --- a/types/argparse/index.d.ts +++ b/types/argparse/index.d.ts @@ -69,6 +69,7 @@ export interface ArgumentParserOptions { prog?: string; usage?: string; version?: string; + debug?: boolean; } export interface ArgumentGroupOptions { diff --git a/types/array.prototype.flatmap/array.prototype.flatmap-tests.ts b/types/array.prototype.flatmap/array.prototype.flatmap-tests.ts new file mode 100644 index 0000000000..5236a352ca --- /dev/null +++ b/types/array.prototype.flatmap/array.prototype.flatmap-tests.ts @@ -0,0 +1,47 @@ +import flatMap = require("array.prototype.flatmap"); +import "array.prototype.flatmap/auto"; +import flatMapImpl = require("array.prototype.flatmap/implementation"); +import getPolyfill = require("array.prototype.flatmap/polyfill"); +import shim = require("array.prototype.flatmap/shim"); + +// infers type of the output array from the return type of the callback +flatMap(["foo"], word => word.split("")); // $ExpectType string[] +flatMapImpl(["foo"], word => word.split("")); // $ExpectType string[] +["foo"].flatMap(word => word.split("")); // $ExpectType string[] + +// infers the type of the value argument to the callback +flatMap([1, 2], word => word.split("")); // $ExpectError +flatMapImpl([1, 2], word => word.split("")); // $ExpectError +[1, 2].flatMap(word => word.split("")); // $ExpectError + +// the callback must return an array +flatMap([1, 2], word => word); // $ExpectError +flatMapImpl([1, 2], word => word); // $ExpectError +[1, 2].flatMap(word => word); // $ExpectError + +// the callback accepts an index argument +flatMap(["foo"], (_, index) => [index]); // $ExpectType number[] +flatMapImpl(["foo"], (_, index) => [index]); // $ExpectType number[] +["foo"].flatMap((_, index) => [index]); // $ExpectType number[] + +// the callback accepts an argument that refers to the original array +flatMap(["foo"], (_, __, input) => input); // $ExpectType string[] +flatMapImpl(["foo"], (_, __, input) => input); // $ExpectType string[] +["foo"].flatMap((_, __, input) => input); // $ExpectType string[] + +// the third argument is used as the calling context for the callback +flatMap(["foo"], function() { return this.foo; }, { foo: [1, 2] }); // $ExpectType number[] +flatMapImpl(["foo"], function() { return this.foo; }, { foo: [1, 2] }); // $ExpectType number[] +["foo"].flatMap(function() { return this.foo; }, { foo: [1, 2] }); // $ExpectType number[] + +// assumes that value of `this` in callback is `undefined` by default (this is +// accurate in strict mode) +flatMap([1], function() { return [this]; }); // $ExpectType undefined[] +flatMapImpl([1], function() { return [this]; }); // $ExpectType undefined[] +[1].flatMap(function() { return [this]; }); // $ExpectType undefined[] + +// `getPolyfill` returns a flatMap implementation +getPolyfill()(["foo"], word => word.split("")); // $ExpectType string[] + +// `shim` installs a flatMap implementation in `Array` prototype and returns it +shim()(["foo"], word => word.split("")); // $ExpectType string[] diff --git a/types/array.prototype.flatmap/auto.d.ts b/types/array.prototype.flatmap/auto.d.ts new file mode 100644 index 0000000000..43177fb3ad --- /dev/null +++ b/types/array.prototype.flatmap/auto.d.ts @@ -0,0 +1,6 @@ +interface Array { + flatMap( + fn: (this: R, x: T, index: number, array: this) => U[], + thisArg?: R + ): U[]; +} diff --git a/types/array.prototype.flatmap/implementation.d.ts b/types/array.prototype.flatmap/implementation.d.ts new file mode 100644 index 0000000000..80ad9f39d0 --- /dev/null +++ b/types/array.prototype.flatmap/implementation.d.ts @@ -0,0 +1,7 @@ +// This is the same type as the callable signature in `FlatMap` in `index.d.ts`. +declare function flatMap( + xs: ReadonlyArray, + fn: (this: T, x: A, index: number, array: A[]) => B[], + thisArg?: T +): B[]; +export = flatMap; diff --git a/types/array.prototype.flatmap/index.d.ts b/types/array.prototype.flatmap/index.d.ts new file mode 100644 index 0000000000..6bcc29f8b5 --- /dev/null +++ b/types/array.prototype.flatmap/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for array.prototype.flatmap 1.2 +// Project: https://github.com/es-shims/Array.prototype.flatMap#readme +// Definitions by: Jesse Hallett +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import flatMapImpl = require("./implementation"); + +interface FlatMap { + ( + xs: ReadonlyArray, + fn: (this: T, x: A, index: number, array: A[]) => B[], + thisArg?: T + ): B[]; + getPolyfill(): typeof flatMapImpl; + implementation: typeof flatMapImpl; + shim(): typeof flatMapImpl; +} + +declare const flatMap: FlatMap; +export = flatMap; diff --git a/types/array.prototype.flatmap/polyfill.d.ts b/types/array.prototype.flatmap/polyfill.d.ts new file mode 100644 index 0000000000..ad228b4065 --- /dev/null +++ b/types/array.prototype.flatmap/polyfill.d.ts @@ -0,0 +1,4 @@ +import flatMap = require("./implementation"); + +declare function getPolyfill(): typeof flatMap; +export = getPolyfill; diff --git a/types/array.prototype.flatmap/shim.d.ts b/types/array.prototype.flatmap/shim.d.ts new file mode 100644 index 0000000000..9f75c3a88a --- /dev/null +++ b/types/array.prototype.flatmap/shim.d.ts @@ -0,0 +1,4 @@ +import flatMap = require("./implementation"); + +declare function shim(): typeof flatMap; +export = shim; diff --git a/types/array.prototype.flatmap/tsconfig.json b/types/array.prototype.flatmap/tsconfig.json new file mode 100644 index 0000000000..8a046f1837 --- /dev/null +++ b/types/array.prototype.flatmap/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "array.prototype.flatmap-tests.ts", + "auto.d.ts", + "implementation.d.ts", + "index.d.ts", + "polyfill.d.ts", + "shim.d.ts" + ] +} diff --git a/types/deepmerge/tslint.json b/types/array.prototype.flatmap/tslint.json similarity index 100% rename from types/deepmerge/tslint.json rename to types/array.prototype.flatmap/tslint.json diff --git a/types/ascii-art/ascii-art-tests.ts b/types/ascii-art/ascii-art-tests.ts new file mode 100644 index 0000000000..d5a2d567f8 --- /dev/null +++ b/types/ascii-art/ascii-art-tests.ts @@ -0,0 +1,193 @@ +import art from 'ascii-art'; + +art.font('test', 'doom').toPromise(); + +art.font('my text', 'Doom', (rendered: string) => { + rendered.big(); +}); + +art.font('my text', 'Doom', '', (rendered) => { + rendered.big(); +}); + +art.artwork({ + artwork: 'textfiles.com/art/st-char.asc' +}).lines(31, 45, (rendered: string) => { + // cleanup non-unix terminators + rendered = rendered.replace(/\r/g, ''); + art.image({ + filepath : '~/Images/earth_in_space.jpg', + alphabet : 'ultra-wide' + }).overlay(rendered, { + x: 0, + y: -1, + style: 'red+blink', + transparent: '&' + }, (_final: any) => {}); +}); + +art.font('Ghost Wire BBS', 'Doom', (logo) => { + art.font('No place like home', 'rusted', (subtext) => { + art.table({ + verticalBar : ' ', + horizontalBar : ' ', + intersection : ' ', + data: [ + {name: art.style('current users', 'red'), value: '203'}, + {name: 'operator', value: 'vince.vega'}, + {name: 'dial-in', value: '(917)555-4202'}, + ] + }).lines(2, (table: any) => { + art.image({ + filepath : '~/Images/starburst_red.jpg', + alphabet : 'ultra-wide' + }).lines(2, 30).overlay(logo, { + x: 0, + y: 0, + style: 'blue', + }).overlay(subtext, { + x: 19, + y: 8, + style: 'yellow', + }).overlay(table, { + x: -1, + y: -1, + style: 'green', + }, (_final: any) => { + }); + }); + }); +}); + +art.image({ + width : 40, + filepath : '/Images/initech.png', + alphabet : 'wide' +}).font('INITECH', 'Doom', 'cyan', (_ascii) => { +}); + +art.table({ + data: [ + {text: ' .\'ANDRE. '}, + {text: ' ..THE.GIANT\'. '}, + {text: '.With.Bobby."The.Brain"'}, + {text: '.Heenan.'} + ], + verticalBar : ' ', + horizontalBar : ' ', + intersection : ' ' +}).lines(2, (table: any) => { + art.strings([ + 'ANDRE', + 'the', + 'GIANT', + 'POSSE', + '7\'4"', + '520 LB' + ], 'rusted', (andre: any, the: any, giant: any, posse: any, height: any, weight: any) => { + art.strings([ 'has', 'a'], 'twopoint', (has: any, a: any) => { + art.image({ + filepath : '/Images/andre_has_a_posse.jpeg', + alphabet : 'ultra-wide' + }).overlay(andre, { + x: 8, y: 4, + style: 'white' + }).overlay(the, { + x: 10, y: 7, + style: 'white', + transparent : true + }).overlay(giant, { + x: 8, y: 10, + style: 'white', + transparent : true + }).overlay(has, { + x: 10, y: 14, + style: 'white' + }).overlay(a, { + x: 13, y: 17, + style: 'white' + }).overlay(posse, { + x: 5, y: 20, + style: 'bright_black', + transparent: true + }).overlay(height, { + x: 59, y: 3, + style: 'bright_black', + transparent: true + }).overlay(weight, { + x: 59, y: 8, + style: 'bright_black', + transparent: true + }).overlay(table, { + x: 6, y: -6, + style: 'bright_black', + transparent: true + }, (_final: any) => { + }); + }); + }); +}); + +art.Figlet.fontPath = 'Fonts'; + +const image = new art.Image({ + filepath: '~/Images/metropolis.jpg', + alphabet: 'variant4' +}); +image.write((_err: any, _rendered: string) => { +}); + +art.font('Prompt', 'Basic', 'red').font('v1', 'Doom', 'magenta', (_rendered) => { +}); + +art.image({ + width : 40, + filepath : '/Images/initech.png', + alphabet : 'wide' +}).font('INITECH', 'Doom', 'cyan', (_ascii) => { +}); + +art.style('my text', 'red+underline'); + +art.table({ + width : 80, + data : [ /* ... */ ], + verticalBar : ' ', + horizontalBar : ' ', + intersection : ' ', + columns : [ + { + value : 'Product', + style : 'black+gray_bg' + }, { + value : 'Maker', + style : 'white' + }, { + value : 'Location', + style : 'white' + } + ] +}, (_rendered) => { + // use rendered text +}); + +art.table({ + width : 80, + data : [ /* ... */ ], + bars : { + ul_corner: 'â”', + ur_corner: '┓', + lr_corner: 'â”›', + ll_corner: 'â”—', + bottom_t: 'â”»', + top_t: '┳', + right_t: '┫', + left_t: '┣', + intersection: 'â•‹', + vertical: '┃', + horizontal: 'â”', + }, + borderColor : 'bright_white', +}, (_rendered) => { + // use rendered text +}); diff --git a/types/ascii-art/index.d.ts b/types/ascii-art/index.d.ts new file mode 100644 index 0000000000..3a753a183b --- /dev/null +++ b/types/ascii-art/index.d.ts @@ -0,0 +1,43 @@ +// Type definitions for ascii-art 1.4 +// Project: https://github.com/khrome/ascii-art +// Definitions by: Lukas Elmer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export type StyleType = (text: string, style?: string, close?: boolean) => Art; +export type FontType = ((text: string, font?: string, styleOrCallback?: string | Cb, callback?: Cb) => Art); +export type ImageType = (options: object, callback?: Cb) => Art; +export type TableType = (options: object, callback?: Cb) => Art; +export type ArtworkType = (options: object, callback?: Cb) => Art; +export type LinesType = (...options: any[]) => Art; +export type OverlayType = (...options: any[]) => Art; +export type JoinType = (...options: any[]) => Art; +export type StringsType = (...options: any[]) => Art; + +export const style: StyleType; +export const font: FontType; +export const image: ImageType; +export const table: TableType; +export const artwork: ArtworkType; +export const lines: LinesType; +export const overlay: OverlayType; +export const join: JoinType; +export const strings: StringsType; +export const Figlet: any; +export const Image: any; + +export interface Art { + style: StyleType; + font: FontType; + image: ImageType; + table: TableType; + artwork: ArtworkType; + lines: LinesType; + overlay: OverlayType; + join: JoinType; + working: boolean; + + toPromise: (() => Promise); +} + +export type Cb = (result: string) => void; diff --git a/types/ascii-art/tsconfig.json b/types/ascii-art/tsconfig.json new file mode 100644 index 0000000000..1f9759cc1f --- /dev/null +++ b/types/ascii-art/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "allowSyntheticDefaultImports": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ascii-art-tests.ts" + ] +} diff --git a/types/ascii-art/tslint.json b/types/ascii-art/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/ascii-art/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/ascii2mathml/index.d.ts b/types/ascii2mathml/index.d.ts index dcb9f7bb98..0ff3b1d10e 100644 --- a/types/ascii2mathml/index.d.ts +++ b/types/ascii2mathml/index.d.ts @@ -7,29 +7,31 @@ export = A2MML; declare var A2MML: ascii2mathml; -interface Options { - decimalMark?: string; - colSep?: string; - rowSep?: string; - display?: 'inline' | 'block'; - dir?: 'ltr' | 'rtl'; - bare?: boolean; - standalone?: boolean; - annotate?: boolean; -} - interface ascii2mathml { /** * Generates a function with default options set to convert * ASCIIMath expression to MathML markup. * @param options Options */ - (options: Options): ascii2mathml; + (options: A2MML.Options): ascii2mathml; /** * Converts ASCIIMath expression to MathML markup. * @param asciimath ASCIIMath expression * @param options Options */ - (asciimath: string, options?: Options): string; + (asciimath: string, options?: A2MML.Options): string; +} + +declare namespace A2MML { + interface Options { + decimalMark?: string; + colSep?: string; + rowSep?: string; + display?: 'inline' | 'block'; + dir?: 'ltr' | 'rtl'; + bare?: boolean; + standalone?: boolean; + annotate?: boolean; + } } diff --git a/types/assert/assert-tests.ts b/types/assert/assert-tests.ts new file mode 100644 index 0000000000..22248c18bd --- /dev/null +++ b/types/assert/assert-tests.ts @@ -0,0 +1,10 @@ +import * as assert from 'assert'; + +assert(true, "it's working"); + +assert.ok(true, "inner functions work as well"); + +assert.throws(() => {}); +assert.throws(() => {}, () => {}, "works wonderfully"); + +assert['fail'](true, true, "works like a charm"); diff --git a/types/assert/index.d.ts b/types/assert/index.d.ts new file mode 100644 index 0000000000..d79805f5af --- /dev/null +++ b/types/assert/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for commonjs-assert 1.4 +// Project: https://github.com/browserify/commonjs-assert +// Definitions by: Nico Gallinal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function assert(value: any, message?: string): void; + +declare namespace assert { + function fail(actual?: any, expected?: any, message?: string, operator?: string): void; + + function ok(value: any, message?: string): void; + + function equal(actual: any, expected: any, message?: string): void; + + function notEqual(actual: any, expected: any, message?: string): void; + + function deepEqual(actual: any, expected: any, message?: string): void; + + function notDeepEqual(acutal: any, expected: any, message?: string): void; + + function strictEqual(actual: any, expected: any, message?: string): void; + + function notStrictEqual(actual: any, expected: any, message?: string): void; + + function throws(block: () => void, message?: string): void; + function throws(block: () => void, error: () => void | ((err: any) => boolean) | RegExp, message?: string): void; + + function doesNotThrow(block: () => void, message?: string): void; + function doesNotThrow(block: () => void, error: () => void | ((err: any) => boolean) | RegExp, message?: string): void; + + function ifError(value: any): void; + + class AssertionError implements Error { + name: string; + message: string; + actual: any; + expected: any; + operator: string; + generatedMessage: boolean; + + constructor(options?: { message?: string; actual?: any; expected?: any; operator?: string; stackStartFunction?: () => void }); + } +} + +export = assert; diff --git a/types/assert/tsconfig.json b/types/assert/tsconfig.json new file mode 100644 index 0000000000..5ab217b2ab --- /dev/null +++ b/types/assert/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "assert-tests.ts" + ] +} diff --git a/types/assert/tslint.json b/types/assert/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/assert/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/astring/index.d.ts b/types/astring/index.d.ts new file mode 100644 index 0000000000..c2768e7d5f --- /dev/null +++ b/types/astring/index.d.ts @@ -0,0 +1,50 @@ +// Type definitions for astring 1.3 +// Project: https://github.com/davidbonnet/astring +// Definitions by: Nikolaj Kappler +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as ESTree from 'estree'; +import 'node'; +import { Stream } from 'stream'; + +export interface Options { + /** string to use for indentation (defaults to " ") */ + indent?: string; + /** string to use for line endings (defaults to "\n") */ + lineEnd?: string; + /** indent level to start from (defaults to 0) */ + startingIndentLevel?: number; + /** generate comments if true (defaults to false) */ + comments?: boolean; + /** custom code generator (defaults to astring.baseGenerator) */ + generator?: object; + /** source map generator (defaults to null), see https://github.com/mozilla/source-map#sourcemapgenerator */ + sourceMap?: any; +} + +/** Returns a string representing the rendered code of the provided AST `node`. However, if an `output` stream is provided in the options, it writes to that stream and returns it. */ +export function generate(node: ESTree.Node, options?: Options): string; +/** Returns a string representing the rendered code of the provided AST `node`. However, if an `output` stream is provided in the options, it writes to that stream and returns it. */ +export function generate(node: ESTree.Node, options: Options & { + /** output stream to write the rendered code to (defaults to null) */ + output: Stream; +}): Stream; + +/** + * A code generator consists of a mapping of node names and functions that take two arguments: `node` and `state`. + * The `node` points to the node from which to generate the code and the `state` exposes the `write` method that takes generated code strings. + */ +export type Generator = { [key in ESTree.Node["type"]]: (node: Extract, state: { write(s: string): void }) => void }; + +/** Base generator that can be used to extend Astring. See https://github.com/davidbonnet/astring#extending */ +export const baseGenerator: Generator; + +declare global { + interface astring { + generate: typeof generate; + /** Base generator that can be used to extend Astring. See https://github.com/davidbonnet/astring#extending */ + baseGenerator: Generator; + } + const astring: astring; +} diff --git a/types/astring/test/astring-global.test.ts b/types/astring/test/astring-global.test.ts new file mode 100644 index 0000000000..c756c9c60e --- /dev/null +++ b/types/astring/test/astring-global.test.ts @@ -0,0 +1,5 @@ +// global scope function +astring.generate(null); + +// global scope function +astring.baseGenerator.Program(null, { write(s: string) { return; } }); diff --git a/types/astring/test/astring.test.ts b/types/astring/test/astring.test.ts new file mode 100644 index 0000000000..782af01017 --- /dev/null +++ b/types/astring/test/astring.test.ts @@ -0,0 +1,32 @@ +import { baseGenerator, generate } from "astring"; +import { FunctionExpression, MemberExpression, Program } from "estree"; +import { Stream } from "stream"; + +const ast: Program = null; +const functionE: FunctionExpression = null; +const memberE: MemberExpression = null; + +// should accept different nodes +generate(ast); +generate(functionE); +generate(memberE); + +// options without output option should generate string +const string: string = generate(ast, { + comments: true, + generator: baseGenerator, + indent: "\t", + lineEnd: "\n", + startingIndentLevel: 42, + sourceMap: null +}); + +// options with output option should return Stream +const stream: Stream = generate(ast, { + output: new Stream() +}); + +// Generator should map node types to functions whose first parameter is same node type +baseGenerator.Program(ast, { write(s: string) { return; } }); +baseGenerator.FunctionExpression(functionE, { write(s: string) { return; } }); +baseGenerator.MemberExpression(memberE, { write(s: string) { return; } }); diff --git a/types/astring/tsconfig.json b/types/astring/tsconfig.json new file mode 100644 index 0000000000..b00d44f643 --- /dev/null +++ b/types/astring/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/astring.test.ts", + "test/astring-global.test.ts" + ] +} \ No newline at end of file diff --git a/types/astring/tslint.json b/types/astring/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/astring/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/async/index.d.ts b/types/async/index.d.ts index 961dd73ebb..e6cfd3bcaa 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -2,34 +2,34 @@ // Project: https://github.com/caolan/async // Definitions by: Boris Yankov , Arseniy Maximov , Joe Herman , Angus Fenying , Pascal Martin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 export as namespace async; export interface Dictionary { [key: string]: T; } export type IterableCollection = T[] | IterableIterator | Dictionary -export interface ErrorCallback { (err?: T): void; } -export interface AsyncBooleanResultCallback { (err?: E, truthValue?: boolean): void; } -export interface AsyncResultCallback { (err?: E, result?: T): void; } -export interface AsyncResultArrayCallback { (err?: E, results?: Array): void; } -export interface AsyncResultObjectCallback { (err: E | undefined, results: Dictionary): void; } +export interface ErrorCallback { (err?: E | null): void; } +export interface AsyncBooleanResultCallback { (err?: E | null, truthValue?: boolean): void; } +export interface AsyncResultCallback { (err?: E | null, result?: T): void; } +export interface AsyncResultArrayCallback { (err?: E | null, results?: Array): void; } +export interface AsyncResultObjectCallback { (err: E | undefined, results: Dictionary): void; } -export interface AsyncFunction { (callback: (err?: E, result?: T) => void): void; } -export interface AsyncFunctionEx { (callback: (err?: E, ...results: T[]) => void): void; } -export interface AsyncIterator { (item: T, callback: ErrorCallback): void; } -export interface AsyncForEachOfIterator { (item: T, key: number|string, callback: ErrorCallback): void; } -export interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } -export interface AsyncMemoIterator { (memo: R | undefined, item: T, callback: AsyncResultCallback): void; } -export interface AsyncBooleanIterator { (item: T, callback: AsyncBooleanResultCallback): void; } +export interface AsyncFunction { (callback: (err?: E | null, result?: T) => void): void; } +export interface AsyncFunctionEx { (callback: (err?: E | null, ...results: T[]) => void): void; } +export interface AsyncIterator { (item: T, callback: ErrorCallback): void; } +export interface AsyncForEachOfIterator { (item: T, key: number|string, callback: ErrorCallback): void; } +export interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } +export interface AsyncMemoIterator { (memo: R | undefined, item: T, callback: AsyncResultCallback): void; } +export interface AsyncBooleanIterator { (item: T, callback: AsyncBooleanResultCallback): void; } -export interface AsyncWorker { (task: T, callback: ErrorCallback): void; } -export interface AsyncVoidFunction { (callback: ErrorCallback): void; } +export interface AsyncWorker { (task: T, callback: ErrorCallback): void; } +export interface AsyncVoidFunction { (callback: ErrorCallback): void; } export type AsyncAutoTasks, E> = { [K in keyof R]: AsyncAutoTask } export type AsyncAutoTask, E> = AsyncAutoTaskFunctionWithoutDependencies | (keyof R | AsyncAutoTaskFunction)[]; -export interface AsyncAutoTaskFunctionWithoutDependencies { (cb: AsyncResultCallback | ErrorCallback): void; } -export interface AsyncAutoTaskFunction, E> { (results: R, cb: AsyncResultCallback | ErrorCallback): void; } +export interface AsyncAutoTaskFunctionWithoutDependencies { (cb: AsyncResultCallback | ErrorCallback): void; } +export interface AsyncAutoTaskFunction, E = Error> { (results: R, cb: AsyncResultCallback | ErrorCallback): void; } export interface AsyncQueue { length(): number; @@ -37,9 +37,8 @@ export interface AsyncQueue { running(): number; idle(): boolean; concurrency: number; - push(task: T | T[], callback?: ErrorCallback): void; - push(task: T, callback?: AsyncResultCallback): void; - unshift(task: T | T[], callback?: ErrorCallback): void; + push(task: T | T[], callback?: AsyncResultCallback): void; + unshift(task: T | T[], callback?: ErrorCallback): void; saturated: () => any; empty: () => any; drain: () => any; @@ -61,7 +60,7 @@ export interface AsyncPriorityQueue { concurrency: number; started: boolean; paused: boolean; - push(task: T | T[], priority: number, callback?: AsyncResultArrayCallback): void; + push(task: T | T[], priority: number, callback?: AsyncResultArrayCallback): void; saturated: () => any; empty: () => any; drain: () => any; @@ -94,112 +93,113 @@ export interface AsyncCargo { } // Collections -export function each(arr: IterableCollection, iterator: AsyncIterator, callback?: ErrorCallback): void; +export function each(arr: IterableCollection, iterator: AsyncIterator, callback?: ErrorCallback): void; export const eachSeries: typeof each; -export function eachLimit(arr: IterableCollection, limit: number, iterator: AsyncIterator, callback?: ErrorCallback): void; +export function eachLimit(arr: IterableCollection, limit: number, iterator: AsyncIterator, callback?: ErrorCallback): void; export const forEach: typeof each; export const forEachSeries: typeof each; export const forEachLimit: typeof eachLimit; -export function forEachOf(obj: IterableCollection, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; +export function forEachOf(obj: IterableCollection, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; export const forEachOfSeries: typeof forEachOf; -export function forEachOfLimit(obj: IterableCollection, limit: number, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; +export function forEachOfLimit(obj: IterableCollection, limit: number, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; export const eachOf: typeof forEachOf; export const eachOfSeries: typeof forEachOf; export const eachOfLimit: typeof forEachOfLimit; -export function map(arr: T[] | IterableIterator, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; -export function map(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; +export function map(arr: T[] | IterableIterator, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; +export function map(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; export const mapSeries: typeof map; -export function mapLimit(arr: IterableCollection, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; -export function mapValuesLimit(obj: Dictionary, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; -export function mapValues(obj: Dictionary, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; +export function mapLimit(arr: IterableCollection, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; +export function mapValuesLimit(obj: Dictionary, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; +export function mapValues(obj: Dictionary, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; export const mapValuesSeries: typeof mapValues; -export function filter(arr: IterableCollection, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; +export function filter(arr: IterableCollection, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; export const filterSeries: typeof filter; -export function filterLimit(arr: IterableCollection, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; +export function filterLimit(arr: IterableCollection, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; export const select: typeof filter; export const selectSeries: typeof filter; export const selectLimit: typeof filterLimit; export const reject: typeof filter; export const rejectSeries: typeof filter; export const rejectLimit: typeof filterLimit; -export function reduce(arr: T[] | IterableIterator, memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): void; +export function reduce(arr: T[] | IterableIterator, memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): void; export const inject: typeof reduce; export const foldl: typeof reduce; export const reduceRight: typeof reduce; export const foldr: typeof reduce; -export function detect(arr: IterableCollection, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; +export function detect(arr: IterableCollection, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; export const detectSeries: typeof detect; -export function detectLimit(arr: IterableCollection, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; +export function detectLimit(arr: IterableCollection, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; export const find: typeof detect; export const findSeries: typeof detect; export const findLimit: typeof detectLimit; -export function sortBy(arr: T[] | IterableIterator, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; -export function some(arr: IterableCollection, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; +export function sortBy(arr: T[] | IterableIterator, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; +export function some(arr: IterableCollection, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; export const someSeries: typeof some; -export function someLimit(arr: IterableCollection, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; +export function someLimit(arr: IterableCollection, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; export const any: typeof some; export const anySeries: typeof someSeries; export const anyLimit: typeof someLimit; -export function every(arr: IterableCollection, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; +export function every(arr: IterableCollection, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; export const everySeries: typeof every; -export function everyLimit(arr: IterableCollection, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; +export function everyLimit(arr: IterableCollection, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; export const all: typeof every; export const allSeries: typeof every; export const allLimit: typeof everyLimit; -export function concat(arr: IterableCollection, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; -export function concatLimit(arr: IterableCollection, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; +export function concat(arr: IterableCollection, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; +export function concatLimit(arr: IterableCollection, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; export const concatSeries: typeof concat; // Control Flow -export function series(tasks: AsyncFunction[], callback?: AsyncResultArrayCallback): void; -export function series(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; -export function parallel(tasks: Array>, callback?: AsyncResultArrayCallback): void; -export function parallel(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; -export function parallelLimit(tasks: Array>, limit: number, callback?: AsyncResultArrayCallback): void; -export function parallelLimit(tasks: Dictionary>, limit: number, callback?: AsyncResultObjectCallback): void; -export function whilst(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; -export function doWhilst(fn: AsyncFunctionEx, test: (...results: T[]) => boolean, callback: ErrorCallback): void; -export function until(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; -export function doUntil(fn: AsyncFunctionEx, test: (...results: T[]) => boolean, callback: ErrorCallback): void; -export function during(test: (testCallback : AsyncBooleanResultCallback) => void, fn: AsyncVoidFunction, callback: ErrorCallback): void; -export function doDuring(fn: AsyncVoidFunction, test: (testCallback: AsyncBooleanResultCallback) => void, callback: ErrorCallback): void; -export function forever(next: (next : ErrorCallback) => void, errBack: ErrorCallback) : void; -export function waterfall(tasks: Function[], callback?: AsyncResultCallback): void; +export function series(tasks: AsyncFunction[], callback?: AsyncResultArrayCallback): void; +export function series(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; +export function parallel(tasks: Array>, callback?: AsyncResultArrayCallback): void; +export function parallel(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; +export function parallelLimit(tasks: Array>, limit: number, callback?: AsyncResultArrayCallback): void; +export function parallelLimit(tasks: Dictionary>, limit: number, callback?: AsyncResultObjectCallback): void; +export function whilst(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; +export function doWhilst(fn: AsyncFunctionEx, test: (...results: T[]) => boolean, callback: ErrorCallback): void; +export function until(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; +export function doUntil(fn: AsyncFunctionEx, test: (...results: T[]) => boolean, callback: ErrorCallback): void; +export function during(test: (testCallback : AsyncBooleanResultCallback) => void, fn: AsyncVoidFunction, callback: ErrorCallback): void; +export function doDuring(fn: AsyncVoidFunction, test: (testCallback: AsyncBooleanResultCallback) => void, callback: ErrorCallback): void; +export function forever(next: (next : ErrorCallback) => void, errBack: ErrorCallback) : void; +export function waterfall(tasks: Function[], callback?: AsyncResultCallback): void; export function compose(...fns: Function[]): Function; export function seq(...fns: Function[]): Function; export function applyEach(fns: Function[], ...argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. export function applyEachSeries(fns: Function[], ...argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. -export function queue(worker: AsyncWorker, concurrency?: number): AsyncQueue; -export function queue(worker: AsyncResultIterator, concurrency?: number): AsyncQueue; -export function priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue; -export function cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo; -export function auto, E>(tasks: AsyncAutoTasks, concurrency?: number, callback?: AsyncResultCallback): void; -export function autoInject(tasks: any, callback?: AsyncResultCallback): void; -export function retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; -export function retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: AsyncResultCallback): void; -export function retryable(opts: number | {times: number, interval: number}, task: AsyncFunction): AsyncFunction; -export function apply(fn: Function, ...args: any[]): AsyncFunction; +export function queue(worker: AsyncWorker, concurrency?: number): AsyncQueue; +export function queue(worker: AsyncResultIterator, concurrency?: number): AsyncQueue; +export function priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue; +export function cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo; +export function auto, E = Error>(tasks: AsyncAutoTasks, concurrency?: number, callback?: AsyncResultCallback): void; +export function auto, E = Error>(tasks: AsyncAutoTasks, callback?: AsyncResultCallback): void; +export function autoInject(tasks: any, callback?: AsyncResultCallback): void; +export function retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; +export function retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: AsyncResultCallback): void; +export function retryable(opts: number | {times: number, interval: number}, task: AsyncFunction): AsyncFunction; +export function apply(fn: Function, ...args: any[]): AsyncFunction; export function nextTick(callback: Function, ...args: any[]): void; export const setImmediate: typeof nextTick; -export function reflect(fn: AsyncFunction) : (callback: (err: null, result: {error?: E, value?: T}) => void) => void; -export function reflectAll(tasks: AsyncFunction[]): ((callback: (err: null, result: {error?: E, value?: T}) => void) => void)[]; +export function reflect(fn: AsyncFunction) : (callback: (err: null, result: {error?: E, value?: T}) => void) => void; +export function reflectAll(tasks: AsyncFunction[]): ((callback: (err: null, result: {error?: E, value?: T}) => void) => void)[]; -export function timeout(fn: AsyncFunction, milliseconds: number, info?: any): AsyncFunction; -export function timeout(fn: AsyncResultIterator, milliseconds: number, info?: any): AsyncResultIterator; +export function timeout(fn: AsyncFunction, milliseconds: number, info?: any): AsyncFunction; +export function timeout(fn: AsyncResultIterator, milliseconds: number, info?: any): AsyncResultIterator; export function times (n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; -export function timesSeries(n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; -export function timesLimit(n: number, limit: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; +export function timesSeries(n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; +export function timesLimit(n: number, limit: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; -export function transform(arr: T[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback): void; -export function transform(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback): void; +export function transform(arr: T[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback): void; +export function transform(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback): void; -export function transform(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void, callback?: AsyncResultObjectCallback): void; -export function transform(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void, callback?: AsyncResultObjectCallback): void; +export function transform(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void, callback?: AsyncResultObjectCallback): void; +export function transform(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void, callback?: AsyncResultObjectCallback): void; -export function race(tasks: (AsyncFunction)[], callback: AsyncResultCallback) : void; +export function race(tasks: (AsyncFunction)[], callback: AsyncResultCallback) : void; // Utils export function memoize(fn: Function, hasher?: Function): Function; diff --git a/types/async/test/index.ts b/types/async/test/index.ts index 3c6c2f5dfe..0081dd3dcd 100644 --- a/types/async/test/index.ts +++ b/types/async/test/index.ts @@ -114,7 +114,7 @@ async.series([ ], function (err, results) { }); -async.series([ +async.series([ function (callback) { callback(undefined, 'one'); }, @@ -138,7 +138,7 @@ async.series({ }, function (err, results) { }); -async.series({ +async.series({ one: function (callback) { setTimeout(function () { callback(undefined, 1); @@ -178,7 +178,7 @@ async.parallel([ ], function (err, results) { }); -async.parallel([ +async.parallel([ function (callback) { setTimeout(function () { callback(undefined, 'one'); @@ -207,7 +207,7 @@ async.parallel({ }, function (err, results) { }); -async.parallel({ +async.parallel({ one: function (callback) { setTimeout(function () { callback(undefined, 1); @@ -273,7 +273,7 @@ async.waterfall([ ], function (err, result) { }); -var q = async.queue(function (task: any, callback: (err?:Error,msg?:string) => void) { +var q = async.queue(function (task: any, callback: (err?:Error,msg?:string) => void) { console.log('hello ' + task.name); callback(undefined,'a message.'); }, 2); @@ -293,7 +293,7 @@ q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) { console.log('finished processing bar'); }); -q.push({name: 'foo'}, function (err,msg) { +q.push({name: 'foo'}, function (err, msg) { console.log('foo finished with a message "'+ msg! + '"'); }); @@ -330,7 +330,7 @@ q.resume(); q.kill(); // tests for strongly typed tasks -var q2 = async.queue(function (task: string, callback: () => void) { +var q2 = async.queue(function (task: string, callback: () => void) { console.log('Task: ' + task); callback(); }, 1); @@ -356,7 +356,7 @@ q2.unshift(['task3', 'task4', 'task5'], function (error) { }); -var aq = async.queue(function (level: number, callback: (error?: Error, newLevel?: number) => void) { +var aq = async.queue(function (level: number, callback: (error?: Error, newLevel?: number) => void) { console.log('hello ' + level); callback(undefined, level+1); }); @@ -387,14 +387,47 @@ cargo.push({ name: 'baz' }, function (err: Error) { var filename = ''; async.auto({ - get_data: function (callback: any) { }, - make_folder: function (callback: any) { }, + get_data: function (callback: AsyncResultCallback) { }, + make_folder: function (callback: AsyncResultCallback) { }, //arrays with different types are not accepted by TypeScript. - write_file: ['get_data', 'make_folder', function (callback: any) { + write_file: ['get_data', 'make_folder', function (callback: AsyncResultCallback) { callback(null, filename); }], //arrays with different types are not accepted by TypeScript. - email_link: ['write_file', function (callback: any, results: any) { }] + email_link: ['write_file', function (callback: AsyncResultCallback, results: any) { }] +}); + +async.auto({ + get_data: function (callback: AsyncResultCallback) { }, + make_folder: function (callback: AsyncResultCallback) { }, + //arrays with different types are not accepted by TypeScript. + write_file: ['get_data', 'make_folder', function (callback: AsyncResultCallback) { + callback(null, filename); + }], + //arrays with different types are not accepted by TypeScript. + email_link: ['write_file', function (callback: AsyncResultCallback, results: any) { }] +}, function (err, results) { + console.log('finished auto'); +}); + +interface A { + get_data: any; + make_folder: any; + write_file: any; + email_link: any; +} + +async.auto({ + get_data: function (callback: AsyncResultCallback) { }, + make_folder: function (callback: AsyncResultCallback) { }, + //arrays with different types are not accepted by TypeScript. + write_file: ['get_data', 'make_folder', function (callback: AsyncResultCallback) { + callback(null, filename); + }], + //arrays with different types are not accepted by TypeScript. + email_link: ['write_file', function (callback: AsyncResultCallback, results: any) { }] +}, 1, function (err, results) { + console.log('finished auto'); }); async.retry(3, function (callback, results) { }, function (err, result) { }); @@ -459,10 +492,10 @@ async.dir(function (name: string, callback: any) { // each -async.each({ +async.each({ "a": 1, "b": 2 -}, function(val: number, next: ErrorCallback): void { +}, function(val: number, next: ErrorCallback): void { setTimeout(function(): void { @@ -478,10 +511,10 @@ async.each({ }); -async.eachSeries({ +async.eachSeries({ "a": 1, "b": 2 -}, function(val: number, next: ErrorCallback): void { +}, function(val: number, next: ErrorCallback): void { setTimeout(function(): void { @@ -497,14 +530,14 @@ async.eachSeries({ }); -async.eachLimit({ +async.eachLimit({ "a": 1, "b": 2, "c": 3, "d": 4, "e": 5, "f": 6 -}, 2, function(val: number, next: ErrorCallback): void { +}, 2, function(val: number, next: ErrorCallback): void { setTimeout(function(): void { @@ -522,10 +555,10 @@ async.eachLimit({ // forEachOf/eachOf -async.eachOf({ +async.eachOf({ "a": 1, "b": 2 -}, function(val: number, key: string, next: ErrorCallback): void { +}, function(val: number, key: string, next: ErrorCallback): void { setTimeout(function(): void { @@ -541,10 +574,10 @@ async.eachOf({ }); -async.forEachOfSeries({ +async.forEachOfSeries({ "a": 1, "b": 2 -}, function(val: number, key: string, next: ErrorCallback): void { +}, function(val: number, key: string, next: ErrorCallback): void { setTimeout(function(): void { @@ -560,14 +593,14 @@ async.forEachOfSeries({ }); -async.forEachOfLimit({ +async.forEachOfLimit({ "a": 1, "b": 2, "c": 3, "d": 4, "e": 5, "f": 6 -}, 2, function(val: number, key: string, next: ErrorCallback): void { +}, 2, function(val: number, key: string, next: ErrorCallback): void { setTimeout(function(): void { @@ -585,11 +618,11 @@ async.forEachOfLimit({ // map -async.map({ +async.map({ "a": 1, "b": 2, "c": 3 -}, function(val: number, next: AsyncResultCallback): void { +}, function(val: number, next: AsyncResultCallback): void { setTimeout(function(): void { @@ -605,11 +638,11 @@ async.map({ }); -async.mapSeries({ +async.mapSeries({ "a": 1, "b": 2, "c": 3 -}, function(val: number, next: AsyncResultCallback): void { +}, function(val: number, next: AsyncResultCallback): void { setTimeout(function(): void { @@ -625,14 +658,14 @@ async.mapSeries({ }); -async.mapLimit({ +async.mapLimit({ "a": 1, "b": 2, "c": 3, "d": 4, "e": 5, "f": 6 -}, 2, function(val: number, next: AsyncResultCallback): void { +}, 2, function(val: number, next: AsyncResultCallback): void { setTimeout(function(): void { @@ -650,11 +683,11 @@ async.mapLimit({ // mapValues -async.mapValues({ +async.mapValues({ "a": 1, "b": 2, "c": 3 -}, function(val: number, key: string, next: AsyncResultCallback): void { +}, function(val: number, key: string, next: AsyncResultCallback): void { setTimeout(function(): void { @@ -670,11 +703,11 @@ async.mapValues({ }); -async.mapValuesSeries({ +async.mapValuesSeries({ "a": 1, "b": 2, "c": 3 -}, function(val: number, key: string, next: AsyncResultCallback): void { +}, function(val: number, key: string, next: AsyncResultCallback): void { setTimeout(function(): void { @@ -692,11 +725,11 @@ async.mapValuesSeries({ // filter/select/reject -async.filter({ +async.filter({ "a": 1, "b": 2, "c": 3 -}, function(val: number, next: AsyncBooleanResultCallback): void { +}, function(val: number, next: AsyncBooleanResultCallback): void { setTimeout(function(): void { @@ -712,11 +745,11 @@ async.filter({ }); -async.reject({ +async.reject({ "a": 1, "b": 2, "c": 3 -}, function(val: number, next: AsyncBooleanResultCallback): void { +}, function(val: number, next: AsyncBooleanResultCallback): void { setTimeout(function(): void { @@ -734,11 +767,11 @@ async.reject({ // concat -async.concat({ +async.concat({ "a": "1", "b": "2", "c": "3" -}, function(item: string, next: AsyncResultCallback): void { +}, function(item: string, next: AsyncResultCallback): void { console.log(`async.concat: ${item}`); @@ -752,11 +785,11 @@ async.concat({ // detect/find -async.detect({ +async.detect({ "a": 1, "b": 2, "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { +}, function(item: number, next: AsyncBooleanResultCallback): void { console.log(`async.detect/find: ${item}`); @@ -777,11 +810,11 @@ async.detect({ // every/all -async.every({ +async.every({ "a": 1, "b": 2, "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { +}, function(item: number, next: AsyncBooleanResultCallback): void { console.log(`async.every/all: ${item}`); @@ -795,11 +828,11 @@ async.every({ // some/any -async.some({ +async.some({ "a": 1, "b": 2, "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { +}, function(item: number, next: AsyncBooleanResultCallback): void { console.log(`async.some/any: ${item}`); diff --git a/types/asynciterator/tslint.json b/types/asynciterator/tslint.json index 3db14f85ea..1c36270d47 100644 --- a/types/asynciterator/tslint.json +++ b/types/asynciterator/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-angle-bracket-type-assertion": false + } +} diff --git a/types/athenajs/index.d.ts b/types/athenajs/index.d.ts new file mode 100644 index 0000000000..08c828679e --- /dev/null +++ b/types/athenajs/index.d.ts @@ -0,0 +1,784 @@ +// Type definitions for athenajs 0.1 +// Project: https://github.com/AthenaJS/athenajs +// Definitions by: Nicolas Ramz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export as namespace AthenaJS; + +export function Dom(sel?: string | HTMLElement): _Dom; + +export class Scene { + constructor(options?: SceneOptions); + map: Map; + hudScene: Scene | null; + running: boolean; + opacity: number; + addObject(object: Drawable | Drawable[], layer?: number): Scene; + animate(fxName: string, options: EffectOptions): Promise; + bindEvents(eventList: string): void; + debug(bool?: boolean): void; + fadeIn(duration: number): Promise; + fadeOut(duration: number): Promise; + fadeInAndOut(inDuration: number, delay: number, outDuration: number): Promise; + getOpacity(): number; + getPlayTime(): number; + load(type: string, src: string, id?: string): void; + loadAudio(src: string, id?: string): void; + loadImage(src: string, id?: string): void; + loadMap(src: string, id?: string): void; + notify(name: string, data?: JSObject): void; + removeObject(obj: Drawable): void; + setBackgroundImage(image: string|HTMLImageElement): void; + setLayerPriority(layer: number, background: boolean): void; + setMap(map: Map | JSObject, x?: number, y?: number): void; + setOpacity(opacity: number): void; + setup(): void; + start(): void; + stop(): void; +} +export class Game { + constructor(options: GameOptions); + bindEvents(eventList: string): void; + setScene(scene: Scene): void; + toggleFullscreen(): void; + toggleSound(bool: boolean): void; + toggleTileInspector(bool: boolean): void; + togglePause(): void; + scene: Scene; + sound: boolean; +} +export class Drawable { + constructor(type: string, options: DrawableOptions); + addChild(child: Drawable): void; + animate(name: string, options: JSObject): Promise; + center(): Drawable; + destroy(data?: any): void; + moveTo(x: number, y: number, duration?: number): Drawable; + notify(id: string, data?: JSObject): void; + onCollision(object: Drawable): void; + onEvent(eventType: string, data?: JSObject): void; + playSound(id: string, options?: { pan?: boolean, loop?: false }): void; + setBehavior(behavior: string | { new(sprite: Drawable, options?: JSObject): Behavior }, options?: JSObject): void; + setScale(scale: number): void; + getCurrentWidth(): number; + getCurrentHeight(): number; + getProperty(prop: string): any; + setProperty(prop: string, value: any): void; + setMask(mask: MaskOptions | null, exclude?: boolean): void; + stopAnimate(endValue?: number): void; + reset(): void; + show(): void; + hide(): void; + type: string; + width: number; + height: number; + x: number; + y: number; + vx: number; + vy: number; + canCollide: boolean; + currentMovement: string; + running: boolean; + movable: boolean; + behavior: Behavior; + currentMap: Map; + data: JSObject; + visible: boolean; +} + +export interface MaskOptions { + x: number; + y: number; + width: number; + height: number; +} + +export interface MenuItem { + text: string; + selectable: boolean; + visible: boolean; + active?: boolean; +} + +export interface MenuOptions { + title: string; + color: string; + menuItems: MenuItem[]; +} + +export class Menu extends Drawable { + constructor(id: string, options: MenuOptions); + nextItem(): void; + getSelectedItemIndex(): number; +} + +export class SimpleText extends Drawable { + constructor(type: string, simpleTextOptions: SimpleTextOptions); + getCurrentOffsetX(): number; + getCurrentOffsetY(): number; + setColor(color: string): void; + setSize(width: number, height: number): void; + setText(text: string): void; +} +export class Paint extends Drawable { + constructor(type: string, paintOptions: PaintOptions); + arc(cx: number, cy: number, r: number, starteAngle: number, endAngle: number, fillStyle: string, borderSize: number): void; + fill(color?: string): void; + circle(cx: number, cy: number, r: number, fillStyle?: string, borderWidth?: number, borderStyle?: string): void; + rect(x: number, y: number, width: number, height: number, color: string): void; + name: string; + color: string; +} + +export class BitmapText extends Drawable { + constructor(type: string, textOptions: BitmapTextOptions); + setText(text: string): void; +} + +export class Sprite extends Drawable { + constructor(type: string, spriteOptions: SpriteOptions); + addAnimation(name: string, imgPath: string, options: AnimOptions): void; + setAnimation(name: string, fn?: Callback, frameNum?: number, revert?: boolean): void; + clearMove(): void; +} + +export interface pixelPos { + x: number; + y: number; +} + +export class Map { + constructor(options: MapOptions); + addObject(obj: Drawable, layerIndex?: number): void; + addTileSet(tiles: TileDesc[]): void; + checkMatrixForCollision(buffer: number[], matrixWidth: number, x: number, y: number, behavior: number): boolean; + clear(tileNum?: number, behavior?: number): void; + getTileBehaviorAtIndex(col: number, row: number): number; + getTileIndexFromPixel(x: number, y: number): pixelPos; + moveTo(x: number, y: number): void; + respawn(): void; + setData(map: Uint8Array, behaviors: Uint8Array): void; + setEasing(easing: string): void; + shift(startLine: number, height: number): void; + updateTile(col: number, row: number, tileNum?: number, behavior?: number): void; + duration: number; + numRows: number; + numCols: number; + width: number; + height: number; + tileWidth: number; + tileHeight: number; +} + +export class Tile { + constructor(options: JSObject); + static TYPE: { + AIR: 1; + WALL: 2; + LADDER: 3; + }; + offsetX: number; + offsetY: number; + width: number; + height: number; + + inertia: number; + upCollide: boolean; + downCollide: boolean; +} + +export interface TileDesc { + offsetX: number; + offsetY: number; + width: number; + height: number; +} + +export interface MapOptions { + src: string; + tileWidth: number; + tileHeight: number; + width: number; + height: number; + viewportW?: number; + viewportH?: number; + buffer?: ArrayBuffer; +} + +export interface FXInstance { + addFX(fxName: string, FxClass: { new(options: EffectOptions, display: Display): Effect }): void; +} + +export const FX: FXInstance; + +export class _FX { + /** + * Creates the FX class, adding the linear easing + */ + constructor(); + + /** + * Add a new Effect + */ + addFX(fxName: string, FxClass: { new(): Effect }): void; + + /** + * Retrieve an effect Class by its name + * + */ + getEffect(fxName: string): Effect; + + /** + * Add a new easing function for other objects to use + * + */ + addEasing(easingName: string, easingFn: (x?: number, t?: number, b?: number, c?: number, d?: number) => void): void; + + /** + * Retrieves an easing function + * + */ + getEasing(easingName: string): (x?: number, t?: number, b?: number, c?: number, d?: number) => void; +} + +export interface EffectOptions { + easing?: string; + when?: string; + startValue?: number; + endValue?: number; + duration?: number; +} + +export class Effect { + width: number; + height: number; + buffer: RenderingContext; + animProgress: number; + startValue: number; + ended: boolean; + /** + * This the class constructor. Default options are: + * + */ + constructor(options: EffectOptions, display: Display); + + /** + * Changes the easing function used for the ffect + * + */ + setEasing(easing: (x?: number, t?: number, b?: number, c?: number, d?: number) => void): void; + + /** + * Called when the ffect is started. + * + * This method can be overriden but the super should always be called + */ + start(): Promise; + + /** + * called when the effect is stopped + */ + stop(object: any, setEndValue: any): void; + + /** + * Calculates current animation process + * + * This method can be overridden but the super should always be calle first + */ + process(ctx: RenderingContext, fxCtx?: RenderingContext, obj?: any): boolean; +} + +// why do we need this ? +export type RenderingContext = CanvasRenderingContext2D; + +export interface DisplayOptions { + width: number; + height: number; + type: string; + layers?: boolean[]; + name: string; +} + +export class Display { + /** + * Creates a new Display instance + * + */ + constructor(options: DisplayOptions, target: string | HTMLElement); + + /** + * Creates a new (offscreen) drawing buffer + * + */ + getBuffer(width: number, height: number): RenderingContext; + + /** + * Toggles fullscreen display scaling + */ + toggleFullscreen(): void; + + /** + * Changes the zIndex property of the specified layer canvas + * + */ + setLayerZIndex(layer: number, zIndex: number): void; + + /** + * Clears a canvas display buffer + * + */ + clearScreen(ctx: RenderingContext): void; + + /** + * Clears every rendering buffer, including the special fxCtx one + */ + clearAllScreens(): void; + + /** + * Changes the (CSS) opacity of a canvas + * + */ + setCanvasOpacity(canvas: HTMLElement, opacity: number): void; + + /** + * Renders the specified scene + * + */ + renderScene(scene: Scene): void; + + /** + * Prepares the canvas before rendering images. + * + * Explanation: during development, I noticed that the very first time + * the ctx.drawImage() was used to draw onto a canvas, it took a very long time, + * like at least 10ms for a very small 32x32 pixels drawImage. + * + * Subsequent calls do not have this problem and are instant. + * Maybe some ColorFormat conversion happens. + * + * This method makes sure that when the game starts rendering, we don't have + * any of these delays that can impact gameplay and alter the gameplay experience + * in a negative way. + */ + prepareCanvas(resources: JSObject[]): void; + + /** + * Starts an animation on the display + * + */ + animate(fxName: string, options: EffectOptions, context: RenderingContext): Promise; + + /** + * stops current animation + * + * TODO + */ + stopAnimate(fxName?: string): void; + + /** + * Executes an effect on a frame at a given time + * + */ + executeFx(ctx: RenderingContext, fxCtx: RenderingContext, obj: Drawable, time: number, when: string): void; + + /** + * Clears every display layer and clears fx queues + */ + clearDisplay(): void; +} + +export const InputManager: _InputManager; + +export class MapEvent { + /** + * Creates a new MapEvent + * + */ + constructor(map: Map); + + /** + * Resets the MapEvent switches, events and items + */ + reset(): void; + + /** + * Adds a new [`Drawable`]{#item} onto the map + * + */ + addItem(id: string, item: Drawable): void; + + /** + * Returns an item + * + */ + getItem(id: string): Drawable | undefined; + + // TODO: ability to trigger an event once a switch has been modified + setSwitch(id: string, bool: boolean): void; + + toggleSwitch(id: string): void; + + /** + * Retrieves a switch from the map using its id + * + */ + getSwitch(id: string): any; + + /** + * checks of conditions of specified trigger are valid + * + */ + checkConditions(trigger: JSObject): boolean; + + handleAction(options: JSObject): void; + + handleEvent(options: JSObject): boolean; + + /** + * Schedule adding a new object to the map + */ + scheduleSprite(spriteId: string, spriteOptions: JSObject, delay: number): Drawable; + + /** + * Add a new wave of objects to the map + * Used for example when the player triggers apparition of several enemies or bonuses + * + * @related {Wave} + */ + handleWave(options: JSObject): boolean; + + endWave(): void; + + triggerEvent(id: string): void; + + isEventTriggered(id: string): boolean; +} + +export class Behavior { + vx: number; + vy: number; + gravity: number; + sprite: Drawable; + constructor(sprite: Drawable, options?: JSObject); + onUpdate(timestamp: number): void; + onVXChange?(vx: number): void; + onVYChange?(vy: number): void; + + /** + * Returns current mapEvent + * + */ + getMapEvent(): MapEvent; + reset(): void; +} + +export interface _AudioManager { + audioCache: JSObject; + enabled: boolean; + /** + * Adds a new sound element to the audio cache. + * *Note* if a sound with the same id has already been added, it will be replaced + * by the new one. + * + */ + addSound(id: string, element: HTMLAudioElement): void; +/** + * Toggles global sound playback + * + */ + toggleSound(bool: boolean): void; +/** + * Plays the specified sound with `id`. + * + */ + play(id: string, loop?: boolean, volume?: number, panning?: number): any; +/** + * Stops playing the sound id + * + */ + stop(id: string, instanceId: any): void; +} + +export const AudioManager: _AudioManager; + +export interface Res { + id: string; + type: string; + src: string; +} + +export type Callback = (...args: any[]) => void; + +export interface _NotificationManager { + notify(name: string, data?: JSObject): void; +} + +export const NotificationManager: _NotificationManager; + +export interface _ResourceManager { + addResources(resource: Res, group?: string): Promise; + getCanvasFromImage(image: HTMLImageElement): HTMLCanvasElement; + getResourceById(id: string, group?: string, fullObject?: boolean): any; + loadResources(group: string, progressCb?: Callback, errorCb?: Callback): void; + loadImage(res: Res, group?: string): Promise; + loadAudio(res: Res, group?: string): Promise; + newResourceFromPool(id: string): any; + registerScript(id: string, elt: any, poolSize?: number): void; +} + +export const ResourceManager: _ResourceManager; + +export interface _InputManager { +/** + * A list of common keyCodes + */ +KEYS: { + 'UP': 38, + 'DOWN': 40, + 'LEFT': 37, + 'RIGHT': 39, + 'SPACE': 32, + 'ENTER': 13, + 'ESCAPE': 27, + 'CTRL': 17 +}; +/** + * List of common pad buttons + */ +PAD_BUTTONS: { + 32: 1, // Face (main) buttons + FACE_0: 1, + FACE_3: 2, + FACE_4: 3, + LEFT_SHOULDER: 4, // Top shoulder buttons + RIGHT_SHOULDER: 5, + LEFT_SHOULDER_BOTTOM: 6, // Bottom shoulder buttons + RIGHT_SHOULDER_BOTTOM: 7, + SELECT: 8, + START: 9, + LEFT_ANALOGUE_STICK: 10, // Analogue sticks (if depressible) + RIGHT_ANALOGUE_STICK: 11, + 38: 12, // Directional (discrete) pad + 40: 13, + 37: 14, + 39: 15 +}; +axes: JSObject; +newGamepadPollDelay: number; +gamepadSupport: boolean; +recording: boolean; +playingEvents: boolean; +playingPos: number; +/*recordedEvents: Array,*/ +pad: null; +latches: JSObject; +keyPressed: JSObject; +padPressed: JSObject; +keyCb: JSObject; +enabled: boolean; +inputMode: string; +// virtual joystick instance +dPadJoystick: null; +jPollInterval: number; +/** + * Initializes the InputManager with a reference to the game. + * + * This method prepares the InputManager by reseting keyboard states/handlers and + * set current inputMode + * + */ + init(): void; +/** + * Starts recording input events. They are stored into `InputManager.recordedEvents` + */ +startRecordingEvents(): void; +/** + * Stops recording events. + */ +stopRecordingEvents(): void; +/** + * After events have been reccorded they can be played back using this method. + */ +playRecordedEvents(): void; +/** + * Sets next key states using recorded events + * + * TODO: add an optional callback to be called at the end of the playback + * so that demo can be looped. + */ +nextRecordedEvents(): void; +/** + * Saves current event state onto the recordedEvents stack + */ +/** + * Changes input mode + * + */ +setInputMode(mode: string): void; + /** + * Returns an object with the state of all keys + */ + getAllKeysStatus(): JSObject; + getKeyStatus(key: string, latch: boolean): boolean; + isKeyDown(key: string|number, latch?: boolean): boolean; + /** + * Install callback that gets called when a key is pressed/released + * + */ + installKeyCallback(key: string, event: string, callback: (key: string, event: string) => void): void; + removeKeyCallback(key: string, event: string, callback: () => void): void; + clearEvents(): void; +} + +export interface Promise { + then(val?: () => any): Promise; + catch(val?: () => any): Promise; +} + +/* Deferred */ +export class Deferred { + constructor(); + /** + * Creates and immediately resolves a new deferred. + * + */ + static resolve(val?: any): Promise; + promise: Promise; + reject(val: any): void; + resolve(val: any): void; +} + +/* Dom support */ +export interface _Dom extends Iterable { + [key: number]: TElement; + length: number; + css(prop: string, val: string): _Dom; + css(prop: JSObject): _Dom; + css(prop: string): string|null; + find(selector: string): _Dom; + appendTo(selector: string | _Dom | HTMLElement): _Dom; + attr(att: string, val: string): _Dom; + attr(att: JSObject): _Dom; + addClass(classes: string): _Dom; + removeClass(classes: string): _Dom; + html(str: string): _Dom; + show(): _Dom; + hide(): _Dom; +} + +/* Game Support */ +export interface GameOptions { + name: string; + showFps: boolean; + width: number; + height: number; + debug: boolean; + scene?: Scene; + target?: string | HTMLElement; + sound?: boolean; +} + +export interface SceneOptions { + name?: string; + resources?: Res[]; + opacity?: number; + layers?: number; + hudScene?: Scene; +} + +export interface DrawableOptions { + x?: number; + y?: number; + behavior?: { new(sprite: Drawable, options?: JSObject): Behavior }; + canCollide?: boolean; + canCollideFriendBullet?: boolean; + collideGroup?: number; + objectId?: string; + layer?: number; + map?: Map; + visible?: boolean; + pool?: number; +} + +export interface SimpleTextOptions extends DrawableOptions { + text?: string; + width?: number; + height?: number; + fontFace?: string; + fontSize?: string; + fontStyle?: string; + fontWeight?: string; + align?: string; + color?: string; +} + +export interface PaintOptions extends DrawableOptions { + width?: number; + height?: number; + color?: string; + lineHeight?: number; +} + +export interface BitmapTextOptions extends DrawableOptions { + width?: number; + height?: number; + offsetX: number; + startY: number; + charWidth: number; + charHeight: number; + imageId?: string; + imageSrc?: string; + scrollOffsetX?: number; + scrollOffsetY?: number; + text?: string; + size?: string; +} + +export interface SpriteOptions extends DrawableOptions { + easing?: string; + imageId?: string; + animations?: Animations; + data?: JSObject; +} + +export interface AnimOptions { + numFrames: number; + frameWidth: number; + frameHeight: number; + frameDuration: number; + offsetX?: number; + offsetY?: number; + frameSpacing?: number; +} + +export interface AnimationObject { + frameDuration?: number; + frames: Array<{ + offsetX: number; + offsetY: number; + width: number; + height: number; + hitBox?: { + x: number; + y: number; + x2: number; + y2: number; + }, + plane?: number; + }>; + loop?: number; + speed?: number; +} + +export interface JSObject { + [key: string]: any; +} + +export interface Animations { + [key: string]: AnimationObject; +} + +export interface GameEvent { + type: string; + data: JSObject; +} diff --git a/types/athenajs/test/bitmaptext.ts b/types/athenajs/test/bitmaptext.ts new file mode 100644 index 0000000000..b32a0d2541 --- /dev/null +++ b/types/athenajs/test/bitmaptext.ts @@ -0,0 +1,18 @@ +import { BitmapText } from 'athenajs'; + +const bitmap: BitmapText = new BitmapText('myBitmap', { + size: 'big', + width: 180, + height: 32, + visible: false, + scrollOffsetX: 0, + scrollOffsetY: 0, + text: 'pause', + offsetX: 34, + startY: 36, + charWidth: 18, + charHeight: 18, + imageId: 'font' +}); + +bitmap.center(); diff --git a/types/athenajs/test/deferred.ts b/types/athenajs/test/deferred.ts new file mode 100644 index 0000000000..5cdc077a19 --- /dev/null +++ b/types/athenajs/test/deferred.ts @@ -0,0 +1,28 @@ +import { Deferred } from 'athenajs'; + +let def: Deferred; + +// static Deferred.resolve +Deferred.resolve(true).then(() => { + console.log('resolved'); +}) + .then(() => { + console.log('resolved'); + }); + +def = new Deferred(); + +// resolve/reject +def.resolve(10); + +def = new Deferred(); +def.reject(false); +def.promise.then(() => { + console.log('done'); +}) + .then(() => { + console.log('real done'); + }) + .catch(() => { + console.log('oops'); + }); diff --git a/types/athenajs/test/dom.ts b/types/athenajs/test/dom.ts new file mode 100644 index 0000000000..c3a0df08c0 --- /dev/null +++ b/types/athenajs/test/dom.ts @@ -0,0 +1,33 @@ +import { Dom } from 'athenajs'; + +const div = Dom('div'); +const body = Dom(document.body); +const domElt: HTMLElement = body[0]; + +// Dom.appendTo +div.appendTo(body).show().hide(); +div.appendTo(domElt); + +const str: string | null = body.css('display'); +const i: number = body.length; + +// Dom.css +body.css('display', ' block'); +body.css({ display: 'none' }); +body.css('display', 'block'); + +// Dom.find +body.find('div').appendTo('body'); + +// Dom.attr +body.attr('data-test', 'hi'); +body.attr({ 'data-test2': 'foo' }); + +// Dom.addClass/Dom.removeClass +body.addClass('foo').removeClass('foo'); + +// Dom.show/hide +body.show().hide(); + +// Dom.html +body.html('
foo
'); diff --git a/types/athenajs/test/drawable.ts b/types/athenajs/test/drawable.ts new file mode 100644 index 0000000000..7caaccaf8d --- /dev/null +++ b/types/athenajs/test/drawable.ts @@ -0,0 +1,36 @@ +import { Behavior, Drawable, Map } from 'athenajs'; + +const sprite = new Drawable('mySprite', { + objectId: 'my Rocking Sprite', + layer: 0 +}); +const sprite2 = new Drawable('mySprite2', {}); + +sprite.addChild(sprite2); +sprite.animate('Fade', { + duration: 100 +}); +sprite.moveTo(0, 0).notify('yo!'); + +sprite.onCollision(sprite2); +sprite.onEvent('boom'); +sprite.playSound('explosion', { + pan: true +}); +sprite.setBehavior('stupid'); +sprite.setBehavior(Behavior); +sprite.setScale(1.0); + +const str: string = sprite.getProperty('strProp'); +sprite.setProperty('strProp', str); + +sprite.setMask({ + x: 0, + y: 0, + width: 100, + height: 100 +}); + +sprite.setMask(null); + +sprite.stopAnimate(10); diff --git a/types/athenajs/test/game.ts b/types/athenajs/test/game.ts new file mode 100644 index 0000000000..b6505251f8 --- /dev/null +++ b/types/athenajs/test/game.ts @@ -0,0 +1,23 @@ +import { Game, Scene } from 'athenajs'; + +let myScene: Scene = new Scene(); +let sound: boolean; + +const game: Game = new Game({ + name: 'myGame', + showFps: true, + width: 320, + height: 200, + debug: true, + scene: myScene, + target: 'body', + sound: true +}); + +game.setScene(myScene); +game.toggleSound(false); +game.toggleTileInspector(true); +game.toggleFullscreen(); +game.togglePause(); +myScene = game.scene; +sound = game.sound; diff --git a/types/athenajs/test/map.ts b/types/athenajs/test/map.ts new file mode 100644 index 0000000000..a2d21ab7f0 --- /dev/null +++ b/types/athenajs/test/map.ts @@ -0,0 +1,29 @@ +import { Map, TileDesc } from 'athenajs'; + +const map = new Map({ + src: "tiles", + tileWidth: 32, + tileHeight: 32, + width: 29 * 32, + height: 8 * 32, + viewportW: 320, + viewportH: 200 +}); +const tiles: TileDesc[] = []; +const mapContent: Uint8Array = new Uint8Array(10); +const behaviors: Uint8Array = new Uint8Array(10); + +for (let row = 0; row < 8; row++) { + for (let col = 0; col < 29; col++) { + tiles.push({ + offsetX: col * 32, + offsetY: row * 32, + width: 32, + height: 32 + }); + } +} + +map.addTileSet(tiles); + +map.setData(mapContent, behaviors); diff --git a/types/athenajs/test/paint.ts b/types/athenajs/test/paint.ts new file mode 100644 index 0000000000..3b6d60b705 --- /dev/null +++ b/types/athenajs/test/paint.ts @@ -0,0 +1,12 @@ +import { Paint } from 'athenajs'; + +const paint: Paint = new Paint('brush', { + width: 300, + height: 200, + color: 'red' +}); + +paint.color = 'red'; +paint.circle(0, 0, 150); +paint.circle(0, 0, 100, 'green'); +paint.circle(0, 0, 50, 'green', 2, 'blue'); diff --git a/types/athenajs/test/scene.ts b/types/athenajs/test/scene.ts new file mode 100644 index 0000000000..c39e85f1d0 --- /dev/null +++ b/types/athenajs/test/scene.ts @@ -0,0 +1,58 @@ +import { Game, Scene, Drawable, Map } from 'athenajs'; + +let num: number; + +const hudScene = new Scene(); +const myScene: Scene = new Scene({ + name: 'myScene', + resources: [{ + id: 'myRes', + src: 'src', + type: 'image' + }], + opacity: 1, + layers: 0, + hudScene +}); + +num = myScene.getOpacity(); +myScene.setOpacity(10); + +const sprite = new Drawable('mySprite', {}); + +myScene.debug(false); +myScene.bindEvents('gameover'); +myScene.addObject(sprite); +myScene.animate('Fade', { + easing: 'linear' +}).then(() => { + console.log('effect ended'); + }); +myScene.fadeIn(1000).then(() => { + myScene.fadeOut(2000); + myScene.fadeInAndOut(2000, 1000, 1000); + console.log(myScene.getPlayTime()); +}); + +myScene.load('image', 'img/foo.png'); +myScene.load('image', 'img/background.png', 'bg'); +myScene.loadAudio('sound/yeah.mp3'); +myScene.loadImage('img/bar.gif'); +myScene.loadAudio('sound/yeah.mp3'); +myScene.loadAudio('maps/map.json'); + +myScene.setBackgroundImage(new Image()); +myScene.setLayerPriority(10, true); + +myScene.notify('ready'); + +myScene.removeObject(sprite); + +myScene.setMap({}); +myScene.setMap(new Map({ + src: 'img/tiles.png', + tileWidth: 24, + tileHeight: 32, + width: 240, + height: 320 +})); diff --git a/types/athenajs/test/simpletext.ts b/types/athenajs/test/simpletext.ts new file mode 100644 index 0000000000..2599d366c4 --- /dev/null +++ b/types/athenajs/test/simpletext.ts @@ -0,0 +1,17 @@ +import { SimpleText } from 'athenajs'; + +const myText: SimpleText = new SimpleText('MyText', { + text: 'yop', + width: 100, + height: 200, + fontFace: 'Arial', + fontSize: '20px', + fontStyle: 'italic', + fontWeight: '300', + align: 'center', + color: 'white' +}); + +myText.setSize(100, 200); +myText.setText('Hi!'); +myText.setColor('rgba(0,0,0,.4'); diff --git a/types/athenajs/test/sprite.ts b/types/athenajs/test/sprite.ts new file mode 100644 index 0000000000..bc2106c4ce --- /dev/null +++ b/types/athenajs/test/sprite.ts @@ -0,0 +1,28 @@ +import { Sprite } from 'athenajs'; + +const sprite: Sprite = new Sprite('mySprite', { + imageId: 'tiles', + animations: { + anim1: { + frameDuration: 1, + frames: [{ + offsetX: 396, + offsetY: 2, + width: 64, + height: 96, + hitBox: { + x: 1, + y: 4, + x2: 62, + y2: 95 + }, + plane: 0 + }], + loop: 0 + } + } +}); + +sprite.setAnimation('anim1', () => { + sprite.setAnimation('anim1', () => { console.log('the end!'); }, 0, true); +}); diff --git a/types/athenajs/test/tetris/flash_lines.ts b/types/athenajs/test/tetris/flash_lines.ts new file mode 100644 index 0000000000..668d2c1f33 --- /dev/null +++ b/types/athenajs/test/tetris/flash_lines.ts @@ -0,0 +1,35 @@ +import { Paint, PaintOptions } from 'athenajs'; + +interface FlashOptions extends PaintOptions { + lineHeight: number; + x: number; + y: number; + width: number; +} + +export default class FlashLines extends Paint { + lines: number[]; + lineHeight: number; + + constructor(name: string, options: FlashOptions) { + super('flashlines', options); + + this.lines = []; + this.lineHeight = options.lineHeight; + } + + flash() { + return this.animate('Fade', { + startValue: 1, + endValue: 0, + duration: 400, + loop: 2 + }); + } + + render() { + for (const line of this.lines) { + this.rect(0, line * this.lineHeight, this.width, this.lineHeight, 'white'); + } + } +} diff --git a/types/athenajs/test/tetris/grid.ts b/types/athenajs/test/tetris/grid.ts new file mode 100644 index 0000000000..ed6d96a2d0 --- /dev/null +++ b/types/athenajs/test/tetris/grid.ts @@ -0,0 +1,469 @@ +import { Scene, Map, Tile, Dom, SimpleText, AudioManager as AM, Deferred } from "athenajs"; +import Shape from "./shape"; +import FlashLines from "./flash_lines"; + +// size constants +const MAP_ROWS = 22; +const MAP_COLS = 12; +const TILE_WIDTH = 20; +const TILE_HEIGHT = 20; +// tile offsets in the spritesheet +const MAP_TILES_OFFSET_Y = 440; +const WALL_TILE_OFFSET_X = 140; +const BACK_TILE_OFFSET_X = 160; +// wall tile number +const WALL_TILE = 8; +// game width +const TOTAL_WIDTH = 800; +const TOTAL_HEIGHT = 600; +// speed (drop delay) at start +const START_TIMING = 1200; +// speed increase at each level +const LEVEL_TIMING = 55; + +class Grid extends Scene { + // game parameters + score: number; + level: number; + timing: number; + lines: number; + scoreTable: number[]; + + // game sprites + // current tetris shape + shape: Shape; + // next tetris shape + nextShape: Shape; + // next tetris string + nextString: SimpleText; + // score + scoreString: SimpleText; + // "line:" + linesString: SimpleText; + // "level:" + levelString: SimpleText; + // "pause:" + pauseString: SimpleText; + // flashing lines + flashLines: FlashLines; + // ->, <- + controls: SimpleText; + + constructor() { + super({ + resources: [ + { + id: "tiles", + type: "image", + src: "img/tetris_tiles.png" + }, + { + id: "gameover", + type: "audio", + src: "sound/gameover.mp3" + }, + { + id: "ground", + type: "audio", + src: "sound/ground.mp3" + }, + { + id: "level", + type: "audio", + src: "sound/level.mp3" + }, + { + id: "lines", + type: "audio", + src: "sound/lines.mp3" + }, + { + id: "lines_tetris", + type: "audio", + src: "sound/lines_tetris.mp3" + }, + { + id: "move", + type: "audio", + src: "sound/move.mp3" + }, + { + id: "pause", + type: "audio", + src: "sound/pause.mp3" + }, + { + id: "rotate", + type: "audio", + src: "sound/rotate.mp3" + } + ] + }); + + // here we keep game-related properties + this.score = 0; + this.level = 0; + this.lines = 0; + this.timing = START_TIMING; + this.scoreTable = [40, 100, 300, 1200]; + + // we only need to catch the 'ground' event from the 'shape' element + this.bindEvents("shape:ground"); + } + + /** + * Generate tileset for the tetris map, mostly hardcoded stuff + * + */ + generateTileSet() { + // create the list of all tiles for the map + const tiles = [ + { + offsetX: WALL_TILE_OFFSET_X, + offsetY: MAP_TILES_OFFSET_Y, + width: TILE_WIDTH, + height: TILE_HEIGHT + } + ]; + + // add a tile for each color + for (let i = 0, offset = 0; i < 7; ++i, offset += TILE_WIDTH) { + tiles.push({ + offsetX: offset, + offsetY: MAP_TILES_OFFSET_Y, + width: TILE_WIDTH, + height: TILE_HEIGHT + }); + } + + tiles.push({ + offsetX: BACK_TILE_OFFSET_X, + offsetY: MAP_TILES_OFFSET_Y, + width: TILE_WIDTH, + height: TILE_HEIGHT + }); + + return tiles; + } + + /** + * Generates the map of the game, adding walls around the playground + */ + createMap() { + // first create the map with an empty buffer + const map = new Map({ + src: "tiles", + tileWidth: TILE_WIDTH, + tileHeight: TILE_WIDTH, + width: TILE_WIDTH * MAP_COLS, + height: TILE_HEIGHT * MAP_ROWS, + buffer: new ArrayBuffer(MAP_COLS * MAP_ROWS * 2) + }); + + // finally add the tileset + map.addTileSet(this.generateTileSet()); + + return map; + } + + resetMap() { + const map = this.map; + + map.clear(0, Tile.TYPE.AIR); + + // set map tiles around the playground as wall tiles + for (let i = 0; i < map.numRows; ++i) { + map.updateTile(0, i, WALL_TILE, Tile.TYPE.WALL); + map.updateTile(map.numCols - 1, i, WALL_TILE, Tile.TYPE.WALL); + } + + for (let i = 0; i < map.numCols; ++i) { + map.updateTile(i, map.numRows - 1, WALL_TILE, Tile.TYPE.WALL); + } + } + + /** + * Generates the tile sprite that will be moved by the player + */ + createShapes() { + this.shape = new Shape("shape", { + data: { + speed: this.timing + } + }); + + this.nextShape = new Shape("nextShape", { + x: 610, + y: 110 + }); + + this.nextShape.movable = false; + this.nextString = new SimpleText("nextString", { + text: "Next", + x: 620, + y: 70 + }); + + this.scoreString = new SimpleText("scoreString", { + text: "Score: 0", + x: 50, + y: 70 + }); + + this.linesString = new SimpleText("linesString", { + text: "Lines: 0", + x: 50, + y: 120 + }); + + this.levelString = new SimpleText("levelString", { + text: "Level: 0", + x: 50, + y: 170 + }); + + this.pauseString = new SimpleText("pauseString", { + text: "Pause", + x: 380, + y: 550, + visible: false + }); + + this.controls = new SimpleText("controlsString", { + text: "Controls:\narrow keys", + x: 50, + y: 220 + }); + + this.flashLines = new FlashLines("flash", { + x: (TOTAL_WIDTH - TILE_WIDTH * MAP_COLS) / 2 + TILE_WIDTH, + y: (TOTAL_HEIGHT - TILE_HEIGHT * MAP_ROWS) / 2, + width: TILE_WIDTH * (MAP_COLS - 2), + lineHeight: TILE_HEIGHT + }); + } + + /** + * Called when the scene is ready: generates the map and adds the player's shape + * sprite onto the screen + */ + setup() { + this.createShapes(); + + this.map = this.createMap(); + } + + start() { + const map = this.map; + + this.setBackgroundImage("img/background.png"); + + // center map + this.setMap( + map, + (TOTAL_WIDTH - map.width) / 2, + (TOTAL_HEIGHT - map.height) / 2 + ); + + map.addObject(this.shape); + + this.addObject([ + this.nextShape, + this.nextString, + this.linesString, + this.scoreString, + this.levelString, + this.pauseString, + this.flashLines, + this.controls + ]); + + this.reset(); + } + + reset() { + this.score = 0; + this.level = 0; + this.lines = 0; + this.timing = START_TIMING; + this.resetMap(); + this.shape.moveToTop(); + + this.shape.setRandomShape(); + this.nextShape.setRandomShape(); + this.linesString.setText("Lines: " + this.lines); + this.scoreString.setText("Score: " + this.score); + this.levelString.setText("Level: " + this.level); + + this.shape.movable = true; + this.shape.behavior.reset(); + } + + /** + * Called on game over, simply displays the score in an alert box and restarts the game + */ + gameover() { + AM.play("gameover"); + alert("game over!" + this.score); + this.reset(); + } + + /** + * This method is called whenever an event that has been registered is received + * + */ + onEvent(event: any) { + const nextShape = this.nextShape; + const shape = this.shape; + + switch (event.type) { + case "shape:ground": + // update the map with the new shape + this.updateMap(); + // check for lines to remove + this.removeLinesFromMap( + event.data.startLine, + event.data.numRows + ).then(() => { + shape.setShape(nextShape.shapeName, nextShape.rotation); + nextShape.setRandomShape(); + + this.shape.moveToTop(); + + // we may have a game over here: if the shape collides with another one + if (!this.shape.snapTile(0, 0, false)) { + this.gameover(); + } else { + this.shape.movable = true; + } + }); + break; + } + } + + /** + * This method is called when a shape has reached the ground: in this case + * we simply update the map using the shape's matrix + */ + updateMap() { + const shape = this.shape; + const data = this.shape.shape; + const map = this.map; + const pos = map.getTileIndexFromPixel(shape.x, shape.y); + const buffer = shape.getMatrix(); + const rows = data.height / map.tileHeight; + const cols = data.width / map.tileWidth; + + for (let j = 0; j < rows; ++j) { + for (let i = 0; i < cols; ++i) { + if (buffer[j * cols + i]) { + map.updateTile(pos.x + i, pos.y + j, data.color, Tile.TYPE.WALL); + } + } + } + } + + /** + * returns the number of lines that contains no hole, starting from + * startLine up to startLine + height + * + */ + getLinesToRemove(startLine: number, height: number): number[] { + console.log("[Grid] getLinesToRemove()"); + const map = this.map; + const lines: number[] = []; + let lastLine = startLine + height - 1; + + // avoid bottom ground + if (lastLine > map.numRows - 2) lastLine = map.numRows - 2; + + for (let j = lastLine; j >= startLine; --j) { + let hole = false; + for (let i = 1; i < map.numCols - 1; ++i) { + hole = hole || map.getTileBehaviorAtIndex(i, j) !== Tile.TYPE.WALL; + } + if (!hole) { + lines.push(j); + } + } + + return lines; + } + + /** + * Updates level + level object's text + */ + updateLevel() { + const oldLevel = this.level; + this.level = Math.floor(this.lines / 10); + this.levelString.setText("Level: " + this.level); + this.timing = START_TIMING - this.level * LEVEL_TIMING; + this.shape.data['speed'] = this.timing; + oldLevel !== this.level && AM.play("level"); + } + + /** + * Updates the player's score using line number & current level + * + */ + increaseScore(lines: number) { + this.score += + this.scoreTable[lines - 1] + this.level * this.scoreTable[lines - 1]; + this.lines += lines; + this.linesString.setText("Lines: " + this.lines); + this.scoreString.setText("Score: " + this.score); + + if (lines === 4) { + AM.play("lines_tetris"); + } else { + AM.play("lines"); + } + } + + /** + * Removes lines from the map, shifting the map as needed, and adding + * empty tiles at the top + * + */ + removeLinesFromMap(startLine: number, height: number) { + const map = this.map; + const lines = this.getLinesToRemove(startLine, height); + + // no full lines detected + if (!lines.length) { + return Deferred.resolve(true); + } + + this.flashLines.lines = lines; + return this.flashLines.flash().then(() => { + // shift the map for each line to remove + for (let i = 0; i < lines.length; ++i) { + map.shift(lines[i] + i, 1); + } + + // add wall at each side of the new lines + for (let i = 0; i < height; ++i) { + for (let j = 0; j < map.numCols; ++j) { + map.updateTile(j, i, 0, Tile.TYPE.AIR); + } + map.updateTile(0, i, 8, Tile.TYPE.WALL); + map.updateTile(map.numCols - 1, i, 8, Tile.TYPE.WALL); + } + + Dom('.athena-game').addClass('shake-vertical shake-constant'); + setTimeout(() => { + Dom('.athena-game').removeClass('shake-vertical shake-constant'); + }, 300); + + this.increaseScore(lines.length); + this.updateLevel(); + }); + } + + pause(isRunning: boolean) { + this.pauseString.visible = !isRunning; + AM.play("pause"); + } +} + +export default Grid; diff --git a/types/athenajs/test/tetris/shape.ts b/types/athenajs/test/tetris/shape.ts new file mode 100644 index 0000000000..4d8ed9c64b --- /dev/null +++ b/types/athenajs/test/tetris/shape.ts @@ -0,0 +1,256 @@ +import { Sprite, Tile, AudioManager as AM, JSObject } from 'athenajs'; +import ShapeBehavior from './shape_behavior'; + +interface shapeDescription { + name: string; + width: number; + height: number; + color: number; + rotations: number[][]; +} + +class Shape extends Sprite { + shapes: shapeDescription[]; + // current shape + shape: shapeDescription; + shapeName: string; + // current shape rotation + rotation: number; + + constructor(name: string, options = {}) { + super(name, { + imageId: 'tiles', + easing: 'linear', + // behavior: ShapeBehavior, + // ...options + }); + + /** + * Hardcoded tetris shapes. In addition to its width/height, color and + * name, each shape contains a rotation a matrix for each rotation + * that looks like: + * + * --- + * |J + * |JJJ + * | + * --- + * + * Matrix: [1, 0, 0, + * 1, 1, 1 + * 0, 0, 0] + * + * Each shape contains four different rotations + */ + this.shapes = [ + { + name: 'I', width: 80, height: 80, color: 7, rotations: [ + [0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0], + [0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0] + ] + }, + { + name: 'J', width: 60, height: 60, color: 6, rotations: [ + [1, 0, 0, 1, 1, 1, 0, 0, 0], + [0, 1, 1, 0, 1, 0, 0, 1, 0], + [0, 0, 0, 1, 1, 1, 0, 0, 1], + [0, 1, 0, 0, 1, 0, 1, 1, 0] + ] + }, + { + name: 'L', width: 60, height: 60, color: 5, rotations: [ + [0, 0, 1, 1, 1, 1, 0, 0, 0], + [0, 1, 0, 0, 1, 0, 0, 1, 1], + [0, 0, 0, 1, 1, 1, 1, 0, 0], + [1, 1, 0, 0, 1, 0, 0, 1, 0] + ] + }, + { + name: 'O', width: 80, height: 60, color: 4, rotations: [ + [0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0], + [0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0], + [0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0], + [0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0] + ] + }, + { + name: 'S', width: 60, height: 60, color: 3, rotations: [ + [0, 1, 1, 1, 1, 0, 0, 0, 0], + [0, 1, 0, 0, 1, 1, 0, 0, 1], + [0, 0, 0, 0, 1, 1, 1, 1, 0], + [1, 0, 0, 1, 1, 0, 0, 1, 0] + ] + }, + { + name: 'Z', width: 60, height: 60, color: 2, rotations: [ + [1, 1, 0, 0, 1, 1, 0, 0, 0], + [0, 0, 1, 0, 1, 1, 0, 1, 0], + [0, 0, 0, 1, 1, 0, 0, 1, 1], + [0, 1, 0, 1, 1, 0, 1, 0, 0] + ] + }, + { + name: 'T', width: 60, height: 60, color: 1, rotations: [ + [0, 1, 0, 1, 1, 1, 0, 0, 0], + [0, 1, 0, 0, 1, 1, 0, 1, 0], + [0, 0, 0, 1, 1, 1, 0, 1, 0], + [0, 1, 0, 1, 1, 0, 0, 1, 0] + ] + } + ]; + + this.addAnimations(); + this.setShape('S', 0); + } + + /** + * Moves the shape at the top center of the map + */ + moveToTop(): void { + if (this.shape) { + const map = this.currentMap; + const col = Math.floor(((map.width - this.shape.width) / 2) / map.tileWidth); + + this.moveTo(col * map.tileWidth, 0); + } + } + + /** + * Changes the sprite's shape and rotation + * + */ + setShape(name: string, rotation: number): void { + this.shapeName = name; + this.rotation = rotation; + this.shape = this.shapes.find((shape) => shape.name === this.shapeName) || this.shapes[0]; + this.setAnimation(`${name}${rotation}`); + } + + /** + * Pick a new random shape + */ + setRandomShape(): void { + const shapeName = this.shapes[Math.random() * 7 | 0].name; + const rotation = Math.random() * 4 | 0; + + console.log(`[Shape] setRandomShape() - ${shapeName}`); + + if (!this.movable) { + this.animate('Fade', { + duration: 200, + startValue: 1, + endValue: 0 + }).then(() => { + this.setShape(shapeName, rotation); + this.animate('Fade', { + duration: 200, + startValue: 0, + endValue: 1 + }); + }); + } else { + this.setShape(shapeName, rotation); + } + } + + /** + * Returns current matrix for the shape + * + */ + getMatrix(rotation = -1): number[] { + return this.shape.rotations[rotation === -1 ? this.rotation : rotation]; + } + + /** + * Move the shape on the map by a certain number of tiles, optionnaly sending an event + * of a collision is detected + * + */ + snapTile(horizontal = 0, vertical = 0, notify = true, noSound = false): boolean { + const map = this.currentMap; + const buffer = this.getMatrix(); + const tilePos = map.getTileIndexFromPixel(this.x, this.y); + const newX = tilePos.x + horizontal; + const newY = tilePos.y + vertical; + + // first check there is no collision with walls + if (!map.checkMatrixForCollision(buffer, this.shape.width, newX, newY, Tile.TYPE.WALL)) { + this.x += horizontal * map.tileWidth; + this.y += vertical * map.tileHeight; + + return true; + } else { + // if a collision was detected and vertical == 1 it means the shape reached + // the ground: in this case we send a notification for the grid + // and make the shape stop responding to user input or timer + if (vertical === 1) { + this.movable = false; + if (notify) { + AM.play('ground'); + this.notify('ground', { + startLine: tilePos.y, + numRows: this.shape.height / map.tileHeight + }); + } + } + return false; + } + } + + /** + * Switches to the next shape's rotation, if no collision found onto the map + */ + nextRotation(): void { + let matrix: number[]; + let newRotation = this.rotation + 1; + + const map = this.currentMap; + const tilePos = map.getTileIndexFromPixel(this.x, this.y); + + // cycles if last position reached + if (newRotation > 3) { + newRotation = 0; + } + + // get current shape + position matrix + matrix = this.getMatrix(newRotation); + + if (!map.checkMatrixForCollision(matrix, this.shape.width, tilePos.x, tilePos.y, Tile.TYPE.WALL)) { + // change shape rotation if no collision detected + this.setShape(this.shapeName, newRotation); + AM.play('rotate'); + } else { + console.log('rotation not possible'); + } + } + + /** + * We add a new Sprite animation for each combination of rotation + shapeType: + * { + * 'J0', // first rotation of the J Shape + * .... + * 'J3', // last rotation of the J Shape + * 'L0', // first rotation of the L shape + * ... + * } + */ + addAnimations(): void { + // shape sprite images start at the top of the image file + let offsetY = 0; + + this.shapes.forEach((shape) => { + let offsetX = 0; + for (let i = 0; i < 4; ++i) { + this.addAnimation(`${shape.name}${i}`, 'tiles', { + offsetY, offsetX, frameWidth: shape.width, frameHeight: shape.height, frameDuration: 1, numFrames: 1 + }); + offsetX += shape.width; + } + offsetY += shape.height; + }); + } +} + +export default Shape; diff --git a/types/athenajs/test/tetris/shape_behavior.ts b/types/athenajs/test/tetris/shape_behavior.ts new file mode 100644 index 0000000000..7804696454 --- /dev/null +++ b/types/athenajs/test/tetris/shape_behavior.ts @@ -0,0 +1,140 @@ +import { Behavior, InputManager as IM, AudioManager as AM, Sprite, Drawable } from 'athenajs'; +import Shape from './shape'; + +/** + * Simple Behavior for the tetris shape that moves the shape on cursor key press + * and when timer is reached + * + * + * @see {Behavior} + */ +class ShapeBehavior extends Behavior { + state: number; + lastRotation: number; + ts: number; + LONG_DELAY: number; + SMALL_DELAY: number; + delay: number; + key: number; + timerEnabled: boolean; + startTime: number; + + constructor(sprite: Shape, options?: any) { + super(sprite as Drawable, options); + + // current behavior state: moving right, left, top, bottom + this.state = 0; + // when lastRotation happened + this.lastRotation = 0; + this.ts = 0; + // long delay before starting to move quickly + this.LONG_DELAY = 250; + // repeat-delay once the long delay has been reached + this.SMALL_DELAY = 70; + + this.reset(); + } + + reset() { + IM.clearEvents(); + + // current delay before repeating a key + this.delay = this.LONG_DELAY; + this.key = 0; + this.timerEnabled = true; + } + + /** + * When the player keeps a key down, we wait for a long delay before + * quickly moving the picece: we don't want to miss interpret his move. + * + * If he quickly releases the key and quickly presses it, we have to + * react though + * + */ + ready(state: number, timestamp: number): boolean { + // if the player pressed a different key + // we react immediately but have to wait a long_delay + // before repeating the key if he keeps pressing it + if (this.state !== state) { + this.ts = timestamp; + this.state = state; + this.delay = this.LONG_DELAY; + return true; + } else if (timestamp - this.ts > this.delay) { + // player keeps pressing the key for a long delay + // we react and set delay to a smaller one to quickly + // repeat the action + this.ts = timestamp; + this.delay = this.SMALL_DELAY; + return true; + } else { + // repeat delay not reached + return false; + } + } + + /** + * Checks tetris timer + * + */ + timer(timestamp: number): boolean { + const sprite = this.sprite; + if (!this.startTime) { + this.startTime = timestamp; + } else { + if (timestamp - this.startTime > sprite.data['speed']) { + // timer reached + this.startTime = timestamp; + return true; + } + } + return false; + } + + checkKeyDelay(key: number, timestamp: number, x: number, y: number): void { + const sprite = this.sprite as Shape; + if (this.ready(key, timestamp)) { + sprite.snapTile(x, y) && AM.play('move'); + } + } + + /** + * This method is called when updating the shape's position + * and updates its position when cursor keys are pressed or + * the timer happened + */ + onUpdate(timestamp: number) { + const sprite = this.sprite as Shape; + + // debug: stop the timer when t key is pressed + if (IM.isKeyDown(84)) { + this.timerEnabled = !this.timerEnabled; + return; + } + + // first check timer + if (this.timerEnabled && this.timer(timestamp)) { + // timer reached: move the sprite down + sprite.snapTile(0, 1); + return; + } + + // Then checks cursor keys + if (IM.isKeyDown('DOWN')) { + this.checkKeyDelay(1, timestamp, 0, 1); + } else if (IM.isKeyDown('LEFT')) { + this.checkKeyDelay(2, timestamp, -1, 0); + } else if (IM.isKeyDown('RIGHT')) { + this.checkKeyDelay(3, timestamp, 1, 0); + } else if ((IM.isKeyDown('UP') || IM.isKeyDown('SPACE')) && (timestamp - this.lastRotation > 150)) { + this.lastRotation = timestamp; + sprite.nextRotation(); + } else if (this.state) { + // key released + this.ready(0, timestamp); + } + } +} + +export default ShapeBehavior; diff --git a/types/athenajs/test/tetris/tetris.ts b/types/athenajs/test/tetris/tetris.ts new file mode 100644 index 0000000000..05434a2249 --- /dev/null +++ b/types/athenajs/test/tetris/tetris.ts @@ -0,0 +1,11 @@ +import { Game } from 'athenajs'; +import Grid from './grid'; + +const tetris = new Game({ + name: 'athena-tetris', + showFps: true, + debug: true, + width: 800, + height: 600, + scene: new Grid() +}); diff --git a/types/athenajs/tsconfig.json b/types/athenajs/tsconfig.json new file mode 100644 index 0000000000..54a31f17a7 --- /dev/null +++ b/types/athenajs/tsconfig.json @@ -0,0 +1,40 @@ +{ + "compilerOptions": { + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "noEmit": true, + "types": [], + "lib": [ + "es5", + "es6", + "es2015.iterable", + "dom" + ], + "module": "commonjs", + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/dom.ts", + "test/deferred.ts", + "test/game.ts", + "test/scene.ts", + "test/drawable.ts", + "test/simpletext.ts", + "test/paint.ts", + "test/bitmaptext.ts", + "test/sprite.ts", + "test/map.ts", + "test/tetris/tetris.ts", + "test/tetris/shape.ts", + "test/tetris/grid.ts", + "test/tetris/shape_behavior.ts", + "test/tetris/flash_lines.ts" + ] +} \ No newline at end of file diff --git a/types/athenajs/tslint.json b/types/athenajs/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/athenajs/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/atlassian-crowd-client/lib/models/session.d.ts b/types/atlassian-crowd-client/lib/models/session.d.ts index 2ef16a0814..2369f976bc 100644 --- a/types/atlassian-crowd-client/lib/models/session.d.ts +++ b/types/atlassian-crowd-client/lib/models/session.d.ts @@ -3,7 +3,7 @@ declare class Session { readonly token: string; readonly createdAt: Date; readonly expiresAt: Date; - + constructor(token: string, createdAt: Date, expiresAt: Date); toCrowd(): SessionObj; static fromCrowd(obj: SessionObj): Session; diff --git a/types/atlassian-crowd-client/settings.d.ts b/types/atlassian-crowd-client/settings.d.ts index 755c26038a..4c56a85e06 100644 --- a/types/atlassian-crowd-client/settings.d.ts +++ b/types/atlassian-crowd-client/settings.d.ts @@ -3,7 +3,7 @@ export interface Settings { readonly application: { readonly name: string; readonly password: string; - } + }; readonly nesting?: boolean; readonly sessionTimeout?: number; readonly debug?: boolean; diff --git a/types/atom/atom-tests.ts b/types/atom/atom-tests.ts index 9d01e194a9..6acca94fc5 100644 --- a/types/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -1748,6 +1748,14 @@ function testProject() { // Accessing the git repository repositories = project.getRepositories(); + subscription = project.observeRepositories(gitRepo => { + const repo: Atom.GitRepository = gitRepo; + }); + + subscription = project.onDidAddRepository(gitRepo => { + const repo: Atom.GitRepository = gitRepo; + }); + async function getDirectoryRepo() { const potentialRepo = await project.repositoryForDirectory(dir); if (potentialRepo) repository = potentialRepo; @@ -3041,6 +3049,25 @@ function testTextEditor() { editor.addGutter({ name: "Test", priority: 42 }); editor.addGutter({ name: "Test", visible: true }); editor.addGutter({ name: "Test", priority: 42, visible: true }); + editor.addGutter({ name: "Test", type: 'decorated' }); + editor.addGutter({ name: "Test", type: 'line-number' }); + editor.addGutter({ name: "Test", class: 'someClass' }); + editor.addGutter({ name: "Test", labelFn(lineData) { + num = lineData.bufferRow; + num = lineData.screenRow; + num = lineData.maxDigits; + bool = lineData.foldable; + bool = lineData.softWrapped; + return 'label'; + }}); + editor.addGutter({ name: "Test", onMouseDown(lineData) { + num = lineData.bufferRow; + num = lineData.screenRow; + } }); + editor.addGutter({ name: "Test", onMouseMove(lineData) { + num = lineData.bufferRow; + num = lineData.screenRow; + } }); gutters = editor.getGutters(); diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index c403569ab2..d77663c460 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Atom 1.28 +// Type definitions for Atom 1.31 // Project: https://github.com/atom/atom // Definitions by: GlenCFL // smhxx @@ -7,7 +7,7 @@ // TypeScript Version: 2.3 // NOTE: only those classes exported within this file should be retain that status below. -// https://github.com/atom/atom/blob/v1.28.0/exports/atom.js +// https://github.com/atom/atom/blob/v1.31.0/exports/atom.js /// @@ -2415,11 +2415,7 @@ export class TextEditor { // Gutters /** Add a custom Gutter. */ - addGutter(options: { - name: string, - priority?: number, - visible?: boolean, - }): Gutter; + addGutter(options: GutterOptions): Gutter; /** Get this editor's gutters. */ getGutters(): Gutter[]; @@ -2459,6 +2455,74 @@ export class TextEditor { tokenForBufferPosition(pos: PointCompatible): {value: string, scopes: string[]}; } +export interface GutterOptions { + /** (required) A unique String to identify this gutter. */ + name: string; + + /** + * A Number that determines stacking order between gutters. + * Lower priority items are forced closer to the edges of the window. (default: -100) + */ + priority?: number; + + /** + * Boolean specifying whether the gutter is visible initially after being created. + * (default: true) + */ + visible?: boolean; + + /** + * String specifying the type of gutter to create. + * 'decorated' gutters are useful as a destination for decorations created with + * Gutter::decorateMarker. + * 'line-number' gutters. + */ + type?: 'decorated' | 'line-number'; + + /** String added to the CSS classnames of the gutter's root DOM element. */ + class?: string; + + /** + * Function called by a 'line-number' gutter to generate the label for each + * line number element. Should return a String that will be used to label the + * corresponding line. + */ + labelFn?: (lineData: LineDataExtended) => string; + + /** + * Function to be called when a mousedown event is received by a line-number + * element within this type: 'line-number' Gutter. If unspecified, the default + * behavior is to select the clicked buffer row. + */ + onMouseDown?: (lineData: LineData) => void; + + /** + * Function to be called when a mousemove event occurs on a line-number + * element within within this type: 'line-number' Gutter. + */ + onMouseMove?: (lineData: LineData) => void; +} + +export interface LineData { + /** Number indicating the zero-indexed buffer index of a line. */ + bufferRow: number; + + /** Number indicating the zero-indexed screen index. */ + screenRow: number; +} + +/** Object containing information about each line to label. */ +export interface LineDataExtended extends LineData { + /** Boolean that is true if a fold may be created here. */ + foldable: boolean; + + /** Boolean if this screen row is the soft-wrapped continuation of the same buffer row. */ + softWrapped: boolean; + + /** Number the maximum number of digits necessary to represent any known screen row. */ + maxDigits: number; +} + export interface PixelPosition { left: number; top: number; @@ -4497,6 +4561,12 @@ export interface Project { */ getRepositories(): GitRepository[]; + /** Invoke the given callback with all current and future repositories in the project. */ + observeRepositories(callback: (repository: GitRepository) => void): Disposable; + + /** Invoke the given callback when a repository is added to the project. */ + onDidAddRepository(callback: (repository: GitRepository) => void): Disposable; + /** Get the repository for a given directory asynchronously. */ repositoryForDirectory(directory: Directory): Promise; @@ -5844,7 +5914,7 @@ export interface TextEditorObservedEvent { // information under certain contexts. // NOTE: the config schema with these defaults can be found here: -// https://github.com/atom/atom/blob/v1.28.0/src/config-schema.js +// https://github.com/atom/atom/blob/v1.31.0/src/config-schema.js /** * Allows you to strongly type Atom configuration variables. Additional key:value * pairings merged into this interface will result in configuration values under diff --git a/types/atom/tslint.json b/types/atom/tslint.json index 4c3e6e9036..3811d3257c 100644 --- a/types/atom/tslint.json +++ b/types/atom/tslint.json @@ -4,6 +4,9 @@ "await-promise": [true, "CancellablePromise"], "indent": [true, "spaces", 4], "max-line-length": [true, 100], - "no-any": true + "no-any": true, + + // TODOs + "no-declare-current-package": false } } diff --git a/types/auth-header/auth-header-tests.ts b/types/auth-header/auth-header-tests.ts new file mode 100644 index 0000000000..e8b510531c --- /dev/null +++ b/types/auth-header/auth-header-tests.ts @@ -0,0 +1,6 @@ +import * as auth from 'auth-header'; + +const basic: string = auth.format('Basic'); +const basic2: string = auth.format({scheme: 'Basic'}); + +const parsed: {scheme: string, token: null | string | string[]} = auth.parse(''); diff --git a/types/auth-header/index.d.ts b/types/auth-header/index.d.ts new file mode 100644 index 0000000000..fab462be9e --- /dev/null +++ b/types/auth-header/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for auth-header 1.0 +// Project: https://github.com/izaakschroeder/auth-header +// Definitions by: ForbesLindesay +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +type Params = + | Array<[string, string | ReadonlyArray]> + | {[key: string]: string | ReadonlyArray}; +export {Params}; + +export interface TokenOptions { + scheme: string; + token?: string; + params?: Params; +} + +export interface Token { + scheme: string; + params: {[key: string]: string | string[]}; + token: null | string | string[]; +} + +export function format(token: TokenOptions): string; +export function format(scheme: string, token?: string, params?: Params): string; + +export function parse(header: string): Token; diff --git a/types/auth-header/tsconfig.json b/types/auth-header/tsconfig.json new file mode 100644 index 0000000000..58c6fad6d7 --- /dev/null +++ b/types/auth-header/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "auth-header-tests.ts" + ] +} diff --git a/types/fast-diff/tslint.json b/types/auth-header/tslint.json similarity index 100% rename from types/fast-diff/tslint.json rename to types/auth-header/tslint.json diff --git a/types/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts index f13599ebae..6d21de4ed3 100644 --- a/types/auth0-js/auth0-js-tests.ts +++ b/types/auth0-js/auth0-js-tests.ts @@ -11,6 +11,7 @@ webAuth.authorize({ responseType: 'token', redirectUri: 'https://example.com/auth/callback', language: 'en', + login_hint: "email@email.com", prompt: 'login', }); diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index 033a4bcbde..7ca266e6ce 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -4,6 +4,7 @@ // Matt Durrant // Peter Blazejewicz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 export as namespace auth0; @@ -172,7 +173,7 @@ export class WebAuth { * * @param callback: any(err, token_payload) */ - parseHash(callback: Auth0Callback): void; + parseHash(callback: Auth0Callback): void; /** * Parse the url hash and extract the returned tokens depending on the transaction. @@ -183,7 +184,7 @@ export class WebAuth { * * @param callback: any(err, token_payload) */ - parseHash(options: ParseHashOptions, callback: Auth0Callback): void; + parseHash(options: ParseHashOptions, callback: Auth0Callback): void; /** * Decodes the id_token and verifies the nonce. @@ -482,7 +483,7 @@ export class CrossOriginAuthentication { callback(): void; } -export type Auth0Callback = (error: null | Auth0Error, result: T) => void; +export type Auth0Callback = (error: null | E, result: T) => void; export interface TokenProvider { enableCache?: boolean; @@ -522,18 +523,51 @@ export interface PasswordlessAuthOptions { email: string; } +/** + * These are error codes defined by the auth0-js lib. + */ +export type LibErrorCodes = 'timeout' | 'request_error' | 'invalid_token'; + +/** + * The user was not logged in at Auth0, so silent authentication is not possible. + */ +export type LoginRequiredErrorCode = 'login_required'; + +/** + * The user was logged in at Auth0 and has authorized the application, but needs to + * be redirected elsewhere before authentication can be completed; for example, when + * using a redirect rule. + */ +export type InteractionRequiredErrorCode = 'interaction_required'; + +/** + * The user was logged in at Auth0, but needs to give consent to authorize the application. + */ +export type ConsentRequiredErrorCode = 'consent_required'; + +/** + * These are error codes defined by the OpenID Connect specification. + */ +export type SpecErrorCodes = + LoginRequiredErrorCode | + InteractionRequiredErrorCode | + ConsentRequiredErrorCode | + 'account_selection_required' | + 'invalid_request_uri' | + 'invalid_request_object' | + 'request_not_supported' | + 'request_uri_not_supported' | + 'registration_not_supported'; + export interface Auth0Error { - error?: any; - errorDescription?: string; - code?: string; - description?: string; - name?: string; - policy?: string; - original?: any; - statusCode?: number; - statusText?: string; + error: LibErrorCodes | SpecErrorCodes | string; + errorDescription: string; } +export type Auth0ParseHashError = Auth0Error & { + state?: string; +}; + /** * The contents of the authResult object returned by {@link WebAuth#parseHash } */ @@ -761,6 +795,7 @@ export interface AuthorizeOptions { scope?: string; audience?: string; language?: string; + login_hint?: string; prompt?: string; mode?: "login" | "signUp"; } diff --git a/types/auth0-lock/auth0-lock-tests.ts b/types/auth0-lock/auth0-lock-tests.ts index 4b5c60e716..6e23e81d5e 100644 --- a/types/auth0-lock/auth0-lock-tests.ts +++ b/types/auth0-lock/auth0-lock-tests.ts @@ -140,12 +140,17 @@ new Auth0Lock(CLIENT_ID, DOMAIN, otherOptions); const multiVariantOptions : Auth0LockConstructorOptions = { container: "myContainer", closable: false, + language: "en", languageDictionary: { signUpTerms: "I agree to the
terms of service ...", title: "My Company", }, + autoclose: true, autofocus: false, + allowAutocomplete: false, + scrollGlobalMessagesIntoView: false, allowShowPassword: true, + allowPasswordAutocomplete: false, }; new Auth0Lock(CLIENT_ID, DOMAIN, multiVariantOptions); diff --git a/types/auth0-lock/index.d.ts b/types/auth0-lock/index.d.ts index 622ac3d36c..2916ec58c8 100644 --- a/types/auth0-lock/index.d.ts +++ b/types/auth0-lock/index.d.ts @@ -5,6 +5,7 @@ // Larry Faudree // Will Caulfield // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 /// @@ -98,6 +99,7 @@ interface Auth0LockAuthOptions { params?: Auth0LockAuthParamsOptions; redirect?: boolean; redirectUrl?: string; + responseMode?: string; responseType?: string; sso?: boolean; audience?: string; @@ -113,8 +115,10 @@ interface Auth0LockPopupOptions { interface Auth0LockConstructorOptions { additionalSignUpFields?: Auth0LockAdditionalSignUpField[]; allowedConnections?: string[]; + allowAutocomplete?: boolean; allowForgotPassword?: boolean; allowLogin?: boolean; + allowPasswordAutocomplete?: boolean; allowSignUp?: boolean; allowShowPassword?: boolean; assetsUrl?: string; @@ -129,6 +133,7 @@ interface Auth0LockConstructorOptions { defaultADUsernameFromEmailPrefix?: string; defaultDatabaseConnection?: string; defaultEnterpriseConnection?: string; + flashMessage?: Auth0LockFlashMessageOptions; forgotPasswordLink?: string; hashCleanup?: boolean; initialScreen?: "login" | "signUp" | "forgotPassword"; @@ -142,6 +147,7 @@ interface Auth0LockConstructorOptions { popupOptions?: Auth0LockPopupOptions; prefill?: { email?: string, username?: string}; rememberLastLogin?: boolean; + scrollGlobalMessagesIntoView?: boolean; signupLink?: string; socialButtonStyle?: "big" | "small"; theme?: Auth0LockThemeOptions; diff --git a/types/auth0/auth0-tests.ts b/types/auth0/auth0-tests.ts index f4251364d2..60bbf86823 100644 --- a/types/auth0/auth0-tests.ts +++ b/types/auth0/auth0-tests.ts @@ -203,3 +203,26 @@ management.linkUsers('primaryId', { user_id: 'secondaryId' }) management.linkUsers('primaryId', { user_id: 'secondaryId' }, (err: Error, result: any) => {}); +// Get all clients (with promise) +management.getClients() + .then((clients: auth0.Client[]) => { + console.log(clients); + }) + .catch((err) => { + // Handle the error + }); + +//Get all clients (with callback) +management.getClients((err: Error, clients: auth0.Client[]) => {}); + +// Get all clients with params (with promise) +management.getClients({fields:['name','client_metadata'], include_fields:true}) + .then((clients: auth0.Client[]) => { + console.log(clients); + }) + .catch((err) => { + // Handle the error + }); + +// Get all cients with params (with callback) +management.getClients({fields:['name','client_metadata'], include_fields:true}, (err:Error, clients:auth0.Client[]) => {}); diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index e03ad5aa06..ed0e9d1f3f 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for auth0 2.9.2 // Project: https://github.com/auth0/node-auth0 -// Definitions by: Wilson Hobbs , Seth Westphal , Amiram Korach +// Definitions by: Seth Westphal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -588,7 +588,19 @@ export interface ImpersonateSettingOptions { clientId?: string; } - +export type ClientAppType = 'native' | 'spa' | 'regular_web' | 'non_interactive' | 'rms' | 'box' | + 'cloudbees' | 'concur' | 'dropbox' | 'mscrm' | 'echosign' | 'egnyte' | 'newrelic' | 'office365' | + 'salesforce' | 'sentry' | 'sharepoint' | 'slack' | 'springcm' | 'zendesk' | 'zoom'; +export interface GetClientsOptions { + fields?: string[]; + include_fields?: boolean; + page?: number; + per_page?: number; + include_totals?: boolean; + is_global?: boolean; + is_first_party?: boolean; + app_type?: ClientAppType[]; +} export class AuthenticationClient { @@ -661,8 +673,9 @@ export class ManagementClient { // Clients - getClients(): Promise; - getClients(cb: (err: Error, clients: Client[]) => void): void; + getClients(params?: GetClientsOptions): Promise; + getClients(cb: (err: Error, clients: Client[]) => void ): void; + getClients(params: GetClientsOptions, cb: (err: Error, clients: Client[]) => void ): void; getClient(params: ClientParams): Promise; getClient(params: ClientParams, cb: (err: Error, client: Client) => void): void; diff --git a/types/autobahn/index.d.ts b/types/autobahn/index.d.ts index 59bb2c404d..c62f6115af 100644 --- a/types/autobahn/index.d.ts +++ b/types/autobahn/index.d.ts @@ -190,6 +190,8 @@ declare namespace autobahn { export class Connection { constructor(options?: IConnectionOptions); + isOpen: boolean; + open(): void; close(reason?: string, message?: string): void; diff --git a/types/autoprefixer/autoprefixer-tests.ts b/types/autoprefixer/autoprefixer-tests.ts index 47ef1cbc08..21940ac008 100644 --- a/types/autoprefixer/autoprefixer-tests.ts +++ b/types/autoprefixer/autoprefixer-tests.ts @@ -1,17 +1,17 @@ -import * as autopref from 'autoprefixer'; +import autoprefixer = require("autoprefixer"); +import { Transformer } from 'postcss'; -const ap: autopref.Transformer = autopref({ - browsers: ['> 5%', 'last 2 versions'], - env: '', - cascade: true, - add: true, - remove: true, - supports: true, - flexbox: true, - grid: true, - stats: {}, +const ap1: Transformer = autoprefixer(); + +const ap2: Transformer = autoprefixer({ + browsers: [], + env: "test", + cascade: false, + add: false, + remove: false, + supports: false, + flexbox: false, + grid: false, + stats: {}, + ignoreUnknownVersions: false, }); -const ap2: autopref.Transformer = autopref({ - flexbox: 'no-2009', -}); -const info: string = ap.info(); diff --git a/types/autoprefixer/index.d.ts b/types/autoprefixer/index.d.ts index 1957632053..faf11371db 100644 --- a/types/autoprefixer/index.d.ts +++ b/types/autoprefixer/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for autoprefixer 6.7 +// Type definitions for autoprefixer 9.1 // Project: https://github.com/postcss/autoprefixer -// Definitions by: Armando Meziat +// Definitions by: Armando Meziat , murt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -import { Plugin, Transformer as PostcssTransformer } from 'postcss'; +import { Plugin } from "postcss"; declare namespace autoprefixer { interface Options { @@ -16,15 +17,10 @@ declare namespace autoprefixer { flexbox?: boolean | 'no-2009'; grid?: boolean; stats?: any; + ignoreUnknownVersions?: boolean; } - interface Transformer extends PostcssTransformer { - info(): string; - } - - interface Autoprefixer extends Plugin { - (opts?: Options): Transformer; - } + type Autoprefixer = Plugin; } declare const autoprefixer: autoprefixer.Autoprefixer; diff --git a/types/autoprefixer/package.json b/types/autoprefixer/package.json index c4c2b4c357..1e1a719545 100644 --- a/types/autoprefixer/package.json +++ b/types/autoprefixer/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "postcss": "^5.2.15" + "postcss": "7.x.x" } } diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 5fa225eafd..00b71132e9 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -8,6 +8,7 @@ declare let error: Error; declare let bool: boolean; declare let boolOrUndefined: boolean | undefined; declare let apiGwEvtReqCtx: AWSLambda.APIGatewayEventRequestContext; +declare let apiGwEvtReqCtxOpt: AWSLambda.APIGatewayEventRequestContext | null | undefined; declare let apiGwEvt: AWSLambda.APIGatewayEvent; declare let customAuthorizerEvt: AWSLambda.CustomAuthorizerEvent; declare let clientCtx: AWSLambda.ClientContext; @@ -102,11 +103,13 @@ str = apiGwEvtReqCtx.resourcePath; /* API Gateway Event */ strOrNull = apiGwEvt.body; str = apiGwEvt.headers["example"]; +str = apiGwEvt.multiValueHeaders["example"][0]; str = apiGwEvt.httpMethod; bool = apiGwEvt.isBase64Encoded; str = apiGwEvt.path; str = apiGwEvt.pathParameters!["example"]; str = apiGwEvt.queryStringParameters!["example"]; +str = apiGwEvt.multiValueQueryStringParameters!["example"][0]; str = apiGwEvt.stageVariables!["example"]; apiGwEvtReqCtx = apiGwEvt.requestContext; str = apiGwEvt.resource; @@ -115,10 +118,12 @@ str = apiGwEvt.resource; str = customAuthorizerEvt.type; str = customAuthorizerEvt.methodArn; strOrUndefined = customAuthorizerEvt.authorizationToken; -str = apiGwEvt.pathParameters!["example"]; -str = apiGwEvt.queryStringParameters!["example"]; -str = apiGwEvt.stageVariables!["example"]; -apiGwEvtReqCtx = apiGwEvt.requestContext; +str = customAuthorizerEvt.headers!["example"]; +str = customAuthorizerEvt.multiValueHeaders!["example"][0]; +str = customAuthorizerEvt.pathParameters!["example"]; +str = customAuthorizerEvt.queryStringParameters!["example"]; +str = customAuthorizerEvt.multiValueQueryStringParameters!["example"][0]; +apiGwEvtReqCtxOpt = customAuthorizerEvt.requestContext; /* DynamoDB Stream Event */ const dynamoDBStreamEvent: AWSLambda.DynamoDBStreamEvent = { @@ -245,6 +250,9 @@ num = proxyResult.statusCode; proxyResult.headers!["example"] = str; proxyResult.headers!["example"] = bool; proxyResult.headers!["example"] = num; +proxyResult.multiValueHeaders!["example"][0] = str; +proxyResult.multiValueHeaders!["example"][0] = bool; +proxyResult.multiValueHeaders!["example"][0] = num; boolOrUndefined = proxyResult.isBase64Encoded; str = proxyResult.body; @@ -383,6 +391,8 @@ cognitoUserPoolEvent.triggerSource === "TokenGeneration_Authentication"; cognitoUserPoolEvent.triggerSource === "TokenGeneration_NewPasswordChallenge"; cognitoUserPoolEvent.triggerSource === "TokenGeneration_AuthenticateDevice"; cognitoUserPoolEvent.triggerSource === "TokenGeneration_RefreshTokens"; +cognitoUserPoolEvent.triggerSource === "UserMigration_Authentication"; +cognitoUserPoolEvent.triggerSource === "UserMigration_ForgotPassword"; str = cognitoUserPoolEvent.region; str = cognitoUserPoolEvent.userPoolId; strOrUndefined = cognitoUserPoolEvent.userName; @@ -404,6 +414,7 @@ strOrUndefined = cognitoUserPoolEvent.request.session![0].challengeMetadata; strOrUndefined = cognitoUserPoolEvent.request.challengeName; str = cognitoUserPoolEvent.request.privateChallengeParameters!["answer"]; str = cognitoUserPoolEvent.request.challengeAnswer!; +strOrUndefined = cognitoUserPoolEvent.request.password; boolOrUndefined = cognitoUserPoolEvent.response.answerCorrect; strOrUndefined = cognitoUserPoolEvent.response.smsMessage; strOrUndefined = cognitoUserPoolEvent.response.emailMessage; @@ -415,6 +426,14 @@ str = cognitoUserPoolEvent.response.publicChallengeParameters!["captchaUrl"]; str = cognitoUserPoolEvent.response.privateChallengeParameters!["answer"]; strOrUndefined = cognitoUserPoolEvent.response.challengeMetadata; boolOrUndefined = cognitoUserPoolEvent.response.answerCorrect; +str = cognitoUserPoolEvent.response.userAttributes!["username"]; +cognitoUserPoolEvent.response.finalUserStatus === "CONFIRMED"; +cognitoUserPoolEvent.response.finalUserStatus === "RESET_REQUIRED"; +cognitoUserPoolEvent.response.messageAction === "SUPPRESS"; +cognitoUserPoolEvent.response.desiredDeliveryMediums === ["EMAIL"]; +cognitoUserPoolEvent.response.desiredDeliveryMediums === ["SMS"]; +cognitoUserPoolEvent.response.desiredDeliveryMediums === ["SMS", "EMAIL"]; +boolOrUndefined = cognitoUserPoolEvent.response.forceAliasCreation; // CloudFormation Custom Resource switch (cloudformationCustomResourceEvent.RequestType) { diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index cce721e68c..d9d22f8c65 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -22,6 +22,8 @@ // Louis Larry // Daniel Papukchiev // Oliver Hookins +// Trevor Leach +// James Gregory // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -58,11 +60,13 @@ export interface APIGatewayEventRequestContext { export interface APIGatewayProxyEvent { body: string | null; headers: { [name: string]: string }; + multiValueHeaders: { [name: string]: string[] }; httpMethod: string; isBase64Encoded: boolean; path: string; pathParameters: { [name: string]: string } | null; queryStringParameters: { [name: string]: string } | null; + multiValueQueryStringParameters: { [name: string]: string[] } | null; stageVariables: { [name: string]: string } | null; requestContext: APIGatewayEventRequestContext; resource: string; @@ -75,8 +79,10 @@ export interface CustomAuthorizerEvent { methodArn: string; authorizationToken?: string; headers?: { [name: string]: string }; + multiValueHeaders?: { [name: string]: string[] }; pathParameters?: { [name: string]: string } | null; queryStringParameters?: { [name: string]: string } | null; + multiValueQueryStringParameters?: { [name: string]: string[] } | null; requestContext?: APIGatewayEventRequestContext; } @@ -234,7 +240,9 @@ export interface CognitoUserPoolTriggerEvent { | "TokenGeneration_Authentication" | "TokenGeneration_NewPasswordChallenge" | "TokenGeneration_AuthenticateDevice" - | "TokenGeneration_RefreshTokens"; + | "TokenGeneration_RefreshTokens" + | "UserMigration_Authentication" + | "UserMigration_ForgotPassword"; region: string; userPoolId: string; userName?: string; @@ -256,6 +264,7 @@ export interface CognitoUserPoolTriggerEvent { challengeName?: string; privateChallengeParameters?: { [key: string]: string }; challengeAnswer?: string; + password?: string; }; response: { autoConfirmUser?: boolean; @@ -269,6 +278,11 @@ export interface CognitoUserPoolTriggerEvent { privateChallengeParameters?: { [key: string]: string }; challengeMetadata?: string; answerCorrect?: boolean; + userAttributes?: { [key: string]: string }; + finalUserStatus?: "CONFIRMED" | "RESET_REQUIRED"; + messageAction?: "SUPPRESS"; + desiredDeliveryMediums?: Array<"EMAIL" | "SMS">; + forceAliasCreation?: boolean; }; } export type CognitoUserPoolEvent = CognitoUserPoolTriggerEvent; @@ -433,6 +447,9 @@ export interface APIGatewayProxyResult { headers?: { [header: string]: boolean | number | string; }; + multiValueHeaders?: { + [header: string]: Array; + }; body: string; isBase64Encoded?: boolean; } diff --git a/types/axe-webdriverjs/tsconfig.json b/types/axe-webdriverjs/tsconfig.json index d8637d03e4..4eaf433c1c 100644 --- a/types/axe-webdriverjs/tsconfig.json +++ b/types/axe-webdriverjs/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/axios-token-interceptor/index.d.ts b/types/axios-token-interceptor/index.d.ts index 85121f8165..a09fb7591b 100644 --- a/types/axios-token-interceptor/index.d.ts +++ b/types/axios-token-interceptor/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/sandrinodimattia/axios-token-interceptor#readme // Definitions by: Mike Dodge // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import { AxiosRequestConfig } from 'axios'; diff --git a/types/azure-sb/index.d.ts b/types/azure-sb/index.d.ts index 9f9d07d3dc..bd62e100ab 100644 --- a/types/azure-sb/index.d.ts +++ b/types/azure-sb/index.d.ts @@ -75,7 +75,7 @@ export namespace Azure.ServiceBus { DefaultMessageTimeToLive: string; DuplicateDetectionHistoryTimeWindow: string; EnablePartitioning: boolean; - MaxSizeInMegaBytes: number; + MaxSizeInMegabytes: number; RequiresDuplicateDetection: boolean; } diff --git a/types/azure/index.d.ts b/types/azure/index.d.ts index 8e7a321713..d35729d385 100644 --- a/types/azure/index.d.ts +++ b/types/azure/index.d.ts @@ -159,13 +159,13 @@ export declare class BlobService extends StorageServiceClient { //#region Service Methods /** - * Gets the properties of a storage account�s Blob service, including Azure Storage Analytics. + * Gets the properties of a storage account's Blob service, including Azure Storage Analytics. */ getServiceProperties(callback: StorageServicePropertiesCallback): void; getServiceProperties(options: TimeoutIntervalOptions, callback: StorageServicePropertiesCallback): void; /** - * Sets the properties of a storage account�s Blob service, including Azure Storage Analytics. + * Sets the properties of a storage account's Blob service, including Azure Storage Analytics. * You can also use this operation to set the default request version for all incoming requests that do not have a version specified. */ setServiceProperties(serviceProperties: StorageServiceProperties, callback: StorageCallbackVoid): void; @@ -256,7 +256,7 @@ export declare class BlobService extends StorageServiceClient { setBlobProperties(container: string, blob: string, options: SetBlobPropertiesOptions, callback: StorageCallback): void; /** - * Sets user-defined metadata for the specified blob or snapshot as one or more name-value pairs + * Sets user-defined metadata for the specified blob or snapshot as one or more name-value pairs * It does not return or modify the content of the blob. */ setBlobMetadata(container: string, blob: string, metadata: StorageMetadata, callback: StorageCallback): void; @@ -288,9 +288,9 @@ export declare class BlobService extends StorageServiceClient { /** * Marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collection. - * If a blob has snapshots, you must delete them when deleting the blob. Using the deleteSnapshots option, you can choose either to delete both the blob and its snapshots, + * If a blob has snapshots, you must delete them when deleting the blob. Using the deleteSnapshots option, you can choose either to delete both the blob and its snapshots, * or to delete only the snapshots but not the blob itself. If the blob has snapshots, you must include the deleteSnapshots option or the blob service will return an error - * and nothing will be deleted. + * and nothing will be deleted. * If you are deleting a specific snapshot using the snapshotId option, the deleteSnapshots option must NOT be included. */ deleteBlob(container: string, blob: string, callback: StorageCallback): void; @@ -445,8 +445,8 @@ export declare class BlobService extends StorageServiceClient { //#region Lease Methods /** - * Acquires a new lease. - * If container and blob are specified, acquires a blob lease. + * Acquires a new lease. + * If container and blob are specified, acquires a blob lease. * Otherwise, if only container is specified and blob is null, acquires a container lease. */ acquireLease(container: string, blob: string, callback: StorageCallback): void; @@ -521,13 +521,13 @@ export declare class QueueService extends StorageServiceClient { //#region Service Methods /** - * Gets the properties of a storage account�s Blob service, including Azure Storage Analytics. + * Gets the properties of a storage account's Blob service, including Azure Storage Analytics. */ getServiceProperties(callback: StorageServicePropertiesCallback): void; getServiceProperties(options: TimeoutIntervalOptions, callback: StorageServicePropertiesCallback): void; /** - * Sets the properties of a storage account�s Blob service, including Azure Storage Analytics. + * Sets the properties of a storage account's Blob service, including Azure Storage Analytics. * You can also use this operation to set the default request version for all incoming requests that do not have a version specified. */ setServiceProperties(serviceProperties: StorageServiceProperties, callback: StorageCallbackVoid): void; @@ -684,7 +684,7 @@ interface RoleEnvironmentInterface extends events.EventEmitter { /** * Indicates whether the role instance is running in the Microsoft Azure - * environment. It is good practice to enclose any code that uses + * environment. It is good practice to enclose any code that uses * service runtime in the isAvailable callback. */ isAvailable(callback: SimpleCallback): void; @@ -702,7 +702,7 @@ interface RoleEnvironmentInterface extends events.EventEmitter { /** * Retrieves the settings in the service configuration file. - * + * * A role's configuration settings are defined in the service definition file. * Values for configuration settings are set in the service configuration file. * For more information on configuration settings, see the [Service Definition Schema](http://msdn.microsoft.com/en-us/library/windowsazure/ee758711.aspx) @@ -719,10 +719,10 @@ interface RoleEnvironmentInterface extends events.EventEmitter { /** * Requests that the current role instance be stopped and restarted. - * + * * Before the role instance is recycled, the Microsoft Azure load balancer takes the role instance out of rotation. * This ensures that no new requests are routed to the instance while it is restarting. - * + * * A call to `RequestRecycle` initiates the normal shutdown cycle. Microsoft Azure raises the * `Stopping` event and calls the `OnStop` method so that you can run the necessary code to * prepare the instance to be recycled. @@ -731,7 +731,7 @@ interface RoleEnvironmentInterface extends events.EventEmitter { /** * Sets the status of the role instance. - * + * * An instance may indicate that it is in one of two states: Ready or Busy. If an instance's state is Ready, it is * prepared to receive requests from the load balancer. If the instance's state is Busy, it will not receive * requests from the load balancer. diff --git a/types/babel__core/index.d.ts b/types/babel__core/index.d.ts index 277228341b..85a89392af 100644 --- a/types/babel__core/index.d.ts +++ b/types/babel__core/index.d.ts @@ -4,16 +4,16 @@ // Marvin Hagemeister // Melvin Groenhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.9 import { GeneratorOptions } from "@babel/generator"; import traverse, { Visitor, NodePath } from "@babel/traverse"; import template from "@babel/template"; import * as t from "@babel/types"; -import { ParseOptions } from "@babel/parser"; +import { ParserOptions } from "@babel/parser"; export { - ParseOptions, + ParserOptions, GeneratorOptions, t as types, template, @@ -217,7 +217,7 @@ export interface TransformOptions { * * Default: `{}` */ - parserOpts?: ParseOptions | null; + parserOpts?: ParserOptions | null; /** * List of plugins to load and use diff --git a/types/babel__core/package.json b/types/babel__core/package.json index c2ca8a8f9b..582285d229 100644 --- a/types/babel__core/package.json +++ b/types/babel__core/package.json @@ -1,6 +1,7 @@ { "private": true, "dependencies": { - "@babel/types": "^7.0.0-beta.54" + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" } } diff --git a/types/babel__core/tsconfig.json b/types/babel__core/tsconfig.json index 2f96e019cb..22eb208383 100644 --- a/types/babel__core/tsconfig.json +++ b/types/babel__core/tsconfig.json @@ -22,9 +22,6 @@ "@babel/generator": [ "babel__generator" ], - "@babel/parser": [ - "babel__parser" - ], "@babel/template": [ "babel__template" ], diff --git a/types/babel__generator/babel__generator-tests.ts b/types/babel__generator/babel__generator-tests.ts index 90a668ad55..728638c868 100644 --- a/types/babel__generator/babel__generator-tests.ts +++ b/types/babel__generator/babel__generator-tests.ts @@ -1,9 +1,9 @@ // Example from https://github.com/babel/babel/tree/master/packages/babel-generator import generate from "@babel/generator"; -import { parse } from "@babel/parser"; +import * as t from "@babel/types"; const code = "class Example {}"; -const ast = parse(code); +declare const ast: t.Node; ast.type; ast.loc!.start; diff --git a/types/babel__generator/index.d.ts b/types/babel__generator/index.d.ts index 03fcf2765a..9b6a9fbc1c 100644 --- a/types/babel__generator/index.d.ts +++ b/types/babel__generator/index.d.ts @@ -4,7 +4,7 @@ // Johnny Estilles // Melvin Groenhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.9 import * as t from "@babel/types"; diff --git a/types/babel__generator/package.json b/types/babel__generator/package.json index c2ca8a8f9b..2442a952db 100644 --- a/types/babel__generator/package.json +++ b/types/babel__generator/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "@babel/types": "^7.0.0-beta.54" + "@babel/types": "^7.0.0" } } diff --git a/types/babel__generator/tsconfig.json b/types/babel__generator/tsconfig.json index be65e3da1f..01acda5d38 100644 --- a/types/babel__generator/tsconfig.json +++ b/types/babel__generator/tsconfig.json @@ -18,9 +18,6 @@ "paths": { "@babel/generator": [ "babel__generator" - ], - "@babel/parser": [ - "babel__parser" ] } }, diff --git a/types/babel__parser/babel__parser-tests.ts b/types/babel__parser/babel__parser-tests.ts deleted file mode 100644 index 1c9873e5e8..0000000000 --- a/types/babel__parser/babel__parser-tests.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { parse, parseExpression } from "@babel/parser"; - -declare function assert(expr: boolean): void; - -const code = `function square(n) { - return n * n; -}`; - -const node = parse(code); -assert(node.type === "File"); -assert(node.start === 0); -assert(node.end === 38); -assert(!!node.loc && node.loc.start > node.loc.end); - -parse(code, { - sourceType: "module", // default: "script" - plugins: ["jsx"] // default: [] -}); diff --git a/types/babel__parser/index.d.ts b/types/babel__parser/index.d.ts deleted file mode 100644 index bf383ffa0c..0000000000 --- a/types/babel__parser/index.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -// Type definitions for @babel/parser 7.0 -// Project: https://github.com/babel/babel/tree/master/packages/babel-parser -// Definitions by: Troy Gerwien -// Marvin Hagemeister -// Melvin Groenhoff -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 - -import { File, Expression } from "@babel/types"; - -export function parse(code: string, opts?: ParseOptions): File; - -export function parseExpression(input: string, options?: ParseOptions): Expression; - -export interface ParseOptions { - /** - * By default, import and export declarations can only appear at a program's top level. - * Setting this option to true allows them anywhere where a statement is allowed. - */ - allowImportExportEverywhere?: boolean; - - /** - * By default, await use is not allowed outside of an async function. Set this to true to accept such code. - */ - allowAwaitOutsideFunction?: boolean; - - /** - * By default, a return statement at the top level raises an error. Set this to true to accept such code. - */ - allowReturnOutsideFunction?: boolean; - - allowSuperOutsideMethod?: boolean; - - /** - * Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". - * Defaults to "script". "unambiguous" will make @babel/parser attempt to guess, based on the presence of ES6 import or export - * statements. Files with ES6 imports and exports are considered "module" and are otherwise "script". - */ - sourceType?: "script" | "module" | "unambiguous"; - - /** - * Correlate output AST nodes with their source filename. Useful when - * generating code and source maps from the ASTs of multiple input files. - */ - sourceFilename?: string; - - /** - * By default, the first line of code parsed is treated as line 1. You can provide a line number to alternatively start with. Useful - * for integration with other source tools. - */ - startLine?: number; - - /** - * Array containing the plugins that you want to enable. - */ - plugins?: PluginList; - - strictMode?: boolean; - - /** - * Adds a `ranges` property to each node: `[node.start, node.end]` - */ - ranges?: boolean; - - /** - * Adds all parsed tokens to a `tokens` property on the `File` node - */ - tokens?: boolean; -} - -export type PluginList = Array; - -export type PluginName = - "asyncGenerators" | - "bigInt" | - "classPrivateMethods" | - "classPrivateProperties" | - "classProperties" | - "decorators" | - "doExpressions" | - "dynamicImport" | - "estree" | - "exportDefaultFrom" | - "exportNamespaceFrom" | - "flow" | - "flowComments" | - "functionBind" | - "functionSent" | - "importMeta" | - "jsx" | - "nullishCoalescingOperator" | - "numericSeparator" | - "objectRestSpread" | - "optionalCatchBinding" | - "optionalChaining" | - "pipelineOperator" | - "throwExpressions" | - "typescript"; - -export interface PluginOptions { - decorators?: { - decoratorsBeforeExport?: boolean; - }; - flow?: { - all?: boolean; - }; -} diff --git a/types/babel__template/index.d.ts b/types/babel__template/index.d.ts index 5f3bc18bc3..8750e52d8e 100644 --- a/types/babel__template/index.d.ts +++ b/types/babel__template/index.d.ts @@ -4,12 +4,12 @@ // Marvin Hagemeister // Melvin Groenhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.9 -import { ParseOptions } from "@babel/parser"; +import { ParserOptions } from "@babel/parser"; import { Expression, File, Program, Statement } from "@babel/types"; -export interface TemplateBuilderOptions extends ParseOptions { +export interface TemplateBuilderOptions extends ParserOptions { /** * A set of placeholder names to automatically accept. Items in this list do not need to match the given placeholder pattern. */ diff --git a/types/babel__template/package.json b/types/babel__template/package.json index c2ca8a8f9b..582285d229 100644 --- a/types/babel__template/package.json +++ b/types/babel__template/package.json @@ -1,6 +1,7 @@ { "private": true, "dependencies": { - "@babel/types": "^7.0.0-beta.54" + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" } } diff --git a/types/babel__template/tsconfig.json b/types/babel__template/tsconfig.json index 386236c02f..50fce77ad8 100644 --- a/types/babel__template/tsconfig.json +++ b/types/babel__template/tsconfig.json @@ -20,9 +20,6 @@ "@babel/generator": [ "babel__generator" ], - "@babel/parser": [ - "babel__parser" - ], "@babel/template": [ "babel__template" ] diff --git a/types/babel__traverse/babel__traverse-tests.ts b/types/babel__traverse/babel__traverse-tests.ts index 2fc7b07a8a..5b4fbbef5f 100644 --- a/types/babel__traverse/babel__traverse-tests.ts +++ b/types/babel__traverse/babel__traverse-tests.ts @@ -1,4 +1,3 @@ -import { parse } from "@babel/parser"; import traverse, { Visitor } from "@babel/traverse"; import * as t from "@babel/types"; @@ -21,11 +20,7 @@ const MyVisitor2: Visitor = { }; // Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-traverse -const code = `function square(n) { - return n * n; -}`; - -const ast = parse(code); +declare const ast: t.Node; traverse(ast, { enter(path) { diff --git a/types/babel__traverse/index.d.ts b/types/babel__traverse/index.d.ts index 475ca9fb14..465a60464f 100644 --- a/types/babel__traverse/index.d.ts +++ b/types/babel__traverse/index.d.ts @@ -5,7 +5,7 @@ // Ryan Petrich // Melvin Groenhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.9 import * as t from "@babel/types"; diff --git a/types/babel__traverse/package.json b/types/babel__traverse/package.json index c2ca8a8f9b..2442a952db 100644 --- a/types/babel__traverse/package.json +++ b/types/babel__traverse/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "@babel/types": "^7.0.0-beta.54" + "@babel/types": "^7.0.0" } } diff --git a/types/babel__traverse/tsconfig.json b/types/babel__traverse/tsconfig.json index 898675d222..b6c30190af 100644 --- a/types/babel__traverse/tsconfig.json +++ b/types/babel__traverse/tsconfig.json @@ -17,9 +17,6 @@ "noEmit": true, "forceConsistentCasingInFileNames": true, "paths": { - "@babel/parser": [ - "babel__parser" - ], "@babel/traverse": [ "babel__traverse" ] diff --git a/types/babylon/index.d.ts b/types/babylon/index.d.ts index 07eb74bb32..b179f6f357 100644 --- a/types/babylon/index.d.ts +++ b/types/babylon/index.d.ts @@ -46,6 +46,7 @@ export type PluginName = 'estree' | 'jsx' | 'flow' | + 'typescript' | 'classConstructorCall' | 'doExpressions' | 'objectRestSpread' | diff --git a/types/backbone.layoutmanager/tslint.json b/types/backbone.layoutmanager/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/backbone.layoutmanager/tslint.json +++ b/types/backbone.layoutmanager/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/backbone.marionette/index.d.ts b/types/backbone.marionette/index.d.ts index bacd045ba1..609bf37b67 100644 --- a/types/backbone.marionette/index.d.ts +++ b/types/backbone.marionette/index.d.ts @@ -4,13 +4,15 @@ // Natan Vivo , // Sven Tschui , // Volker Nauruhn , -// Ard Timmerman +// Ard Timmerman , +// J. Joe Koullas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import * as Backbone from 'backbone'; import * as JQuery from 'jquery'; import * as Radio from 'backbone.radio'; +import * as _ from 'underscore'; export as namespace Marionette; @@ -179,6 +181,131 @@ export class Container { * Find a view by it's cid. */ remove(view: TView): void; + + /** + * @see _.forEach + */ + forEach(iterator: _.ListIterator, context?: any): Container; + + /** + * @see _.each + */ + each(iterator: _.ListIterator, context?: any): Container; + + /** + * @see _.map + */ + map(iterator: _.ListIterator, context?: any): TResult[]; + + /** + * @see _.find + */ + find(iterator: _.ListIterator, context?: any): Container | undefined; + + /** + * @see _.detect + */ + detect(iterator: _.ListIterator, context?: any): Container | undefined; + + /** + * @see _.filter + */ + filter(iterator: _.ListIterator, context?: any): TView[]; + + /** + * @see _.select + */ + select(iterator: _.ListIterator, context?: any): TView[]; + + /** + * @see _.reject + */ + reject(iterator: _.ListIterator, context?: any): TView[]; + + /** + * @see _.every + */ + every(iterator: _.ListIterator, context?: any): boolean; + + /** + * @see _.all + */ + all(iterator: _.ListIterator, context?: any): boolean; + + /** + * @see _.some + */ + some(iterator: _.ListIterator, context?: any): boolean; + + /** + * @see _.any + */ + any(iterator: _.ListIterator, context?: any): boolean; + + /** + * @see _.include + */ + include(value: TView, fromIndex?: number): boolean; + + /** + * @see _.contains + */ + contains(value: TView, fromIndex?: number): boolean; + + /** + * @see _.invoke + */ + invoke(methodName: string, ...args: any[]): any; + + /** + * @see _.toArray + */ + toArray(): TView[]; + + /** + * @see _.first + */ + first(): TView | undefined; + + /** + * @see _.initial + */ + initial(n?: number): TView[]; + + /** + * @see _.rest + */ + rest(n?: number): TView[]; + + /** + * @see _.last + */ + last(n: number): TView[]; + + /** + * @see _.without + */ + without(...values: TView[]): TView[]; + + /** + * @see _.isEmpty + */ + isEmpty(): boolean; + + /** + * @see _.pluck + */ + pluck(propertyName: string): any[]; + + /** + * @see _.reduce + */ + reduce(iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; + + /** + * @see _.partition + */ + partition(iterator: _.ListIterator, context?: any): TView[][]; } /** @@ -1154,7 +1281,7 @@ export class View extends Backbone.View i export interface CollectionViewOptions< TModel extends Backbone.Model, TCollection extends Backbone.Collection = Backbone.Collection -> extends Backbone.ViewOptions, ViewMixinOptions { + > extends Backbone.ViewOptions, ViewMixinOptions { /** * Specify a child view to use. */ diff --git a/types/backbone/tslint.json b/types/backbone/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/backbone/tslint.json +++ b/types/backbone/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/baidumap-web-sdk/tslint.json b/types/baidumap-web-sdk/tslint.json index aab43caa1d..eccb336643 100644 --- a/types/baidumap-web-sdk/tslint.json +++ b/types/baidumap-web-sdk/tslint.json @@ -2,14 +2,21 @@ "extends": "dtslint/dt.json", "rules": { // All are TODOs - "eofline": false, + "adjacent-overload-signatures": false, + "array-type": false, + "ban-types": false, "comment-format": false, "dt-header": false, + "eofline": false, "max-line-length": false, "member-access": false, + "no-consecutive-blank-lines": false, + "no-empty-interface": false, "no-namespace": false, + "no-unnecessary-class": false, "no-useless-files": false, "no-var": false, - "semicolon": false + "semicolon": false, + "space-before-function-paren": false } } diff --git a/types/basicauth-middleware/basicauth-middleware-tests.ts b/types/basicauth-middleware/basicauth-middleware-tests.ts new file mode 100644 index 0000000000..258f382807 --- /dev/null +++ b/types/basicauth-middleware/basicauth-middleware-tests.ts @@ -0,0 +1,21 @@ +import express = require('express'); +import basicAuth = require('basicauth-middleware'); + +const app = express(); + +app.use(basicAuth("username", "password", "realm")); +app.use(basicAuth([["username", "password"]])); + +function checkSync(username: string, password: string): boolean { + return username === "user" && password === "pass"; +} +function checkCallback(username: string, password: string, callback: (err: Error|null, authorized: boolean) => void): void { + callback(null, username === "user" && password === "pass"); +} +function checkPromise(username: string, password: string): Promise { + return Promise.resolve(true); +} + +app.use(basicAuth(checkSync)); +app.use(basicAuth(checkCallback)); +app.use(basicAuth(checkPromise)); diff --git a/types/basicauth-middleware/index.d.ts b/types/basicauth-middleware/index.d.ts new file mode 100644 index 0000000000..21e3a27ad8 --- /dev/null +++ b/types/basicauth-middleware/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for basicauth-middleware 3.1 +// Project: https://github.com/nchaulet/basicauth-middleware +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { RequestHandler } from "express"; +type checkFunctionSync = (username: string, password: string) => boolean; +type checkFunctionCallback = (username: string, password: string, callback: (err: Error|null, authorized: boolean) => void) => void; +type checkFunctionPromise = (username: string, password: string) => PromiseLike; +type CheckFunction = checkFunctionSync | checkFunctionPromise | checkFunctionCallback; + +declare function basicAuth(checkFnOrUsers: Array<[string, string]>|CheckFunction, realm?: string): RequestHandler; +declare function basicAuth(username: string, password: string, realm?: string): RequestHandler; + +export = basicAuth; diff --git a/types/basicauth-middleware/tsconfig.json b/types/basicauth-middleware/tsconfig.json new file mode 100644 index 0000000000..e31e940e70 --- /dev/null +++ b/types/basicauth-middleware/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + + }, + "files": [ + "index.d.ts", + "basicauth-middleware-tests.ts" + ] +} diff --git a/types/grid-styled/tslint.json b/types/basicauth-middleware/tslint.json similarity index 100% rename from types/grid-styled/tslint.json rename to types/basicauth-middleware/tslint.json diff --git a/types/bcrypt/index.d.ts b/types/bcrypt/index.d.ts index 3cf57ca562..674a65bba5 100644 --- a/types/bcrypt/index.d.ts +++ b/types/bcrypt/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bcrypt 2.0 +// Type definitions for bcrypt 3.0 // Project: https://www.npmjs.org/package/bcrypt // Definitions by: Peter Harris // Ayman Nedjmeddine diff --git a/types/bell/bell-tests.ts b/types/bell/bell-tests.ts index bcd3a3d40c..5eaeac4f35 100644 --- a/types/bell/bell-tests.ts +++ b/types/bell/bell-tests.ts @@ -105,5 +105,53 @@ async function run() { clientId: '', clientSecret: '', scope: ['user_read', 'channel_read'] + }, + { + provider: { + auth: 'http://test.com/auth', + token: 'http://test.com/auth', + name: 'custom', + protocol: 'oauth', + temporary: 'wat', + async profile(credentials, params, get) { + console.log(credentials.provider); + console.log(credentials.query); + console.log(credentials.secret); + console.log(this.clientId); + credentials.profile = await get('http://test.com/profile', { + a: 'test', + }); + }, + }, + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + location: () => '', + }, + { + provider: { + auth: 'http://test.com/auth', + token: 'http://test.com/auth', + name: 'custom', + protocol: 'oauth2', + scope: ['a', 's', 'd', 'f'], + scopeSeparator: '~~~', + async profile(credentials, params, get) { + console.log(credentials.provider); + console.log(credentials.query); + console.log(credentials.token); + console.log(credentials.refreshToken); + console.log(this.clientId); + credentials.profile = await get('http://test.com/profile', { + a: 'test', + }); + }, + }, + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + location: () => '', }]; } diff --git a/types/bell/index.d.ts b/types/bell/index.d.ts index cf6a6866e1..4b56a239a3 100644 --- a/types/bell/index.d.ts +++ b/types/bell/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/hapijs/bell // Definitions by: Simon Schick // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.7 +// TypeScript Version: 2.8 import { Server, Request, Plugin, AuthCredentials } from 'hapi'; @@ -22,45 +22,45 @@ export interface StringLikeMap { [key: string]: string | number; } export type Provider = - 'arcgisonline' | - 'auth0' | - 'azuread' | - 'bitbucket' | - 'digitalocean' | - 'discord' | - 'dropbox' | - 'dropboxV2' | - 'facebook' | - 'fitbit' | - 'foursquare' | - 'github' | - 'gitlab' | - 'google' | - 'googleplus' | - 'instagram' | - 'linkedin' | - 'live' | - 'medium' | - 'meetup' | - 'mixer' | - 'nest' | - 'office365' | - 'okta' | - 'phabricator' | - 'pingfed' | - 'pinterest' | - 'reddit' | - 'salesforce' | - 'slack' | - 'spotify' | - 'stripe' | - 'trakt' | - 'tumblr' | - 'twitch' | - 'twitter' | - 'vk' | - 'wordpress' | - 'yahoo'; + 'arcgisonline' | + 'auth0' | + 'azuread' | + 'bitbucket' | + 'digitalocean' | + 'discord' | + 'dropbox' | + 'dropboxV2' | + 'facebook' | + 'fitbit' | + 'foursquare' | + 'github' | + 'gitlab' | + 'google' | + 'googleplus' | + 'instagram' | + 'linkedin' | + 'live' | + 'medium' | + 'meetup' | + 'mixer' | + 'nest' | + 'office365' | + 'okta' | + 'phabricator' | + 'pingfed' | + 'pinterest' | + 'reddit' | + 'salesforce' | + 'slack' | + 'spotify' | + 'stripe' | + 'trakt' | + 'tumblr' | + 'twitch' | + 'twitter' | + 'vk' | + 'wordpress' | + 'yahoo'; export type RequestPassThrough = (request: Request) => PromiseLike | AuthCredentials; @@ -188,29 +188,33 @@ export interface KnownProviderOptions extends RequiredProviderOptions, OptionalO * @param uri the requested resource URI (bell will add the token or authentication header as needed). * @param params any URI query parameters (cannot include them in the URI due to signature requirements). */ -export type AuthedRequest = (uri: string, params: { [key: string]: string } | null) => Promise; +export type AuthedRequest = (uri: string, params?: { [key: string]: string }) => Promise; + +export interface Credentials { + provider: Provider | 'custom'; + token: string; + query: StringLikeMap; + /** + * Varying data depending on provider. + */ + profile?: object; +} + +export interface Credentials1 extends Credentials { + secret: string; +} + +export interface Credentials2 extends Credentials { + refreshToken?: string; + expiresIn?: number; +} export interface CustomProtocol { /** - * the authorization protocol used. + * The name of the protocol. + * @default custom */ - protocol: 'oauth' | 'oauth2'; - /** - * the OAuth signature method (OAuth 1.0a only). Must be one of: - * * 'HMAC-SHA1' - default - * * 'RSA-SHA1' - in that case, the clientSecret is your RSA private key - */ - signatureMethod?: 'HMAC-SHA1' | 'RSA-SHA1'; - /** - * the temporary credentials (request token) endpoint (OAuth 1.0a only). - */ - temporary?: string; - /** - * boolean that determines if OAuth client id and client secret will be sent - * as parameters as opposed to an Authorization header (OAuth 2.0 only). - * Defaults to false. - */ - useParamsAuth?: boolean; + name?: string; /** * the authorization endpoint URI. */ @@ -219,18 +223,6 @@ export interface CustomProtocol { * the access token endpoint URI. */ token: string; - /** - * the OAuth version. - */ - version?: string; - /** - * an array of scope strings (OAuth 2.0 only). - */ - scope?: string[] | ((query: StringLikeMap) => string[]); - /** - * the scope separator character (OAuth 2.0 only). Only required when a provider has a broken OAuth 2.0 implementation. Defaults to space (Facebook and GitHub default to comma). - */ - scopeSeparator?: string; /** * a headers object with additional headers required by the provider * (e.g. GitHub required the 'User-Agent' header which is set by default). @@ -238,23 +230,68 @@ export interface CustomProtocol { headers?: { [key: string]: string; }; +} + +/** + * a function used to obtain user profile information and normalize it. + * @param credentials the credentials object. + * Change the object directly within the function (profile information is typically stored under credentials.profile). + * @param params the parsed information received from the provider (e.g. token, secret, and other custom fields). + * @param get an OAuth helper function to make authenticated requests using the credentials received. + */ +export type ProfileGetter = (this: CustomProviderOptions, credentials: C, params: { [key: string]: string }, get: AuthedRequest) => Promise; + +export interface CustomProtocol1 extends CustomProtocol { /** - * a function used to obtain user profile information and normalize it. - * @param credentials the credentials object. - * Change the object directly within the function (profile information is typically stored under credentials.profile). - * @param params the parsed information received from the provider (e.g. token, secret, and other custom fields). - * @param get an OAuth helper function to make authenticated requests using the credentials received. + * the authorization protocol used. */ - profile(credentials: any, params: { [key: string]: string }, get: AuthedRequest): Promise; + protocol: 'oauth'; + + /** + * the OAuth signature method. Must be one of: + * * 'HMAC-SHA1' - default + * * 'RSA-SHA1' - in that case, the clientSecret is your RSA private key + */ + signatureMethod?: 'HMAC-SHA1' | 'RSA-SHA1'; + /** + * the temporary credentials (request token) endpoint). + */ + temporary?: string; + + profile: ProfileGetter; +} + +export interface CustomProtocol2 extends CustomProtocol { + /** + * the authorization protocol used. + */ + protocol: 'oauth2'; + /** + * an array of scope strings. + */ + scope?: string[] | ((query: StringLikeMap) => string[]); + /** + * boolean that determines if OAuth client id and client secret will be sent + * as parameters as opposed to an Authorization header. + * Defaults to false. + */ + useParamsAuth?: boolean; + + /** + * the scope separator character. Only required when a provider has a broken OAuth 2.0 implementation. Defaults to space (Facebook and GitHub default to comma). + */ + scopeSeparator?: string; + + profile: ProfileGetter; } export interface CustomProviderOptions extends RequiredProviderOptions, OptionalOptions { - provider: CustomProtocol; + provider: CustomProtocol1 | CustomProtocol2; } export type BellOptions = CustomProviderOptions | KnownProviderOptions; -export const plugin: Plugin; +export const plugin: Plugin; /** * Enables simulation mode. */ diff --git a/types/better-scroll/index.d.ts b/types/better-scroll/index.d.ts index 326dd2c3a0..91e5710805 100644 --- a/types/better-scroll/index.d.ts +++ b/types/better-scroll/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for better-scroll 1.12 // Project: https://github.com/ustbhuangyi/better-scroll // Definitions by: cloudstone +// jack // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -42,6 +43,24 @@ export interface PullUpOption { threshold: number; } +export interface MouseWheelOption { + speed: number; + invert: boolean; + easeTime: number; +} + +export interface ZoomOption { + start: number; + min: number; + max: number; +} + +export interface InfinityOption { + fetch: (count: number) => void; + render: (item: any, div: Element) => Element; + createTombstone: () => Element; +} + export interface BounceObjectOption { top?: boolean; bottom?: boolean; @@ -49,6 +68,10 @@ export interface BounceObjectOption { right?: boolean; } +export interface DoubleClick { + delay: number; +} + export interface EaseOption { swipe?: { style: string; @@ -73,6 +96,7 @@ export interface BsOption { directionLockThreshold: number; eventPassthrough: string | boolean; click: boolean; + dblclick: boolean | DoubleClick; tap: boolean; bounce: boolean | BounceObjectOption; bounceTime: number; @@ -140,6 +164,23 @@ export interface BsOption { * } */ pullUpLoad: Partial | boolean; + + // mouseWheel: { + // speed: 20, + // invert: false, + // easeTime: 300 + // } + mouseWheel: Partial | boolean; + + // zoom: { + // start: 1, + // min: 1, + // max: 4 + // } + zoom: Partial | boolean; + + // https://ustbhuangyi.github.io/better-scroll/doc/zh-hans/options-advanced.html + infinity: Partial | boolean; } export interface Position { diff --git a/types/bezier-js/bezier-js-tests.ts b/types/bezier-js/bezier-js-tests.ts index 003b6e1c45..9bcada8474 100644 --- a/types/bezier-js/bezier-js-tests.ts +++ b/types/bezier-js/bezier-js-tests.ts @@ -21,6 +21,11 @@ function test() { startcap: cap, endcap: cap, forward: bezier, back: bezier, bbox: bbox, intersections: function (shape) { return [[0]]; } }; var split: BezierJs.Split = { left: bezier, right: bezier, span: [point] }; + var quadratic: BezierJs.Bezier = BezierJs.Bezier.quadraticFromPoints({ x: 0, y: 0 }, { x: 1, y: 1 }, { x: 2, y: 2 }, 0.5); + var quadratic: BezierJs.Bezier = BezierJs.Bezier.quadraticFromPoints({ x: 0, y: 0 }, { x: 1, y: 1 }, { x: 2, y: 2 }); + var cubic: BezierJs.Bezier = BezierJs.Bezier.cubicFromPoints({ x: 0, y: 0 }, { x: 1, y: 1 }, { x: 2, y: 2 }, 0.5, 2); + var cubic: BezierJs.Bezier = BezierJs.Bezier.cubicFromPoints({ x: 0, y: 0 }, { x: 1, y: 1 }, { x: 2, y: 2 }, 0.5); + var cubic: BezierJs.Bezier = BezierJs.Bezier.cubicFromPoints({ x: 0, y: 0 }, { x: 1, y: 1 }, { x: 2, y: 2 }); bezier.arcs(); bezier.clockwise; diff --git a/types/bezier-js/index.d.ts b/types/bezier-js/index.d.ts index b44b027dc2..ffd74f5d46 100644 --- a/types/bezier-js/index.d.ts +++ b/types/bezier-js/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Bezier.js // Project: https://github.com/Pomax/bezierjs // Definitions by: Dan Marshall +// Simon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace BezierJs { @@ -96,8 +97,8 @@ declare namespace BezierJs { constructor(p1: Point, p2: Point, p3: Point, p4?: Point); static fromSVG(svgString: string): Bezier; static getABC(n: number, S: Point, B: Point, E: Point, t: number): ABC; - static quadraticFromPoints(p1: Point, p2: Point, p3: Point, t: number): Bezier; - static cubicFromPoints(S: Point, B: Point, E: Point, t: number, d1: number): Bezier; + static quadraticFromPoints(p1: Point, p2: Point, p3: Point, t?: number): Bezier; + static cubicFromPoints(S: Point, B: Point, E: Point, t?: number, d1?: number): Bezier; static getUtils(): typeof utils; getUtils(): typeof utils; valueOf(): string; diff --git a/types/bl/bl-tests.ts b/types/bl/bl-tests.ts index 084cf1925a..68fbc79279 100644 --- a/types/bl/bl-tests.ts +++ b/types/bl/bl-tests.ts @@ -9,16 +9,27 @@ var str: string; var noAssert: boolean; bl = new BufferList(); +bl = new BufferList(bl); +bl = new BufferList([bl]); +bl = new BufferList(Buffer.from('asdf')); +bl = new BufferList([Buffer.from('asdf')]); +bl = new BufferList('hi'); bl = new BufferList((err:Error, buffer:Buffer) => { - + if (err) { + throw err; + } + console.log(buffer.toString()); }); bl.append(buffer); +num = bl.length; + num = bl.get(num); buffer = bl.slice(num, num); buffer = bl.slice(num); buffer = bl.slice(); +bl.shallowSlice(0, 1).shallowSlice(); bl.copy(buffer, num, num, num); bl.copy(buffer, num, num); @@ -34,8 +45,11 @@ str = bl.toString(str, num, num); str = bl.toString(str, num); str = bl.toString(str); str = bl.toString(); - -num = bl.length; +bl.indexOf('foo', 0, 'hex') === 1; +bl.indexOf(Buffer.from('foo')) === 1; +bl.indexOf(4) === 1; +bl.indexOf(bl) === 1; +bl.indexOf(new Uint8Array([1,3,4])) === 2; num = bl.readDoubleBE(offset, noAssert); num = bl.readDoubleBE(offset); diff --git a/types/bl/index.d.ts b/types/bl/index.d.ts index 8ad01671fd..8bd9e96aac 100644 --- a/types/bl/index.d.ts +++ b/types/bl/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for BufferList v0.8.0 +// Type definitions for BufferList v2.1.0 // Project: https://github.com/rvagg/bl // Definitions by: Bart van der Schoor +// Francis Gulotta // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -9,17 +10,18 @@ import stream = require('stream'); declare class BufferList extends stream.Duplex { - constructor(callback?: (err: Error, buffer: Buffer) => void); + constructor(callbackOrData?: ((err: Error, buffer: Buffer) => void) | Buffer | Buffer[] | BufferList | BufferList[] | string); + length: number; append(buffer: Buffer | Buffer[] | BufferList | BufferList[] | string): void; get(index: number): number; slice(start?: number, end?: number): Buffer; + shallowSlice(start?: number, end?: number): BufferList; copy(dest: Buffer, destStart?: number, srcStart?: number, srcEnd?: number): void; duplicate(): BufferList; consume(bytes?: number): void; toString(encoding?: string, start?: number, end?: number): string; - length: number; - + indexOf(value: string | number | Uint8Array | BufferList | Buffer, byteOffset?: number, encoding?: string): number; readDoubleBE(offset: number, noAssert?: boolean): number; readDoubleLE(offset: number, noAssert?: boolean): number; readFloatBE(offset: number, noAssert?: boolean): number; diff --git a/types/bn.js/index.d.ts b/types/bn.js/index.d.ts index 8c0bc8dd5f..db4c9f8b9e 100644 --- a/types/bn.js/index.d.ts +++ b/types/bn.js/index.d.ts @@ -45,7 +45,7 @@ interface ReductionContext { declare class BN { constructor( number: number | string | number[] | Buffer | BN, - base?: number, + base?: number | 'hex', endian?: Endianness ); constructor( diff --git a/types/bookshelf/tslint.json b/types/bookshelf/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/bookshelf/tslint.json +++ b/types/bookshelf/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/boom/boom-tests.ts b/types/boom/boom-tests.ts index 5ffd808de4..2cae1aec29 100644 --- a/types/boom/boom-tests.ts +++ b/types/boom/boom-tests.ts @@ -144,12 +144,12 @@ const boomifiedError = Boom.boomify(new Error('test'), { statusCode: 400, messag // isBoom -const isBoomError = new Boom('test') +const isBoomError = new Boom('test'); Boom.isBoom(isBoomError); -const maybeBoom = new Boom('test'); -if(Boom.isBoom(maybeBoom)) { +const maybeBoom = new Boom('test'); +if (Boom.isBoom(maybeBoom)) { // isBoom is a type guard that allows accessing these properties: maybeBoom.output.headers; } @@ -183,7 +183,8 @@ interface CustomPayload extends Boom.Payload { /** * Test assignment of custom error data: */ -const errorWithData = Boom.badImplementation('', { custom1: 'test', customType: 'Custom1', isCustom: true } as CustomData1); +// tslint:disable-next-line:no-object-literal-type-assertion +const errorWithData = Boom.badImplementation('', { custom1: 'test', customType: 'Custom1', isCustom: true }); const errorWithNoExplicitDataType: Boom = errorWithData; // can assign to error without explicit data type const errorWithExplicitType: Boom = errorWithData; // can assign to union data type const errorWithConcreteCustomData: Boom = errorWithData; // can assign to concrete data type diff --git a/types/boom/index.d.ts b/types/boom/index.d.ts index b38dafe038..71a738a009 100644 --- a/types/boom/index.d.ts +++ b/types/boom/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for boom 7.2.0 +// Type definitions for boom 7.2 // Project: https://github.com/hapijs/boom // Definitions by: Igor Rogatty // AJP @@ -10,28 +10,31 @@ export = Boom; /** - * boom provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object (instance of Error) which includes the following properties: - * @see {@link https://github.com/hapijs/boom#boom} - */ + * boom provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object (instance of Error) which includes the following properties: + * @see {@link https://github.com/hapijs/boom#boom} + */ declare class Boom extends Error { - - /** Creates a new Boom object using the provided message and then calling boomify() to decorate the error with the Boom properties. */ - constructor(message?: string | Error, options?: Boom.Options); - /** isBoom - if true, indicates this is a Boom object instance. */ - isBoom: boolean; - /** isServer - convenience bool indicating status code >= 500. */ - isServer: boolean; - /** message - the error message. */ - message: string; - /** output - the formatted response. Can be directly manipulated after object construction to return a custom error response. Allowed root keys: */ - output: Boom.Output; - /** reformat() - rebuilds error.output using the other object properties. */ - reformat: () => string; - /** "If message is unset, the 'error' segment of the header will not be present and isMissing will be true on the error object." mentioned in @see {@link https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes} */ - isMissing?: boolean; - /** https://github.com/hapijs/boom#createstatuscode-message-data and https://github.com/hapijs/boom/blob/v4.3.0/lib/index.js#L99 */ - data: Data; - } + /** Creates a new Boom object using the provided message and then calling boomify() to decorate the error with the Boom properties. */ + constructor(message?: string | Error, options?: Boom.Options); + /** isBoom - if true, indicates this is a Boom object instance. */ + isBoom: boolean; + /** isServer - convenience bool indicating status code >= 500. */ + isServer: boolean; + /** message - the error message. */ + message: string; + /** output - the formatted response. Can be directly manipulated after object construction to return a custom error response. Allowed root keys: */ + output: Boom.Output; + /** reformat() - rebuilds error.output using the other object properties. */ + reformat(): string; + /** + * "If message is unset, the 'error' segment of the header will not be present and + * isMissing will be true on the error object." mentioned in + * @see {@link https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes} + */ + isMissing?: boolean; + /** https://github.com/hapijs/boom#createstatuscode-message-data and https://github.com/hapijs/boom/blob/v4.3.0/lib/index.js#L99 */ + data: Data; +} declare namespace Boom { interface Options { /** statusCode - the HTTP status code. Defaults to 500 if no status code is already set. */ @@ -44,20 +47,32 @@ declare namespace Boom { ctor?: any; /** message - error message string. If the error already has a message, the provided message is added as a prefix. Defaults to no message. */ message?: string; - /** override - if false, the err provided is a Boom object, and a statusCode or message are provided, the values are ignored. Defaults to true (apply the provided statusCode and message options to the error regardless of its type, Error or Boom object). */ + /** + * override - if false, the err provided is a Boom object, and a statusCode or message are + * provided, the values are ignored. Defaults to true (apply the provided statusCode and + * message options to the error regardless of its type, Error or Boom object). + */ override?: boolean; } interface Output { /** statusCode - the HTTP status code (typically 4xx or 5xx). */ statusCode: number; - /** headers - an object containing any HTTP headers where each key is a header name and value is the header content. (Limited value type to string https://github.com/hapijs/boom/issues/151 ) */ + /** + * headers - an object containing any HTTP headers where each key is a header name and + * value is the header content. (Limited value type to string + * https://github.com/hapijs/boom/issues/151 ) + */ headers: {[index: string]: string}; - /** payload - the formatted object used as the response payload (stringified). Can be directly manipulated but any changes will be lost if reformat() is called. Any content allowed and by default includes the following content: */ + /** + * payload - the formatted object used as the response payload (stringified). + * Can be directly manipulated but any changes will be lost if reformat() is called. + * Any content allowed and by default includes the following content: + */ payload: Payload; } - interface Payload { + interface Payload { /** statusCode - the HTTP status code, derived from error.output.statusCode. */ statusCode: number; /** error - the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from statusCode. */ @@ -79,13 +94,13 @@ declare namespace Boom { * @param options optional additional options * @see {@link https://github.com/hapijs/boom#boomifyerror-options} */ - function boomify(error: Error, options?: { statusCode?: number, message?: string, override?: boolean }): Boom; + function boomify(error: Error, options?: { statusCode?: number, message?: string, override?: boolean }): Boom; /** * Identifies whether an error is a Boom object. Same as calling instanceof Boom. * @param error the error object to identify. */ - function isBoom(error: Error): error is Boom + function isBoom(error: Error): error is Boom; // 4xx /** @@ -94,7 +109,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadrequestmessage-data} */ - function badRequest(message?: string, data?: Data): Boom; + function badRequest(message?: string, data?: Data): Boom; /** * Returns a 401 Unauthorized error @@ -102,13 +117,21 @@ declare namespace Boom { * @param scheme can be one of the following: * * an authentication scheme name * * an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header. - * @param attributes an object of values to use while setting the 'WWW-Authenticate' header. This value is only used when scheme is a string, otherwise it is ignored. Every key/value pair will be included in the 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the attributes key. Alternatively value can be a string which is use to set the value of the scheme, for example setting the token value for negotiate header. If string is used message parameter must be null. null and undefined will be replaced with an empty string. If attributes is set, message will be used as the 'error' segment of the 'WWW-Authenticate' header. If message is unset, the 'error' segment of the header will not be present and isMissing will be true on the error object. + * @param attributes an object of values to use while setting the 'WWW-Authenticate' header. + * This value is only used when scheme is a string, otherwise it is ignored. + * Every key/value pair will be included in the 'WWW-Authenticate' in the format of + * 'key="value"' as well as in the response payload under the attributes key. + * Alternatively value can be a string which is use to set the value of the scheme, + * for example setting the token value for negotiate header. + * If string is used message parameter must be null. + * null and undefined will be replaced with an empty string. If attributes is set, + * message will be used as the 'error' segment of the 'WWW-Authenticate' header. + * If message is unset, the 'error' segment of the header will not be present and isMissing will be true on the error object. * @see {@link https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes} */ - function unauthorized(message?: string, scheme?: string, attributes?: {[index: string]: string}): Boom; - function unauthorized(message?: string, scheme?: string[]): Boom; - function unauthorized(message?: null, scheme?: string, attributes?: {[index: string]: string} | string): Boom; - function unauthorized(message?: null, scheme?: string[]): Boom; + function unauthorized(message?: string, scheme?: string, attributes?: {[index: string]: string}): Boom; + function unauthorized(message?: string, scheme?: string[]): Boom; + function unauthorized(message?: null, scheme?: string, attributes?: {[index: string]: string} | string): Boom; /** * Returns a 402 Payment Required error @@ -116,7 +139,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompaymentrequiredmessage-data} */ - function paymentRequired(message?: string, data?: Data): Boom; + function paymentRequired(message?: string, data?: Data): Boom; /** * Returns a 403 Forbidden error @@ -124,7 +147,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomforbiddenmessage-data} */ - function forbidden(message?: string, data?: Data): Boom; + function forbidden(message?: string, data?: Data): Boom; /** * Returns a 404 Not Found error @@ -132,7 +155,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotfoundmessage-data} */ - function notFound(message?: string, data?: Data): Boom; + function notFound(message?: string, data?: Data): Boom; /** * Returns a 405 Method Not Allowed error @@ -141,7 +164,7 @@ declare namespace Boom { * @param allow optional string or array of strings (to be combined and separated by ', ') which is set to the 'Allow' header. * @see {@link https://github.com/hapijs/boom#boommethodnotallowedmessage-data-allow} */ - function methodNotAllowed(message?: string, data?: Data, allow?: string | string[]): Boom; + function methodNotAllowed(message?: string, data?: Data, allow?: string | string[]): Boom; /** * Returns a 406 Not Acceptable error @@ -149,7 +172,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotacceptablemessage-data} */ - function notAcceptable(message?: string, data?: Data): Boom; + function notAcceptable(message?: string, data?: Data): Boom; /** * Returns a 407 Proxy Authentication Required error @@ -157,7 +180,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomproxyauthrequiredmessage-data} */ - function proxyAuthRequired(message?: string, data?: Data): Boom; + function proxyAuthRequired(message?: string, data?: Data): Boom; /** * Returns a 408 Request Time-out error @@ -165,7 +188,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomclienttimeoutmessage-data} */ - function clientTimeout(message?: string, data?: Data): Boom; + function clientTimeout(message?: string, data?: Data): Boom; /** * Returns a 409 Conflict error @@ -173,7 +196,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomconflictmessage-data} */ - function conflict(message?: string, data?: Data): Boom; + function conflict(message?: string, data?: Data): Boom; /** * Returns a 410 Gone error @@ -181,7 +204,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomresourcegonemessage-data} */ - function resourceGone(message?: string, data?: Data): Boom; + function resourceGone(message?: string, data?: Data): Boom; /** * Returns a 411 Length Required error @@ -189,7 +212,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomlengthrequiredmessage-data} */ - function lengthRequired(message?: string, data?: Data): Boom; + function lengthRequired(message?: string, data?: Data): Boom; /** * Returns a 412 Precondition Failed error @@ -197,7 +220,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompreconditionfailedmessage-data} */ - function preconditionFailed(message?: string, data?: Data): Boom; + function preconditionFailed(message?: string, data?: Data): Boom; /** * Returns a 413 Request Entity Too Large error @@ -205,7 +228,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomentitytoolargemessage-data} */ - function entityTooLarge(message?: string, data?: Data): Boom; + function entityTooLarge(message?: string, data?: Data): Boom; /** * Returns a 414 Request-URI Too Large error @@ -213,7 +236,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomuritoolongmessage-data} */ - function uriTooLong(message?: string, data?: Data): Boom; + function uriTooLong(message?: string, data?: Data): Boom; /** * Returns a 415 Unsupported Media Type error @@ -221,7 +244,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomunsupportedmediatypemessage-data} */ - function unsupportedMediaType(message?: string, data?: Data): Boom; + function unsupportedMediaType(message?: string, data?: Data): Boom; /** * Returns a 416 Requested Range Not Satisfiable error @@ -229,7 +252,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomrangenotsatisfiablemessage-data} */ - function rangeNotSatisfiable(message?: string, data?: Data): Boom; + function rangeNotSatisfiable(message?: string, data?: Data): Boom; /** * Returns a 417 Expectation Failed error @@ -237,7 +260,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomexpectationfailedmessage-data} */ - function expectationFailed(message?: string, data?: Data): Boom; + function expectationFailed(message?: string, data?: Data): Boom; /** * Returns a 418 I'm a Teapot error @@ -245,7 +268,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomteapotmessage-data} */ - function teapot(message?: string, data?: Data): Boom; + function teapot(message?: string, data?: Data): Boom; /** * Returns a 422 Unprocessable Entity error @@ -253,7 +276,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombaddatamessage-data} */ - function badData(message?: string, data?: Data): Boom; + function badData(message?: string, data?: Data): Boom; /** * Returns a 423 Locked error @@ -261,7 +284,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomlockedmessage-data} */ - function locked(message?: string, data?: Data): Boom; + function locked(message?: string, data?: Data): Boom; /** * Returns a 424 Failed Dependency error @@ -269,7 +292,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomfaileddependencymessage-data} */ - function failedDependency(message?: string, data?: Data): Boom; + function failedDependency(message?: string, data?: Data): Boom; /** * Returns a 428 Precondition Required error @@ -277,7 +300,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompreconditionrequiredmessage-data} */ - function preconditionRequired(message?: string, data?: Data): Boom; + function preconditionRequired(message?: string, data?: Data): Boom; /** * Returns a 429 Too Many Requests error @@ -285,7 +308,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomtoomanyrequestsmessage-data} */ - function tooManyRequests(message?: string, data?: Data): Boom; + function tooManyRequests(message?: string, data?: Data): Boom; /** * Returns a 451 Unavailable For Legal Reasons error @@ -293,7 +316,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomillegalmessage-data} */ - function illegal(message?: string, data?: Data): Boom; + function illegal(message?: string, data?: Data): Boom; // 5xx /** @@ -303,7 +326,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadimplementationmessage-data---alias-internal} */ - function badImplementation(message?: string, data?: Data): Boom; + function badImplementation(message?: string, data?: Data): Boom; /** * Returns a 500 Internal Server Error error @@ -312,7 +335,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadimplementationmessage-data---alias-internal} */ - function internal(message?: string, data?: Data): Boom; + function internal(message?: string, data?: Data): Boom; /** * Returns a 501 Not Implemented error with your error message to the user @@ -320,7 +343,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotimplementedmessage-data} */ - function notImplemented(message?: string, data?: Data): Boom; + function notImplemented(message?: string, data?: Data): Boom; /** * Returns a 502 Bad Gateway error with your error message to the user @@ -328,7 +351,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadgatewaymessage-data} */ - function badGateway(message?: string, data?: Data): Boom; + function badGateway(message?: string, data?: Data): Boom; /** * Returns a 503 Service Unavailable error with your error message to the user @@ -336,7 +359,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomserverunavailablemessage-data} */ - function serverUnavailable(message?: string, data?: Data): Boom; + function serverUnavailable(message?: string, data?: Data): Boom; /** * Returns a 504 Gateway Time-out error with your error message to the user @@ -344,5 +367,5 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomgatewaytimeoutmessage-data} */ - function gatewayTimeout(message?: string, data?: Data): Boom; + function gatewayTimeout(message?: string, data?: Data): Boom; } diff --git a/types/boom/tslint.json b/types/boom/tslint.json index a41bf5d19a..1c36270d47 100644 --- a/types/boom/tslint.json +++ b/types/boom/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "no-angle-bracket-type-assertion": false } } diff --git a/types/boom/v4/boom-tests.ts b/types/boom/v4/boom-tests.ts index 33e86699e8..ee2a8eefb8 100644 --- a/types/boom/v4/boom-tests.ts +++ b/types/boom/v4/boom-tests.ts @@ -1,5 +1,4 @@ import Boom = require('boom'); -import * as Hapi from 'hapi'; // 4xx and data type diff --git a/types/boom/v4/tsconfig.json b/types/boom/v4/tsconfig.json index f8f2968c34..58f1109eee 100644 --- a/types/boom/v4/tsconfig.json +++ b/types/boom/v4/tsconfig.json @@ -25,4 +25,4 @@ "index.d.ts", "boom-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/bootpag/index.d.ts b/types/bootpag/index.d.ts index af47cc3219..bf7c134e35 100644 --- a/types/bootpag/index.d.ts +++ b/types/bootpag/index.d.ts @@ -32,12 +32,12 @@ declare namespace JqueryBootpag { leaps?: boolean; /** - * next button text (default "�") + * next button text (default ???) */ next?: string; /** - * prev button text (default "�") + * prev button text (default ???) */ prev?: string; diff --git a/types/bootstrap-maxlength/index.d.ts b/types/bootstrap-maxlength/index.d.ts index e1fd71deb8..0a92539850 100644 --- a/types/bootstrap-maxlength/index.d.ts +++ b/types/bootstrap-maxlength/index.d.ts @@ -113,7 +113,7 @@ declare namespace BootstrapMaxlength { */ message?: string | ((currentText : string, maxLength: Number) => string), /** - * If true the input will count using utf8 bytesize/encoding. For example: the '�' character is counted as two characters. + * If true the input will count using utf8 bytesize/encoding. For example: the '¢' character is counted as two characters. * @default false */ utf8?: boolean, diff --git a/types/bootstrap-toggle/bootstrap-toggle-tests.ts b/types/bootstrap-toggle/bootstrap-toggle-tests.ts new file mode 100644 index 0000000000..764415a048 --- /dev/null +++ b/types/bootstrap-toggle/bootstrap-toggle-tests.ts @@ -0,0 +1,38 @@ +import 'bootstrap-toggle'; + +const $elem = $("#toggle"); + +// Test Initialise Cases +$elem.bootstrapToggle(); + +$elem.bootstrapToggle({}); + +$elem.bootstrapToggle({ + // Defaults from source project + on: 'On', + off: 'Off', + onstyle: 'primary', + offstyle: 'default', + size: 'normal', + style: '', + width: null, + height: null +}); + +$elem.bootstrapToggle({ + width: 100, + height: 100 +}); + +$elem.bootstrapToggle({ + width: "100%", + height: "100%" +}); + +// Methods +$elem.bootstrapToggle("destroy"); +$elem.bootstrapToggle("on"); +$elem.bootstrapToggle("off"); +$elem.bootstrapToggle("toggle"); +$elem.bootstrapToggle("enable"); +$elem.bootstrapToggle("disable"); diff --git a/types/bootstrap-toggle/index.d.ts b/types/bootstrap-toggle/index.d.ts new file mode 100644 index 0000000000..51dcec9446 --- /dev/null +++ b/types/bootstrap-toggle/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for bootstrap-toggle 2.2 +// Project: https://github.com/minhur/bootstrap-toggle +// Definitions by: Mitchell Grice +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +interface BootstrapToggleOptions { + on?: string; + off?: string; + size?: string; + onstyle?: string; + offstyle?: string; + style?: string; + width?: number | string | null; + height?: number | string | null; +} + +interface JQuery { + bootstrapToggle(options?: BootstrapToggleOptions): JQuery; + bootstrapToggle(command: "destroy" | "on" | "off" | "toggle" | "enable" | "disable"): JQuery; +} diff --git a/types/bootstrap-toggle/tsconfig.json b/types/bootstrap-toggle/tsconfig.json new file mode 100644 index 0000000000..b3d28afbde --- /dev/null +++ b/types/bootstrap-toggle/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bootstrap-toggle-tests.ts" + ] +} diff --git a/types/react-i18next/tslint.json b/types/bootstrap-toggle/tslint.json similarity index 100% rename from types/react-i18next/tslint.json rename to types/bootstrap-toggle/tslint.json diff --git a/types/bootstrap/v3/bootstrap-tests.ts b/types/bootstrap/v3/bootstrap-tests.ts index cd786b41a7..00a8fa44fd 100644 --- a/types/bootstrap/v3/bootstrap-tests.ts +++ b/types/bootstrap/v3/bootstrap-tests.ts @@ -1,48 +1,267 @@ -$('body').off('.data-api'); -$('body').off('.alert.data-api'); +// -------------------------------------------------------------------------------------- +// Modal +// -------------------------------------------------------------------------------------- -$(".btn.danger").button("toggle").addClass("fat"); -$("#myModal").modal(); -$("#myModal").modal({ keyboard: false }); -$("#myModal").modal('show'); +$(".modal").modal(); -$('#myModal').on('show', (e) => e.preventDefault()); +$(".modal").modal("show"); -$('#myModal').modal({ keyboard: false }); -$('#myModal').modal('toggle'); +$(".modal").modal("toggle"); -$('.dropdown-toggle').dropdown(); +$(".modal").modal("handleUpdate"); -$('#navbar').scrollspy(); -$('body').scrollspy({ target: '#navbar-example' }); +$(".modal").modal({ + backdrop: "static", + keyboard: false, + show: true, + remote: "remote.html", +}); -$('#element').tooltip('show'); +$(".modal").modal({ + backdrop: false, +}); -$('#element').popover('show'); +// -------------------------------------------------------------------------------------- +// Dropdown +// -------------------------------------------------------------------------------------- + +$(".dropdown").dropdown(); + +$(".dropdown").dropdown("toggle"); + +// -------------------------------------------------------------------------------------- +// Scrollspy +// -------------------------------------------------------------------------------------- + +$(".navbar").scrollspy(); + +$(".navbar").scrollspy("refresh"); + +$(".navbar").scrollspy({ + target: "#navbar-example", + offset: 10, +}); + +// -------------------------------------------------------------------------------------- +// Tooltip +// -------------------------------------------------------------------------------------- + +$("#element").tooltip(); + +$("#element").tooltip("show"); + +$("#element").tooltip({ + animation: true, + container: false, + delay: 0, + html: false, + placement: "top", + selector: ".selector", + template: '', + title: "", + trigger: "hover focus", + viewport: { selector: "body", padding: 0 }, +}); + +$("#element").tooltip({ + container: "body", +}); + +$("#element").tooltip({ + delay: { show: 500, hide: 100 }, +}); + +$("#element").tooltip({ + placement() { return "top"; }, +}); + +$("#element").tooltip({ + placement(tooltip: HTMLElement, trigger: Element) { + console.log(this.options.delay); + return "top"; + }, +}); + +$("#element").tooltip({ + placement(tooltip: HTMLElement, trigger: Element) { + // $ExpectError + console.log(this.options.content); // only for PopoverOption, not TooltipOption + return "top"; + }, +}); + +$("#element").tooltip({ + title() { return this.id; }, +}); + +$("#element").tooltip({ + viewport: "body", +}); + +// -------------------------------------------------------------------------------------- +// Popover +// -------------------------------------------------------------------------------------- + +$("#element").popover(); + +$("#element").popover("show"); + +$("#element").popover({ + animation: true, + container: false, + content: "content", + delay: 0, + html: false, + placement: "top", + selector: ".selector", + template: '', + title: "", + trigger: "hover focus", + viewport: { selector: "body", padding: 0 }, +}); + +$("#element").popover({ + container: "body", +}); + +$("#element").popover({ + content() { return `Elem id: ${this.id}`; }, +}); + +$("#element").popover({ + delay: { show: 500, hide: 100 }, +}); + +$("#element").popover({ + placement() { return "top"; }, +}); + +$("#element").popover({ + placement(tooltip: HTMLElement, trigger: Element) { + console.log(this.options.content); + return "top"; + }, +}); + +$("#element").popover({ + title() { return `Elem id: ${this.id}`; }, +}); + +$("#element").popover({ + viewport: "body", +}); + +// -------------------------------------------------------------------------------------- +// Alert +// -------------------------------------------------------------------------------------- $(".alert").alert(); -$(".alert").alert('close'); -$('.nav-tabs').button(); -$().button('toggle'); +$(".alert").alert("close"); + +// -------------------------------------------------------------------------------------- +// Button +// -------------------------------------------------------------------------------------- + +$(".btn").button(); + +$(".btn").button("toggle"); + +$(".btn").button("reset"); + +$(".btn").button("Swaps text to any data defined text state."); + +// -------------------------------------------------------------------------------------- +// Collapse +// -------------------------------------------------------------------------------------- $(".collapse").collapse(); -$('#myCollapsible').collapse({ toggle: false }); +$(".collapse").collapse("toggle"); -$('.carousel').carousel(); -$('.carousel').carousel({ interval: 2000 }); - -$('.typeahead').typeahead({ - matcher: item => true, - sorter: (items: any[]) => items, - updater: item => item, - highlighter: item => "" +$(".collapse").collapse({ + parent: "#selector", + toggle: false, }); -$('#navbar').affix(); +// -------------------------------------------------------------------------------------- +// Carousel +// -------------------------------------------------------------------------------------- -$('.item').emulateTransitionEnd(2000); +$(".carousel").carousel(); + +$(".carousel").carousel("cycle"); + +$(".carousel").carousel(200); + +$(".carousel").carousel({ + interval: 2000, + pause: "hover", + wrap: true, + keyboard: false, +}); + +$(".carousel").carousel({ + interval: false, +}); + +$(".carousel").carousel({ + pause: null, +}); + +// -------------------------------------------------------------------------------------- +// Affix +// -------------------------------------------------------------------------------------- + +$(".affix").affix(); + +$(".affix").affix("checkPosition"); + +$(".affix").affix({ + offset: 10, + target: window, +}); + +$(".affix").affix({ + offset: { top: 10, bottom: 5 }, +}); + +$(".affix").affix({ + offset: { top: 10 }, +}); + +$(".affix").affix({ + offset: { bottom: () => 10 }, +}); + +$(".affix").affix({ + offset: { + top: 100, + bottom() { + const that = this as BootstrapOffset; + return (that.bottom = $(".footer").outerHeight(true)!); + }, + } +}); + +$(".affix").affix({ + target: ".selector", +}); + +$(".affix").affix({ + target: document.getElementById("id")!, +}); + +$(".affix").affix({ + target: $("#id"), +}); + +// -------------------------------------------------------------------------------------- +// Transition +// -------------------------------------------------------------------------------------- + +$(".item").emulateTransitionEnd(2000); $.support.transition = false; -console.log(($.support.transition as any as TransitionEventNames).end === "transitionend"); + +console.log(($.support.transition as TransitionEventNames).end === "transitionend"); diff --git a/types/bootstrap/v3/index.d.ts b/types/bootstrap/v3/index.d.ts index 06142cc1d1..a6ddbeb1f8 100644 --- a/types/bootstrap/v3/index.d.ts +++ b/types/bootstrap/v3/index.d.ts @@ -1,21 +1,49 @@ -// Type definitions for Bootstrap 3.3.5 +// Type definitions for Bootstrap 3.3 // Project: http://twitter.github.com/bootstrap/ // Definitions by: Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 - /// -interface ModalOptions { - backdrop?: boolean|string; - keyboard?: boolean; - show?: boolean; - remote?: string; +// -------------------------------------------------------------------------- +// Some Types and Interfaces +// -------------------------------------------------------------------------- + +type BootstrapPlacement = "auto" | "top" | "bottom" | "left" | "right"; + +type BootstrapTrigger = "click" | "hover" | "focus" | "manual" | + "click hover" | "click focus" | "hover focus" | + "click hover focus"; + +type BootstrapDynamicOffset = (elem: JQuery) => number; + +interface BootstrapDelay { + show?: number; + hide?: number; } -interface ModalOptionsBackdropString { - backdrop?: string; // for "static" +interface BootstrapOffset { + top?: number | BootstrapDynamicOffset; + bottom?: number | BootstrapDynamicOffset; +} + +interface BootstrapViewport { + padding?: number; + selector: string; +} + +interface TooltipInstance { + options: T; +} + +// -------------------------------------------------------------------------------------- +// Options Interfaces +// -------------------------------------------------------------------------------------- + +interface ModalOptions { + backdrop?: boolean | "static"; keyboard?: boolean; show?: boolean; remote?: string; @@ -28,103 +56,83 @@ interface ScrollSpyOptions { interface TooltipOptions { animation?: boolean; + container?: string | false; + delay?: number | BootstrapDelay; html?: boolean; - placement?: string | Function; + placement?: BootstrapPlacement | ((this: TooltipInstance, tooltip: HTMLElement, trigger: Element) => BootstrapPlacement); selector?: string; - title?: string | Function; - trigger?: string; template?: string; - delay?: number | Object; - container?: string | boolean; - viewport?: string | Function | Object; + title?: string | ((this: Element) => string); + trigger?: BootstrapTrigger; + viewport?: string | BootstrapViewport; } -interface PopoverOptions { - animation?: boolean; - html?: boolean; - placement?: string | Function; - selector?: string; - trigger?: string; - title?: string | Function; - template?: string; - content?: any; - delay?: number | Object; - container?: string | boolean; - viewport?: string | Function | Object; +interface PopoverOptions extends TooltipOptions { + content?: string | ((this: Element) => string); } interface CollapseOptions { - parent?: any; + parent?: string | false; toggle?: boolean; } interface CarouselOptions { - interval?: number; - pause?: string; + interval?: number | false; + pause?: "hover" | null; wrap?: boolean; keyboard?: boolean; } -interface TypeaheadOptions { - source?: any; - items?: number; - minLength?: number; - matcher?: (item: any) => boolean; - sorter?: (items: any[]) => any[]; - updater?: (item: any) => any; - highlighter?: (item: any) => string; +interface AffixOptions { + offset?: number | BootstrapOffset; + target?: string | Node | JQuery | Window; } -interface AffixOptions { - offset?: number | Function | Object; - target?: any; +// -------------------------------------------------------------------------------------- +// jQuery +// -------------------------------------------------------------------------------------- + +interface JQuery { + modal(action?: "toggle" | "show" | "hide" | "handleUpdate"): JQuery; + modal(options: ModalOptions): JQuery; + + dropdown(action?: "toggle"): JQuery; + + scrollspy(action?: "refresh"): JQuery; + scrollspy(options: ScrollSpyOptions): JQuery; + + tab(action?: "show"): JQuery; + + tooltip(action?: "show" | "hide" | "toggle" | "destroy"): JQuery; + tooltip(options: TooltipOptions): JQuery; + + popover(action?: "show" | "hide" | "toggle" | "destroy"): JQuery; + popover(options: PopoverOptions): JQuery; + + alert(action?: "close"): JQuery; + + button(action?: "toggle" | "reset" | string): JQuery; + + collapse(action?: "toggle" | "show" | "hide"): JQuery; + collapse(options: CollapseOptions): JQuery; + + carousel(action?: "cycle" | "pause" | number | "prev" | "next"): JQuery; + carousel(options: CarouselOptions): JQuery; + + affix(action?: "checkPosition"): JQuery; + affix(options: AffixOptions): JQuery; + + emulateTransitionEnd(duration: number): JQuery; } +// -------------------------------------------------------------------------------------- +// Other +// -------------------------------------------------------------------------------------- + interface TransitionEventNames { end: string; } -interface JQuery { - modal(options?: ModalOptions): JQuery; - modal(options?: ModalOptionsBackdropString): JQuery; - modal(command: string, relatedTarget?: Element): JQuery; - - dropdown(): JQuery; - dropdown(command: string): JQuery; - - scrollspy(command: string): JQuery; - scrollspy(options?: ScrollSpyOptions): JQuery; - - tab(): JQuery; - tab(command: string): JQuery; - - tooltip(options?: TooltipOptions): JQuery; - tooltip(command: string): JQuery; - - popover(options?: PopoverOptions): JQuery; - popover(command: string): JQuery; - - alert(): JQuery; - alert(command: string): JQuery; - - button(): JQuery; - button(command: string): JQuery; - - collapse(options?: CollapseOptions): JQuery; - collapse(command: string): JQuery; - - carousel(options?: CarouselOptions): JQuery; - carousel(command: string): JQuery; - carousel(index: number): JQuery; - - typeahead(options?: TypeaheadOptions): JQuery; - - affix(options?: AffixOptions): JQuery; - affix(command: string): JQuery; - - emulateTransitionEnd(duration: number): JQuery; -} - interface JQuerySupport { transition: boolean | TransitionEventNames; } diff --git a/types/bootstrap/v3/tsconfig.json b/types/bootstrap/v3/tsconfig.json index 585af4f8b2..38477cd68e 100644 --- a/types/bootstrap/v3/tsconfig.json +++ b/types/bootstrap/v3/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ diff --git a/types/bootstrap/v3/tslint.json b/types/bootstrap/v3/tslint.json index a41bf5d19a..075fa88707 100644 --- a/types/bootstrap/v3/tslint.json +++ b/types/bootstrap/v3/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "no-single-declare-module": false } } diff --git a/types/bootstrap3-dialog/tsconfig.json b/types/bootstrap3-dialog/tsconfig.json index cdf93479b7..774e895668 100644 --- a/types/bootstrap3-dialog/tsconfig.json +++ b/types/bootstrap3-dialog/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/broccoli-plugin/broccoli-plugin-tests.ts b/types/broccoli-plugin/broccoli-plugin-tests.ts new file mode 100644 index 0000000000..4434fce10c --- /dev/null +++ b/types/broccoli-plugin/broccoli-plugin-tests.ts @@ -0,0 +1,46 @@ +import Plugin = require('broccoli-plugin'); + +declare function copySync(src: string, dest: string): void; +declare function setTimeout(callback: () => void, duration: number): void; + +class SlowItDown extends Plugin { + constructor(private readonly waitInMS: number) { + super([], { + annotation: `${waitInMS} ms`, + needsCache: false + }); + } + + async build() { + await new Promise(resolve => setTimeout(resolve, this.waitInMS)); + } +} + +class FileCopier extends Plugin { + constructor(inputNodes: Plugin.BroccoliNode[]) { + super(inputNodes, { + name: 'CopyFiles', + persistentOutput: true + }); + } + + build() { + for (const input of this.inputPaths) { + copySync(input, this.outputPath); + } + } + + getCallbackObject() { + return this; + } +} + +new FileCopier([ + new SlowItDown(5000), + 'src', + 'assets' +]); + +new Plugin(); // $ExpectError +new Plugin([{}]); // $ExpectError +new Plugin([], { foo: 'bar' }); // $ExpectError diff --git a/types/broccoli-plugin/index.d.ts b/types/broccoli-plugin/index.d.ts new file mode 100644 index 0000000000..36b1da65e2 --- /dev/null +++ b/types/broccoli-plugin/index.d.ts @@ -0,0 +1,78 @@ +// Type definitions for broccoli-plugin 1.3 +// Project: https://github.com/broccolijs/broccoli-plugin +// Definitions by: Dan Freeman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export = BroccoliPlugin; + +declare namespace BroccoliPlugin { + type BroccoliNode = BroccoliPlugin | string; + + interface BroccoliPluginOptions { + /** + * The name of this plugin. Defaults to `this.constructor.name`. + */ + name?: string; + + /** + * A descriptive annotation. Useful for debugging, to tell multiple + * instances of the same plugin apart. + */ + annotation?: string; + + /** + * If `true`, the output directory is not automatically emptied between + * builds. Defaults to `false`. + */ + persistentOutput?: boolean; + + /** + * If `true`, a cache directory is created automatically and the path is + * set at `cachePath`. If `false`, a cache directory is not created and + * `this.cachePath` is `undefined`. Defaults to `true`. + */ + needsCache?: boolean; + } +} + +declare class BroccoliPlugin { + constructor(inputNodes: BroccoliPlugin.BroccoliNode[], options?: BroccoliPlugin.BroccoliPluginOptions); + + /** + * An array of paths on disk corresponding to each node in `inputNodes`. + * Your plugin will read files from these paths. + */ + readonly inputPaths: ReadonlyArray; + + /** + * The path on disk corresponding to this plugin instance (this node). + * Your plugin will write files to this path. This directory is emptied by + * Broccoli before each build, unless the `persistentOutput` options is + * `true`. + */ + readonly outputPath: string; + + /** + * The path on disk to an auxiliary cache directory. Use this to store + * files that you want preserved between builds. This directory will + * only be deleted when Broccoli exits. If a cache directory is not + * needed, set `needsCache` to false when calling `broccoli-plugin` + * constructor. + */ + readonly cachePath?: string; + + /** + * Override this method in your subclass. It will be called on each + * (re-)build. All paths stay the same between builds. + * To perform asynchronous work, return a promise. + */ + build(): void | Promise; + + /** + * Advanced usage only. + * Return the object on which Broccoli will call `obj.build()`. Called + * once after instantiation. By default, returns `this`. + */ + getCallbackObject(): { build(): void | Promise }; +} diff --git a/types/broccoli-plugin/tsconfig.json b/types/broccoli-plugin/tsconfig.json new file mode 100644 index 0000000000..0f36813dc1 --- /dev/null +++ b/types/broccoli-plugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "broccoli-plugin-tests.ts" + ] +} diff --git a/types/react-i18next/v4/tslint.json b/types/broccoli-plugin/tslint.json similarity index 100% rename from types/react-i18next/v4/tslint.json rename to types/broccoli-plugin/tslint.json diff --git a/types/browser-sync/index.d.ts b/types/browser-sync/index.d.ts index bcf0aa966e..72399f1618 100644 --- a/types/browser-sync/index.d.ts +++ b/types/browser-sync/index.d.ts @@ -368,7 +368,7 @@ declare namespace browserSync { ws?: boolean; reqHeaders?: (config: object) => Hash; proxyRes?: ProxyResponseMiddleware | ProxyResponseMiddleware[]; - proxyReq?: ((res: http.ServerRequest) => void)[] | ((res: http.ServerRequest) => void); + proxyReq?: ((res: http.IncomingMessage) => void)[] | ((res: http.IncomingMessage) => void); error?: (err: NodeJS.ErrnoException, req: http.IncomingMessage, res: http.ServerResponse) => void; } @@ -457,7 +457,7 @@ declare namespace browserSync { */ (config?: Options, callback?: (err: Error, bs: object) => any): BrowserSyncInstance; /** - * + * */ instances: Array; /** @@ -547,7 +547,7 @@ declare namespace browserSync { * * @method use * @param {object} module The object to be `required`. - * @param {object} options The + * @param {object} options The * @param {any} cb A callback function that will return any errors. */ use(module: { "plugin:name"?: string, plugin: (opts: object, bs: BrowserSyncInstance) => any }, options?: object, cb?: any): void; diff --git a/types/browserslist/browserslist-tests.ts b/types/browserslist/browserslist-tests.ts new file mode 100644 index 0000000000..d5e88e5b5d --- /dev/null +++ b/types/browserslist/browserslist-tests.ts @@ -0,0 +1,22 @@ +import browserslist from "browserslist"; + +browserslist(); // $ExpectType string[] +browserslist(""); // $ExpectType string[] +browserslist([""]); // $ExpectType string[] + +const opts: browserslist.Options[] = [ + {}, + { path: "" }, + { env: "" }, + { stats: { "": { "": 0 } } }, + { config: "" }, + { ignoreUnknownVersions: false }, + { dangerousExtend: false } +]; +for (const opt of opts) { + browserslist("", opt); // $ExpectType string[] + browserslist([""], opt); // $ExpectType string[] +} + +browserslist.coverage([""]); // $ExpectType number +browserslist.coverage([""], { "": { "": 0 } }); // $ExpectType number diff --git a/types/browserslist/index.d.ts b/types/browserslist/index.d.ts new file mode 100644 index 0000000000..7c4a0add0c --- /dev/null +++ b/types/browserslist/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for browserslist 4.3 +// Project: https://github.com/browserslist/browserslist#readme +// Definitions by: Dave Cardwell +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +declare namespace browserslist { + interface Browserslist { + (queries?: string | ReadonlyArray, opts?: Options): string[]; + + coverage: (browsers: ReadonlyArray, stats?: Stats) => number; + + clearCaches: () => void; + } + + interface Stats { + [browser: string]: { + [version: string]: number; + }; + } + + interface Options { + path?: string; + env?: string; + stats?: Stats; + config?: string; + ignoreUnknownVersions?: boolean; + dangerousExtend?: boolean; + } +} + +declare var browserslist: browserslist.Browserslist; + +export = browserslist; diff --git a/types/browserslist/tsconfig.json b/types/browserslist/tsconfig.json new file mode 100644 index 0000000000..cf68d8bf64 --- /dev/null +++ b/types/browserslist/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": ["index.d.ts", "browserslist-tests.ts"] +} diff --git a/types/browserslist/tslint.json b/types/browserslist/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/browserslist/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index a8c7f403a7..dd484ce1d1 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -125,6 +125,7 @@ videoQueue.add({ video: 'http://example.com/video1.mov' }, { jobId: 1 }) pdfQueue .on('error', (err: Error) => undefined) .on('active', (job: Queue.Job, jobPromise: Queue.JobPromise) => jobPromise.cancel()) +.on('waiting', (jobId: Queue.JobId) => undefined) .on('active', (job: Queue.Job) => undefined) .on('stalled', (job: Queue.Job) => undefined) .on('progress', (job: Queue.Job) => undefined) @@ -132,4 +133,53 @@ pdfQueue .on('failed', (job: Queue.Job) => undefined) .on('paused', () => undefined) .on('resumed', () => undefined) -.on('cleaned', (jobs: Queue.Job[], status: Queue.JobStatus) => undefined); +.on('cleaned', (jobs: Queue.Job[], status: Queue.JobStatusClean) => undefined) +.on('drained', () => undefined) +.on('removed', (job: Queue.Job) => undefined); + +// test different process methods + +const profileQueue = new Queue('profile'); +// Max concurrency for requestProfile is 100 +profileQueue.process('requestProfile', 100, () => {}); +profileQueue.process(100, () => {}); + +// other tests +const myQueue = new Queue('myQueue', { + settings: { + drainDelay: 5 + }, + defaultJobOptions: { + stackTraceLimit: 1, + } +}); + +myQueue.on('active', (job: Queue.Job) => { + job.moveToCompleted(); + job.moveToCompleted('done'); + job.moveToCompleted('done', true); + job.moveToCompleted('done', true).then(val => { + if (val) { + const nextJobData: any = val[0]; + const nextJobId: Queue.JobId = val[1]; + } + }); + + job.moveToFailed({ message: "Call to external service failed!" }, true); + job.moveToFailed(new Error('test error'), true); + job.moveToFailed(new Error('test error'), true).then(val => { + if (val) { + const nextJobData: any = val[0]; + const nextJobId: Queue.JobId = val[1]; + } + }); + + job.discard(); +}); + +// test all constructor options: + +new Queue('profile'); +new Queue('profile', 'url'); +new Queue('profile', { prefix: 'test' }); +new Queue('profile', 'url', { prefix: 'test' }); diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index ac820290f2..6096d98145 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bull 3.3 +// Type definitions for bull 3.4 // Project: https://github.com/OptimalBits/bull // Definitions by: Bruno Grieder // Cameron Crothers @@ -10,6 +10,8 @@ // Bond Akinmade // Wuha Team // Alec Brunelle +// Dan Manastireanu +// Kjell-Morten Bratsberg Thorsen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -23,9 +25,9 @@ import * as Promise from "bluebird"; */ declare const Bull: { (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; - (queueName: string, url?: string): Bull.Queue; // tslint:disable-line unified-signatures + (queueName: string, url: string, opts?: Bull.QueueOptions): Bull.Queue; // tslint:disable-line unified-signatures new (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; - new (queueName: string, url?: string): Bull.Queue; // tslint:disable-line unified-signatures + new (queueName: string, url: string, opts?: Bull.QueueOptions): Bull.Queue; // tslint:disable-line unified-signatures }; declare namespace Bull { @@ -92,6 +94,12 @@ declare namespace Bull { backoffStrategies?: { [key: string]: (attemptsMade: number, err: typeof Error) => number; }; + + /** + * A timeout for when the queue is in `drained` state (empty waiting for jobs). + * It is used when calling `queue.getNextJob()`, which will pass it to `.brpoplpush` on the Redis client. + */ + drainDelay?: number; } type DoneCallback = (error?: Error | null, value?: any) => void; @@ -141,6 +149,11 @@ declare namespace Bull { */ retry(): Promise; + /** + * Ensure this job is never ran again even if attemptsMade is less than job.attempts. + */ + discard(): Promise; + /** * Returns a promise that resolves to the returned data when the job has been finished. * TODO: Add a watchdog to check if the job has finished periodically. @@ -148,6 +161,18 @@ declare namespace Bull { */ finished(): Promise; + /** + * Moves a job to the `completed` queue. Pulls a job from 'waiting' to 'active' + * and returns a tuple containing the next jobs data and id. If no job is in the `waiting` queue, returns null. + */ + moveToCompleted(returnValue?: string, ignoreLock?: boolean): Promise<[any, JobId] | null>; + + /** + * Moves a job to the `failed` queue. Pulls a job from 'waiting' to 'active' + * and returns a tuple containing the next jobs data and id. If no job is in the `waiting` queue, returns null. + */ + moveToFailed(errorInfo: { message: string; }, ignoreLock?: boolean): Promise<[any, JobId] | null>; + /** * Promotes a job that is currently "delayed" to the "waiting" state and executed as soon as possible. */ @@ -170,6 +195,7 @@ declare namespace Bull { } type JobStatus = 'completed' | 'waiting' | 'active' | 'delayed' | 'failed'; + type JobStatusClean = 'completed' | 'wait' | 'active' | 'delayed' | 'failed'; interface BackoffOptions { /** @@ -205,6 +231,11 @@ declare namespace Bull { * Cron pattern specifying when the job should execute */ cron: string; + + /** + * Start date when the repeat job should start repeating (only with cron). + */ + startDate?: Date | string | number; } interface EveryRepeatOptions extends RepeatOptions { @@ -273,6 +304,11 @@ declare namespace Bull { * Default behavior is to keep the job in the completed set. */ removeOnFail?: boolean; + + /** + * Limits the amount of stack trace lines that will be recorded in the stacktrace. + */ + stackTraceLimit?: number; } interface JobCounts { @@ -601,12 +637,12 @@ declare namespace Bull { /** * Tells the queue remove all jobs created outside of a grace period in milliseconds. - * You can clean the jobs with the following states: completed, waiting, active, delayed, and failed. + * You can clean the jobs with the following states: completed, wait (typo for waiting), active, delayed, and failed. * @param grace Grace period in milliseconds. * @param status Status of the job to clean. Values are completed, wait, active, delayed, and failed. Defaults to completed. * @param limit Maximum amount of jobs to clean per call. If not provided will clean all matching jobs. */ - clean(grace: number, status?: JobStatus, limit?: number): Promise>>; + clean(grace: number, status?: JobStatusClean, limit?: number): Promise>>; /** * Listens to queue events @@ -618,6 +654,11 @@ declare namespace Bull { */ on(event: 'error', callback: ErrorEventCallback): this; + /** + * A Job is waiting to be processed as soon as a worker is idling. + */ + on(event: 'waiting', callback: WaitingEventCallback): this; + /** * A job has started. You can use `jobPromise.cancel()` to abort it */ @@ -654,6 +695,11 @@ declare namespace Bull { */ on(event: 'resumed', callback: EventCallback): this; // tslint:disable-line unified-signatures + /** + * A job successfully removed. + */ + on(event: 'removed', callback: RemovedEventCallback): this; + /** * Old jobs have been cleaned from the queue. * `jobs` is an array of jobs that were removed, and `type` is the type of those jobs. @@ -661,6 +707,12 @@ declare namespace Bull { * @see Queue#clean() for details */ on(event: 'cleaned', callback: CleanedEventCallback): this; + + /** + * Emitted every time the queue has processed all the waiting jobs + * (even if there can be some delayed jobs not yet processed) + */ + on(event: 'drained', callback: EventCallback): this; // tslint:disable-line unified-signatures } type EventCallback = () => void; @@ -684,7 +736,11 @@ declare namespace Bull { type FailedEventCallback = (job: Job, error: Error) => void; - type CleanedEventCallback = (jobs: Array>, status: JobStatus) => void; + type CleanedEventCallback = (jobs: Array>, status: JobStatusClean) => void; + + type RemovedEventCallback = (job: Job) => void; + + type WaitingEventCallback = (jobId: JobId) => void; } export = Bull; diff --git a/types/bunyan-winston-adapter/index.d.ts b/types/bunyan-winston-adapter/index.d.ts index 718c9804e1..1ce6ae0a8b 100644 --- a/types/bunyan-winston-adapter/index.d.ts +++ b/types/bunyan-winston-adapter/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/gluwer/bunyan-winston-adapter // Definitions by: Steve Hipwell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.2 import * as bunyan from "bunyan"; import { Logger } from "winston"; diff --git a/types/bunyan/bunyan-tests.ts b/types/bunyan/bunyan-tests.ts index e1d1861049..1072ec2031 100644 --- a/types/bunyan/bunyan-tests.ts +++ b/types/bunyan/bunyan-tests.ts @@ -6,6 +6,14 @@ const ringBufferOptions: Logger.RingBufferOptions = { const ringBuffer: Logger.RingBuffer = new Logger.RingBuffer(ringBufferOptions); ringBuffer.write("hello"); +const rotatingFileStreamOptions: Logger.RotatingFileStreamOptions = { + period: "1d", + count: 10, + path: "path" +}; +const rotatingFileStream: Logger.RotatingFileStream = new Logger.RotatingFileStream(rotatingFileStreamOptions); +rotatingFileStream.write("hello"); + let level: number; level = Logger.resolveLevel("trace"); level = Logger.resolveLevel("debug"); @@ -49,6 +57,11 @@ const options: Logger.LoggerOptions = { stream: ringBuffer, level: Logger.ERROR, reemitErrorEvents: true + }, { + type: 'raw', + stream: rotatingFileStream, + level: Logger.ERROR, + reemitErrorEvents: true }] }; diff --git a/types/bunyan/index.d.ts b/types/bunyan/index.d.ts index 4ee972d29c..f6f0b287aa 100644 --- a/types/bunyan/index.d.ts +++ b/types/bunyan/index.d.ts @@ -270,6 +270,29 @@ declare namespace Logger { destroy(): void; destroySoon(): void; } + + interface RotatingFileStreamOptions { + path: string; + count?: number; + period?: string; + } + + class RotatingFileStream extends EventEmitter implements NodeJS.WritableStream { + constructor(options: RotatingFileStreamOptions); + + writable: boolean; + periodNum: number; + periodScope: string; + stream: any; + rotQueue: any[]; + rotating: boolean; + + write(record: any): boolean; + end(record?: any): void; + destroy(): void; + destroySoon(): void; + rotate(): void; + } } export = Logger; diff --git a/types/business-rules-engine/Validation.d.ts b/types/business-rules-engine/Validation.d.ts index 7f61f517be..bff7bf6243 100644 --- a/types/business-rules-engine/Validation.d.ts +++ b/types/business-rules-engine/Validation.d.ts @@ -1,239 +1 @@ -// Type definitions for business-rules-engine - v1.0.20 -// Project: https://github.com/rsamec/form -// Definitions by: Roman Samec -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace Validation { - interface IErrorCustomMessage { - (config: any, args: any): string; - } - interface IPropertyValidator { - isAcceptable(s: any): boolean; - customMessage?: IErrorCustomMessage; - tagName?: string; - } - interface IStringValidator extends IPropertyValidator { - isAcceptable(s: string): boolean; - } - interface IAsyncPropertyValidator { - isAcceptable(s: any): Q.Promise; - customMessage?: IErrorCustomMessage; - isAsync: boolean; - tagName?: string; - } - interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator { - isAcceptable(s: string): Q.Promise; - } - enum CompareOperator { - LessThan = 0, - LessThanEqual = 1, - Equal = 2, - NotEqual = 3, - GreaterThanEqual = 4, - GreaterThan = 5, - } - interface IError { - HasError: boolean; - ErrorMessage: string; - TranslateArgs?: IErrorTranslateArgs; - } - interface IErrorTranslateArgs { - TranslateId: string; - MessageArgs: any; - CustomMessage?: IErrorCustomMessage; - } - interface IOptional { - (): boolean; - } - interface IValidationFailure extends IError { - IsAsync: boolean; - Error: IError; - } - interface IValidationResult { - Name: string; - Add(validationResult: IValidationResult): void; - Remove(index: number): void; - Children: IValidationResult[]; - HasErrors: boolean; - HasErrorsDirty: boolean; - ErrorMessage: string; - ErrorCount: number; - Optional?: IOptional; - TranslateArgs?: IErrorTranslateArgs[]; - } - interface IValidate { - (args: IError): void; - } - interface IAsyncValidate { - (args: IError): Q.Promise; - } - interface IValidatorFce { - Name: string; - ValidationFce?: IValidate; - AsyncValidationFce?: IAsyncValidate; - } - interface IValidator { - Validate(context: any): IValidationFailure; - ValidateAsync(context: any): Q.Promise; - Error: IError; - } - interface IAbstractValidator { - RuleFor(prop: string, validator: IPropertyValidator): any; - ValidationFor(prop: string, validatorFce: IValidatorFce): any; - Validation(validatorFce: IValidatorFce): any; - ValidatorFor(prop: string, validator: IAbstractValidator): any; - CreateRule(name: string): IAbstractValidationRule; - CreateAbstractRule(name: string): IAbstractValidationRule; - CreateAbstractListRule(name: string): IAbstractValidationRule; - ForList: boolean; - } - interface IAbstractValidationRule { - Validate(context: T): IValidationResult; - ValidateAsync(context: T): Q.Promise; - ValidateAll(context: T): Q.Promise; - ValidateProperty(context: T, propName: string): void; - ValidationResult: IValidationResult; - Rules: { - [name: string]: IPropertyValidationRule; - }; - Validators: { - [name: string]: IValidator; - }; - Children: { - [name: string]: IAbstractValidationRule; - }; - } - interface IPropertyValidationRule { - Validators: { - [name: string]: any; - }; - Validate(context: IValidationContext): IValidationFailure[]; - ValidateAsync(context: IValidationContext): Q.Promise; - } - interface IValidationContext { - Value: string; - Key: string; - Data: T; - } - class Error implements IError { - public HasError: boolean; - public ErrorMessage: string; - constructor(); - } - class ValidationFailure implements IError { - public Error: IError; - public IsAsync: boolean; - constructor(Error: IError, IsAsync: boolean); - public HasError : boolean; - public ErrorMessage : string; - public TranslateArgs : IErrorTranslateArgs; - } - class ValidationResult implements IValidationResult { - public Name: string; - constructor(Name: string); - public IsDirty: boolean; - public Children : IValidationResult[]; - public Add(error: IValidationResult): void; - public Remove(index: number): void; - public Optional: IOptional; - public TranslateArgs: IErrorTranslateArgs[]; - public HasErrorsDirty : boolean; - public HasErrors : boolean; - public ErrorCount : number; - public ErrorMessage : string; - } - class CompositeValidationResult implements IValidationResult { - public Name: string; - public Children: IValidationResult[]; - constructor(Name: string); - public Optional: IOptional; - public AddFirst(error: IValidationResult): void; - public Add(error: IValidationResult): void; - public Remove(index: number): void; - public HasErrorsDirty : boolean; - public HasErrors : boolean; - public ErrorCount : number; - public ErrorMessage : string; - public TranslateArgs : IErrorTranslateArgs[]; - public LogErrors(headerMessage?: string): void; - public Errors : { - [name: string]: IValidationResult; - }; - private FlattenErros; - public SetDirty(): void; - public SetPristine(): void; - private SetDirtyEx(node, dirty); - private flattenErrors(node, errorCollection); - private traverse(node, indent); - } - class AbstractValidator implements IAbstractValidator { - public Validators: { - [name: string]: IPropertyValidator[]; - }; - public AbstractValidators: { - [name: string]: IAbstractValidator; - }; - public ValidationFunctions: { - [name: string]: IValidatorFce[]; - }; - public RuleFor(prop: string, validator: IPropertyValidator): void; - public ValidationFor(prop: string, fce: IValidatorFce): void; - public Validation(fce: IValidatorFce): void; - public ValidatorFor(prop: string, validator: IAbstractValidator, forList?: boolean): void; - public CreateAbstractRule(name: string): IAbstractValidationRule; - public CreateAbstractListRule(name: string): IAbstractValidationRule; - public CreateRule(name: string): IAbstractValidationRule; - public ForList: boolean; - } - class MessageLocalization { - static customMsg: string; - static defaultMessages: { - "required": string; - "remote": string; - "email": string; - "url": string; - "date": string; - "dateISO": string; - "number": string; - "digits": string; - "signedDigits": string; - "creditcard": string; - "equalTo": string; - "maxlength": string; - "minlength": string; - "rangelength": string; - "range": string; - "max": string; - "min": string; - "step": string; - "contains": string; - "mask": string; - "custom": string; - }; - static ValidationMessages: { - "required": string; - "remote": string; - "email": string; - "url": string; - "date": string; - "dateISO": string; - "number": string; - "digits": string; - "signedDigits": string; - "creditcard": string; - "equalTo": string; - "maxlength": string; - "minlength": string; - "rangelength": string; - "range": string; - "max": string; - "min": string; - "step": string; - "contains": string; - "mask": string; - "custom": string; - }; - static GetValidationMessage(validator: any): string; - } -} declare module "node-validation" {export = Validation;} diff --git a/types/business-rules-engine/index.d.ts b/types/business-rules-engine/index.d.ts index d85cd49c81..593eb92f51 100644 --- a/types/business-rules-engine/index.d.ts +++ b/types/business-rules-engine/index.d.ts @@ -4,242 +4,237 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Source: typings/business-rules-engine/Validation.d.ts - import * as Q from "q"; -declare namespace Validation { - interface IErrorCustomMessage { - (config: any, args: any): string; - } - interface IPropertyValidator { - isAcceptable(s: any): boolean; - customMessage?: IErrorCustomMessage; - tagName?: string; - } - interface IStringValidator extends IPropertyValidator { - isAcceptable(s: string): boolean; - } - interface IAsyncPropertyValidator { - isAcceptable(s: any): Q.Promise; - customMessage?: IErrorCustomMessage; - isAsync: boolean; - tagName?: string; - } - interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator { - isAcceptable(s: string): Q.Promise; - } - enum CompareOperator { - LessThan = 0, - LessThanEqual = 1, - Equal = 2, - NotEqual = 3, - GreaterThanEqual = 4, - GreaterThan = 5, - } - interface IError { - HasError: boolean; - ErrorMessage: string; - TranslateArgs?: IErrorTranslateArgs; - } - interface IErrorTranslateArgs { - TranslateId: string; - MessageArgs: any; - CustomMessage?: IErrorCustomMessage; - } - interface IOptional { - (): boolean; - } - interface IValidationFailure extends IError { - IsAsync: boolean; - Error: IError; - } - interface IValidationResult { - Name: string; - Add(validationResult: IValidationResult): void; - Remove(index: number): void; - Children: IValidationResult[]; - HasErrors: boolean; - HasErrorsDirty: boolean; - ErrorMessage: string; - ErrorCount: number; - Optional?: IOptional; - TranslateArgs?: IErrorTranslateArgs[]; - } - interface IValidate { - (args: IError): void; - } - interface IAsyncValidate { - (args: IError): Q.Promise; - } - interface IValidatorFce { - Name: string; - ValidationFce?: IValidate; - AsyncValidationFce?: IAsyncValidate; - } - interface IValidator { - Validate(context: any): IValidationFailure; - ValidateAsync(context: any): Q.Promise; - Error: IError; - } - interface IAbstractValidator { - RuleFor(prop: string, validator: IPropertyValidator): any; - ValidationFor(prop: string, validatorFce: IValidatorFce): any; - Validation(validatorFce: IValidatorFce): any; - ValidatorFor(prop: string, validator: IAbstractValidator): any; - CreateRule(name: string): IAbstractValidationRule; - CreateAbstractRule(name: string): IAbstractValidationRule; - CreateAbstractListRule(name: string): IAbstractValidationRule; - ForList: boolean; - } - interface IAbstractValidationRule { - Validate(context: T): IValidationResult; - ValidateAsync(context: T): Q.Promise; - ValidateAll(context: T): Q.Promise; - ValidateProperty(context: T, propName: string): void; - ValidationResult: IValidationResult; - Rules: { - [name: string]: IPropertyValidationRule; - }; - Validators: { - [name: string]: IValidator; - }; - Children: { - [name: string]: IAbstractValidationRule; - }; - } - interface IPropertyValidationRule { - Validators: { - [name: string]: any; - }; - Validate(context: IValidationContext): IValidationFailure[]; - ValidateAsync(context: IValidationContext): Q.Promise; - } - interface IValidationContext { - Value: string; - Key: string; - Data: T; - } - class Error implements IError { - public HasError: boolean; - public ErrorMessage: string; - constructor(); - } - class ValidationFailure implements IError { - public Error: IError; - public IsAsync: boolean; - constructor(Error: IError, IsAsync: boolean); - public HasError : boolean; - public ErrorMessage : string; - public TranslateArgs : IErrorTranslateArgs; - } - class ValidationResult implements IValidationResult { - public Name: string; - constructor(Name: string); - public IsDirty: boolean; - public Children : IValidationResult[]; - public Add(error: IValidationResult): void; - public Remove(index: number): void; - public Optional: IOptional; - public TranslateArgs: IErrorTranslateArgs[]; - public HasErrorsDirty : boolean; - public HasErrors : boolean; - public ErrorCount : number; - public ErrorMessage : string; - } - class CompositeValidationResult implements IValidationResult { - public Name: string; - public Children: IValidationResult[]; - constructor(Name: string); - public Optional: IOptional; - public AddFirst(error: IValidationResult): void; - public Add(error: IValidationResult): void; - public Remove(index: number): void; - public HasErrorsDirty : boolean; - public HasErrors : boolean; - public ErrorCount : number; - public ErrorMessage : string; - public TranslateArgs : IErrorTranslateArgs[]; - public LogErrors(headerMessage?: string): void; - public Errors : { - [name: string]: IValidationResult; - }; - private FlattenErros; - public SetDirty(): void; - public SetPristine(): void; - private SetDirtyEx(node, dirty); - private flattenErrors(node, errorCollection); - private traverse(node, indent); - } - class AbstractValidator implements IAbstractValidator { - public Validators: { - [name: string]: IPropertyValidator[]; - }; - public AbstractValidators: { - [name: string]: IAbstractValidator; - }; - public ValidationFunctions: { - [name: string]: IValidatorFce[]; - }; - public RuleFor(prop: string, validator: IPropertyValidator): void; - public ValidationFor(prop: string, fce: IValidatorFce): void; - public Validation(fce: IValidatorFce): void; - public ValidatorFor(prop: string, validator: IAbstractValidator, forList?: boolean): void; - public CreateAbstractRule(name: string): IAbstractValidationRule; - public CreateAbstractListRule(name: string): IAbstractValidationRule; - public CreateRule(name: string): IAbstractValidationRule; - public ForList: boolean; - } - class MessageLocalization { - static customMsg: string; - static defaultMessages: { - "required": string; - "remote": string; - "email": string; - "url": string; - "date": string; - "dateISO": string; - "number": string; - "digits": string; - "signedDigits": string; - "creditcard": string; - "equalTo": string; - "maxlength": string; - "minlength": string; - "rangelength": string; - "range": string; - "max": string; - "min": string; - "step": string; - "contains": string; - "mask": string; - "custom": string; - }; - static ValidationMessages: { - "required": string; - "remote": string; - "email": string; - "url": string; - "date": string; - "dateISO": string; - "number": string; - "digits": string; - "signedDigits": string; - "creditcard": string; - "equalTo": string; - "maxlength": string; - "minlength": string; - "rangelength": string; - "range": string; - "max": string; - "min": string; - "step": string; - "contains": string; - "mask": string; - "custom": string; - }; - static GetValidationMessage(validator: any): string; - } +export interface IErrorCustomMessage { + (config: any, args: any): string; +} +export interface IPropertyValidator { + isAcceptable(s: any): boolean; + customMessage?: IErrorCustomMessage; + tagName?: string; +} +export interface IStringValidator extends IPropertyValidator { + isAcceptable(s: string): boolean; +} +export interface IAsyncPropertyValidator { + isAcceptable(s: any): Q.Promise; + customMessage?: IErrorCustomMessage; + isAsync: boolean; + tagName?: string; +} +export interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator { + isAcceptable(s: string): Q.Promise; +} +export enum CompareOperator { + LessThan = 0, + LessThanEqual = 1, + Equal = 2, + NotEqual = 3, + GreaterThanEqual = 4, + GreaterThan = 5, +} +export interface IError { + HasError: boolean; + ErrorMessage: string; + TranslateArgs?: IErrorTranslateArgs; +} +export interface IErrorTranslateArgs { + TranslateId: string; + MessageArgs: any; + CustomMessage?: IErrorCustomMessage; +} +export interface IOptional { + (): boolean; +} +export interface IValidationFailure extends IError { + IsAsync: boolean; + Error: IError; +} +export interface IValidationResult { + Name: string; + Add(validationResult: IValidationResult): void; + Remove(index: number): void; + Children: IValidationResult[]; + HasErrors: boolean; + HasErrorsDirty: boolean; + ErrorMessage: string; + ErrorCount: number; + Optional?: IOptional; + TranslateArgs?: IErrorTranslateArgs[]; +} +export interface IValidate { + (args: IError): void; +} +export interface IAsyncValidate { + (args: IError): Q.Promise; +} +export interface IValidatorFce { + Name: string; + ValidationFce?: IValidate; + AsyncValidationFce?: IAsyncValidate; +} +export interface IValidator { + Validate(context: any): IValidationFailure; + ValidateAsync(context: any): Q.Promise; + Error: IError; +} +export interface IAbstractValidator { + RuleFor(prop: string, validator: IPropertyValidator): any; + ValidationFor(prop: string, validatorFce: IValidatorFce): any; + Validation(validatorFce: IValidatorFce): any; + ValidatorFor(prop: string, validator: IAbstractValidator): any; + CreateRule(name: string): IAbstractValidationRule; + CreateAbstractRule(name: string): IAbstractValidationRule; + CreateAbstractListRule(name: string): IAbstractValidationRule; + ForList: boolean; +} +export interface IAbstractValidationRule { + Validate(context: T): IValidationResult; + ValidateAsync(context: T): Q.Promise; + ValidateAll(context: T): Q.Promise; + ValidateProperty(context: T, propName: string): void; + ValidationResult: IValidationResult; + Rules: { + [name: string]: IPropertyValidationRule; + }; + Validators: { + [name: string]: IValidator; + }; + Children: { + [name: string]: IAbstractValidationRule; + }; +} +export interface IPropertyValidationRule { + Validators: { + [name: string]: any; + }; + Validate(context: IValidationContext): IValidationFailure[]; + ValidateAsync(context: IValidationContext): Q.Promise; +} +export interface IValidationContext { + Value: string; + Key: string; + Data: T; +} +export class Error implements IError { + public HasError: boolean; + public ErrorMessage: string; + constructor(); +} +export class ValidationFailure implements IError { + public Error: IError; + public IsAsync: boolean; + constructor(Error: IError, IsAsync: boolean); + public HasError : boolean; + public ErrorMessage : string; + public TranslateArgs : IErrorTranslateArgs; +} +export class ValidationResult implements IValidationResult { + public Name: string; + constructor(Name: string); + public IsDirty: boolean; + public Children : IValidationResult[]; + public Add(error: IValidationResult): void; + public Remove(index: number): void; + public Optional: IOptional; + public TranslateArgs: IErrorTranslateArgs[]; + public HasErrorsDirty : boolean; + public HasErrors : boolean; + public ErrorCount : number; + public ErrorMessage : string; +} +export class CompositeValidationResult implements IValidationResult { + public Name: string; + public Children: IValidationResult[]; + constructor(Name: string); + public Optional: IOptional; + public AddFirst(error: IValidationResult): void; + public Add(error: IValidationResult): void; + public Remove(index: number): void; + public HasErrorsDirty : boolean; + public HasErrors : boolean; + public ErrorCount : number; + public ErrorMessage : string; + public TranslateArgs : IErrorTranslateArgs[]; + public LogErrors(headerMessage?: string): void; + public Errors : { + [name: string]: IValidationResult; + }; + private FlattenErros; + public SetDirty(): void; + public SetPristine(): void; + private SetDirtyEx(node, dirty); + private flattenErrors(node, errorCollection); + private traverse(node, indent); +} +export class AbstractValidator implements IAbstractValidator { + public Validators: { + [name: string]: IPropertyValidator[]; + }; + public AbstractValidators: { + [name: string]: IAbstractValidator; + }; + public ValidationFunctions: { + [name: string]: IValidatorFce[]; + }; + public RuleFor(prop: string, validator: IPropertyValidator): void; + public ValidationFor(prop: string, fce: IValidatorFce): void; + public Validation(fce: IValidatorFce): void; + public ValidatorFor(prop: string, validator: IAbstractValidator, forList?: boolean): void; + public CreateAbstractRule(name: string): IAbstractValidationRule; + public CreateAbstractListRule(name: string): IAbstractValidationRule; + public CreateRule(name: string): IAbstractValidationRule; + public ForList: boolean; +} +export class MessageLocalization { + static customMsg: string; + static defaultMessages: { + "required": string; + "remote": string; + "email": string; + "url": string; + "date": string; + "dateISO": string; + "number": string; + "digits": string; + "signedDigits": string; + "creditcard": string; + "equalTo": string; + "maxlength": string; + "minlength": string; + "rangelength": string; + "range": string; + "max": string; + "min": string; + "step": string; + "contains": string; + "mask": string; + "custom": string; + }; + static ValidationMessages: { + "required": string; + "remote": string; + "email": string; + "url": string; + "date": string; + "dateISO": string; + "number": string; + "digits": string; + "signedDigits": string; + "creditcard": string; + "equalTo": string; + "maxlength": string; + "minlength": string; + "rangelength": string; + "range": string; + "max": string; + "min": string; + "step": string; + "contains": string; + "mask": string; + "custom": string; + }; + static GetValidationMessage(validator: any): string; } -export = Validation; export as namespace Validation; diff --git a/types/caller/caller-tests.ts b/types/caller/caller-tests.ts new file mode 100644 index 0000000000..81d8d64606 --- /dev/null +++ b/types/caller/caller-tests.ts @@ -0,0 +1,4 @@ +import caller = require('caller'); + +const callerFile: string = caller(); +const callerFile2: string = caller(1); diff --git a/types/caller/index.d.ts b/types/caller/index.d.ts new file mode 100644 index 0000000000..f09b6f129b --- /dev/null +++ b/types/caller/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for caller 1.0 +// Project: https://github.com/totherik/caller +// Definitions by: Ignocide +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function caller(depth?: number): string; + +export = caller; diff --git a/types/caller/tsconfig.json b/types/caller/tsconfig.json new file mode 100644 index 0000000000..80ae4b956e --- /dev/null +++ b/types/caller/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "caller-tests.ts" + ] +} diff --git a/types/caller/tslint.json b/types/caller/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/caller/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/caniuse-api/caniuse-api-tests.ts b/types/caniuse-api/caniuse-api-tests.ts new file mode 100644 index 0000000000..46b6a1eec4 --- /dev/null +++ b/types/caniuse-api/caniuse-api-tests.ts @@ -0,0 +1,17 @@ +import * as caniuse from "caniuse-api"; + +caniuse.features; // $ExpectType string[] + +caniuse.getSupport(""); // $ExpectType BrowserSupport + +caniuse.isSupported("", ""); // $ExpectType boolean +caniuse.isSupported("", [""]); // $ExpectType boolean + +caniuse.find(""); // $ExpectType string[] + +caniuse.getLatestStableBrowsers(); // $ExpectType string[] + +caniuse.setBrowserScope(""); // $ExpectType void +caniuse.setBrowserScope([""]); // $ExpectType void + +caniuse.getBrowserScope(); // $ExpectType string[] diff --git a/types/caniuse-api/index.d.ts b/types/caniuse-api/index.d.ts new file mode 100644 index 0000000000..ce6dac23ec --- /dev/null +++ b/types/caniuse-api/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for caniuse-api 3.0 +// Project: https://github.com/nyalab/caniuse-api#readme +// Definitions by: Dave Cardwell +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export const features: string[]; + +export interface BrowserSupport { + [browser: string]: { + y?: number; + n?: number; + a?: number; + x?: number; + }; +} + +export function getSupport(feature: string): BrowserSupport; + +export function isSupported( + feature: string, + browsers: string | ReadonlyArray +): boolean; + +export function find(query: string): string[]; + +export function getLatestStableBrowsers(): string[]; + +export function setBrowserScope( + browserscope: string | ReadonlyArray +): void; + +export function getBrowserScope(): string[]; diff --git a/types/caniuse-api/tsconfig.json b/types/caniuse-api/tsconfig.json new file mode 100644 index 0000000000..2e43754f9e --- /dev/null +++ b/types/caniuse-api/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "caniuse-api-tests.ts"] +} diff --git a/types/caniuse-api/tslint.json b/types/caniuse-api/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/caniuse-api/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cassandra-driver/index.d.ts b/types/cassandra-driver/index.d.ts index 33a9f5988f..f57f203a03 100644 --- a/types/cassandra-driver/index.d.ts +++ b/types/cassandra-driver/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cassandra-driver v3.4.1 +// Type definitions for cassandra-driver v3.5.0 // Project: https://github.com/datastax/nodejs-driver // Definitions by: Marc Fisher // Christian D @@ -413,7 +413,7 @@ export namespace types { pageState: string; nextPage: Function; - first(): Row; + first(): Row | null; getPageState(): string; getColumns(): Array<{ [key: string]: string; }>; wasApplied(): boolean; @@ -526,7 +526,8 @@ export interface ClientOptions { protocolOptions?: { port?: number, maxSchemaAgreementWaitSeconds?: number, - maxVersion?: number + maxVersion?: number, + noCompact?: boolean }, socketOptions?: { connectTimeout?: number, diff --git a/types/catbox-memory/catbox-memory-tests.ts b/types/catbox-memory/catbox-memory-tests.ts new file mode 100644 index 0000000000..9c4c1bcdfe --- /dev/null +++ b/types/catbox-memory/catbox-memory-tests.ts @@ -0,0 +1,8 @@ +import * as CatboxMemory from 'catbox-memory'; + +const client = new CatboxMemory({ + allowMixedContent: true, + cloneBuffersOnGet: false, + maxByteSize: 1024, + minCleanupIntervalMsec: 1000, +}); diff --git a/types/catbox-memory/index.d.ts b/types/catbox-memory/index.d.ts new file mode 100644 index 0000000000..b615d6c45d --- /dev/null +++ b/types/catbox-memory/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for catbox-memory 4.0 +// Project: https://github.com/hapijs/catbox-memory#readme +// Definitions by: Simon Schick +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ClientApi } from 'catbox'; + +interface CatboxMemory extends ClientApi {} + +// tslint:disable-next-line:no-unnecessary-class +declare class CatboxMemory implements ClientApi { + constructor(options?: CatboxMemory.Options); +} + +declare namespace CatboxMemory { + interface Options { + /** + * Sets an upper limit on the number of bytes that can be stored in the cache. + * Once this limit is reached no additional items will be added to the cache until some expire. + * The utilized memory calculation is a rough approximation and must not be relied on. + * @default 104857600 (100MB). + */ + maxByteSize?: number; + /** + * The minimum number of milliseconds in between each cache cleanup. + * @default 1000 (1 second) + */ + minCleanupIntervalMsec?: number; + /** + * by default, all data is cached as JSON strings, and converted to an object using JSON.parse() on retrieval. + * By setting this option to true, Buffer data can be stored alongside the stringified data. + * Buffers are not stringified, and are copied before storage to prevent the value from changing while in the cache. + * @default false + */ + allowMixedContent?: boolean; + /** + * by default, buffers stored in the cache with allowMixedContent set to true are copied when they are set but not when they are retrieved. + * This means a change to the buffer returned by a get() will change the value in the cache. To prevent this, + * set cloneBuffersOnGet to true to always return a copy of the cached buffer. + * @default false + */ + cloneBuffersOnGet?: boolean; + } +} + +export = CatboxMemory; diff --git a/types/catbox-memory/tsconfig.json b/types/catbox-memory/tsconfig.json new file mode 100644 index 0000000000..c52e660d39 --- /dev/null +++ b/types/catbox-memory/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "catbox-memory-tests.ts" + ] +} diff --git a/types/catbox-memory/tslint.json b/types/catbox-memory/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/catbox-memory/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/catbox-redis/catbox-redis-tests.ts b/types/catbox-redis/catbox-redis-tests.ts index d7fb5eb701..91d86445b7 100644 --- a/types/catbox-redis/catbox-redis-tests.ts +++ b/types/catbox-redis/catbox-redis-tests.ts @@ -1,6 +1,6 @@ import * as CatbotRedis from 'catbox-redis'; -const cache = new CatbotRedis({ +const cache = new CatbotRedis({ host: 'localhost', partition: 'test', port: 2018, @@ -10,3 +10,8 @@ cache.get({ segment: 'test', id: 'test', }); + +cache.set({ + segment: 'test', + id: 'test', +}, 'test', 123); diff --git a/types/catbox-redis/index.d.ts b/types/catbox-redis/index.d.ts index a0d3590953..18972c6493 100644 --- a/types/catbox-redis/index.d.ts +++ b/types/catbox-redis/index.d.ts @@ -53,7 +53,7 @@ declare module 'catbox-redis' { sentinelName?: string; } } - class CatboxRedis extends Client { + class CatboxRedis extends Client { constructor(options: CatboxRedis.CatboxRedisOptions); } export = CatboxRedis; diff --git a/types/catbox/catbox-tests.ts b/types/catbox/catbox-tests.ts index 25d4826d25..e86d2a94af 100644 --- a/types/catbox/catbox-tests.ts +++ b/types/catbox/catbox-tests.ts @@ -1,16 +1,22 @@ -import { CacheItem, Client, Policy, EnginePrototypeOrObject } from "catbox"; +import { Client, Policy, EnginePrototypeOrObject, DecoratedResult, CachedObject } from "catbox"; const Memory: EnginePrototypeOrObject = { async start(): Promise {}, stop(): void {}, - async get(): Promise {}, + async get(): Promise> { + return { + item: 'asd', + stored: 12, + ttl: 123, + }; + }, async set(): Promise {}, async drop(): Promise {}, isReady(): boolean { return true; }, validateSegmentName(segment: string): null { return null; }, }; -const client = new Client(Memory, { partition: 'cache' }); +const client = new Client(Memory, { partition: 'cache' }); const cache = new Policy({ expiresIn: 5000, @@ -25,3 +31,11 @@ cache.drop('foo').then(() => {}); cache.isReady(); cache.stats(); + +const decoratedCache = new Policy({ + getDecoratedValue: true, +}, client, 'cache2'); + +decoratedCache.get('test').then((a: DecoratedResult) => { + const res: string = a.value; +}); diff --git a/types/catbox/index.d.ts b/types/catbox/index.d.ts index f6881b1aef..2a17490dd4 100644 --- a/types/catbox/index.d.ts +++ b/types/catbox/index.d.ts @@ -4,7 +4,7 @@ // AJP // Rodrigo Saboya // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 /** * Client @@ -17,7 +17,7 @@ * the Riak bucket, or as a key prefix in Redis and Memcached. To share the cache across multiple clients, use the same partition name. * @see {@link https://github.com/hapijs/catbox#client} */ -export class Client implements ClientApi { +export class Client implements ClientApi { constructor(engine: EnginePrototypeOrObject, options: ClientOptions); /** start() - creates a connection to the cache server. Must be called before any other method is available. */ @@ -28,14 +28,14 @@ export class Client implements ClientApi { * get(key, callback) - retrieve an item from the cache engine if found where: * * key - a cache key object (see [ICacheKey]). */ - get(key: CacheKey): Promise; + get(key: CacheKey): Promise>; /** * set(key, value, ttl, callback) - store an item in the cache for a specified length of time, where: * * key - a cache key object (see [ICacheKey]). * * value - the string or object value to be stored. * * ttl - a time-to-live value in milliseconds after which the item is automatically removed from the cache (or is marked invalid). */ - set(key: CacheKey, value: CacheItem, ttl: number): Promise; + set(key: CacheKey, value: T, ttl: number): Promise; /** * drop(key, callback) - remove an item from cache where: * * key - a cache key object (see [ICacheKey]). @@ -47,13 +47,13 @@ export class Client implements ClientApi { validateSegmentName(segment: string): null | Error; } -export type EnginePrototypeOrObject = EnginePrototype | ClientApi; +export type EnginePrototypeOrObject = EnginePrototype | ClientApi; /** * A prototype CatBox engine function */ -export interface EnginePrototype { - new(settings: ClientOptions): ClientApi; +export interface EnginePrototype { + new(settings: ClientOptions): ClientApi; } /** @@ -61,7 +61,7 @@ export interface EnginePrototype { * The Client object provides the following methods: * @see {@link https://github.com/hapijs/catbox#api} */ -export interface ClientApi { +export interface ClientApi { /** start() - creates a connection to the cache server. Must be called before any other method is available. */ start(): Promise; /** stop() - terminates the connection to the cache server. */ @@ -70,14 +70,14 @@ export interface ClientApi { * get(key, callback) - retrieve an item from the cache engine if found where: * * key - a cache key object (see [ICacheKey]). */ - get(key: CacheKey): Promise; + get(key: CacheKey): Promise>; /** * set(key, value, ttl) - store an item in the cache for a specified length of time, where: * * key - a cache key object (see [ICacheKey]). * * value - the string or object value to be stored. * * ttl - a time-to-live value in milliseconds after which the item is automatically removed from the cache (or is marked invalid). */ - set(key: CacheKey, value: CacheItem, ttl: number): Promise; + set(key: CacheKey, value: T, ttl: number): Promise; /** * drop(key) - remove an item from cache where: * * key - a cache key object (see [ICacheKey]). @@ -100,17 +100,15 @@ export interface CacheKey { } /** Cached object contains the following: */ -export interface CachedObject { +export interface CachedObject { /** item - the value stored in the cache using set(). */ - item: any; + item: T; /** stored - the timestamp when the item was stored in the cache (in milliseconds). */ stored: number; /** ttl - the remaining time-to-live (not the original value used when storing the object). */ ttl: number; } -export type CacheItem = any; - export interface ClientOptions { /** * this will store items under keys that start with this value. @@ -118,89 +116,69 @@ export interface ClientOptions { partition: string; } +export type PolicyOptionVariants = PolicyOptions | DecoratedPolicyOptions; + /** - * The Policy object provides a convenient cache interface by setting a global policy which is automatically applied to every storage action. + * The Policy object provides a convenient cache interface by setting a + * global policy which is automatically applied to every storage action. * The object is constructed using new Policy(options, [cache, segment]) where: * * options - an object with the IPolicyOptions structure * * cache - a Client instance (which has already been started). - * * segment - required when cache is provided. The segment name used to isolate cached items within the cache partition. + * * segment - required when cache is provided. The segment name used to + * isolate cached items within the cache partition. * @see {@link https://github.com/hapijs/catbox#policy} */ -export class Policy implements PolicyAPI { - constructor(options: PolicyOptions, cache: Client, segment: string); +export class Policy> { + constructor(options: O, cache: Client, segment: string); /** - * get(id) - retrieve an item from the cache. If the item is not found and the generateFunc method was provided, - * a new value is generated, stored in the cache, and returned. Multiple concurrent requests are queued and processed once. The method arguments are: - * * id - the unique item identifier (within the policy segment). Can be a string or an object with the required 'id' key. + * retrieve an item from the cache. If the item is not + * found and the generateFunc method was provided, + * a new value is generated, stored in the cache, and returned. + * Multiple concurrent requests are queued and processed once. The method arguments are: + * @param id the unique item identifier (within the policy segment). + * Can be a string or an object with the required 'id' key. */ - get(id: string | { id: string }): Promise; + get(id: string | { id: string }): Promise ? DecoratedResult : T | null>; + /** - * set(id, value, ttl) - store an item in the cache where: - * * id - the unique item identifier (within the policy segment). - * * value - the string or object value to be stored. - * * ttl - a time-to-live override value in milliseconds after which the item is automatically removed from the cache (or is marked invalid). + * store an item in the cache where: + * @param id - the unique item identifier (within the policy segment). + * @param value - the string or object value to be stored. + * @param ttl - a time-to-live override value in milliseconds after which the item is automatically + * removed from the cache (or is marked invalid). * This should be set to 0 in order to use the caching rules configured when creating the Policy object. */ - set(id: string | { id: string }, value: CacheItem, ttl: number | null): Promise; + set(id: string | { id: string }, value: T, ttl?: number): Promise; /** - * drop(id) - remove the item from cache where: - * * id - the unique item identifier (within the policy segment). + * remove the item from cache where: + * @param id the unique item identifier (within the policy segment). */ drop(id: string | { id: string }): Promise; - /** ttl(created) - given a created timestamp in milliseconds, returns the time-to-live left based on the configured rules. */ + /** + * given a created timestamp in milliseconds, returns the time-to-live left + * based on the configured rules. + */ ttl(created: number): number; - /** rules(options) - changes the policy rules after construction (note that items already stored will not be affected) */ - rules(options: PolicyOptions): void; - /** isReady() - returns true if cache engine determines itself as ready, false if it is not ready or if there is no cache engine set. */ + /** changes the policy rules after construction (note that items already stored will not be affected) */ + rules(options: PolicyOptions): void; + /** + * returns true if cache engine determines itself as ready, false if it is not ready or if + * here is no cache engine set. + */ isReady(): boolean; - /** stats - an object with cache statistics */ + /** an object with cache statistics */ stats(): CacheStatisticsObject; } -/** - * Policy API - * The Policy object provides the following methods: - * @see {@link https://github.com/hapijs/catbox#api-1} - */ -export interface PolicyAPI { - /** - * get(id) - retrieve an item from the cache. If the item is not found and the generateFunc method was provided, - * a new value is generated, stored in the cache, and returned. Multiple concurrent requests are queued and processed once. The method arguments are: - * * id - the unique item identifier (within the policy segment). Can be a string or an object with the required 'id' key. - */ - get(id: string | { id: string }): Promise; - /** - * set(id, value, ttl) - store an item in the cache where: - * * id - the unique item identifier (within the policy segment). - * * value - the string or object value to be stored. - * * ttl - a time-to-live override value in milliseconds after which the item is automatically removed from the cache (or is marked invalid). - * This should be set to 0 in order to use the caching rules configured when creating the Policy object. - */ - set(id: string | { id: string }, value: CacheItem, ttl: number | null): Promise; - /** - * drop(id) - remove the item from cache where: - * * id - the unique item identifier (within the policy segment). - */ - drop(id: string | { id: string }): Promise; - /** ttl(created) - given a created timestamp in milliseconds, returns the time-to-live left based on the configured rules. */ - ttl(created: number): number; - /** rules(options) - changes the policy rules after construction (note that items already stored will not be affected) */ - rules(options: PolicyOptions): void; - /** isReady() - returns true if cache engine determines itself as ready, false if it is not ready or if there is no cache engine set. */ - isReady(): boolean; - /** stats - an object with cache statistics */ - stats(): CacheStatisticsObject; -} - -export interface PolicyGetPromiseResult { - value: CacheItem; - cached: PolicyGetCachedOptions; +export interface DecoratedResult { + value: T; + cached: PolicyGetCachedOptions; report: PolicyGetReportLog; } -export interface PolicyGetCachedOptions { +export interface PolicyGetCachedOptions { /** item - the cached value. */ - item: CacheItem; + item: T; /** stored - the timestamp when the item was stored in the cache. */ stored: number; /** ttl - the cache ttl value for the record. */ @@ -212,13 +190,13 @@ export interface PolicyGetCachedOptions { /** * @see {@link https://github.com/hapijs/catbox#policy} */ -export interface PolicyOptions { +export interface PolicyOptions { /** expiresIn - relative expiration expressed in the number of milliseconds since the item was saved in the cache. Cannot be used together with expiresAt. */ expiresIn?: number; /** expiresAt - time of day expressed in 24h notation using the 'HH:MM' format, at which point all cache records for the route expire. Uses local time. Cannot be used together with expiresIn. */ expiresAt?: string; /** generateFunc - a function used to generate a new cache item if one is not found in the cache when calling get(). The method's signature is function(id, next) where: */ - generateFunc?: GenerateFunc; + generateFunc?: GenerateFunc; /** * staleIn - number of milliseconds to mark an item stored in cache as stale and attempt to regenerate it when generateFunc is provided. * Must be less than expiresIn. Alternatively function that returns staleIn value in milliseconds. The function signature is function(stored, ttl) where: @@ -242,11 +220,18 @@ export interface PolicyOptions { generateIgnoreWriteError?: boolean; /** * pendingGenerateTimeout - number of milliseconds while generateFunc call is in progress for a given id, before a subsequent generateFunc call is allowed. - * Defaults to 0, no blocking of concurrent generateFunc calls beyond staleTimeout. + * @default 0, no blocking of concurrent generateFunc calls beyond staleTimeout. */ pendingGenerateTimeout?: number; } +export interface DecoratedPolicyOptions extends PolicyOptions { + /** + * @default false + */ + getDecoratedValue?: boolean; +} + export interface GenerateFuncFlags { ttl: number; } @@ -262,7 +247,7 @@ export interface GenerateFuncFlags { * * ttl - the cache ttl value in milliseconds. Set to 0 to skip storing in the cache. Defaults to the cache global policy. * @see {@link https://github.com/hapijs/catbox#policy} */ -export type GenerateFunc = (id: string, flags: GenerateFuncFlags) => Promise; +export type GenerateFunc = (id: string, flags: GenerateFuncFlags) => Promise; /** * An object with logging information about the generation operation containing the following keys (as relevant): diff --git a/types/chai-fs/chai-fs-tests.ts b/types/chai-fs/chai-fs-tests.ts new file mode 100644 index 0000000000..2b7df3ed8f --- /dev/null +++ b/types/chai-fs/chai-fs-tests.ts @@ -0,0 +1,400 @@ +import { assert, expect, use, should } from 'chai'; +import Chaifs = require('chai-fs'); + +use(Chaifs); +should(); + +const name = 'name'; +const path = 'tmp/'; +const otherPath = 'otherPath/'; +const msg = 'message'; +const array: any[] = [1, 2, 3, 4]; +const data: ArrayBuffer = new ArrayBuffer(512); +const obj: object = { key: 'value' }; +const schema = JSON.parse('{ "name":"John", "age":30, "city":"New York"}'); + +// basename() +expect(path).to.have.basename(name); +expect(path).to.have.basename(name, msg); +expect(path).to.not.have.basename(name); +expect(path).to.not.have.basename(name, msg); + +path.should.have.basename(name); +path.should.have.basename(name, msg); +path.should.not.have.basename(name); +path.should.not.have.basename(name, msg); + +assert.basename(path, name); +assert.basename(path, name, msg); +assert.notBasename(path, name); +assert.notBasename(path, name, msg); + +// dirname() +expect(path).to.have.dirname(name); +expect(path).to.have.dirname(name, msg); +expect(path).to.not.have.dirname(name); +expect(path).to.not.have.dirname(name, msg); + +path.should.have.dirname(name); +path.should.have.dirname(name, msg); +path.should.not.have.dirname(name); +path.should.not.have.dirname(name, msg); + +assert.dirname(path, name); +assert.dirname(path, name, msg); +assert.notDirname(path, name); +assert.notDirname(path, name, msg); + +// extname() +expect(path).to.have.extname(name); +expect(path).to.have.extname(name, msg); +expect(path).to.not.have.extname(name); +expect(path).to.not.have.extname(name, msg); + +path.should.have.extname(name); +path.should.have.extname(name, msg); +path.should.not.have.extname(name); +path.should.not.have.extname(name, msg); + +assert.extname(path, name); +assert.extname(path, name, msg); +assert.notExtname(path, name); +assert.notExtname(path, name, msg); + +// path() +expect(path).to.be.a.path(); +expect(path).to.be.a.path(msg); +expect(path).to.not.be.a.path(); +expect(path).to.not.be.a.path(msg); + +path.should.be.a.path(); +path.should.be.a.path(msg); +path.should.be.a.path(); +path.should.be.a.path(msg); +path.should.not.be.a.path(); +path.should.not.be.a.path(msg); + +assert.pathExists(path); +assert.pathExists(path, msg); +assert.notPathExists(path); +assert.notPathExists(path, msg); + +// directory +expect(path).to.be.a.directory(); +expect(path).to.be.a.directory(msg); +expect(path).to.not.be.a.directory(); +expect(path).to.not.be.a.directory(msg); + +path.should.be.a.directory(); +path.should.be.a.directory(msg); +path.should.not.be.a.directory(); +path.should.not.be.a.directory(msg); + +assert.isDirectory(path); +assert.isDirectory(path, msg); +assert.notIsDirectory(path); +assert.notIsDirectory(path, msg); + +// directory().and.empty +expect(path).to.be.a.directory().and.empty; +expect(path).to.be.a.directory(msg).and.empty; +expect(path).to.be.a.directory().and.not.empty; +expect(path).to.be.a.directory(msg).and.not.empty; + +path.should.be.a.directory().and.empty; +path.should.be.a.directory(msg).and.empty; +path.should.be.a.directory().and.not.empty; +path.should.be.a.directory(msg).and.not.empty; + +assert.isEmptyDirectory(path); +assert.isEmptyDirectory(path, msg); +assert.notIsEmptyDirectory(path); +assert.notIsEmptyDirectory(path, msg); + +// directory().with.contents([...]) +// #1 +expect(path).to.be.a.directory(msg).with.contents(array); +expect(path).to.be.a.directory(msg).with.contents(array, msg); +// #2 +expect(path).to.be.a.directory(msg).and.not.have.contents(array); +expect(path).to.be.a.directory(msg).and.not.have.contents(array, msg); +// #3 +expect(path).to.be.a.directory(msg).with.deep.contents(array); +expect(path).to.be.a.directory(msg).with.deep.contents(array, msg); +// #4 +expect(path).to.be.a.directory(msg).and.not.have.deep.contents(array); +expect(path).to.be.a.directory(msg).and.not.have.deep.contents(array, msg); +// #5 +expect(path).to.be.a.directory(msg).and.include.contents(array); +expect(path).to.be.a.directory(msg).and.include.contents(array, msg); +// #6 +expect(path).to.be.a.directory(msg).and.not.include.contents(array); +expect(path).to.be.a.directory(msg).and.not.include.contents(array, msg); + +// #1 +path.should.be.a.directory(msg).with.contents(array); +path.should.be.a.directory(msg).with.contents(array, msg); +// #2 +path.should.be.a.directory(msg).and.not.have.contents(array); +path.should.be.a.directory(msg).and.not.have.contents(array, msg); +// #3 +path.should.be.a.directory(msg).with.deep.contents(array); +path.should.be.a.directory(msg).with.deep.contents(array, msg); +// #4 +path.should.be.a.directory(msg).and.not.have.deep.contents(array); +path.should.be.a.directory(msg).and.not.have.deep.contents(array, msg); +// #5 +path.should.be.a.directory(msg).and.include.contents(array); +path.should.be.a.directory(msg).and.include.contents(array, msg); +// #6 +path.should.be.a.directory(msg).and.not.include.contents(array); +path.should.be.a.directory(msg).and.not.include.contents(array, msg); + +assert.directoryContent(path, array); +assert.directoryContent(path, array, msg); +assert.notDirectoryContent(path, array); +assert.notDirectoryContent(path, array, msg); +assert.directoryDeepContent(path, array); +assert.directoryDeepContent(path, array, msg); +assert.notDirectoryDeepContent(path, array); +assert.notDirectoryDeepContent(path, array, msg); +assert.directoryInclude(path, array); +assert.directoryInclude(path, array, msg); +assert.notDirectoryInclude(path, array); +assert.notDirectoryInclude(path, array, msg); + +// directory().with.files([...]) +// #1 +expect(path).to.be.a.directory(msg).with.files(array); +expect(path).to.be.a.directory(msg).with.files(array, msg); +// #2 +expect(path).to.be.a.directory(msg).with.files(array); +expect(path).to.be.a.directory(msg).with.files(array, msg); +// #3 +expect(path).to.be.a.directory(msg).and.not.have.files(array); +expect(path).to.be.a.directory(msg).and.not.have.files(array, msg); +// #4 +expect(path).to.be.a.directory(msg).and.not.have.files(array); +expect(path).to.be.a.directory(msg).and.not.have.files(array, msg); +// #5 +expect(path).to.be.a.directory(msg).with.deep.files(array, msg); +expect(path).to.be.a.directory(msg).with.deep.files(array); +// #6 +expect(path).to.be.a.directory(msg).with.deep.files(array); +expect(path).to.be.a.directory(msg).with.deep.files(array, msg); +// #7 +expect(path).to.be.a.directory(msg).and.not.have.deep.files(array); +expect(path).to.be.a.directory(msg).and.not.have.deep.files(array, msg); +// #8 +expect(path).to.be.a.directory(msg).and.not.have.deep.files(array); +expect(path).to.be.a.directory(msg).and.not.have.deep.files(array, msg); +// #9 +expect(path).to.be.a.directory(msg).and.include.files(array); +expect(path).to.be.a.directory(msg).and.include.files(array, msg); +// #10 +expect(path).to.be.a.directory(msg).and.not.include.files(array); +expect(path).to.be.a.directory(msg).and.not.include.files(array, msg); + +// #1 +path.should.be.a.directory(msg).with.files(array); +path.should.be.a.directory(msg).with.files(array, msg); +// #2 +path.should.be.a.directory().and.not.have.files(array); +path.should.be.a.directory(msg).and.not.have.files(array); +path.should.be.a.directory(msg).and.not.have.files(array, msg); +// #3 +path.should.be.a.directory().with.deep.files(array); +path.should.be.a.directory(msg).with.deep.files(array); +path.should.be.a.directory(msg).with.deep.files(array, msg); +// #4 +path.should.be.a.directory(msg).and.not.have.deep.files(array); +path.should.be.a.directory(msg).and.not.have.deep.files(array, msg); +// #5 +path.should.be.a.directory(msg).and.include.files(array); +path.should.be.a.directory(msg).and.include.files(array, msg); +// #6 +path.should.be.a.directory(msg).and.not.include.files(array); +path.should.be.a.directory(msg).and.not.include.files(array, msg); + +assert.directoryFiles(path, array); +assert.directoryFiles(path, array, msg); +assert.notDirectoryFiles(path, array); +assert.notDirectoryFiles(path, array, msg); +assert.directoryDeepFiles(path, array); +assert.directoryDeepFiles(path, array, msg); +assert.notDirectoryDeepFiles(path, array); +assert.notDirectoryDeepFiles(path, array, msg); +assert.directoryIncludeFiles(path, array); +assert.directoryIncludeFiles(path, array, msg); +assert.notDirectoryIncludeFiles(path, array); +assert.notDirectoryIncludeFiles(path, array, msg); + +// directory().with.subDirs([...]) +// #1 +expect(path).to.be.a.directory(msg).with.subDirs(array); +expect(path).to.be.a.directory(msg).with.subDirs(array, msg); +// #2 +expect(path).to.be.a.directory(msg).and.not.have.subDirs(array); +expect(path).to.be.a.directory(msg).and.not.have.subDirs(array, msg); +// #3 +expect(path).to.be.a.directory(msg).with.deep.subDirs(array); +expect(path).to.be.a.directory(msg).with.deep.subDirs(array, msg); +// #4 +expect(path).to.be.a.directory(msg).and.not.have.deep.subDirs(array); +expect(path).to.be.a.directory(msg).and.not.have.deep.subDirs(array, msg); +// #5 +expect(path).to.be.a.directory(msg).and.include.subDirs(array); +expect(path).to.be.a.directory(msg).and.include.subDirs(array, msg); +// #6 +expect(path).to.be.a.directory(msg).and.not.include.subDirs(array); +expect(path).to.be.a.directory(msg).and.not.include.subDirs(array, msg); + +// #1 +path.should.be.a.directory(msg).with.subDirs(array); +path.should.be.a.directory(msg).with.subDirs(array, msg); +// #2 +path.should.be.a.directory(msg).and.not.have.subDirs(array); +path.should.be.a.directory(msg).and.not.have.subDirs(array, msg); +// #3 +path.should.be.a.directory(msg).with.deep.subDirs(array); +path.should.be.a.directory(msg).with.deep.subDirs(array, msg); +// #4 +path.should.be.a.directory(msg).and.not.have.deep.subDirs(array); +path.should.be.a.directory(msg).and.not.have.deep.subDirs(array, msg); +// #5 +path.should.be.a.directory(msg).and.include.subDirs(array); +path.should.be.a.directory(msg).and.include.subDirs(array, msg); +// #6 +path.should.be.a.directory(msg).and.not.include.subDirs(array); +path.should.be.a.directory(msg).and.not.include.subDirs(array, msg); + +assert.directorySubDirs(path, array, msg); +assert.notDirectorySubDirs(path, array, msg); +assert.directoryDeepSubDirs(path, array, msg); +assert.notDirectoryDeepSubDirs(path, array, msg); +assert.directoryIncludeSubDirs(path, array, msg); +assert.notDirectoryIncludeSubDirs(path, array, msg); + +// directory().and.equal(otherPath) +// #1 +expect(path).to.be.a.directory(msg).and.equal(otherPath); +expect(path).to.be.a.directory(msg).and.equal(otherPath, msg); +// #2 +expect(path).to.be.a.directory(msg).and.not.equal(otherPath); +expect(path).to.be.a.directory(msg).and.not.equal(otherPath, msg); +// #3 +expect(path).to.be.a.directory(msg).and.deep.equal(otherPath); +expect(path).to.be.a.directory(msg).and.deep.equal(otherPath, msg); +// #4 +expect(path).to.be.a.directory(msg).and.not.deep.equal(otherPath); +expect(path).to.be.a.directory(msg).and.not.deep.equal(otherPath, msg); + +// #1 +path.should.be.a.directory(msg).and.equal(otherPath); +path.should.be.a.directory(msg).and.equal(otherPath, msg); +// #2 +path.should.be.a.directory(msg).and.not.equal(otherPath); +path.should.be.a.directory(msg).and.not.equal(otherPath, msg); +// #3 +path.should.be.a.directory(msg).and.deep.equal(otherPath); +path.should.be.a.directory(msg).and.deep.equal(otherPath, msg); +// #4 +path.should.be.a.directory(msg).and.not.deep.equal(otherPath); +path.should.be.a.directory(msg).and.not.deep.equal(otherPath, msg); + +assert.directoryEqual(path, otherPath, msg); +assert.notDirectoryEqual(path, otherPath, msg); +assert.directoryDeepEqual(path, otherPath, msg); +assert.notDirectoryDeepEqual(path, otherPath, msg); + +// file() +expect(path).to.be.a.file(); +expect(path).to.be.a.file(msg); +expect(path).to.not.be.a.file(); +expect(path).to.not.be.a.file(msg); + +path.should.be.a.file(); +path.should.be.a.file(msg); +path.should.not.be.a.file(); +path.should.not.be.a.file(msg); + +assert.isFile(path); +assert.isFile(path, msg); +assert.notIsFile(path); +assert.notIsFile(path, msg); + +// file().and.empty +expect(path).to.be.a.file(msg).and.empty; +expect(path).to.be.a.file(msg).and.not.empty; + +path.should.be.a.file(msg).and.empty; +path.should.be.a.file(msg).and.not.empty; + +assert.isEmptyFile(path, msg); +assert.notIsEmptyFile(path, msg); + +// file().with.content(str) +expect(path).to.be.a.file(msg).with.content(data); +expect(path).to.be.a.file(msg).with.content(data, msg); +expect(path).to.be.a.file(msg).and.not.have.content(data); +expect(path).to.be.a.file(msg).and.not.have.content(data, msg); + +path.should.be.a.file(msg).with.content(data); +path.should.be.a.file(msg).with.content(data, msg); +path.should.be.a.file(msg).and.not.have.content(data); +path.should.be.a.file(msg).and.not.have.content(data, msg); + +assert.fileContent(path, data); +assert.fileContent(path, data, msg); +assert.notFileContent(path, data); +assert.notFileContent(path, data, msg); + +// file().with.contents.that.match(/xyz/) +// expect(path).to.be.a.file(msg).with.contents.that.match(/xyz/, msg); +// expect(path).to.be.a.file(msg).and.not.have.contents.that.match(/xyz/, msg); + +// path.should.be.a.file(msg).with.contents.that.match(/xyz/, msg); +// path.should.be.a.file(msg).and.not.have.contents.that.match(/xyz/, msg); + +assert.fileContentMatch(path, /xyz/); +assert.fileContentMatch(path, /xyz/, msg); +assert.notFileContentMatch(path, /xyz/); +assert.notFileContentMatch(path, /xyz/, msg); + +// file().and.equal(otherPath) +expect(path).to.be.a.file(msg).and.equal(otherPath); +expect(path).to.be.a.file(msg).and.equal(otherPath, msg); +expect(path).to.be.a.file(msg).and.not.equal(otherPath); +expect(path).to.be.a.file(msg).and.not.equal(otherPath, msg); + +path.should.be.a.file(msg).and.equal(otherPath); +path.should.be.a.file(msg).and.equal(otherPath, msg); +path.should.be.a.file(msg).and.not.equal(otherPath); +path.should.be.a.file(msg).and.not.equal(otherPath, msg); + +assert.fileEqual(path, otherPath, msg); +assert.notFileEqual(path, otherPath, msg); + +// file().with.json +expect(path).to.be.a.file(msg).with.json; +expect(path).to.be.a.file(msg).with.not.json; + +path.should.be.a.file(msg).with.json; +path.should.be.a.file(msg).with.not.json; + +assert.jsonFile(path); +assert.jsonFile(path, msg); +assert.notJsonFile(path); +assert.notJsonFile(path, msg); + +// file().using.json.schema(obj) +expect(path).to.be.a.file(msg).with.json.using.schema(obj); +expect(path).to.be.a.file(msg).with.json.not.using.schema(obj); + +path.should.be.a.file(msg).with.json.using.schema(obj); +path.should.be.a.file(msg).with.json.not.using.schema(obj); + +assert.jsonSchemaFile(path, schema); +assert.jsonSchemaFile(path, schema, msg); +assert.notJsonSchemaFile(path, schema); +assert.notJsonSchemaFile(path, schema, msg); diff --git a/types/chai-fs/index.d.ts b/types/chai-fs/index.d.ts new file mode 100644 index 0000000000..3b82eee078 --- /dev/null +++ b/types/chai-fs/index.d.ts @@ -0,0 +1,222 @@ +// Type definitions for chai-fs 2.0 +// Project: https://github.com/chaijs/chai-fs +// Definitions by: Dimitar Danailov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// +/// + +declare global { + namespace Chai { + interface TypeComparison { + path(msg?: string): Assertion; + directory(msg?: string): Assertion; + file(msg?: string): Assertion; + } + + interface Deep { + contents(array: any[], msg?: string): Assertion; + files(array: any[], msg?: string): Assertion; + subDirs(array: any[], msg?: string): Assertion; + } + + interface Include { + contents(array: any[], msg?: string): Assertion; + files(array: any[], msg?: string): Assertion; + subDirs(array: any[], msg?: string): Assertion; + } + + interface LanguageChains { + json: Assertion; + using: Assertion; + } + + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + // Basename + basename(path?: string, name?: string, msg?: string): Assertion; + notBasename(path: string, name: string, msg?: string): Assertion; + + // Dirname + dirname(name: string, msg?: string): Assertion; + notDirname(path: string, name: string, msg?: string): Assertion; + + // Еxtname + extname(path: string, name?: string, msg?: string): Assertion; + notExtname(path: string, name: string, msg?: string): Assertion; + + // Path + pathExists(path: string, msg?: string): Assertion; + notPathExists(path: string, msg?: string): Assertion; + + // Directory + isDirectory(path: string, msg?: string): Assertion; + notIsDirectory(path: string, msg?: string): Assertion; + + // directory().and.empty + isEmptyDirectory(path: string, msg?: string): Assertion; + notIsEmptyDirectory(path: string, msg?: string): Assertion; + + // directory().with.contents([...]) + contents(array: any[], msg?: string): Assertion; + directoryContent(path: string, array: any[], msg?: string): Assertion; + notDirectoryContent(path: string, array: any[], msg?: string): Assertion; + directoryDeepContent(path: string, array: any[], msg?: string): Assertion; + notDirectoryDeepContent(path: string, array: any[], msg?: string): Assertion; + directoryInclude(path: string, array: any[], msg?: string): Assertion; + notDirectoryInclude(path: string, array: any[], msg?: string): Assertion; + + // directory().with.files([...]) + files(array: any[], msg?: string): Assertion; + directoryFiles(path: string, array: any[], msg?: string): Assertion; + notDirectoryFiles(path: string, array: any[], msg?: string): Assertion; + directoryDeepFiles(path: string, array: any[], msg?: string): Assertion; + notDirectoryDeepFiles(path: string, array: any[], msg?: string): Assertion; + directoryIncludeFiles(path: string, array: any[], msg?: string): Assertion; + notDirectoryIncludeFiles(path: string, array: any[], msg?: string): Assertion; + + // directory().with.subDirs([...]) + subDirs(array: any[], msg?: string): Assertion; + directorySubDirs(path: string, array: any[], msg?: string): Assertion; + notDirectorySubDirs(path: string, array: any[], msg?: string): Assertion; + directoryDeepSubDirs(path: string, array: any[], msg?: string): Assertion; + notDirectoryDeepSubDirs(path: string, array: any[], msg?: string): Assertion; + directoryIncludeSubDirs(path: string, array: any[], msg?: string): Assertion; + notDirectoryIncludeSubDirs(path: string, array: any[], msg?: string): Assertion; + + // directory().and.equal(otherPath) + directoryEqual(path: string, otherPath: string, msg?: string): Assertion; + notDirectoryEqual(path: string, otherPath: string, msg?: string): Assertion; + directoryDeepEqual(path: string, otherPath: string, msg?: string): Assertion; + notDirectoryDeepEqual(path: string, otherPath: string, msg?: string): Assertion; + + // file + isFile(path: string, msg?: string): Assertion; + notIsFile(path: string, msg?: string): Assertion; + + // file().and.empty + isEmptyFile(path: string, msg?: string): Assertion; + notIsEmptyFile(path: string, msg?: string): Assertion; + + // file().with.content(str) + content(data: any, msg?: string): Assertion; + fileContent(path: string, data: any, msg?: string): Assertion; + notFileContent(path: string, data: any, msg?: string): Assertion; + + // file().with.contents.that.match(/xyz/) + fileContentMatch(path: string, regExp: RegExp, msg?: string): Assertion; + notFileContentMatch(path: string, regExp: RegExp, msg?: string): Assertion; + + // file().and.equal(otherPath) + fileEqual(path: string, otherPath: string, msg?: string): Assertion; + notFileEqual(path: string, otherPath: string, msg?: string): Assertion; + + // file().with.json + jsonFile(path: string, msg?: string): Assertion; + notJsonFile(path: string, msg?: string): Assertion; + + // file().using.json.schema(obj) + jsonSchemaFile(path: string, schema: any, msg?: string): Assertion; + notJsonSchemaFile(path: string, schema: any, msg?: string): Assertion; + schema(obj: object): Assertion; + } + + interface Assert { + // Basename + basename(path: string, name: string, msg?: string): void; + notBasename(path: string, name: string, msg?: string): void; + + // Dirname + dirname(path: string, name?: string, msg?: string): void; + notDirname(path: string, name: string, msg?: string): void; + + // Еxtname + extname(path: string, name: string, msg?: string): void; + notExtname(path: string, name: string, msg?: string): void; + + // Path + path(msg?: string): void; + pathExists(path: string, msg?: string): void; + notPathExists(path: string, msg?: string): void; + + // Directory + directory(msg?: string): void; + isDirectory(path: string, msg?: string): void; + notIsDirectory(path: string, msg?: string): void; + + // directory().and.empty + isEmptyDirectory(path: string, msg?: string): void; + notIsEmptyDirectory(path: string, msg?: string): void; + + // directory().with.contents([...]) + contents(array: any[], msg?: string): void; + directoryContent(path: string, array: any[], msg?: string): void; + notDirectoryContent(path: string, array: any[], msg?: string): void; + directoryDeepContent(path: string, array: any[], msg?: string): void; + notDirectoryDeepContent(path: string, array: any[], msg?: string): void; + directoryInclude(path: string, array: any[], msg?: string): void; + notDirectoryInclude(path: string, array: any[], msg?: string): void; + + // directory().with.files([...]) + files(array: any[], msg?: string): void; + directoryFiles(path: string, array: any[], msg?: string): void; + notDirectoryFiles(path: string, array: any[], msg?: string): void; + directoryDeepFiles(path: string, array: any[], msg?: string): void; + notDirectoryDeepFiles(path: string, array: any[], msg?: string): void; + directoryIncludeFiles(path: string, array: any[], msg?: string): void; + notDirectoryIncludeFiles(path: string, array: any[], msg?: string): void; + + // directory().with.subDirs([...]) + subDirs(array: any[], msg?: string): void; + directorySubDirs(path: string, array: any[], msg?: string): void; + notDirectorySubDirs(path: string, array: any[], msg?: string): void; + directoryDeepSubDirs(path: string, array: any[], msg?: string): void; + notDirectoryDeepSubDirs(path: string, array: any[], msg?: string): void; + directoryIncludeSubDirs(path: string, array: any[], msg?: string): void; + notDirectoryIncludeSubDirs(path: string, array: any[], msg?: string): void; + + // directory().and.equal(otherPath) + directoryEqual(path: string, otherPath: string, msg?: string): void; + notDirectoryEqual(path: string, otherPath: string, msg?: string): void; + directoryDeepEqual(path: string, otherPath: string, msg?: string): void; + notDirectoryDeepEqual(path: string, otherPath: string, msg?: string): void; + + // file + file(msg?: string): void; + isFile(path: string, msg?: string): void; + notIsFile(path: string, msg?: string): void; + + // file().and.empty + isEmptyFile(path: string, msg?: string): void; + notIsEmptyFile(path: string, msg?: string): void; + + // file().with.content(str) + fileContent(path: string, data: any, msg?: string): void; + notFileContent(path: string, data: any, msg?: string): void; + + // file().with.contents.that.match(/xyz/) + fileContentMatch(path: string, regExp: RegExp, msg?: string): void; + notFileContentMatch(path: string, regExp: RegExp, msg?: string): void; + + // file().and.equal(otherPath) + fileEqual(path: string, otherPath: string, msg?: string): void; + notFileEqual(path: string, otherPath: string, msg?: string): void; + + // file().with.json + jsonFile(path: string, msg?: string): void; + notJsonFile(path: string, msg?: string): void; + + // file().using.json.schema(obj) + jsonSchemaFile(path: string, schema: any, msg?: string): void; + notJsonSchemaFile(path: string, schema: any, msg?: string): void; + schema(obj: object): void; + } + } +} + +declare function chaiFs(chai: any, utils: any): void; +export = chaiFs; + +interface Object { + should: Chai.Assertion; +} diff --git a/types/chai-fs/tsconfig.json b/types/chai-fs/tsconfig.json new file mode 100644 index 0000000000..8ca5abeb7d --- /dev/null +++ b/types/chai-fs/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chai-fs-tests.ts" + ] +} diff --git a/types/chai-fs/tslint.json b/types/chai-fs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chai-fs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/chai-http/tsconfig.json b/types/chai-http/tsconfig.json index 3554b4ab09..45d92cf188 100644 --- a/types/chai-http/tsconfig.json +++ b/types/chai-http/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/chai-jest-snapshot/tslint.json b/types/chai-jest-snapshot/tslint.json index 3db14f85ea..1c36270d47 100644 --- a/types/chai-jest-snapshot/tslint.json +++ b/types/chai-jest-snapshot/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-angle-bracket-type-assertion": false + } +} diff --git a/types/chai-jquery/chai-jquery-tests.ts b/types/chai-jquery/chai-jquery-tests.ts index 894acf9ca5..bd798be847 100644 --- a/types/chai-jquery/chai-jquery-tests.ts +++ b/types/chai-jquery/chai-jquery-tests.ts @@ -67,6 +67,10 @@ function test_disabled() { expect($('#foo')).to.be.disabled; } +function test_enabled() { + expect($('#foo')).to.be.enabled; +} + function test_empty() { $('.empty').should.be.empty; expect($('body')).not.to.be.empty; diff --git a/types/chai-jquery/index.d.ts b/types/chai-jquery/index.d.ts index bd6826ca08..c2827d2e05 100644 --- a/types/chai-jquery/index.d.ts +++ b/types/chai-jquery/index.d.ts @@ -25,6 +25,7 @@ declare namespace Chai { selected(): Assertion; checked(): Assertion; disabled(): Assertion; + enabled(): Assertion; (selector: string): Assertion; } diff --git a/types/chai/chai-tests.ts b/types/chai/chai-tests.ts index 2c81c42aeb..36002d9bfa 100644 --- a/types/chai/chai-tests.ts +++ b/types/chai/chai-tests.ts @@ -808,6 +808,24 @@ function frozen() { expect(Object.freeze({})).to.be.frozen; ({}).should.be.not.frozen; Object.freeze({}).should.be.frozen; + + expect([1, 2, 3]).to.have.all.members([1, 2, 3]); + expect([1, 2, 3]).to.have.all.members(Object.freeze([1, 2, 3])); + + expect({1: "", 2: "", 3: ""}).to.have.all.keys([1, 2, 3]); + expect({1: "", 2: "", 3: ""}).to.have.all.keys(Object.freeze([1, 2, 3])); + + assert.notDeepInclude([1, 2, 3], 1); + assert.notDeepInclude(Object.freeze([1, 2, 3]), 1); + + assert.include([1, 2, 3], 1); + assert.include(Object.freeze([1, 2, 3]), 1); + + assert.notInclude([1, 2, 3], 1); + assert.notInclude(Object.freeze([1, 2, 3]), 1); + + expect([1, 2, 3]).to.have.oneOf([1, 2, 3]); + expect([1, 2, 3]).to.have.oneOf(Object.freeze([1, 2, 3])); } class PoorlyConstructedError { @@ -1145,6 +1163,8 @@ function members() { expect([5, 4]).not.members([]); expect([5, 4]).not.members([6, 3]); expect([5, 4]).not.members([5, 4, 2]); + + expect([5, 4]).to.have.all.members([4, 5]); } function increaseDecreaseChange() { diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts index 6f0edecc06..5f73803757 100644 --- a/types/chai/index.d.ts +++ b/types/chai/index.d.ts @@ -118,7 +118,7 @@ declare namespace Chai { extensible: Assertion; sealed: Assertion; frozen: Assertion; - oneOf(list: any[], message?: string): Assertion; + oneOf(list: ReadonlyArray, message?: string): Assertion; } interface LanguageChains { @@ -195,6 +195,7 @@ declare namespace Chai { interface KeyFilter { keys: Keys; + members: Members; } interface Equal { @@ -234,7 +235,7 @@ declare namespace Chai { interface Keys { (...keys: string[]): Assertion; - (keys: any[]|Object): Assertion; + (keys: ReadonlyArray|Object): Assertion; } interface Throw { @@ -251,7 +252,7 @@ declare namespace Chai { } interface Members { - (set: any[], message?: string): Assertion; + (set: ReadonlyArray, message?: string): Assertion; } interface PropertyChange { @@ -695,7 +696,7 @@ declare namespace Chai { * @param needle Potential value contained in haystack. * @param message Message to display on error. */ - include(haystack: T[], needle: T, message?: string): void; + include(haystack: ReadonlyArray, needle: T, message?: string): void; /** * Asserts that haystack does not include needle. @@ -704,7 +705,7 @@ declare namespace Chai { * @param needle Potential expected substring of haystack. * @param message Message to display on error. */ - notInclude(haystack: string | any[], needle: any, message?: string): void; + notInclude(haystack: string | ReadonlyArray, needle: any, message?: string): void; /** * Asserts that haystack includes needle. Can be used to assert the inclusion of a value in an array or a subset of properties in an object. Deep equality is used. @@ -731,7 +732,7 @@ declare namespace Chai { * @param needle Potential expected substring of haystack. * @param message Message to display on error. */ - notDeepInclude(haystack: string | any[], needle: any, message?: string): void; + notDeepInclude(haystack: string | ReadonlyArray, needle: any, message?: string): void; /** * Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object. diff --git a/types/charset/index.d.ts b/types/charset/index.d.ts index da8d086868..efc8702289 100644 --- a/types/charset/index.d.ts +++ b/types/charset/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -import { ClientResponse, IncomingHttpHeaders } from 'http'; +import { IncomingMessage, IncomingHttpHeaders } from 'http'; /** * guess data charset from req.headers, xml, html content-type meta tag @@ -27,7 +27,7 @@ import { ClientResponse, IncomingHttpHeaders } from 'http'; * @return charset, lower case, e.g.: utf8, gbk, gb2312, .... If can\'t guess, return null */ // tslint:disable-next-line strict-export-declare-modifiers -declare function charset(obj: string | IncomingHttpHeaders | ClientResponse, data?: Buffer, peekSize?: number): string | null; +declare function charset(obj: string | IncomingHttpHeaders | IncomingMessage, data?: Buffer, peekSize?: number): string | null; // tslint:disable-next-line strict-export-declare-modifiers export = charset; diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 41ab453e0f..705392baed 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -19,7 +19,7 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { backgroundColor: "#000000", borderWidth: 1, label: "test", - data: [1] + data: [1, null, 3] } ] }, @@ -36,6 +36,7 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { tooltips: { filter: data => Number(data.yLabel) > 0, intersect: true, + mode: 'index', itemSort: (a, b) => Math.random() - 0.5, position: "average", caretPadding: 2, @@ -125,6 +126,7 @@ const chartConfig: Chart.ChartConfiguration = { backgroundColor: '#37738353', borderColor: '#37738353', borderWidth: 3, + borderCapStyle: 'round', fill: true }] }, diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 37f4757460..884ddaa760 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -10,7 +10,6 @@ // Guillaume Rodriguez // Simon Archer // Ken Elkabany -// Slavik Nychkalo // Francesco Benedetto // Alexandros Dorodoulis // Manuel Heidrich @@ -174,6 +173,8 @@ declare namespace Chart { type PositionType = 'left' | 'right' | 'top' | 'bottom'; + type InteractionMode = 'point' | 'nearest' | 'single' | 'label' | 'index' | 'x-axis' | 'dataset' | 'x' | 'y'; + interface ChartArea { top: number; right: number; @@ -185,10 +186,10 @@ declare namespace Chart { text?: string; fillStyle?: string; hidden?: boolean; - lineCap?: string; + lineCap?: 'butt' | 'round' | 'square'; lineDash?: number[]; lineDashOffset?: number; - lineJoin?: string; + lineJoin?: 'bevel' | 'round' | 'miter'; lineWidth?: number; strokeStyle?: string; pointStyle?: PointStyle; @@ -331,7 +332,7 @@ declare namespace Chart { interface ChartTooltipOptions { enabled?: boolean; custom?(a: any): void; - mode?: string; + mode?: InteractionMode; intersect?: boolean; backgroundColor?: ChartColor; titleFontFamily?: string; @@ -373,7 +374,7 @@ declare namespace Chart { type ChartTooltipPositioner = (elements: any[], eventPosition: Point) => Point; interface ChartHoverOptions { - mode?: string; + mode?: InteractionMode; animationDuration?: number; intersect?: boolean; onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any; @@ -479,7 +480,12 @@ declare namespace Chart { fontStyle?: string; } - interface TickOptions { + interface TickOptions extends NestedTickOptions { + minor?: NestedTickOptions | false; + major?: NestedTickOptions | false; + } + + interface NestedTickOptions { autoSkip?: boolean; autoSkipPadding?: number; backdropColor?: ChartColor; @@ -504,6 +510,7 @@ declare namespace Chart { reverse?: boolean; showLabelBackdrop?: boolean; source?: 'auto' | 'data' | 'labels'; + stepSize?: number; suggestedMax?: number; suggestedMin?: number; } @@ -540,12 +547,12 @@ declare namespace Chart { backgroundColor?: ChartColor | ChartColor[]; borderWidth?: number | number[]; borderColor?: ChartColor | ChartColor[]; - borderCapStyle?: string; + borderCapStyle?: 'butt' | 'round' | 'square'; borderDash?: number[]; borderDashOffset?: number; - borderJoinStyle?: string; + borderJoinStyle?: 'bevel' | 'round' | 'miter'; borderSkipped?: PositionType; - data?: number[] | ChartPoint[]; + data?: Array | ChartPoint[]; fill?: boolean | number | string; hoverBackgroundColor?: string | string[]; hoverBorderColor?: string | string[]; @@ -565,7 +572,7 @@ declare namespace Chart { pointStyle?: PointStyle | HTMLImageElement | HTMLCanvasElement | Array; xAxisID?: string; yAxisID?: string; - type?: string; + type?: ChartType | string; hidden?: boolean; hideInLegendAndTooltip?: boolean; showLine?: boolean; diff --git a/types/chartist/chartist-tests.ts b/types/chartist/chartist-tests.ts index bd7006723e..cb7f884264 100644 --- a/types/chartist/chartist-tests.ts +++ b/types/chartist/chartist-tests.ts @@ -197,6 +197,7 @@ new Chartist.Bar('.ct-chart', { }, { // Default mobile configuration stackBars: true, + stackMode: 'accumulate', axisX: { labelInterpolationFnc: (value: string) => { return value.split(/\s+/).map((word: string) => { diff --git a/types/chartist/index.d.ts b/types/chartist/index.d.ts index 3d72210c73..9b096839cc 100644 --- a/types/chartist/index.d.ts +++ b/types/chartist/index.d.ts @@ -283,6 +283,7 @@ declare namespace Chartist { * If set to true this property will cause the series bars to be stacked and form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect. */ stackBars?: boolean; + stackMode?: 'overlap' | 'accumulate'; horizontalBars?: boolean; distributeSeries?: boolean; diff --git a/types/chartmogul-node/common.d.ts b/types/chartmogul-node/common.d.ts index ced10f98d7..d12587f090 100644 --- a/types/chartmogul-node/common.d.ts +++ b/types/chartmogul-node/common.d.ts @@ -1,5 +1,5 @@ export interface Map { - [key: string]: any + [key: string]: any; } export interface CursorParams { page?: number; @@ -15,9 +15,9 @@ export interface Cursor { total_pages?: number; } export interface Entries extends Cursor { - entries: T[] + entries: T[]; } -interface Summary { +export interface Summary { current: number; previous: number; ['percentage-change']: number; @@ -25,4 +25,4 @@ interface Summary { export interface EntriesSummary { entries: T[]; summary: Summary; -} \ No newline at end of file +} diff --git a/types/chordsheetjs/chordsheetjs-tests.ts b/types/chordsheetjs/chordsheetjs-tests.ts new file mode 100644 index 0000000000..7f01828e7f --- /dev/null +++ b/types/chordsheetjs/chordsheetjs-tests.ts @@ -0,0 +1,5 @@ +import { Song, HtmlTableFormatter } from 'chordsheetjs'; + +const song = new Song({ key: 'value' }); +const formatter = new HtmlTableFormatter(); +formatter.format(song); diff --git a/types/chordsheetjs/index.d.ts b/types/chordsheetjs/index.d.ts new file mode 100644 index 0000000000..ee2e69593f --- /dev/null +++ b/types/chordsheetjs/index.d.ts @@ -0,0 +1,372 @@ +// Type definitions for chordsheetjs 2.8 +// Project: https://github.com/martijnversluis/ChordSheetJS +// Definitions by: Adam Bloom +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/** + * Represents a chord with the corresponding (partial) lyrics + */ +export class ChordLyricsPair { + /** + * Initialises a ChordLyricsPair + * @param chords The chords + * @param lyrics The lyrics + */ + constructor(chords: string, lyrics: string); + + chords: string; + lyrics: string; + + /** + * Indicates whether a ChordLyricsPair should be visible in a formatted chord sheet (except for ChordPro sheets) + */ + isRenderable: () => boolean; + + /** + * Returns a deep copy of the ChordLyricsPair, useful when programmatically transforming a song + */ + clone: () => ChordLyricsPair; + + toString: () => string; +} + +/** + * Represents a tag/directive. See https://www.chordpro.org/chordpro/ChordPro-Directives.html + */ +export class Tag { + constructor(name: string, value: string | null); + + /** + * The tag full name. When the original tag used the short name, `name` will return the full name. + */ + name: string; + + /** + * The tag value + */ + value: string | null; + + static parse(tag: string): Tag | null; + static parseWithRegex(tag: string, regex: string): Tag | null; + + /** + * The original tag name that was used to construct the tag. + */ + originalName: string; + + /** + * Checks whether the tag value is a non-empty string. + */ + hasValue(): boolean; + + /** + * Checks whether the tag is usually rendered inline. It currently only applies to comment tags. + */ + isRenderable(): boolean; + + /** + * Checks whether the tag is either a standard meta tag or a custom meta directive (`{x_some_name}`) + */ + isMetaTag(): boolean; + + /** + * Returns a clone of the tag. + */ + clone(): Tag; + + toString(): string; +} + +/** + * Represents a line in a chord sheet, consisting of items of type ChordLyricsPair or Tag + */ +export class Line { + constructor(); + + /** + * The items (ChordLyricsPair or Tag) of which the line consists + */ + items: Array; + + /** + * The line type, This is set by the ChordProParser when it read tags like {start_of_chorus} or {start_of_verse} + * Values can be 'verse', 'chorus' or 'none' + */ + type: 'verse' | 'chorus' | 'none'; + + /** + * Indicates whether the line contains any items + */ + isEmpty(): boolean; + + /** + * Adds an item to the line + * @param item The item to be added + */ + addItem(item: ChordLyricsPair | Tag): void; + + /** + * Indicates whether the line contains items that are renderable + */ + hasRenderableItems(): boolean; + + /** + * Returns a deep copy of the line and all of its items + */ + clone(): Line; + + /** + * Indicates whether the line type is 'verse' + */ + isVerse(): boolean; + + /** + * Indicates whether the line type is 'chorus' + */ + isChorus(): boolean; + + /** + * Indicates whether the line contains items that are renderable. Please use hasRenderableItems + * @deprecated + */ + hasContent(): boolean; + + addChordLyricsPair( + chords: ChordLyricsPair | string, + lyrics: string + ): ChordLyricsPair; + ensureChordLyricsPair(): void; + chords(chr: string): void; + lyrics(chr: string): void; + addTag(name: Tag | string, value: string | null): Tag; +} + +/** + * Represents a paragraph of lines in a chord sheet + */ +export class Paragraph { + constructor(); + + /** + * The Line items of which the paragraph consists + */ + lines: Line[]; + + addLine(line: Line): void; + + /** + * Tries to determine the common type for all lines. If the types for all lines are equal, it returns that type. + * If not, it returns 'indeterminate'. + */ + type: string; +} + +/** + * Represents a song in a chord sheet. Currently a chord sheet can only have one song. + */ +export class Song { + constructor(metadata: object); + + /** + * The Line items of which the song consists + */ + lines: Line[]; + + /** + * The Paragraph items of which the song consists + */ + paragraphs: Paragraph[]; + + currentLine: Line; + currentParagraph: Paragraph; + assignMetaData(metadata: object): void; + + /** + * Returns the song lines, skipping the leading empty lines (empty as in not rendering any content). This is useful + * if you want to skip the "header lines": the lines that only contain meta data. + */ + bodyLines: Line[]; + + chords(chr: string): void; + lyrics(chr: string): void; + addLine(): Line; + setCurrentLineType(type: string): void; + flushLine(): void; + finish(): void; + addChordLyricsPair(): ChordLyricsPair; + ensureLine(): void; + addParagraph(): Paragraph; + ensureParagraph(): void; + addTag(tagContents: string): Tag; + + /** + * Returns a deep clone of the song + */ + clone(): Song; + + setMetaData(name: string, value: string): void; + metaData: object; + optimizedMetaData: object; + getOptimizedMetaData(): object; + optimizeMetaDataValue( + valueSet: string[] | undefined + ): string | string[] | null; + getMetaData(name: string): string | null; +} + +/** + * Represents a parser warning, currently only used by ChordProParser. + */ +export class ParserWarning { + /** + * The warning message + */ + message: string; + + /** + * The line number on which the warning occurred + */ + lineNumber: string; + + toString(): string; +} + +/** + * Parses a ChordPro chord sheet + */ +export class ChordProParser { + /** + * Parses a ChordPro chord sheet into a song + * @param chordProChordSheet The ChordPro chord sheet + */ + parse(chordProChordSheet: string): Song; + + song: Song; + lineNumber: number; + sectionType: string; + warnings: ParserWarning[]; + + parseDocument(document: string): void; + readLyrics(chr: string): void; + readChords(chr: string): void; + readTag(chr: string): void; + readComment(chr: string): void; + finishTag(): void; + resetTag(): void; + applyTag(tag: Tag): void; + startSection(sectionType: string, tag: Tag): void; + endSection(sectionType: string, tag: Tag): void; + checkCurrentSectionType(sectionType: string, tag: Tag): void; + addWarning(message: string): void; +} + +export interface ChordSheetParserProps { + preserveWhitespace: boolean; +} + +/** + * Formats a song into a plain text chord sheet + */ +export class ChordSheetParser { + constructor(props: ChordSheetParserProps); + + song: Song; + lines: Line[]; + songLine: Line; + chordLyricsPair: ChordLyricsPair; + currentLine: number; + lineCount: number; + processingText: string; + preserveWhitespace: boolean; + + /** + * Parses a chord sheet into a song + * @param chordSheet The ChordPro chord sheet + */ + parse(chordSheet: string): Song; + + parseLine(line: string): void; + parseNonEmptyLine(line: string): void; + initialize(document: string): void; + readLine(): Line; + hasNextLine(): boolean; + parseLyricsWithChords(chordsLine: string, lyricsLine: string): void; + processCharacters(chordsLine: string, lyricsLine: string): void; + addCharacter(chr: string, nextChar: string): void; + shouldAddCharacterToChords(nextChar: string): boolean; + ensureChordLyricsPairInitialized(): void; +} + +export interface SongHeader { + title: string; + subtitle: string; +} + +export class TextFormatter { + constructor(); + /** + * Formats a song into a plain text chord sheet + * @param song The song to be formatted + */ + format(song: Song): string; + formatHeader(header: SongHeader): string; + formatParagraphs(song: Song): string; + formatParagraph(paragraph: Paragraph): string; + formatLine(line: Line): string; + formatTitle(title: string): string; + formatSubtitle(subtitle: string): string; + formatTopLine(line: Line): string | null; + chordLyricsPairLength(chordLyricsPair: ChordLyricsPair): number; + formatItemTop(item: Tag | ChordLyricsPair | Line): string; + formatLineBottom(line: Line): string; + formatLineWithFormatter( + line: Line, + formatter: (x: string) => string + ): string; + formatItemBottom(item: Tag | ChordLyricsPair | Line): string; +} + +/** + * Formats a song into HTML. It uses TABLEs to align lyrics with chords, which makes the HTML for things like + * PDF conversion. + */ +export class HtmlTableFormatter { + constructor(); + /** + * Formats a song into HTML. + * @param song The song to be formatted + */ + format(song: Song): string; +} + +/** + * Formats a song into HTML. It uses DIVs to align lyrics with chords, which makes it useful for responsive web pages. + */ +export class HtmlDivFormatter { + constructor(); + /** + * Formats a song into HTML. + * @param song The song to be formatted + */ + format(song: Song): string; +} + +/** + * Formats a song into a ChordPro chord sheet + */ +export class ChordProFormatter { + constructor(); + /** + * Formats a song into a ChordPro chord sheet. + * @param song The song to be formatted + */ + format(song: Song): string; + + formatLine(line: Line): string; + formatItem(item: Tag | ChordLyricsPair | Line): string; + formatTag(tag: Tag): string; + formatChordLyricsPair(chordLyricsPair: ChordLyricsPair): string; + formatChordLyricsPairChords(chordLyricsPair: ChordLyricsPair): string; + formatChordLyricsPairLyrics(chordLyricsPair: ChordLyricsPair): string; +} diff --git a/types/chordsheetjs/tsconfig.json b/types/chordsheetjs/tsconfig.json new file mode 100644 index 0000000000..0b2e8140ca --- /dev/null +++ b/types/chordsheetjs/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "chordsheetjs-tests.ts"] +} diff --git a/types/chordsheetjs/tslint.json b/types/chordsheetjs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chordsheetjs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/chroma-js/chroma-js-tests.ts b/types/chroma-js/chroma-js-tests.ts index fdd1b5946b..f1709dd31a 100644 --- a/types/chroma-js/chroma-js-tests.ts +++ b/types/chroma-js/chroma-js-tests.ts @@ -82,6 +82,9 @@ function test_color() { chroma('aquamarine').luminance(0.5, 'lab'); chroma('aquamarine').luminance(0.5, 'hsl'); chroma('orange').hex(); + chroma('orange').hex('auto'); + chroma('orange').hex('rgb'); + chroma('orange').alpha(0.5).hex('rgba'); chroma('#ffa500').name(); chroma('#ffa505').name(); chroma('teal').css(); @@ -107,6 +110,11 @@ function test_color() { chroma('teal').alpha(0.5).css(); chroma('teal').css('hsl'); chroma('orange').rgb(); + + chroma('#000000').num(); + chroma('#0000ff').num(); + chroma('#00ff00').num(); + chroma('#ff0000').num(); } function test_scale() { diff --git a/types/chroma-js/index.d.ts b/types/chroma-js/index.d.ts index 8fdae85b4d..162a318dc8 100644 --- a/types/chroma-js/index.d.ts +++ b/types/chroma-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Chroma.js 1.3 +// Type definitions for Chroma.js 1.4 // Project: https://github.com/gka/chroma.js // Definitions by: Sebastian Brückner , Marcin Pacholec // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -260,9 +260,18 @@ declare namespace chroma { luminance(l: number, colorSpace?: keyof ColorSpaces): Color; /** - * Get color as hexadecimal string. E.g. '#ffa500' + * Get color as hexadecimal string. + * + * @param mode `auto` - string will include alpha channel only if it's less than 1. + * `rgb` - string will not include alpha channel. + * `rgba` - string will include alpha channel. + * + * @example + * chroma('orange').hex() === '#ffa500' + * chroma('orange').alpha(0.5).hex() === '#ffa50080' + * chroma('orange').alpha(0.5).hex('rgb') === '#ffa500' */ - hex(): string; + hex(mode?: 'auto' | 'rgb' | 'rgba'): string; /** * Returns the named color. Falls back to hexadecimal RGB string, if the color isn't present. @@ -280,6 +289,17 @@ declare namespace chroma { * [temperature gradient]{@link ChromaStatic.temperature} above. */ temperature(): number; + + /** + * Returns the numeric representation of the hexadecimal RGB color. + * + * @example + * chroma('#000000').num() === 0 + * chroma('#0000ff').num() === 255 + * chroma('#00ff00').num() === 65280 + * chroma('#ff0000').num() === 16711680 + */ + num(): number; } & { [K in keyof ColorSpaces]: () => ColorSpaces[K]; }; @@ -322,6 +342,7 @@ declare namespace chroma { */ out(format: null): Scale; out(format: K): Scale; + out(format: 'hex'): Scale; } interface Cubehelix { diff --git a/types/chrome-apps/index.d.ts b/types/chrome-apps/index.d.ts index 33b760ce82..8873e80da2 100644 --- a/types/chrome-apps/index.d.ts +++ b/types/chrome-apps/index.d.ts @@ -612,7 +612,10 @@ declare namespace chrome { * @deprecated Deprecated since Chrome 36. Use innerBounds or outerBounds. */ maxHeight?: integer; - /** Type of window to create */ + /** + * @deprecated Deprecated since Chrome 69. All app windows use the 'shell' window type. + * @description Type of window to create + **/ type?: 'shell'; /** * If true, the window will have its own shelf icon. @@ -919,7 +922,8 @@ declare namespace chrome { level?: integer; } /** - * Device properties by which to filter the list of returned audio devices. If the filter is not set or set to {}, returned device list will contain all available audio devices. + * Device properties by which to filter the list of returned audio devices. + * If the filter is not set or set to {}, returned device list will contain all available audio devices. */ interface Filter { /** @@ -1083,8 +1087,9 @@ declare namespace chrome { function getDevices(callback: (devices: Device[]) => void): void; /** - * Get a list of Bluetooth devices known to the system, including paired and recently discovered devices. - * @param filter Since Chrome 67. Some criteria to filter the list of returned bluetooth devices. If the filter is not set or set to {}, returned device list will contain all bluetooth devices. Right now this is only supported in ChromeOS, for other platforms, a full list is returned. + * @since Chrome 67. + * @description Get a list of Bluetooth devices known to the system, including paired and recently discovered devices. + * @param filter Some criteria to filter the list of returned bluetooth devices. If the filter is not set or set to {}, returned device list will contain all bluetooth devices. Right now this is only supported in ChromeOS, for other platforms, a full list is returned. * @param callback Called when the search is completed. */ function getDevices(filter: DeviceFilter, callback: (devices: Device[]) => void): void; @@ -2082,12 +2087,12 @@ declare namespace chrome { /** * **Dev channel only.** * Sets image data to clipboard - * @param imageData The encoded image data. *Since Chrome 70. Warning: this is the current Beta channel.* - * @param type The type of image being passed. *Since Chrome 70. Warning: this is the current Beta channel.* + * @param imageData The encoded image data. *Since Chrome 71. Warning: this is the current Dev channel.* + * @param type The type of image being passed. *Since Chrome 71. Warning: this is the current Dev channel.* * @param [additionalItems] Additional data items for describing image data. * The callback is called with chrome.runtime.lastError set to error code if there is an error. * Requires clipboard and clipboardWrite permissions. - * *Since Chrome 70. Warning: this is the current Beta channel.* + * *Since Chrome 71. Warning: this is the current Dev channel.* * @param [callback] */ function setImageData(imageData: ArrayBuffer, type: ImageType, additionalItems?: AdditionalItems, callback?: () => void): void; @@ -3078,7 +3083,8 @@ declare namespace chrome { 'document_end' | 'document_idle'; /** - * The origin of injected CSS. + * @since Chrome 66. + * @description The origin of injected CSS. **/ type CSSOrigin = 'author' | @@ -3363,7 +3369,7 @@ declare namespace chrome { function chooseEntry(options: ChooseEntryOptionsBase, callback: FileEntryCallback): void; function chooseEntry(options: ChooseFileEntryOptions, callback: FileEntryCallback): void; function chooseEntry(options: ChooseSaveFileEntryOptions, callback: FileEntryCallback): void; - function chooseEntry(options: ChooseMultipleFilesEntryOptions, callback: FileEntryCallback): void; + function chooseEntry(options: ChooseMultipleFilesEntryOptions, callback: FileEntryCallback): void; function chooseEntry(options: ChooseDirectoryEntryOptions, callback: FileEntryCallback): void; /** Returns the file entry with the given id if it can be restored. This call will fail with a runtime error otherwise. */ function restoreEntry(id: string, callback: (entry: FileEntry) => void): void; @@ -5968,6 +5974,11 @@ declare namespace chrome { SSID?: S; /** The network signal strength. */ SignalStrength?: integer; + /** + * @since Chrome 70 + * @description The tethering state associated with the connection. + */ + TetheringState?: string; } interface WiFiProperties void>; /** - * The user clicked on a link for the app's notification settings. - * @since Chrome 32. + * @deprecated Deprecated since Chrome 65. Custom notification settings button is no longer supported. + * @description The user clicked on a link for the app's notification settings. + * As of Chrome 47, only ChromeOS has UI that dispatches this event. + * As of Chrome 65, that UI has been removed from ChromeOS, too. */ const onShowSettings: chrome.events.Event<() => void>; @@ -9319,7 +9339,10 @@ declare namespace chrome { /** The display mode height in native pixels. */ heightInNativePixels: integer; - /** The display mode UI scale factor. */ + /** + * @deprecated Deprecated since Chrome 70. Use `displayZoomFactor` + * @description The display mode UI scale factor. + **/ uiScale: integer; /** The display mode device scale factor. */ @@ -9380,15 +9403,16 @@ declare namespace chrome { * If set to true, changes the display mode to unified desktop. * If set to false, unified desktop mode will be disabled. * This is only valid for the primary display. - * If provided, mirroringSourceId must not be provided and other properties may not apply. This is has no effect if not provided. - * @see(See enableUnifiedDesktop for details). + * If provided, mirroringSourceId must not be provided and other properties may not apply. + * This is has no effect if not provided. + * @see(See `enableUnifiedDesktop` for details). * @since Chrome 59 * */ isUnified?: boolean; /** * @requires(CrOS) Chrome OS only. - * @deprecated Deprecated since Chrome 68. Use *setMirrorMode* + * @deprecated Deprecated since Chrome 68. Use ´setMirrorMode´ * @see setMirrorMode * @description * If set and not empty, enables mirroring for this display. @@ -9416,7 +9440,7 @@ declare namespace chrome { * If set, updates the display's rotation. * Legal values are [0, 90, 180, 270]. * The rotation is set clockwise, relative to the display's vertical position. - * It's applied after overscan paramter. + * It's applied after overscan parameter. */ rotation?: 0 | 90 | 180 | 270; @@ -9912,10 +9936,10 @@ declare namespace chrome { /** The language that this voice supports, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ lang?: string; /** - * This voice's gender. - * One of: 'male', or 'female' + * @deprecated Deprecated since Chrome 70. Gender is deprecated and will be ignored. + * @description This voice's gender. */ - gender?: string; + gender?: 'male' | 'female'; /** The name of the voice. */ voiceName?: string; /** The ID of the extension providing this voice. */ @@ -9959,10 +9983,10 @@ declare namespace chrome { /** The extension ID of the speech engine to use, if known. */ extensionId?: string; /** - * Gender of voice for synthesized speech. - * One of: 'male', or 'female' + * @deprecated Deprecated since Chrome 70. Gender is deprecated and will be ignored. + * @description Gender of voice for synthesized speech. */ - gender?: string; + gender?: 'male' | 'female'; /** The TTS event types the voice must support. */ requiredEventTypes?: string[]; /** The TTS event types that you are interested in listening to. If missing, all event types may be sent. */ @@ -10983,7 +11007,7 @@ declare namespace chrome { */ class RequestMatcher { protected readonly typeGuard: 'RequestMatcher'; - constructor (parameters?: RequestMatcherFields); + constructor(parameters?: RequestMatcherFields); public readonly instanceType: string; } @@ -11001,7 +11025,7 @@ declare namespace chrome { /** Declarative event action that redirects a network request. */ class RedirectRequest { protected readonly typeGuard: 'RedirectRequest'; - constructor (parameters: RedirectRequestParams); + constructor(parameters: RedirectRequestParams); public readonly instanceType: string; } @@ -11036,7 +11060,7 @@ declare namespace chrome { */ class RedirectByRegEx { protected readonly typeGuard: 'RedirectByRegEx'; - constructor (parameters: RedirectByRegExParams); + constructor(parameters: RedirectByRegExParams); public readonly instanceType: string; } @@ -11055,7 +11079,7 @@ declare namespace chrome { */ class SetRequestHeader { protected readonly typeGuard: 'SetRequestHeader'; - constructor (parameters: SetRequestHeaderParams); + constructor(parameters: SetRequestHeaderParams); public readonly instanceType: string; } @@ -11072,7 +11096,7 @@ declare namespace chrome { */ class RemoveRequestHeader { protected readonly typeGuard: 'RemoveRequestHeader'; - constructor (parameters: RemoveRequestHeaderParams); + constructor(parameters: RemoveRequestHeaderParams); public readonly instanceType: string; } @@ -11091,7 +11115,7 @@ declare namespace chrome { */ class AddResponseHeader { protected readonly typeGuard: 'AddResponseHeader'; - constructor (parameters: AddResponseHeaderParams); + constructor(parameters: AddResponseHeaderParams); public readonly instanceType: string; } @@ -11107,7 +11131,7 @@ declare namespace chrome { */ class RemoveResponseHeader { protected readonly typeGuard: 'RemoveResponseHeader'; - constructor (parameters: RemoveResponseHeaderParams); + constructor(parameters: RemoveResponseHeaderParams); public readonly instanceType: string; } @@ -11133,7 +11157,7 @@ declare namespace chrome { */ class IgnoreRules { protected readonly typeGuard: 'IgnoreRules'; - constructor (parameters: IgnoreRulesParams); + constructor(parameters: IgnoreRulesParams); public readonly instanceType: string; } @@ -11150,7 +11174,7 @@ declare namespace chrome { */ class SendMessageToExtension { protected readonly typeGuard: 'SendMessageToExtension'; - constructor (parameters: SendMessageParams); + constructor(parameters: SendMessageParams); public readonly instanceType: string; } @@ -11248,7 +11272,7 @@ declare namespace chrome { */ class AddRequestCookie { protected readonly typeGuard: 'AddRequestCookie'; - constructor (parameters: AddCookie); + constructor(parameters: AddCookie); public readonly instanceType: string; } @@ -11259,7 +11283,7 @@ declare namespace chrome { */ class AddResponseCookie { protected readonly typeGuard: 'AddResponseCookie'; - constructor (parameters: AddCookie); + constructor(parameters: AddCookie); public readonly instanceType: string; } @@ -11292,7 +11316,7 @@ declare namespace chrome { * @param modification Attributes that shall be overridden in cookies that machted the filter. * Attributes that are set to an empty string are removed. */ - constructor (parameters: EditCookieParams); + constructor(parameters: EditCookieParams); public readonly instanceType: string; } @@ -11306,7 +11330,7 @@ declare namespace chrome { * @param filter Filter for cookies that will be modified.All empty entries are ignored. * @param modification */ - constructor (parameter: EditCookieParams); + constructor(parameter: EditCookieParams); public readonly instanceType: string; } @@ -11316,7 +11340,7 @@ declare namespace chrome { */ class RemoveRequestCookie { protected readonly typeGuard: 'RemoveRequestCookie'; - constructor (parameters: RemoveCookieParams); + constructor(parameters: RemoveCookieParams); public readonly instanceType: string; } @@ -11340,7 +11364,7 @@ declare namespace chrome { */ class RemoveResponseCookie { protected readonly typeGuard: 'RemoveResponseCookie'; - constructor (parameters: RemoveCookieParams); + constructor(parameters: RemoveCookieParams); public readonly instanceType: string; } @@ -11518,7 +11542,7 @@ declare namespace chrome { */ declare class HTMLAppViewElement extends HTMLElement { /** Create a new AppView tag */ - constructor (); + constructor(); /** * Requests another app to be embedded. * @param app The extension id of the app to be embedded. @@ -11626,7 +11650,7 @@ declare class HTMLWebViewElement extends HTMLElement { src: string; /** Create a new element */ - constructor (); + constructor(); /** * Queries audio state. @@ -11908,6 +11932,21 @@ declare class HTMLWebViewElement extends HTMLElement { */ loadDataWithBaseUrl(dataUrl: string, baseUrl: string, virtualUrl?: string): void; + /** + * @since Chrome 71 + * @description Sets spatial navigation state of the webview. + * @param enabled Spatial navigation state value. + */ + setSpatialNavigationEnabled(enabled: boolean): void; + + /** + * @since Chrome 71 + * @description Queries whether spatial navigation is enabled for the webview. + * @param callback Callback that will provide the value of the spatial navigation state. + */ + isSpatialNavigationEnabled(callback: (enabled: boolean) => void): void; + + /** * Forcibly kills the guest web page's renderer process. * This may affect multiple webview tags in the current app if they share the same process, diff --git a/types/chrome-apps/test/index.ts b/types/chrome-apps/test/index.ts index 93864d107b..499a34bab1 100644 --- a/types/chrome-apps/test/index.ts +++ b/types/chrome-apps/test/index.ts @@ -1114,6 +1114,7 @@ chrome.networking.onc.getNetworks({ 'networkType': 'All' }, (networkList) => { if (networkObj.WiFi) { // WiFi active :) console.log('Wifi BSID: ' + networkObj.WiFi.BSSID); + const state = networkObj.WiFi.TetheringState; } chrome.networking.onc.setProperties(networkObj.GUID || '', { WiFi: { @@ -1124,6 +1125,19 @@ chrome.networking.onc.getNetworks({ 'networkType': 'All' }, (networkList) => { chrome.networking.onc.getProperties(networkObj.GUID || '', (props) => { const WiFiResult = props.WiFi; }); + chrome.networking.onc.getState(networkObj.GUID || '', (state) => { + const wifiState = state.WiFi || {}; + return wifiState.TetheringState; + }); + chrome.networking.onc.getManagedProperties(networkObj.GUID || '', (result) => { + const wifiResult = result.WiFi; + if (wifiResult !== undefined) { + const managed = wifiResult.HexSSID; + if (managed !== undefined) { + return managed.UserPolicy; + } + } + }); } }); diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 49f079e159..ba074550f8 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -4525,12 +4525,12 @@ declare namespace chrome.pageAction { * Shows the page action. The page action is shown whenever the tab is selected. * @param tabId The id of the tab for which you want to modify the page action. */ - export function hide(tabId: number): void; + export function hide(tabId: number, callback?: () => void): void; /** * Shows the page action. The page action is shown whenever the tab is selected. * @param tabId The id of the tab for which you want to modify the page action. */ - export function show(tabId: number): void; + export function show(tabId: number, callback?: () => void): void; /** Sets the title of the page action. This is displayed in a tooltip over the page action. */ export function setTitle(details: TitleDetails): void; /** Sets the html document to be opened as a popup when the user clicks on the page action's icon. */ diff --git a/types/chrome/tslint.json b/types/chrome/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/chrome/tslint.json +++ b/types/chrome/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/ckeditor/ckeditor-tests.ts b/types/ckeditor/ckeditor-tests.ts index a6f9c9cf5c..6a0b50a4d8 100644 --- a/types/ckeditor/ckeditor-tests.ts +++ b/types/ckeditor/ckeditor-tests.ts @@ -914,6 +914,9 @@ function test_skin() { CKEDITOR.skin.loadPart('part', () => console.log('load')); var path2: string = CKEDITOR.skin.path(); + + CKEDITOR.skin.ua_dialog = 'ie,iequirks,ie8,gecko'; + CKEDITOR.skin.ua_editor = 'ie,gecko'; } function test_style() { diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts index fb7fe92088..69c23d6a99 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -2,13 +2,14 @@ // Project: https://ckeditor.com/ckeditor-4/ // Definitions by: Thomas Wittwer // Stuart Long +// Viktor Pegy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // WORK-IN-PROGRESS: Any contribution support welcomed. // See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/1827 for more informations. interface Window { - CKEDITOR_BASEPATH: string; + CKEDITOR_BASEPATH?: string; } declare namespace CKEDITOR { @@ -2168,6 +2169,8 @@ declare namespace CKEDITOR { // tslint:disable-next-line:no-duplicate-variable var name: string; var ua: { [name: string]: any }; + var ua_dialog: string; + var ua_editor: string; function addIcon(name: string, path: string, offset?: number, bgsize?: string): void; function chameleon(editor: string, part: string): void; @@ -2530,7 +2533,7 @@ declare namespace CKEDITOR { accessKeyUp(dialog: dialog, key: string): void; disable(): void; enable(): void; - focus(): ui.dialog.uiElement; + focus(): ui.dialog.uiElement | undefined; getDialog(): dialog; getElement(): dom.element; getInputElement(): dom.element; @@ -2541,7 +2544,7 @@ declare namespace CKEDITOR { isVisible(): boolean; registerEvents(definition: CKEDITOR.dialog.definition.uiElement): ui.dialog.uiElement; selectParentTab(): ui.dialog.uiElement; - setValue(value: any, noChangeEvent: boolean): ui.dialog.uiElement; + setValue(value: any, noChangeEvent: boolean): ui.dialog.uiElement | undefined; } class vbox extends hbox { diff --git a/types/ckeditor__ckeditor5-utils/ckeditor__ckeditor5-utils-tests.ts b/types/ckeditor__ckeditor5-utils/ckeditor__ckeditor5-utils-tests.ts new file mode 100644 index 0000000000..82c272a6ec --- /dev/null +++ b/types/ckeditor__ckeditor5-utils/ckeditor__ckeditor5-utils-tests.ts @@ -0,0 +1,594 @@ +import * as utils from "ckeditor__ckeditor5-utils"; + +declare const document: Document; +declare const locale: utils.Locale; +declare let bool: boolean; +declare let changes: utils.Change[]; +declare let emitter: utils.Emitter; +declare let htmlElement: HTMLElement; +declare let map: Map; +declare let num: number; +declare let rect: utils.Rect; +declare let rectOrNull: utils.Rect | null; +declare let str: string; + +// utils/dom + +utils.createElement(document, "p"); +utils.createElement(document, "p", {class: "foo"}); +utils.createElement(document, "p", null, "foo"); +utils.createElement(document, "p", null, ["foo", utils.createElement(document, "img")]); + +// TODO? utils/dom/emittermixin + +utils.getAncestors(htmlElement); + +utils.getBorderWidths(htmlElement); + +utils.getCommonAncestor(htmlElement, htmlElement); + +str = utils.getDataFromElement(htmlElement); + +let strNull: HTMLElement | null = utils.getPositionedAncestor(); +strNull = utils.getPositionedAncestor(htmlElement); + +num = utils.indexOf(htmlElement); + +utils.insertAt(htmlElement, 2, htmlElement); + +bool = utils.isNode(htmlElement); +bool = utils.isNode(new Date()); + +bool = utils.isRange(new Range()); +bool = utils.isRange(new Date()); + +bool = utils.isText(new Text("foo")); +bool = utils.isText(new Date()); + +bool = utils.isWindow(window); +bool = utils.isWindow(new Date()); + +let position: utils.Position; + +position = utils.getOptimalPosition({ + element: htmlElement, + target: () => htmlElement, + positions: [(targetRect, elementRect) => ({ + top: targetRect.top, + left: targetRect.left + elementRect.width, + name: "right" + })] +}); + +position = utils.getOptimalPosition({ + element: htmlElement, + target: htmlElement, + positions: [ + (targetRect) => ({ + top: targetRect.bottom, + left: targetRect.left, + name: "mySouthEastPosition" + }), + (targetRect, elementRect) => ({ + top: targetRect.top - elementRect.height, + left: targetRect.left, + name: "myNorthEastPosition" + }) + ], + limiter: document.body, + fitInViewport: true, +}); + +rect = new utils.Rect(document.body); +rect = new utils.Rect(document.getSelection()!.getRangeAt(0)); +rect = new utils.Rect(window); +rect = new utils.Rect({top: 0, right: 10, bottom: 10, left: 0, width: 10, height: 10}); +rect = new utils.Rect(rect); +rect = new utils.Rect(document.body.getClientRects().item(0)!); + +rect = rect.clone(); +bool = rect.contains(rect); +rect = rect.excludeScrollbarsAndBorders(); +num = rect.getArea(); +rect = rect.getIntersection(rect); +num = rect.getIntersectionArea(rect); +rectOrNull = rect.getVisible(); +bool = rect.isEqual(rect); +rect = rect.moveBy(1, 1); +rect = rect.moveTo(1, 1); + +utils.remove(htmlElement); + +utils.scrollAncestorsToShowTarget(new Range()); +utils.scrollAncestorsToShowTarget(htmlElement); + +utils.scrollViewportToShowTarget({target: new Range()}); +utils.scrollViewportToShowTarget({target: htmlElement}); +utils.scrollViewportToShowTarget({target: new Range(), viewportOffset: 30}); +utils.scrollViewportToShowTarget({target: htmlElement, viewportOffset: 30}); + +utils.setDataInElement(htmlElement, "foo"); + +str = utils.toUnit("rem")(10); + +// utils/ckeditorerror ======================================================== + +const regularError = new Error("foo"); +let ckeditorError: utils.CKEditorError; + +const data = {bar: 1}; +ckeditorError = new utils.CKEditorError("foo"); +ckeditorError = new utils.CKEditorError("foo", data); + +utils.CKEditorError.isCKEditorError(ckeditorError); +utils.CKEditorError.isCKEditorError(regularError); + +// utils/collection =========================================================== + +interface Foo { + foo: number; +} + +interface Props { + id: string; +} + +interface PropsStr { + id: string; + name: string; +} + +declare let foo: Foo; +let items: PropsStr[]; +let itemOrNull: Props | null; +let itemOrUndef: Props | undefined; + +const item1 = {id: "id1"}; +const item2 = {id: "id2"}; +const itemStr1 = {id: "foo", name: "yy"}; +const itemStr2 = {id: "foo", name: "xx"}; + +const coll = new utils.Collection(); +const collStr = new utils.Collection({idProperty: "name"}); + +coll.add(item1); +coll.add(item2); +collStr.add(itemStr1); +collStr.add(itemStr2); + +coll.add(item1, 0); +coll.add(item1).add(item2); + +coll.clear(); + +items = collStr.filter((item) => item.name === "yy"); +items = collStr.filter((_, idx) => idx > 0); +items = collStr.filter(function(this: Foo, _, idx) {return this.foo > 0 && idx === 0; }, foo); + +itemOrUndef = collStr.find((item) => item.name === "yy"); +itemOrUndef = collStr.find((_, idx) => idx === 3); +itemOrUndef = collStr.find(function(this: Foo, _, idx) {return this.foo > 0 && idx === 0; }, foo); + +itemOrNull = coll.get(0); +itemOrNull = coll.get("id1"); + +num = coll.getIndex("id1"); +num = coll.getIndex(item1); + +coll.remove(0); +coll.remove("id1"); +coll.remove(item1); + +const strings: string[] = collStr.map((item) => item.name); +const nums: number[] = collStr.map((_, idx) => idx); +const bools: boolean[] = collStr.map(function(this: Foo, _, idx) {return this.foo === idx; }, foo); + +// collection#bindTo + +interface LabelObj { + label: string; +} + +interface LabelValueObj { + label: {value: string}; +} + +interface HiddenObj { + hidden: boolean; +} + +class FactoryClass { + factoryLabel: string; + constructor(data: LabelObj) { + this.factoryLabel = data.label; + } +} + +const source1 = new utils.Collection({idProperty: "label"}); +const target1 = new utils.Collection(); + +target1.bindTo(source1).as(FactoryClass); + +source1.add({label: "foo"}); +source1.add({label: "bar"}); + +source1.remove(0); +console.log(target1.length); +console.log(target1.get(0)!.factoryLabel); + +class FooClass { + fooLabel: string; + constructor(data: LabelObj) { + this.fooLabel = data.label; + } +} + +class BarClass { + barLabel: string; + constructor(data: LabelObj) { + this.barLabel = data.label; + } +} + +const source2 = new utils.Collection({idProperty: "label"}); +const target2 = new utils.Collection(); + +target2.bindTo(source2).using((item) => { + if (item.label === "foo") { + return new FooClass(item); + } else { + return new BarClass(item); + } +}); + +source2.add({label: "foo"}); +source2.add({label: "bar"}); + +console.log(target2.length); +console.log(target2.get(0)! instanceof FooClass); +console.log(target2.get(1)! instanceof BarClass); + +const source3 = new utils.Collection({idProperty: "label"}); +const target3 = new utils.Collection(); + +target3.bindTo(source2).using("label"); + +source3.add({label: {value: "foo"}}); +source3.add({label: {value: "bar"}}); + +console.log(target3.length); +console.log(target3.get(0)!.value); +console.log(target3.get(1)!.value); + +const source4 = new utils.Collection(); +const target4 = new utils.Collection(); + +target4.bindTo(source4).using(item => { + if (item.hidden) { + return null; + } + + return item; +}); + +source4.add({hidden: true}); +source4.add({hidden: false}); + +// utils/comparearrays ======================================================== + +utils.compareArrays([0, 2], [0, 2, 1]); +utils.compareArrays(["abc", 0 ], ["abc", 0, 3]); + +// utils/config =============================================================== + +let strOrUndef: string | undefined; +let config: utils.Config; +const defaultConfig = { + foo: 1, bar: 2, +}; + +config = new utils.Config(); +config = new utils.Config({foo: 10}); +config = new utils.Config({}, defaultConfig); +config = new utils.Config({foo: 10}, defaultConfig); + +config.define({ + resize: { + minHeight: 400, + hidden: true + } +}); + +config.define("resize", {minHeight: 400, hidden: true}); +config.define("language", "en"); +config.define("resize.minHeight", 400); + +str = config.get("language"); +num = config.get("resize.minHeight"); + +config.define("language", undefined); +strOrUndef = config.get("language"); + +// utils/count ================================================================ + +num = utils.count([1, 2, 3, 4, 5]); + +// utils/diff ================================================================= + +changes = utils.diff("aba", "acca"); +changes = utils.diff(Array.from("aba"), Array.from("acca")); + +// utils/difftochanges ======================================================== + +const input = Array.from("abc"); +const output = Array.from("xaby"); +const allChanges = utils.diffToChanges(utils.diff(input, output), output); +allChanges.forEach(change => { + if (change.type === "insert") { + input.splice(change.index, 0, ...change.values); + } else if (change.type === "delete") { + input.splice(change.index, change.howMany); + } +}); + +// utils/elementreplacer ====================================================== + +const replacer = new utils.ElementReplacer(); + +replacer.replace(htmlElement, htmlElement); +replacer.replace(htmlElement); + +replacer.restore(); + +// utils/emittermixin + +emitter = utils.EmitterMixin; +emitter = Object.create(utils.EmitterMixin); + +emitter.delegate("foo") ; +emitter.delegate("foo", "bar"); +emitter.delegate("foo").to(emitter); +emitter.delegate("foo").to(emitter, "bar"); +emitter.delegate("foo").to(emitter, name => name + "-delegated"); + +emitter.fire("foo"); +emitter.fire("foo", 1, "b", true); +emitter.fire("getSelectedContent", (evt: utils.EventInfo) => { + evt.return = new DocumentFragment(); + evt.stop(); +}); + +emitter.listenTo(emitter, "foo", () => {}); +emitter.listenTo(emitter, "foo", () => {}, {priority: 10}); +emitter.listenTo(emitter, "foo", () => {}, {priority: "highest"}); + +emitter.off("foo"); +emitter.off("foo", () => {}); + +emitter.on("foo", () => {}); +emitter.on("foo", () => {}, {priority: 10}); +emitter.on("foo", () => {}, {priority: "normal"}); + +emitter.once("foo", () => {}); +emitter.once("foo", () => {}, {priority: 10}); +emitter.once("foo", () => {}, {priority: "lowest"}); + +emitter.stopDelegating(); +emitter.stopDelegating("foo"); +emitter.stopDelegating("foo", emitter); + +emitter.stopListening(); +emitter.stopListening(emitter); +emitter.stopListening(emitter, "foo"); +emitter.stopListening(emitter, "foo", () => {}); + +// utils/env ================================================================== + +bool = utils.env.isEdge; +bool = utils.env.isMac; + +// utils/eventinfo ============================================================ + +const event = new utils.EventInfo({a: 1}, "test"); +num = event.source.a; +str = event.name; + +event.path[0]; + +event.stop(); +event.off(); + +bool = event.stop.called; +bool = event.off.called; + +// utils/fastdiff ============================================================= + +utils.fastDiff(str, "2ab").forEach(change => { + if (change.type === "insert") { + str = str.substring(0, change.index) + change.values.join("") + str.substring(change.index); + } else if (change.type === "delete") { + str = str.substring(0, change.index) + str.substring(change.index + change.howMany); + } +}); + +// utils/first ================================================================ + +const collection = [ 11, 22 ]; +const iterator = collection[Symbol.iterator](); + +utils.first(iterator); + +// utils/focustracker ========================================================= + +const focusTracker = new utils.FocusTracker(); +htmlElement = focusTracker.focusedElement; +bool = focusTracker.isFocused; +focusTracker.add(htmlElement); +focusTracker.remove(htmlElement); + +// utils/isiterable =========================================================== + +bool = utils.isIterable(str); +bool = utils.isIterable([1, 2, 3]); + +// utils/keyboard ============================================================= + +num = utils.keyCodes.a; +num = utils.keyCodes["a"]; + +num = utils.getCode("0"); +num = utils.getCode({keyCode: 48}) ; +num = utils.getCode({keyCode: 48, altKey: true, ctrlKey: true, shiftKey: true}); + +str = utils.getEnvKeystrokeText("alt+A"); + +num = utils.parseKeystroke("Ctrl+A"); +num = utils.parseKeystroke(["ctrl", "a"]); +num = utils.parseKeystroke(["shift", 33]); + +// utils/keystrokehandler ===================================================== + +declare const keystroke: utils.KeystrokeInfo; +const keystrokes = new utils.KeystrokeHandler(); + +const spy = utils.spy(); +keystrokes.set("Ctrl+A", spy); +keystrokes.set(["Ctrl", "A"], spy); +keystrokes.set(["Ctrl", "A"], spy, {priority: "high"}); +keystrokes.set(["Ctrl", 33], spy, {priority: 10}); + +const emitterMixxin = Object.create(utils.EmitterMixin) as utils.Emitter; +keystrokes.listenTo(emitterMixxin); + +bool = keystrokes.press(keystroke); + +keystrokes.destroy(); + +// utils/locale =============================================================== + +locale.t("Label"); +locale.t('Created file "%0" in %1ms.', ["fileName", "100"]); + +// utils/log ================================================================== + +utils.log.warn("message"); +utils.log.warn('plugin-load: It was not possible to load the "{$pluginName}" plugin in module "{$moduleName}', { + pluginName: "foo", + moduleName: "bar" +}); + +utils.log.error("message"); +utils.log.error('plugin-load: It was not possible to load the "{$pluginName}" plugin in module "{$moduleName}', { + pluginName: "foo", + moduleName: "bar" +}); + +// utils/mapsequal ============================================================ + +utils.mapsEqual(map, map); + +// utils/mix ================================================================== + +class Editor { + b: () => number; +} + +interface SomeMixin { + a: () => string; +} + +const SomeMixin = { + a() { + return "a"; + } +}; + +utils.mix(Editor, SomeMixin); +const mixEditor = new Editor() as Editor & SomeMixin; +mixEditor.a(); +mixEditor.b(); + +// utils/nth ================================================================== + +function* getGenerator() { + yield 11; + yield 22; + yield 33; +} + +utils.nth(2, getGenerator()); + +// utils/objecttomap ========================================================== + +const objMap: Map = utils.objectToMap({foo: 1, bar: 2}); +num = objMap.get("foo")!; + +// utils/observablemixin ====================================================== + +const observable: utils.Observable = utils.ObservableMixin; + +const vehicle = Object.create(utils.ObservableMixin) as utils.Observable; +const car = Object.create(utils.ObservableMixin) as utils.Observable; + +vehicle.bind("color"); +vehicle.bind("color", "year"); +vehicle.bind("color", "year").to(car); +vehicle.bind("color", "year").to(car, "color"); +vehicle.bind("color", "year").to(car, "color", car, "year"); +vehicle.bind("year").to(car, "color", car, "year", (a: string, b: number) => a + b); +vehicle.bind("custom").to(car, "color", car, "year", car, "hue", (...args: Array) => args.join("/")); // TS 3.0: [string, number, string] +vehicle.bind("color").toMany([car, car], "color", () => {}); + +vehicle.decorate("method"); + +car.set("color", "red"); +car.set("seats", undefined); +car.set({ + color: "blue", + wheels: 4, + seats: 5, +}); + +vehicle.unbind(); +vehicle.unbind("color"); +vehicle.unbind("color", "year"); + +// utils/priorities =========================================================== + +num = utils.priorities.get(2); +num = utils.priorities.get("normal"); + +// utils/spy + +const fn1 = utils.spy(); +fn1(); +bool = fn1.called; + +// utils/tomap + +map = utils.toMap({foo: 1, bar: 2}); +map = utils.toMap([["foo", 1], ["bar", 2]]); +map = utils.toMap(map); + +// utils/translation-service ================================================== + +utils.add("pl", { + OK: "OK", + "Cancel [context: reject]": "Anuluj" +}); + +utils.translate("pl", "Cancel [context: reject]"); + +// utils/uid ================================================================== + +str = utils.uid(); + +// utils/unicode ============================================================== + +bool = utils.isCombiningMark("a"); +bool = utils.isHighSurrogateHalf("a"); +bool = utils.isInsideCombinedSymbol(str, 2); +bool = utils.isInsideSurrogatePair(str, 2); +bool = utils.isLowSurrogateHalf(String.fromCharCode(57166)); + +// utils/version ============================================================== diff --git a/types/ckeditor__ckeditor5-utils/index.d.ts b/types/ckeditor__ckeditor5-utils/index.d.ts new file mode 100644 index 0000000000..8d9d50e889 --- /dev/null +++ b/types/ckeditor__ckeditor5-utils/index.d.ts @@ -0,0 +1,471 @@ +// Type definitions for @ckeditor/ckeditor5-utils 10.2 +// Project: https://github.com/ckeditor/ckeditor5-utils +// Definitions by: denisname +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// Helpers + +export interface DeleteChange { + index: number; + type: "delete"; + howMany: number; +} + +export interface InsertChange { + index: number; + type: "insert"; + values: string[]; +} + +export interface BindChain { + to(observable: Observable, ...bindProperties: Array): void; + toMany(observable: Observable[], ...bindProperties: Array): void; +} + +export interface CollectionBindTo { + as: (Class: {new(item: T): K}) => void; + using: (callbackOrProperty: keyof T | ((item: T) => K)) => void; +} + +// utils/dom + +export function createElement(doc: Document, name: string, attributes?: object | null, children?: Node | string | Array): Element; + +// TODO? utils/dom/emittermixin + +export function getAncestors(node: Node): Array; + +export function getBorderWidths(element: HTMLElement): {top: number, right: number, bottom: number, left: number}; + +export function getCommonAncestor(nodeA: Node, nodeB: Node): Node | DocumentFragment | Document | null; + +export function getDataFromElement(el: HTMLElement): string; + +export function getPositionedAncestor(element?: HTMLElement): HTMLElement | null; + +export function indexOf(node: Node): number; + +export function insertAt(parentElement: Element, index: number, nodeToInsert: Node): void; + +export function isNode(obj: any): obj is Node; + +export function isRange(obj: any): obj is Range; + +export function isText(obj: any): obj is Text; + +export function isWindow(obj: any): obj is Window; + +export interface Options { + element: HTMLElement; + fitInViewport?: boolean; + limiter?: HTMLElement | Range | ClientRect | Rect | (() => HTMLElement | Range | ClientRect | Rect); + positions: Array<(targetRect: Rect, elementRect: Rect) => Position>; + target: HTMLElement | Range | ClientRect | Rect | (() => HTMLElement | Range | ClientRect | Rect); +} + +export interface Position { + left: number; + name: string; + top: number; +} + +export function getOptimalPosition(options: Options): Position; + +export class Rect { + readonly bottom: number; + readonly height: number; + readonly left: number; + readonly right: number; + readonly top: number; + readonly width: number; + + constructor(source: HTMLElement | Range | Window | ClientRect | Rect | object); + clone(): Rect; + contains(anotherRect: Rect): boolean; + excludeScrollbarsAndBorders(): Rect; + getArea(): number; + getIntersection(anotherRect: Rect): Rect; + getIntersectionArea(anotherRect: Rect): number; + getVisible(): Rect | null; + isEqual(rect: Rect): boolean; + moveBy(x: number, y: number): Rect; + moveTo(x: number, y: number): Rect; + + static getDomRangeRects(range: Range): Rect[]; +} + +export function remove(node: Node): void; + +export function scrollAncestorsToShowTarget(target: HTMLElement | Range): void; + +export function scrollViewportToShowTarget(options: {target: HTMLElement | Range, viewportOffset?: number}): void; + +export function setDataInElement(el: HTMLElement, data: string): void; + +export function toUnit(unit: string): (value: number) => string; + +// utils/ckeditorerror + +export const DOCUMENTATION_URL: string; + +export class CKEditorError extends Error { + data: object | undefined; + name: string; + + constructor(message: string, data?: object); + + static isCKEditorError(error: Error): boolean; +} + +export function attachLinkToDocumentation(message: string): string; + +// utils/collection + +export function as(Class: Function): void; +export function using(callbackOrProperty: Function | string): void; + +export class Collection implements Iterable, Emitter { + first: T | null; + last: T | null; + length: number; + + constructor(options?: {idProperty?: keyof T}); + add(item: T, index?: number): this; + bindTo(externalCollection: Collection): CollectionBindTo; + clear(): void; + filter(callbackfn: (item: T, index: number) => boolean, thisArg?: any): T[]; + find(predicate: (item: T, index: number) => boolean, thisArg?: any): T | undefined; + get(idOrIndex: string | number): T | null; + getIndex(idOrItem: string | T): number; + map(callbackfn: (item: T, index: number) => U, thisArg?: any): U[]; + remove(subject: T | number | string): T; + + // Iterable + [Symbol.iterator](): Iterator; + + // Emitter + delegate(...events: string[]): EmitterMixinDelegateChain; + fire(eventOrInfo: string | EventInfo, ...args: any[]): any; + listenTo(emitter: Emitter, event: string, callback: Function, options?: {priority?: PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + stopDelegating(event?: string, emitter?: Emitter): void; + stopListening(emitter?: Emitter, event?: string, callback?: Function): void; +} + +// utils/comparearrays + +export type ArrayRelation = "extension" | "same" | "prefix"; + +export function compareArrays(a: ReadonlyArray, b: ReadonlyArray): number | ArrayRelation; + +// utils/config + +export class Config { + constructor(configurations?: object, defaultConfigurations?: object); + define(name: object): void; + define(name: string, value: any): void; + get(name: string): any /*| undefined*/; + set(name: string, value: any /*| undefined*/): void; +} + +// utils/count + +export function count(iterator: Iterable): number; + +// utils/diff + +export type Change = "equal" | "insert" | "delete"; + +export function diff(a: string, b: string, cmp?: (a: string, b: string) => boolean): Change[]; +export function diff(a: ReadonlyArray, b: ReadonlyArray, cmp?: (a: string, b: string) => boolean): Change[]; + +// utils/difftochanges + +export function diffToChanges(diff: Change[], output: string | string[]): Array; + +// utils/elementreplacer + +export class ElementReplacer { + replace(element: HTMLElement, newElement?: HTMLElement): void; + restore(): void; +} + +// utils/emittermixin + +export const EmitterMixin: Emitter; + +export interface Emitter { + delegate(...events: string[]): EmitterMixinDelegateChain; + fire(eventOrInfo: string | EventInfo, ...args: any[]): any; + listenTo(emitter: Emitter, event: string, callback: Function, options?: {priority?: PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + stopDelegating(event?: string, emitter?: Emitter): void; + stopListening(emitter?: Emitter, event?: string, callback?: Function): void; +} + +export interface EmitterMixinDelegateChain { + to(emitter: Emitter, nameOrFunction?: string | ((name: string) => string)): void; +} + +// utils/env + +export namespace env { + const isEdge: boolean; + const isMac: boolean; +} + +// utils/eventinfo + +export class EventInfo { + readonly name: string; + readonly path: object[]; + return: any /*| undefined*/; + readonly source: T; + + constructor(source: T, name: string); + off: { + (): void; + called: boolean; + }; + stop: { + (): void; + called: boolean; + }; +} + +// utils/fastdiff + +export function fastDiff(oldText: string, newText: string): Array; + +// utils/first + +export function first(iterable: Iterable): T; + +// utils/focustracker + +export class FocusTracker implements Observable { + readonly focusedElement: HTMLElement; + readonly isFocused: boolean; + + add(element: HTMLElement): void; + remove(element: HTMLElement): void; + + // Observable + bind(...bindProperties: string[]): BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + + // Observable (Emitter) + delegate(...events: string[]): EmitterMixinDelegateChain; + fire(eventOrInfo: string | EventInfo, ...args: any[]): any; + listenTo(emitter: Emitter, event: string, callback: Function, options?: {priority?: PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + stopDelegating(event?: string, emitter?: Emitter): void; + stopListening(emitter?: Emitter, event?: string, callback?: Function): void; +} + +// utils/isiterable + +export function isIterable(value: any): value is Iterable; + +// utils/keyboard + +export const keyCodes: { + a: 65, + b: 66, + c: 67; + d: 68; + e: 69; + f: 70; + g: 71; + h: 72; + i: 73; + j: 74; + k: 75; + l: 76; + m: 77; + n: 78; + o: 79; + p: 80; + q: 81; + r: 82; + s: 83; + t: 84; + u: 85; + v: 86; + w: 87; + x: 88; + y: 89; + z: 90; + + 0: 48; + 1: 49; + 2: 50; + 3: 51; + 4: 52; + 5: 53; + 6: 54; + 7: 55; + 8: 56; + 9: 57; + + f1: 112; + f2: 113; + f3: 114; + f4: 115; + f5: 116; + f6: 117; + f7: 118; + f8: 118; + f9: 120; + f10: 121; + f11: 122; + f12: 123; + + arrowleft: 37, + arrowup: 38, + arrowright: 39, + arrowdown: 40, + backspace: 8, + "delete": 46, + enter: 13, + space: 32, + esc: 27, + tab: 9, + ctrl: 0x110000, + cmd: 0x110000, + shift: 0x220000, + alt: 0x440000 +}; + +export interface KeystrokeInfo { + altKey?: boolean; + ctrlKey?: boolean; + keyCode: number; + shiftKey?: boolean; +} + +export function getCode(key: string | KeystrokeInfo): number; + +export function getEnvKeystrokeText(keystroke: string): string; + +export function parseKeystroke(keystroke: string | Array): number; + +// utils/keystrokehandler + +export class KeystrokeHandler { + constructor(); + destroy(): void; + listenTo(emitter: Emitter): void; + press(keyEvtData: KeystrokeInfo): boolean; + set(keystroke: string | Array, callback: Function, options?: {priority?: PriorityString | number}): void; +} + +// utils/locale + +export class Locale { + readonly language: string; + + constructor(language?: string); + t(str: string, values?: string[]): string; +} + +// utils/log + +export namespace log { + function error(message: string, data?: object): void; + function warn(message: string, data?: object): void; +} + +// utils/mapsequal + +export function mapsEqual(mapsA: Map, mapsB: Map): boolean; + +// utils/mix + +export function mix(baseClass: {new(): any}, ...mixins: any[]): void; + +// utils/nth + +export function nth(index: number, iterable: Iterable): T; + +// utils/objecttomap + +export function objectToMap(obj: T): Map; + +// utils/observablemixin + +export const ObservableMixin: Observable; + +export interface Observable extends Emitter { + bind(...bindProperties: string[]): BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + + // Emitter + delegate(...events: string[]): EmitterMixinDelegateChain; + fire(eventOrInfo: string | EventInfo, ...args: any[]): any; + listenTo(emitter: Emitter, event: string, callback: Function, options?: {priority?: PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: PriorityString | number}): void; + stopDelegating(event?: string, emitter?: Emitter): void; + stopListening(emitter?: Emitter, event?: string, callback?: Function): void; +} + +// utils/priorities + +export namespace priorities { + function get(priority: PriorityString | number): number; +} + +export type PriorityString = "highest" | "high" | "normal" | "low" | "lowest"; + +// utils/spy + +export function spy(): {(): void; called: boolean}; + +// utils/tomap + +export function toMap(data: Map): Map; +export function toMap(data: ReadonlyArray<[K, V]>): Map; +export function toMap(data: T): Map; + +// utils/translation-service + +export function add(language: string, translations: {[key: string]: string}): void; + +export function translate(language: string, translationKey: string): string; + +// TODO: CKEDITOR_TRANSLATIONS + +// utils/uid + +export function uid(): string; + +// utils/unicode + +export function isCombiningMark(character: string): boolean; + +export function isHighSurrogateHalf(character: string): boolean; + +export function isInsideCombinedSymbol(string: string, offset: number): boolean; + +export function isInsideSurrogatePair(string: string, offset: number): boolean; + +export function isLowSurrogateHalf(character: string): boolean; + +// utils/version + +// TODO: CKEDITOR_VERSION; diff --git a/types/ckeditor__ckeditor5-utils/tsconfig.json b/types/ckeditor__ckeditor5-utils/tsconfig.json new file mode 100644 index 0000000000..1fbda2fd6b --- /dev/null +++ b/types/ckeditor__ckeditor5-utils/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ckeditor__ckeditor5-utils-tests.ts" + ] +} diff --git a/types/ckeditor__ckeditor5-utils/tslint.json b/types/ckeditor__ckeditor5-utils/tslint.json new file mode 100644 index 0000000000..332951717c --- /dev/null +++ b/types/ckeditor__ckeditor5-utils/tslint.json @@ -0,0 +1,20 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": { + "options": [ + ["Object", "Avoid using the `Object` type. Did you mean `object`?"], + ["Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?"], + ["Number", "Avoid using the `Number` type. Did you mean `number`?"], + ["String", "Avoid using the `String` type. Did you mean `string`?"], + ["Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?"] + ] + }, + "quotemark": [ + true, + "double", + "avoid-escape", + "avoid-template" + ] + } +} diff --git a/types/cli-interact/cli-interact-tests.ts b/types/cli-interact/cli-interact-tests.ts new file mode 100644 index 0000000000..89e55ee46f --- /dev/null +++ b/types/cli-interact/cli-interact-tests.ts @@ -0,0 +1,22 @@ +import * as cliInteract from 'cli-interact'; + +cliInteract.getChar('Tell me one of', 'abcdef'); +cliInteract.getChoiceByChar('frequency', ['daily', 'weekly', 'monthly']); +cliInteract.getChoiceByChar('frequency', ['daily', 'weekly', 'monthly'], true); +cliInteract.getChoice('frequency', ['daily', 'weekly', 'monthly']); +cliInteract.getChoice('frequency', ['daily', 'weekly', 'monthly'], { + returnNumeric: true, +}); +cliInteract.getIPversion(true); +cliInteract.getNumber('Case 1: You MAY give me a number: ', {allowNoAnswer: true}); +cliInteract.getNumber('Case 2: You MUST give me a number: '); +cliInteract.getNumber('Case 3: You MUST give me an integer: ', true); +cliInteract.getNumber('Case 4: You MAY give me an answer. If you do, it MUST be an integer', { + allowNoAnswer: true, + requireInteger: true, +}); +cliInteract.getYesNo('Is it true', true); +cliInteract.getYesNo('Is it true'); +cliInteract.question('Tell me what do you want: ', { + charlist: 'yn' +}); diff --git a/types/cli-interact/index.d.ts b/types/cli-interact/index.d.ts new file mode 100644 index 0000000000..eb05aa682e --- /dev/null +++ b/types/cli-interact/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for cli-interact 0.1 +// Project: https://github.com/zhami/cli-interact +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { BasicOptions } from 'readline-sync'; + +export interface ChoiceOptions { + allowNoAnswer?: boolean; + returnNumeric?: boolean; +} + +export interface NumberOptions { + allowNoAnswer?: boolean; + requireInteger?: boolean; +} + +export function getChar(promptText: string, allowedCharsAsString: string, flagAllowNoAnswer?: boolean): string; +export function getChoice(title: string, choices: string[], opts: ChoiceOptions & {returnNumeric: true}): number; +export function getChoice(title: string, choices: string[], opts?: ChoiceOptions): string; +export function getChoiceByChar(title: string, choices: string[], flagAllowNoAnswer?: boolean): string; +export function getInteger(promptText: string): number; +export function getIPversion(flagAllowNoAnswer?: boolean): string; +export function getNumber(promptText: string, opts?: boolean | NumberOptions): number; +export function getYesNo(title: string, flagAllowNoAnswer: true): boolean | undefined; +export function getYesNo(title: string, flagAllowNoAnswer?: false): boolean; +export function question(prompt: string, options?: BasicOptions): string; diff --git a/types/cli-interact/tsconfig.json b/types/cli-interact/tsconfig.json new file mode 100644 index 0000000000..76750910d6 --- /dev/null +++ b/types/cli-interact/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cli-interact-tests.ts" + ] +} diff --git a/types/cli-interact/tslint.json b/types/cli-interact/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cli-interact/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cli-table2/cli-table2-tests.ts b/types/cli-table2/cli-table2-tests.ts index dfaed4ec33..97d8c82dbe 100644 --- a/types/cli-table2/cli-table2-tests.ts +++ b/types/cli-table2/cli-table2-tests.ts @@ -230,3 +230,24 @@ table26.push( // feel free to use colors in your content strings, column widths will be calculated correctly const table27 = new Table({ colWidths: [5], style: { head: [], border: [] } }) as Table.HorizontalTable; table27.push([/*colors.red(*/'hello'/*)*/]); + +// Header as text +const table28 = new Table({ head: ["Top Header 1", "Top Header 2"] }) as Table.HorizontalTable; +table28.push( + ['Value Row 1 Col 1', 'Value Row 1 Col 2'], + ['Value Row 2 Col 1', 'Value Row 2 Col 2'] +); + +// Header as Cells +const table29 = new Table({ head: [{content: "Top Header 1"}, {content: "Top Header 2"}] }) as Table.HorizontalTable; +table29.push( + ['Value Row 1 Col 1', 'Value Row 1 Col 2'], + ['Value Row 2 Col 1', 'Value Row 2 Col 2'] +); + +// ColSpan in header +const table30 = new Table({ head: [{content: "Top Header 1", colSpan: 2}, {content: "Top Header 3"}] }) as Table.HorizontalTable; +table30.push( + ['Value Row 1 Col 1', 'Value Row 1 Col 2', 'Value Row 1 Col 3'], + ['Value Row 2 Col 1', 'Value Row 2 Col 2', 'Value Row 2 Col 3'] +); diff --git a/types/cli-table2/index.d.ts b/types/cli-table2/index.d.ts index b216b23832..865439f000 100644 --- a/types/cli-table2/index.d.ts +++ b/types/cli-table2/index.d.ts @@ -31,7 +31,7 @@ declare namespace CliTable2 { rowHeights: Array; colAligns: HorizontalAlignment[]; rowAligns: VerticalAlignment[]; - head: string[]; + head: Cell[]; wordWrap: boolean; } diff --git a/types/codemirror/codemirror-comment.d.ts b/types/codemirror/codemirror-comment.d.ts new file mode 100644 index 0000000000..47b99fd989 --- /dev/null +++ b/types/codemirror/codemirror-comment.d.ts @@ -0,0 +1,47 @@ +// Type definitions for CodeMirror +// Project: https://github.com/marijnh/CodeMirror +// Definitions by: Nikolaj Kappler +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// See docs https://codemirror.net/doc/manual.html#addon_comment + +// Todo: add 'toggleComment' command, once command type definitions exist in main definitions + +import * as CodeMirror from "codemirror"; + +declare module "codemirror" { + + interface Editor { + /** Tries to uncomment the current selection, and if that fails, line-comments it. */ + toggleComment(options?: CommentOptions): void; + /** Set the lines in the given range to be line comments. Will fall back to `blockComment` when no line comment style is defined for the mode. */ + lineComment(from: Position, to: Position, options?: CommentOptions): void; + /** Wrap the code in the given range in a block comment. Will fall back to `lineComment` when no block comment style is defined for the mode. */ + blockComment(from: Position, to: Position, options?: CommentOptions): void; + /** Try to uncomment the given range. Returns `true` if a comment range was found and removed, `false` otherwise. */ + uncomment(from: Position, to: Position, options?: CommentOptions): boolean; + } + + interface CommentOptions { + /** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */ + blockCommentStart?: string; + /** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */ + blockCommentEnd?: string; + /** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */ + blockCommentLead?: string; + /** Override the [comment string properties](https://codemirror.net/doc/manual.html#mode_comment) of the mode with custom comment strings. */ + lineComment?: string; + /** A string that will be inserted after opening and leading markers, and before closing comment markers. Defaults to a single space. */ + padding?: string; + /** Whether, when adding line comments, to also comment lines that contain only whitespace. */ + commentBlankLines?: boolean; + /** When adding line comments and this is turned on, it will align the comment block to the current indentation of the first line of the block. */ + indent?: boolean; + /** When block commenting, this controls whether the whole lines are indented, or only the precise range that is given. Defaults to `true`. */ + fullLines?: boolean; + } +} + +declare module "codemirror/addon/comment/comment" { + export = CodeMirror; +} diff --git a/types/codemirror/codemirror-panel.d.ts b/types/codemirror/codemirror-panel.d.ts new file mode 100644 index 0000000000..2059c8ff72 --- /dev/null +++ b/types/codemirror/codemirror-panel.d.ts @@ -0,0 +1,51 @@ +// Type definitions for CodeMirror +// Project: https://github.com/marijnh/CodeMirror +// Definitions by: Nikolaj Kappler +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// See docs https://codemirror.net/doc/manual.html#addon_panel + +import * as CodeMirror from "codemirror"; + +declare module "codemirror" { + interface Panel { + /**Removes the panel from the editor */ + clear(): void; + /**Notifies panel that height of DOM node has changed */ + changed(height?: number): void; + } + + interface ShowPanelOptions { + /**Controls the position of the newly added panel. The following values are recognized: + * `top` (default): Adds the panel at the very top. + * `after-top`: Adds the panel at the bottom of the top panels. + * `bottom`: Adds the panel at the very bottom. + * `before-bottom`: Adds the panel at the top of the bottom panels. + */ + position?: "top" | "after-top" | "bottom" | "before-bottom"; + /**The new panel will be added before the given panel. */ + before?: Panel; + /**The new panel will be added after the given panel. */ + after?: Panel; + /**The new panel will replace the given panel. */ + replace?: Panel; + /**Whether to scroll the editor to keep the text's vertical position stable, when adding a panel above it. Defaults to false. */ + stable?: boolean; + } + + interface Editor { + + /** + * Places a DOM node above or below an editor and shrinks the editor to make room for the node. + * When using the `after`, `before` or `replace` options, if the panel doesn't exists or has been removed, the value of the `position` option will be used as a fallback. + * @param node the DOM node + * @param options optional options object + */ + addPanel(node: HTMLElement, options?: ShowPanelOptions): Panel; + + } +} + +declare module "codemirror/addon/display/panel" { + export = CodeMirror; +} diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index 729b8a86d7..cdc3c4cd7c 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -4,6 +4,7 @@ // nrbernard // Pr1st0n // rileymiller +// toddself // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = CodeMirror; @@ -28,11 +29,11 @@ declare namespace CodeMirror { The returned position will be the end of the changed range, after the change is applied. */ function changeEnd(change: EditorChange): Position; - /** It contains a string that indicates the version of the library. This is a triple of integers "major.minor.patch", + /** It contains a string that indicates the version of the library. This is a triple of integers "major.minor.patch", where patch is zero for releases, and something else (usually one) for dev snapshots. */ var version: string; - /** An object containing default values for all options. + /** An object containing default values for all options. You can assign to its properties to modify defaults (though this won't affect editors that have already been created). */ var defaults: any; @@ -260,16 +261,7 @@ declare namespace CodeMirror { line should be either an integer or a line handle, and node should be a DOM node, which will be displayed below the given line. options, when given, should be an object that configures the behavior of the widget. Note that the widget node will become a descendant of nodes with CodeMirror-specific CSS classes, and those classes might in some cases affect it. */ - addLineWidget(line: any, node: HTMLElement, options?: { - /** Whether the widget should cover the gutter. */ - coverGutter: boolean; - /** Whether the widget should stay fixed in the face of horizontal scrolling. */ - noHScroll: boolean; - /** Causes the widget to be placed above instead of below the text of the line. */ - above: boolean; - /** When true, will cause the widget to be rendered even if the line it is associated with is hidden. */ - showIfHidden: boolean; - }): CodeMirror.LineWidget; + addLineWidget(line: any, node: HTMLElement, options?: CodeMirror.LineWidgetOptions): CodeMirror.LineWidget; /** Programatically set the size of the editor (overriding the applicable CSS rules). @@ -346,8 +338,8 @@ declare namespace CodeMirror { /** Retrieves information about the token the current mode found before the given position (a {line, ch} object). */ getTokenAt(pos: CodeMirror.Position, precise?: boolean): Token; - /** This is a (much) cheaper version of getTokenAt useful for when you just need the type of the token at a given position, - and no other information. Will return null for unstyled tokens, and a string, potentially containing multiple + /** This is a (much) cheaper version of getTokenAt useful for when you just need the type of the token at a given position, + and no other information. Will return null for unstyled tokens, and a string, potentially containing multiple space-separated style names, otherwise. */ getTokenTypeAt(pos: CodeMirror.Position): string; @@ -364,6 +356,12 @@ declare namespace CodeMirror { It will call the function, buffering up all changes, and only doing the expensive update after the function returns. This can be a lot faster. The return value from this method will be the return value of your function. */ operation(fn: ()=> T): T; + + /** In normal circumstances, use the above operation method. But if you want to buffer operations happening asynchronously, or that can't all be wrapped in a callback + function, you can call startOperation to tell CodeMirror to start buffering changes, and endOperation to actually render all the updates. Be careful: if you use this + API and forget to call endOperation, the editor will just never update. */ + startOperation(): void; + endOperation(): void; /** Adjust the indentation of the given line. The second argument (which defaults to "smart") may be one of: @@ -426,7 +424,7 @@ declare namespace CodeMirror { off(eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ): void; /** This event is fired before the selection is moved. Its handler may modify the resulting selection head and anchor. - Handlers for this event have the same restriction as "beforeChange" handlers � they should not do anything to directly update the state of the editor. */ + Handlers for this event have the same restriction as "beforeChange" handlers they should not do anything to directly update the state of the editor. */ on(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void ): void; off(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void ): void; @@ -537,20 +535,20 @@ declare namespace CodeMirror { Note that line handles have a text property containing the line's content (as a string). */ eachLine(start: number, end: number, f: (line: CodeMirror.LineHandle) => void ): void; - /** Set the editor content as 'clean', a flag that it will retain until it is edited, and which will be set again - when such an edit is undone again. Useful to track whether the content needs to be saved. This function is deprecated + /** Set the editor content as 'clean', a flag that it will retain until it is edited, and which will be set again + when such an edit is undone again. Useful to track whether the content needs to be saved. This function is deprecated in favor of changeGeneration, which allows multiple subsystems to track different notions of cleanness without interfering.*/ markClean(): void; - - /** Returns a number that can later be passed to isClean to test whether any edits were made (and not undone) in the - meantime. If closeEvent is true, the current history event will be ‘closed’, meaning it can't be combined with further + + /** Returns a number that can later be passed to isClean to test whether any edits were made (and not undone) in the + meantime. If closeEvent is true, the current history event will be ‘closed’, meaning it can't be combined with further changes (rapid typing or deleting events are typically combined).*/ changeGeneration(closeEvent?: boolean): number; - /** Returns whether the document is currently clean — not modified since initialization or the last call to markClean if + /** Returns whether the document is currently clean — not modified since initialization or the last call to markClean if no argument is passed, or since the matching call to changeGeneration if a generation value is given. */ isClean(generation?: number): boolean; - + /** Get the currently selected code. */ getSelection(): string; @@ -559,7 +557,7 @@ declare namespace CodeMirror { getSelections(lineSep?: string): Array; /** Replace the selection with the given string. By default, the new selection will span the inserted text. - The optional collapse argument can be used to change this � passing "start" or "end" will collapse the selection to the start or end of the inserted text. */ + The optional collapse argument can be used to change this -- passing "start" or "end" will collapse the selection to the start or end of the inserted text. */ replaceSelection(replacement: string, collapse?: string): void; /** start is a an optional string indicating which end of the selection to return. @@ -672,6 +670,11 @@ declare namespace CodeMirror { /** Returns an array containing all marked ranges in the document. */ getAllMarks(): CodeMirror.TextMarker[]; + /** Adds a line widget, an element shown below a line, spanning the whole of the editor's width, and moving the lines below it downwards. + line should be either an integer or a line handle, and node should be a DOM node, which will be displayed below the given line. + options, when given, should be an object that configures the behavior of the widget. + Note that the widget node will become a descendant of nodes with CodeMirror-specific CSS classes, and those classes might in some cases affect it. */ + addLineWidget(line: any, node: HTMLElement, options?: CodeMirror.LineWidgetOptions): CodeMirror.LineWidget; /** Gets the mode object for the editor. Note that this is distinct from getOption("mode"), which gives you the mode specification, rather than the resolved, instantiated mode object. */ @@ -709,8 +712,27 @@ declare namespace CodeMirror { or undefined if the marker is no longer in the document. */ find(): {from: CodeMirror.Position, to: CodeMirror.Position}; + /** Called when you've done something that might change the size of the marker and want to cheaply update the display*/ + changed(): void; + /** Returns an object representing the options for the marker. If copyWidget is given true, it will clone the value of the replacedWith option, if any. */ getOptions(copyWidget: boolean): CodeMirror.TextMarkerOptions; + + /** Fired when the cursor enters the marked range */ + on(eventName: 'beforeCursorEnter', handler: () => void) : void; + off(eventName: 'beforeCursorEnter', handler: () => void) : void; + + /** Fired when the range is cleared, either through cursor movement in combination with clearOnEnter or through a call to its clear() method */ + on(eventName: 'clear', handler: (from: Position, to: Position) => void) : void; + off(eventName: 'clear', handler: () => void) : void; + + /** Fired when the last part of the marker is removed from the document by editing operations */ + on(eventName: 'hide', handler: () => void) : void; + off(eventname: 'hide', handler: () => void) : void; + + /** Fired when, after the marker was removed by editing, a undo operation brough the marker back */ + on(eventName: 'unhide', handler: () => void) : void; + off(eventname: 'unhide', handler: () => void) : void; } interface LineWidget { @@ -722,6 +744,17 @@ declare namespace CodeMirror { changed(): void; } + interface LineWidgetOptions { + /** Whether the widget should cover the gutter. */ + coverGutter?: boolean; + /** Whether the widget should stay fixed in the face of horizontal scrolling. */ + noHScroll?: boolean; + /** Causes the widget to be placed above instead of below the text of the line. */ + above?: boolean; + /** When true, will cause the widget to be rendered even if the line it is associated with is hidden. */ + showIfHidden?: boolean; + } + interface EditorChange { /** Position (in the pre-change coordinate system) where the change started. */ from: CodeMirror.Position; diff --git a/types/codemirror/test/comment.ts b/types/codemirror/test/comment.ts new file mode 100644 index 0000000000..f022704a86 --- /dev/null +++ b/types/codemirror/test/comment.ts @@ -0,0 +1,16 @@ +const editor = CodeMirror(document.body); +const position: CodeMirror.Position = { ch: 0, line: 0 }; +const opt: CodeMirror.CommentOptions = { + blockCommentEnd: "*/", + blockCommentStart: "/*", + blockCommentLead: "*", + commentBlankLines: true, + fullLines: true, + indent: true, + lineComment: "//", + padding: " " +}; +editor.toggleComment(opt); +editor.blockComment(position, position, opt); +editor.lineComment(position, position, opt); +const b: boolean = editor.uncomment(position, position, opt); diff --git a/types/codemirror/test/index.ts b/types/codemirror/test/index.ts index bd2aefac88..851e891e8f 100644 --- a/types/codemirror/test/index.ts +++ b/types/codemirror/test/index.ts @@ -91,3 +91,12 @@ CodeMirror.registerHelper("lint", "javascript", {}); myCodeMirror.isReadOnly(); myCodeMirror.execCommand('selectAll'); + +let htmlElement1 = document.createElement('div'); +let htmlElement2 = document.createElement('div'); +let widget1 = myCodeMirror.addLineWidget(1, htmlElement1, {}); +let widget2 = doc.addLineWidget(1, htmlElement2, {}); +widget1.clear(); +widget2.clear(); +htmlElement1.remove(); +htmlElement2.remove(); diff --git a/types/codemirror/test/panel.ts b/types/codemirror/test/panel.ts new file mode 100644 index 0000000000..3cf200beae --- /dev/null +++ b/types/codemirror/test/panel.ts @@ -0,0 +1,17 @@ + +var cm: CodeMirror.Editor = CodeMirror(document.body); + +var panel1 = cm.addPanel(document.body); + +var panel2: CodeMirror.Panel = cm.addPanel(document.body, { + position: "top", + after: panel1, + before: panel1, + replace: panel1, + stable: true +}); + +panel2.changed(); +panel2.changed(100); + +panel2.clear(); diff --git a/types/codemirror/tsconfig.json b/types/codemirror/tsconfig.json index a2c6a52430..d081586f6e 100644 --- a/types/codemirror/tsconfig.json +++ b/types/codemirror/tsconfig.json @@ -20,13 +20,17 @@ "files": [ "index.d.ts", "codemirror-matchbrackets.d.ts", + "codemirror-panel.d.ts", "codemirror-runmode.d.ts", "codemirror-showhint.d.ts", + "codemirror-comment.d.ts", "searchcursor.d.ts", "test/index.ts", "test/matchbrackets.ts", + "test/panel.ts", "test/runmode.ts", "test/searchcursor.ts", - "test/showhint.ts" + "test/showhint.ts", + "test/comment.ts" ] } \ No newline at end of file diff --git a/types/colresizable/colresizable-tests.ts b/types/colresizable/colresizable-tests.ts new file mode 100644 index 0000000000..9fc62512c1 --- /dev/null +++ b/types/colresizable/colresizable-tests.ts @@ -0,0 +1,61 @@ +$("#table").colResizable(); // $ExpectType JQuery + +$("#table").colResizable({ + resizeMode: "fit", + disable: false, + disabledColumns: [1, 2, 3], + liveDrag: true, + postbackSafe: false, + partialRefresh: true, + headerOnly: false, + gripInnerHtml: "", + draggingClass: ".myClass", + minWidth: 100, + hoverCursor: 'pointer', + dragCursor: 'e-resize', + flush: false, + marginLeft: "14px", + marginRight: "auto", + fixed: false, + + onResize(evt) { + evt.currentTarget; // $ExpectType Element + }, + onDrag(evt) { + evt.currentTarget; // $ExpectType Element + } +}); + +// Samples at http://www.bacubacu.com/colresizable +function onSampleResized(e: JQueryMouseEventObject) { + const table = $(e.currentTarget); // reference to the resized table +} + +$("#sample").colResizable({ + liveDrag: true, + gripInnerHtml: "
", + draggingClass: "dragging", + onResize: onSampleResized +}); + +function postbackSample() { + $("#updatePanelSample").colResizable({ + liveDrag: true, + postbackSafe: true, + partialRefresh: true + }); +} + +$("#flexSample").colResizable({resizeMode: 'flex'}); + +$("#overflowSample").colResizable({resizeMode: 'overflow'}); + +function onSlide() {} + +$("#sample5").colResizable({ + liveDrag: true, + draggingClass: "rangeDrag", + gripInnerHtml: "
", + onResize: onSlide, + minWidth: 8 +}); diff --git a/types/colresizable/index.d.ts b/types/colresizable/index.d.ts new file mode 100644 index 0000000000..693c40923c --- /dev/null +++ b/types/colresizable/index.d.ts @@ -0,0 +1,149 @@ +// Type definitions for colresizable 1.6 +// Project: http://bacubacu.com/colresizable/ +// Definitions by: Gilles Waeber +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +interface JQuery { + colResizable(param?: colResizable.Settings): JQuery; +} + +declare namespace colResizable { + interface Settings { + /** + * [default: 'fit'] It is used to set how the resize method works. Those are the possible values: + * - 'fit': this is default resizing model, in which resizing a column does not alter table width, which means that when a column is expanded the next one shrinks. + * - 'flex': in this mode tables can change its width and each column can shrink or expand independently if there is enough space in the parent container. + * If there is not enough space, columns will share its width as they are resized. Table will never get bigger than its parent. + * - 'overflow': allows to resize columns with overflow of parent container. + * [version: 1.6] + */ + resizeMode?: 'fit' | 'flex' | 'overflow'; + + /** + * [default: false] When set to true the table layout is updated while dragging column anchors. + * liveDrag enabled is more CPU consuming so it is not recommended for slow computers, specially when dealing with huge or extremely complicated tables. + * [version: 1.0] + */ + liveDrag?: boolean; + + /** + * @deprecated use resizeMode instead + * [default: true] It is used to set how the resize method works. + * In fixed mode resizing a column does not alter total table width, which means that when a column is expanded the next one shrinks. + * If fixed is set to false then table can change its width and each column can shrink or expand independently. + * [version: 1.5] + */ + fixed?: boolean; + + /** + * [default: false] This attribute can be used to specify that the manually selected column widths must remain unaltered after a postback or browser refresh. + * This feature is mainly oriented to those pages created with server-side logic (codebehind), such as PHP or .NET, and it is only compatible with browsers + * with sessionStorage support (all modern browsers). + * However, if you are targeting older browsers (such as IE7 and IE8) you can still emulate sessionStorage using sessionStorage.js. + * It is important to note that some browsers (IE and FF) doesn’t enable the sessionStorage object while running the website directly from the local file system, + * so if you want to test this feature it is recommended to view the website through a web server or use browsers such as Chrome or Opera which doesn’t have this limitation. + * Don't worry about compatibility issues, once your site is up on the internet, all browsers will act in exactly the same way. + * [version: 1.3] + */ + postbackSafe?: boolean; + + /** + * [default: false] This attribute should be set to true if the table is inside of an updatePanel or any other kind of partial page refresh using ajax. + * Table's ID should be same before and after the partial partial refresh. + * [version: 1.5] + */ + partialRefresh?: boolean; + + /** + * [default: false] This attribute can be used to prevent vertical expansion of the column anchors to fit the table height. + * If it is set to true, column handler's size will be bounded to the first row's vertical size. + * [version: 1.2] + */ + headerOnly?: boolean; + + /** + * [default: ""] Its purpose is to allow column anchor customization by defining the HTML to be used in the column grips to provide some visual feedback. + * It can be used in a wide range of ways to obtain very different outputs, and its flexibility can be increased by combining it with the draggingClass attribute. + * [version: 1.0] + */ + gripInnerHtml?: string; + + /** + * [default: (internal class)] This attribute is used as the css class assigned to column anchors while being dragged. It can be used for visual feedback purposes. + * [version: 1.0] + */ + draggingClass?: string; + + /** + * [default: false] When set to true it aims to remove all previously added enhancements such as events and additional DOM elements assigned by this plugin to + * a single or collection of tables. It is required to disable a previously colResized table prior its removal from the document object tree. + * [version: 1.0] + */ + disable?: boolean; + + /** + * [default: [ ] ] An array of column indexes to be excluded, so it will not be possible to drag them manually. + * [version: 1.6] + */ + disabledColumns?: number[]; + + /** + * [default: 15] This value specifies the minimum width (measured in pixels) that is allowed for the columns. + * [version: 1.1] + */ + minWidth?: number; + + /** + * [default: "e-resize"] This attribute can be used to customize the cursor that will be displayed when the user is positioned on the column anchors. + * [version: 1.3] + */ + hoverCursor?: string; + + /** + * [default: "e-resize"] Defines the cursor that will be used while the user is resizing a column. + * [version: 1.3] + */ + dragCursor?: string; + + /** + * [default: false] Flush is only effective when postbackSafe is enabled. + * Its purpose is to remove all previously stored data related to the current table layout to get it back to its original layout preventing width restoration after postback. + * [version: ] + */ + flush?: boolean; + + /** + * [default: null] If the target table contains an explicit margin-left CSS rule, the same value must be used in this attribute (for example: "auto", "20%", "10px"). + * The reason why it is needed it is because most browsers (all except of IE) don’t allow direct access to the current CSS rule applied to an element in + * its original units (such as "%", "em" or "auto" values). + * If you know any workaround which doesn’t involve iteration through all the styles defined in the site and any other external dependencies, please let me know! + * [version: 1.3] + */ + marginLeft?: string; + + /** + * [default: null] It behaves in exactly the same way than the marginLeft attribute but applied to the right margin. + * [version: 1.3] + */ + marginRight?: string; + + /** + * If a callback function is supplied it will be fired when the user has ended dragging a column anchor altering the previous table layout. + * The callback function can obtain a reference to the updated table through the currentTarget attribute of the event retrieved by parameters + * [version: 1.0] + */ + onResize?: FunctionCallback; + + /** + * This event is fired while dragging a column anchor if liveDrag is enabled. It can be useful if the table is being used as a multiple range slider. + * The callback function can obtain a reference to the updated table through the currentTarget attribute of the event retrieved by parameters + * [version: 1.1] + */ + onDrag?: FunctionCallback; + } + + type FunctionCallback = (e: JQueryMouseEventObject) => void; +} diff --git a/types/colresizable/tsconfig.json b/types/colresizable/tsconfig.json new file mode 100644 index 0000000000..35bf902824 --- /dev/null +++ b/types/colresizable/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "colresizable-tests.ts" + ] +} diff --git a/types/colresizable/tslint.json b/types/colresizable/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/colresizable/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cometd/cometd-tests.ts b/types/cometd/cometd-tests.ts new file mode 100644 index 0000000000..ef56879d6f --- /dev/null +++ b/types/cometd/cometd-tests.ts @@ -0,0 +1,241 @@ +import { CometD, Listener, Message, SubscriptionHandle } from "cometd"; + +const cometd = new CometD(); + +// Configuring +// =========== + +cometd.configure("http://localhost:8080/cometd"); + +cometd.configure({ + url: "http://localhost:8080/cometd" +}); + +cometd.registerExtension("ack", { incoming: () => {}, outgoing: () => {} }); + +cometd.unregisterTransport("websocket"); + +// Handshaking +// =========== + +cometd.handshake(handshakeReply => { + if (handshakeReply.successful) { + // Successfully connected to the server. + } +}); + +const additionalInfoHandshake = { + "com.acme.credentials": { + user: "cometd", + token: "xyzsecretabc" + } +}; +cometd.handshake(additionalInfoHandshake, handshakeReply => { + if (handshakeReply.successful) { + // Successfully connected to the server. + } +}); + +cometd.init("http://host1:8080/cometd"); + +// Subscribing and Unsubscribing +// ============================= + +cometd.subscribe( + "/foo", + message => {}, + subscribeReply => { + if (subscribeReply.successful) { + // The server successfully subscribed this client to the "/foo" channel. + } + } +); + +const additionalInfoSubscribe = { + "com.acme.priority": 10 +}; +cometd.subscribe("/foo", message => {}, additionalInfoSubscribe, subscribeReply => { + if (subscribeReply.successful) { + // The server successfully subscribed this client to the "/foo" channel. + } +}); + +const subscription1 = cometd.addListener("/meta/connect", () => {}); +const subscription2 = cometd.subscribe("/foo/bar/", () => {}); + +cometd.unsubscribe(subscription2); +cometd.removeListener(subscription1); + +const subscription3 = cometd.subscribe("/foo/bar/", () => {}); + +const additionalInfoUnsubscribe = { + "com.acme.discard": true +}; +cometd.unsubscribe(subscription3, additionalInfoUnsubscribe, unsubscribeReply => { + // Your logic here. +}); + +// Subscribers versus Listeners +// ============================ + +let _reportListener: SubscriptionHandle | undefined; + +cometd.addListener("/meta/handshake", message => { + // Only subscribe if the handshake is successful + if (message.successful) { + // Batch all subscriptions together + cometd.batch(() => { + // Correct to subscribe to broadcast channels + cometd.subscribe("/members", m => {}); + + // Correct to subscribe to service channels + cometd.subscribe("/service/status", m => {}); + + // Messy to add listeners after removal, prefer using cometd.subscribe(...) + if (_reportListener) { + cometd.removeListener(_reportListener); + _reportListener = cometd.addListener("/service/report", m => {}); + } + + // Wrong to add listeners without removal + cometd.addListener("/service/notification", m => {}); + }); + } +}); + +// Dynamic Resubscription +// ====================== + +let _subscription: SubscriptionHandle | undefined; + +class Controller { + dynamicSubscribe = () => { + _subscription = cometd.subscribe("/dynamic", this.onEvent); + } + + onEvent = (message: Message) => { + if (message.successful) { + // Your logic here. + } + } + + dynamicUnsubscribe = () => { + if (_subscription) { + cometd.unsubscribe(_subscription); + _subscription = undefined; + } + } +} + +cometd.addListener("/meta/handshake", message => { + if (message.successful) { + cometd.batch(() => { + // Static subscription, no need to remember the subscription handle + cometd.subscribe("/static", () => {}); + + // Dynamic re-subscription + if (_subscription) { + _subscription = cometd.resubscribe(_subscription); + } + }); + } +}); + +// Listeners and Subscribers Exception Handling +// ============================================ + +cometd.onListenerException = function(exception, subscriptionHandle, isListener, message) { + // Uh-oh, something went wrong, disable this listener/subscriber + // Object "this" points to the CometD object + if (isListener) { + this.removeListener(subscriptionHandle); + } else { + this.unsubscribe(subscriptionHandle); + } +}; + +// Meta Channel List +// ================= + +let _connected = false; + +cometd.addListener("/meta/connect", message => { + if (cometd.isDisconnected()) { + return; + } + + const wasConnected = _connected; + _connected = message.successful; + if (!wasConnected && _connected) { + // Reconnected + } else if (wasConnected && !_connected) { + // Disconnected + } +}); + +cometd.addListener("/meta/disconnect", message => { + if (message.successful) { + _connected = false; + } +}); + +// Publishing +// ========== + +cometd.publish("/mychannel", { mydata: { foo: "bar" } }); + +cometd.publish("/mychannel", { mydata: { foo: "bar" } }, publishAck => { + if (publishAck.successful) { + // The message reached the server + } +}); + +// Publishing Binary Data +// ====================== + +// Create an ArrayBuffer. +const buffer = new ArrayBuffer(4); + +// Fill it with the bytes. +const view = new DataView(buffer); +view.setUint8(0, 0xca); +view.setUint8(1, 0xfe); +view.setUint8(2, 0xba); +view.setUint8(3, 0xbe); + +// Send it. +cometd.publishBinary("/binary", view, true, { prolog: "java" }); + +// Disconnecting +// ============= + +cometd.disconnect(disconnectReply => { + if (disconnectReply.successful) { + // Server truly received the disconnect request + } +}); + +const additionalInfoDisconnect = { + "com.acme.reset": false +}; +cometd.disconnect(additionalInfoDisconnect, disconnectReply => { + if (disconnectReply.successful) { + // Server truly received the disconnect request + } +}); + +// Message Batching +// ================ + +cometd.batch(() => { + cometd.publish("/channel1", { product: "foo" }); + cometd.publish("/channel2", { notificationType: "all" }); + cometd.publish("/channel3", { update: false }); +}); + +// Alternatively, but not recommended: +cometd.startBatch(); +cometd.publish("/channel1", { product: "foo" }); +cometd.publish("/channel2", { notificationType: "all" }); +cometd.publish("/channel3", { update: false }); +cometd.endBatch(); diff --git a/types/cometd/index.d.ts b/types/cometd/index.d.ts index cc97b304fe..cd829d444c 100644 --- a/types/cometd/index.d.ts +++ b/types/cometd/index.d.ts @@ -1,55 +1,476 @@ -// Type definitions for CometD 2.5.1 +// Type definitions for CometD 4.0 // Project: http://cometd.org -// Definitions by: Derek Cicerone +// Definitions by: Derek Cicerone , Daniel Perez Alvarez , Alex Henry // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -declare namespace CometD { - - interface ConfigurationOptions { - url: string; - logLevel?: string; - maxConnections?: number; - backoffIncrement?: number; - maxBackoff?: number; - reverseIncomingExtensions?: boolean; - maxNetworkDelay?: number; - requestHeaders?: any; - appendMessageTypeToURL?: boolean; - autoBatch?: boolean; - } - +export interface Configuration { + /** + * The URL of the Bayeux server this client will connect to. + */ + url: string; + /** + * The log level. Possible values are: "warn", "info", "debug". Output to `window.console` if + * available. + */ + logLevel?: string; + /** + * The maximum number of connections used to connect to the Bayeux server. Change this value + * only if you know exactly the client’s connection limit and what "request queued behind long + * poll" means. + */ + maxConnections?: number; + /** + * The number of milliseconds that the backoff time increments every time a connection with the + * Bayeux server fails. CometD attempts to reconnect after the backoff time elapses. + */ + backoffIncrement?: number; + /** + * The maximum number of milliseconds of the backoff time after which the backoff time is not + * incremented further. + */ + maxBackoff?: number; + /** + * The maximum number of milliseconds to wait before considering a request to the Bayeux server + * failed. + */ + maxNetworkDelay?: number; + /** + * An object containing the request headers to be sent for every Bayeux request (for example, + * `{"My-Custom-Header": "MyValue"}`). + */ + requestHeaders?: object; + /** + * Determines whether or not the Bayeux message type (handshake, connect, disconnect) is + * appended to the URL of the Bayeux server (see above). + */ + appendMessageTypeToURL?: boolean; + /** + * Determines whether multiple publishes that get queued are sent as a batch on the first + * occasion, without requiring explicit batching. + */ + autoBatch?: boolean; + /** + * The maximum number of milliseconds to wait for a WebSocket connection to be opened. It does + * not apply to HTTP connections. A timeout value of 0 means to wait forever. + */ + connectTimeout?: number; + /** + * Only applies to the websocket transport. Determines whether to stick using the websocket + * transport when a websocket transport failure has been detected after the websocket transport + * was able to successfully connect to the server. + */ + stickyReconnect?: boolean; + /** + * The max length of the URI for a request made with the callback-polling transport. Microsoft + * Internet Explorer 7 and 8 are known to limit the URI length, so single large messages sent by + * CometD may fail to remain within the max URI length when encoded in JSON. + */ + maxURILength?: number; } -interface CometD { - - websocketEnabled?: boolean; +export interface Message { + successful: boolean; + data: any; +} - onListenerException: (exception: any, subscriptionHandle: any, isListener: boolean, message: string) => void; +export type Listener = (message: Message) => void; +export type Callback = (data: any) => void; - init(options: CometD.ConfigurationOptions): void; +export interface SubscriptionHandle { + id: number; + channel: string; + listener: boolean; + callback: Callback; + scope?: any; +} - configure(config: CometD.ConfigurationOptions): void; - - subscribe(channel: string, listener: (message: any) => void): void; +export interface Extension { + incoming?: Listener; + outgoing?: Listener; +} - addListener(channel: string, listener: (message: any) => void): void; - removeListener(listener: (message: any) => void): void; +export class CometD { + constructor(options?: Configuration); + /** + * Registers the given transport under the given transport type. + * + * The optional index parameter specifies the priority at which the transport is registered + * (where `0` is the max priority). + * + * If a transport with the same type is already registered, this function does nothing and + * returns `false`. + * + * @param type the transport type + * @param transport the transport object + * @param index the index at which this transport is to be registered + * @return true if the transport has been registered, false otherwise + */ + registerTransport(type: string, transport: object, index?: number): boolean; + + /** + * Unregisters the transport with the given transport type. + * + * @param type the transport type to unregister + * @return the transport that has been unregistered, or null if no transport was previously + * registered under the given transport type + */ + unregisterTransport(type: string): void; + + /** + * Unregisters all transports. + */ + unregisterTransports(): void; + + /** + * Configures and establishes the Bayeux communication with the Bayeux server via a handshake + * and a subsequent connect. + * + * @param configuration the configuration object + * @param handshakeProps an object to be merged with the handshake message + */ + init(configuration: string | Configuration, handshakeProps?: object): void; + + /** + * Configures the initial Bayeux communication with the Bayeux server. + * + * @param configuration the URL of the Bayeux server, or a configuration object that must + * contain a mandatory field `url` + */ + configure(config: string | Configuration): void; + + /** + * Establishes the Bayeux communication with the Bayeux server via a handshake and a subsequent + * connect. + * + * @param handshakeCallback a function to be invoked when the handshake is acknowledged + */ + handshake(handshakeCallback: Listener): void; + + /** + * Establishes the Bayeux communication with the Bayeux server via a handshake and a subsequent + * connect. + * + * @param handshakeProps an object to be merged with the handshake message + * @param handshakeCallback a function to be invoked when the handshake is acknowledged + */ + handshake(handshakeProps: object, handshakeCallback: Listener): void; + + /** + * Disconnects from the Bayeux server. + * + * @param disconnectCallback a function to be invoked when the disconnect is acknowledged + */ + disconnect(disconnectCallback: Listener): void; + + /** + * Disconnects from the Bayeux server. + * + * @param disconnectProps an object to be merged with the disconnect message + * @param disconnectCallback a function to be invoked when the disconnect is acknowledged + */ + disconnect(disconnectProps: object, disconnectCallback: Listener): void; + + /** + * Marks the start of a batch of application messages to be sent to the server in a single + * request, obtaining a single response containing (possibly) many application reply messages. + * + * Messages are held in a queue and not sent until `endBatch` is called. If `startBatch` is + * called multiple times, then an equal number of `endBatch` calls must be made to close and + * send the batch of messages. + */ + startBatch(): void; + + /** + * Marks the end of a batch of application messages to be sent to the server in a single + * request. + */ + endBatch(): void; + + /** + * Executes the given callback in the given scope, surrounded by a `startBatch` and `endBatch` + * calls. + * + * @param callback the callback to be executed within `startBatch` and `endBatch` calls + */ + batch(callback: () => void): void; + + /** + * Adds a listener for Bayeux messages, performing the given callback in the given scope when a + * message for the given channel arrives. + * + * - Must be used to listen to meta channel messages. + * - May be used to listen to service channel messages. + * - Should not be used to listen broadcast channel messages (use `subscribe` instead). + * - Does not involve any communication with the Bayeux server, and as such can be called before + * calling `handshake`. + * - Is synchronous: when it returns, you are guaranteed that the listener has been added. + * + * @param channel the channel the listener is interested to + * @param callback the callback to call when a message is sent to the channel + * @returns the subscription handle to be passed to `removeListener` + */ + addListener(channel: string, callback: Listener): SubscriptionHandle; + + /** + * Removes the subscription obtained with a call to `addListener`. + * + * @param subscription the subscription to unsubscribe. + */ + removeListener(subscription: SubscriptionHandle): void; + + /** + * Removes all listeners registered with `addListener` or `subscribe`. + */ clearListeners(): void; + /** + * Subscribes to the given channel, performing the given callback in the given scope when a + * message for the channel arrives. + * + * - Must not be used to listen to meta channels messages (if attempted, the server returns an + * error). + * - May be used to listen to service channel messages. + * - Should be used to listen to broadcast channel messages. + * - Involves a communication with the Bayeux server and as such cannot be called before calling + * `handshake`. + * - Is asynchronous: it returns immediately, well before the Bayeux server has received the + * subscription request. + * + * @param channel the channel to subscribe to + * @param callback the callback to call when a message is sent to the channel + * @param subscribeCallback a function to be invoked when the subscription is acknowledged + * @return the subscription handle to be passed to `unsubscribe` + */ + subscribe(channel: string, callback: Callback, subscribeCallback?: Listener): SubscriptionHandle; + + /** + * Subscribes to the given channel, performing the given callback in the given scope when a + * message for the channel arrives. + * + * - Must not be used to listen to meta channels messages (if attempted, the server returns an + * error). + * - May be used to listen to service channel messages. + * - Should be used to listen to broadcast channel messages. + * - Involves a communication with the Bayeux server and as such cannot be called before calling + * `handshake`. + * - Is asynchronous: it returns immediately, well before the Bayeux server has received the + * subscription request. + * + * @param channel the channel to subscribe to + * @param callback the callback to call when a message is sent to the channel + * @param subscribeProps an object to be merged with the subscribe message + * @param subscribeCallback a function to be invoked when the subscription is acknowledged + * @return the subscription handle to be passed to `unsubscribe` + */ + subscribe(channel: string, callback: Callback, subscribeProps: object, subscribeCallback?: Listener): SubscriptionHandle; + + /** + * Unsubscribes the subscription obtained with a call to `subscribe`. + * + * @param subscription the subscription to unsubscribe. + * @param unsubscribeCallback a function to be invoked when the unsubscription is acknowledged + */ + unsubscribe(subscription: SubscriptionHandle, unsubscribeCallback?: Listener): void; + + /** + * Unsubscribes the subscription obtained with a call to `subscribe`. + * + * @param subscription the subscription to unsubscribe. + * @param unsubscribeProps an object to be merged with the unsubscribe message + * @param unsubscribeCallback a function to be invoked when the unsubscription is acknowledged + */ + unsubscribe(subscription: SubscriptionHandle, unsubscribeProps: object, unsubscribeCallback?: Listener): void; + + /** + * Resubscribes as necessary in case of a re-handshake. + */ + resubscribe(subscription: SubscriptionHandle, subscribeProps?: object): SubscriptionHandle; + + /** + * Removes all subscriptions added via `subscribe`, but does not remove the listeners added via + * `addListener`. + */ clearSubscriptions(): void; - handshake(handshake_params: any): void; + /** + * Publishes a message on the given channel, containing the given content. + * + * @param channel the channel to publish the message to + * @param content the content of the message + * @param publishCallback a function to be invoked when the publish is acknowledged by the + * server + */ + publish(channel: string, content: object, publishCallback?: Listener): void; - publish(channel: string, message: any): void; + /** + * Publishes a message on the given channel, containing the given content. + * + * @param channel the channel to publish the message to + * @param content the content of the message + * @param publishProps an object to be merged with the publish message + * @param publishCallback a function to be invoked when the publish is acknowledged by the + * server + */ + publish(channel: string, content: object, publishProps: object, publishCallback?: Listener): void; + /** + * Publishes a message with binary data on the given channel. + * + * The binary data chunk may be an `ArrayBuffer`, a `DataView`, a `TypedArray` (such as + * `Uint8Array`) or a plain integer array. + * + * The meta data object may contain additional application data such as a file name, a mime + * type, etc. + * + * @param channel the channel to publish the message to + * @param data the binary data to publish + * @param last whether the binary data chunk is the last + * @param meta an object containing meta data associated to the binary chunk + * @param callback a function to be invoked when the publish is acknowledged by the server + */ + publishBinary( + channel: string, + data: ArrayBuffer | DataView | Uint8Array | Uint16Array | Uint32Array, + last: boolean, + meta?: object, + callback?: Listener + ): void; - disconnect(): void; + /** + * Returns a string representing the status of the Bayeux communication with the Bayeux server. + * + * @return the status of the Bayeux communication + */ + getStatus(): string; -} - - - -interface JQueryStatic { - cometd: CometD; + /** + * Returns whether this instance has been disconnected. + * + * @return whether this instance has been disconnected. + */ + isDisconnected(): boolean; + + /** + * Sets the backoff period used to increase the backoff time when retrying an unsuccessful or + * failed message. + * + * Default value is 1 second, which means if there is a persistent failure the retries will + * happen after 1 second, then after 2 seconds, then after 3 seconds, etc. So for example with + * 15 seconds of elapsed time, there will be 5 retries (at 1, 3, 6, 10 and 15 seconds elapsed). + * + * @param period the backoff period to set + */ + setBackoffIncrement(period: number): void; + + /** + * Returns the backoff period used to increase the backoff time when retrying an unsuccessful or + * failed message. + * + * @returns the backoff increment + */ + getBackoffIncrement(): void; + + /** + * Returns the backoff period to wait before retrying an unsuccessful or failed message. + * + * @returns the backoff period + */ + getBackoffPeriod(): void; + + /** + * Increases the backoff period up to the maximum value configured. + * + * @returns the backoff period after increment + */ + increaseBackoffPeriod(): number; + + /** + * Resets the backoff period to zero. + */ + resetBackoffPeriod(): void; + + /** + * Sets the log level for console logging. + * + * @param level the log level string + */ + setLogLevel(level: "error" | "warn" | "info" | "debug"): void; + + /** + * Registers an extension whose callbacks are called for every incoming message (that comes from + * the server to this client implementation) and for every outgoing message (that originates + * from this client implementation for the server). + * + * The format of the extension object is the following: + * + * { + * incoming: (message) => { ... }, + * outgoing: (message) => { ... } + * } + * + * Both properties are optional, but if they are present they will be called respectively for + * each incoming message and for each outgoing message. + * + * @param name the name of the extension + * @param extension the extension to register + * @return true if the extension was registered, false otherwise + */ + registerExtension(name: string, extension: Extension): boolean; + + /** + * Unregister an extension previously registered with `registerExtension`. + * + * @param name the name of the extension to unregister. + * @return true if the extension was unregistered, false otherwise + */ + unregisterExtension(name: string): boolean; + + /** + * Find the extension registered with the given name. + * + * @param name the name of the extension to find + * @return the extension found or null if no extension with the given name has been registered + */ + getExtension(name: string): Extension; + + /** + * Returns the name assigned to this CometD object, or the string 'default' if no name has been + * explicitly passed as parameter to the constructor. + * + * @return the name assigned to this CometD object, or `'default'` + */ + getName(): string; + + /** + * Returns the client ID assigned by the Bayeux server during handshake. + * + * @return the client ID assigned by the Bayeux server + */ + getClientId(): string; + + /** + * Returns the URL of the Bayeux server. + * + * @return the URL of the Bayeux server + */ + getURL(): string; + + /** + * Returns the configuration for this CometD object. + * + * @return the configuration for this CometD object + */ + getConfiguration(): Configuration; + + /** + * Handler invoked every time a listener or subscriber throws an exception. + * + * @param exception the exception thrown + * @param subscriptionHandle the listener or subscription that threw the exception + * @param isListener whether it was a listener + * @param message the message received from the Bayeux server + */ + onListenerException: (exception: any, subscriptionHandle: SubscriptionHandle, isListener: boolean, message: string) => void; } diff --git a/types/cometd/tsconfig.json b/types/cometd/tsconfig.json index 02963e3afd..6533a1a225 100644 --- a/types/cometd/tsconfig.json +++ b/types/cometd/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -17,6 +17,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "cometd-tests.ts" ] } \ No newline at end of file diff --git a/types/cometd/tslint.json b/types/cometd/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/cometd/tslint.json +++ b/types/cometd/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/commangular/commangular-mock.d.ts b/types/commangular/commangular-mock.d.ts index 134e4d0d1e..a31563bc9e 100644 --- a/types/commangular/commangular-mock.d.ts +++ b/types/commangular/commangular-mock.d.ts @@ -4,33 +4,33 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module commangular { - + /////////////////////////////////////////////////////////////////////////// // Commangular Static // see http://commangular.org/docs/#commangular-namespace /////////////////////////////////////////////////////////////////////////// interface ICommAngularStatic { - + /** * Mock dispatch function for testing commands. */ dispatch( ec: ICommandCall, callback: Function ): void; } - + interface ICommandCall { /** * Name of the command that needs to * execute */ command: string; - + /** * Data that needs to be passed to the command */ data?: any; } - - + + /** * Object type expected to be passed into the callback function * of the dispatch() function @@ -41,25 +41,25 @@ declare module commangular { * @param key The property name that is in the object that was passed */ dataPassed( key : string ) : any; - + /** * The data that was returned by the command * @param key The result key that was defined in the command. If no result * was defined use 'lastResult' as the key */ resultKey( key: string ): any; - + /** * Indicates if the command execution was cancelled. */ canceled( ): boolean; - + /** * Indicates if the command was executed???? */ commandExecuted( ): boolean; } - + } @@ -67,7 +67,6 @@ declare module commangular { * Mock dispatch function for testing commands. * @param ec an ICommandCall object * @param callback The function that will be called upon the completion of the command -* function should expecte an ICommandInfo paramter. +* function should expecte an ICommandInfo parameter. */ -declare function dispatch( ec: commangular.ICommandCall, callback: Function ): void; - +declare function dispatch( ec: commangular.ICommandCall, callback: Function ): void; diff --git a/types/commercetools__enzyme-extensions/commercetools__enzyme-extensions-tests.tsx b/types/commercetools__enzyme-extensions/commercetools__enzyme-extensions-tests.tsx new file mode 100644 index 0000000000..bceab689e7 --- /dev/null +++ b/types/commercetools__enzyme-extensions/commercetools__enzyme-extensions-tests.tsx @@ -0,0 +1,30 @@ +import React = require('react'); +import enzyme = require('enzyme'); +import configureExtensions = require('@commercetools/enzyme-extensions'); + +configureExtensions(enzyme.ShallowWrapper); + +function App() { + return 'Hello world'} />; +} + +interface ChildProps { + cb: () => string; +} + +function Child(props: ChildProps) { + return
{props.cb()}
; +} + +enzyme.shallow() + .find(App) + .renderProp('render'); +enzyme.shallow() + .find(Child) + .renderProp('render', 1, 2); + +enzyme.shallow() + .find(Child) + .drill(props => props.cb()); + +enzyme.shallow().until(Child); diff --git a/types/commercetools__enzyme-extensions/index.d.ts b/types/commercetools__enzyme-extensions/index.d.ts new file mode 100644 index 0000000000..7c009f8e95 --- /dev/null +++ b/types/commercetools__enzyme-extensions/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for @commercetools/enzyme-extensions 3.0 +// Project: https://github.com/commercetools/enzyme-extensions +// Definitions by: Christian Rackerseder +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as enzyme from 'enzyme'; + +declare module 'enzyme' { + interface UntilOptions { + maxDepth: number; + } + interface ShallowWrapper

{ + renderProp(propName: string, ...args: any[]): ShallowWrapper

; + drill(expander: (props: any) => ShallowWrapper): ShallowWrapper

; + until(selector: EnzymeSelector, options?: UntilOptions): ShallowWrapper

; + } +} + +declare function monkeyPatchShallowWrapper(s: typeof enzyme.ShallowWrapper): void; + +export = monkeyPatchShallowWrapper; diff --git a/types/commercetools__enzyme-extensions/tsconfig.json b/types/commercetools__enzyme-extensions/tsconfig.json new file mode 100644 index 0000000000..9e6d70239e --- /dev/null +++ b/types/commercetools__enzyme-extensions/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "paths": { + "@commercetools/enzyme-extensions": ["commercetools__enzyme-extensions"] + } + }, + "files": [ + "index.d.ts", + "commercetools__enzyme-extensions-tests.tsx" + ] +} diff --git a/types/commercetools__enzyme-extensions/tslint.json b/types/commercetools__enzyme-extensions/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/commercetools__enzyme-extensions/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/compare-func/compare-func-tests.ts b/types/compare-func/compare-func-tests.ts new file mode 100644 index 0000000000..47b2842724 --- /dev/null +++ b/types/compare-func/compare-func-tests.ts @@ -0,0 +1,30 @@ +import compareFunc = require("compare-func"); + +// This is taken from https://github.com/stevemao/compare-func/blob/master/README.md#usage and extended + +// sort by an object property +[{ x: "b" }, { x: "a" }, { x: "c" }].sort(compareFunc("x")); +// => [{x: "a"}, {x: "b"}, {x: "c"}] + +// sort by a nested object property +[{ x: { y: "b" } }, { x: { y: "a" } }].sort(compareFunc("x.y")); +// => [{x: {y: "a"}}, {x: {y: "b"}}] + +// sort by the `x` property, then `y` +[{ x: "c", y: "c" }, { x: "b", y: "a" }, { x: "b", y: "b" }].sort(compareFunc(["x", "y"])); +// => [{x: "b", y: "a"}, {x: "b", y: "b"}, {x: "c", y: "c"}] + +// sort by the returned value +[{ x: "b" }, { x: "a" }, { x: "c" }].sort(compareFunc((el) => el.x)); +// => [{x: "a"}, {x: "b"}, {x: "c"}] + +// sort by an array of functions +[{ x: "c", y: "c" }, { x: "b", y: "a" }, { x: "b", y: "b" }].sort(compareFunc([ + (el) => el.x, + (el) => el.y, +])); +// => [{x: "a"}, {x: "b"}, {x: "c"}] + +// sort by itself +[1, 3, 2].sort(compareFunc()); +// => [1, 2, 3] diff --git a/types/compare-func/index.d.ts b/types/compare-func/index.d.ts new file mode 100644 index 0000000000..357de04fb0 --- /dev/null +++ b/types/compare-func/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for compare-func 1.3 +// Project: https://github.com/stevemao/compare-func +// Definitions by: Dogan Fennibay +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +type extractFunc = (e: T) => number | string; + +declare function compare_func(prop?: ReadonlyArray> | string | extractFunc): + (e1: T, e2: T) => number; + +export = compare_func; diff --git a/types/compare-func/tsconfig.json b/types/compare-func/tsconfig.json new file mode 100644 index 0000000000..9aa5f60c9d --- /dev/null +++ b/types/compare-func/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "compare-func-tests.ts" + ] +} diff --git a/types/compare-func/tslint.json b/types/compare-func/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/compare-func/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/complex/complex-tests.ts b/types/complex/complex-tests.ts index 23074d104d..8268f0c135 100644 --- a/types/complex/complex-tests.ts +++ b/types/complex/complex-tests.ts @@ -1,42 +1,44 @@ import Complex from 'complex'; -var z: Complex = new Complex(2, 3); -var z: Complex = Complex.from(2, 3); -var z: Complex = Complex.from(2, 4); -var z: Complex = Complex.from(5); -var z: Complex = Complex.from('2+5i'); -var z: Complex = Complex.fromPolar(3, Math.PI); -var z: Complex = Complex.i; -var z: Complex = Complex.one; -var z: Complex = z.fromRect(2, 3); -var z: Complex = z.fromPolar(3, Math.PI); -var z: Complex = z.toPrecision(3); -var z: Complex = z.toFixed(3); -var z: Complex = z.finalize(); -var x: number = z.magnitude(); -var x: number = z.abs(); -var x: number = z.angle(); -var x: number = z.arg(); -var x: number = z.phase(); -var z: Complex = z.conjugate(); -var z: Complex = z.negate(); -var z: Complex = z.multiply(z); -var z: Complex = z.mult(3); -var z: Complex = z.divide(z); -var z: Complex = z.div(3); -var z: Complex = z.add(z); -var z: Complex = z.subtract(z); -var z: Complex = z.sub(3); -var z: Complex = z.pow(z); -var z: Complex = z.sqrt(); -var z: Complex = z.log(2); -var z: Complex = z.exp(); -var z: Complex = z.sin(); -var z: Complex = z.cos(); -var z: Complex = z.tan(); -var z: Complex = z.sinh(); -var z: Complex = z.cosh(); -var z: Complex = z.tanh(); -var z: Complex = z.clone(); -var s: string = z.toString(); -var b: boolean = z.equals(z); +let z: Complex = new Complex(2, 3); +z = Complex.from(2, 3); +z = Complex.from(2, 4); +z = Complex.from(5); +z = Complex.from('2+5i'); +z = Complex.fromPolar(3, Math.PI); +z = Complex.i; +z = Complex.one; +z = z.fromRect(2, 3); +z = z.fromPolar(3, Math.PI); +z = z.toPrecision(3); +z = z.toFixed(3); +z = z.finalize(); +let x: number = z.magnitude(); +x = z.abs(); +x = z.angle(); +x = z.arg(); +x = z.phase(); +z = z.conjugate(); +z = z.negate(); +z = z.multiply(z); +z = z.mult(3); +z = z.divide(z); +z = z.div(3); +z = z.add(z); +z = z.subtract(z); +z = z.sub(3); +z = z.pow(z); +z = z.sqrt(); +z = z.log(2); +z = z.exp(); +z = z.sin(); +z = z.cos(); +z = z.tan(); +z = z.sinh(); +z = z.cosh(); +z = z.tanh(); +z = z.clone(); +const s: string = z.toString(); +const b: boolean = z.equals(z); +const n: number = z.real; +const i: number = z.im; diff --git a/types/complex/index.d.ts b/types/complex/index.d.ts index 90ad161ffc..3f44ba8e1e 100644 --- a/types/complex/index.d.ts +++ b/types/complex/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Complex 3.0.1 +// Type definitions for Complex 3.0 // Project: https://github.com/arian/Complex // Definitions by: Aya Morisawa +// Paul Vasich // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export default class Complex { @@ -46,6 +47,16 @@ export default class Complex { */ static one: Complex; + /** + * The Complex number's real component + */ + real: number; + + /** + * The Complex number's imaginary component + */ + im: number; + /** * Set the real and imaginary properties a and b from a + bi. * @param real The real part of the number @@ -61,19 +72,25 @@ export default class Complex { fromPolar(r: number, phi: number): Complex; /** - * Set the precision of the numbers. Similar to Number.prototype.toPrecision. Useful before printing the number with the toString method. + * Set the precision of the numbers. Similar to Number.prototype.toPrecision. + * Useful before printing the number with the toString method. * @param k An integer specifying the number of significant digits */ toPrecision(k: number): Complex; /** - * Format a number using fixed-point notation. Similar to Number.prototype.toFixed. Useful before printing the number with the toString method. - * @param k The number of digits to appear after the decimal point; this may be a value between 0 and 20, inclusive, and implementations may optionally support a larger range of values. If this argument is omitted, it is treated as 0. + * Format a number using fixed-point notation. Similar to Number.prototype.toFixed. + * Useful before printing the number with the toString method. + * @param k The number of digits to appear after the decimal point [0 - 20]. + * Implementations may optionally support a larger range of values. + * If this argument is omitted, it is treated as 0. */ toFixed(k: number): Complex; /** - * Finalize the instance. The number will not change and any other method call will return a new instance. Very useful when a complex instance should stay constant. For example the Complex.i variable is a finalized instance. + * Finalize the instance. The number will not change and any other method call will return a new instance. + * Very useful when a complex instance should stay constant. + * For example the Complex.i variable is a finalized instance. */ finalize(): Complex; @@ -167,7 +184,8 @@ export default class Complex { /** * Return the natural logarithm (base E) - * @param k The actual answer has a multiplicity (ln(z) = ln|z| + arg(z)) where arg(z) can return the same for different angles (every 2*pi), with this argument you can define which answer is required + * @param k The actual answer has a multiplicity (ln(z) = ln|z| + arg(z)) where arg(z) can return the same for + * different angles (every 2*pi), with this argument you can define which answer is required */ log(k?: number): Complex; @@ -194,17 +212,17 @@ export default class Complex { /** * Calculate the hyperbolic sine of the complex number */ - sinh(): Complex + sinh(): Complex; /** * Calculate the hyperbolic cosine of the complex number */ - cosh(): Complex + cosh(): Complex; /** * Calculate the hyperbolic tangent of the complex number */ - tanh(): Complex + tanh(): Complex; /** * Return a new Complex instance with the same real and imaginary properties diff --git a/types/complex/tsconfig.json b/types/complex/tsconfig.json index b8a54e716a..0869ead6e6 100644 --- a/types/complex/tsconfig.json +++ b/types/complex/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "complex-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/complex/tslint.json b/types/complex/tslint.json index a41bf5d19a..3db14f85ea 100644 --- a/types/complex/tslint.json +++ b/types/complex/tslint.json @@ -1,79 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} +{ "extends": "dtslint/dt.json" } diff --git a/types/connect-datadog/connect-datadog-tests.ts b/types/connect-datadog/connect-datadog-tests.ts new file mode 100644 index 0000000000..4160ba4bc0 --- /dev/null +++ b/types/connect-datadog/connect-datadog-tests.ts @@ -0,0 +1,16 @@ +import connectDD = require('connect-datadog'); +import dogstatsd = require('node-dogstatsd'); + +// works with no options +const middleware = connectDD({}); + +// works with all options +const middleware2 = connectDD({ + stat: 'foo', + path: true, + method: true, + protocol: true, + response_code: true, + tags: ['abc', 'def'], + dogstatsd: new dogstatsd.StatsD('localhost'), +}); diff --git a/types/connect-datadog/index.d.ts b/types/connect-datadog/index.d.ts new file mode 100644 index 0000000000..c3aad8aac7 --- /dev/null +++ b/types/connect-datadog/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for connect-datadog 0.0 +// Project: https://github.com/AppPress/node-connect-datadog +// Definitions by: Moshe Good +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import express = require('express'); +import dogstatsd = require('node-dogstatsd'); + +export = Factory; + +declare function Factory(options?: Factory.Options): express.RequestHandler; + +declare namespace Factory { + interface Options { + stat?: string; + tags?: string[]; + path?: boolean; + method?: boolean; + protocol?: boolean; + response_code?: boolean; + dogstatsd?: dogstatsd.StatsD; + } +} diff --git a/types/connect-datadog/tsconfig.json b/types/connect-datadog/tsconfig.json new file mode 100644 index 0000000000..fa91239b96 --- /dev/null +++ b/types/connect-datadog/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "connect-datadog-tests.ts" + ] +} diff --git a/types/connect-datadog/tslint.json b/types/connect-datadog/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/connect-datadog/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/consola/consola-tests.ts b/types/consola/consola-tests.ts new file mode 100644 index 0000000000..f6cc225346 --- /dev/null +++ b/types/consola/consola-tests.ts @@ -0,0 +1,15 @@ +import * as consola from 'consola'; + +consola.start('TEST'); +consola.info('TEST'); +consola.success('TEST'); +consola.error('TEST'); + +const logger = new consola.Consola({ + level: 30, +}); + +logger.start('TEST'); +logger.info('TEST'); +logger.success('TEST'); +logger.error('TEST'); diff --git a/types/consola/index.d.ts b/types/consola/index.d.ts new file mode 100644 index 0000000000..a17c0c5c8f --- /dev/null +++ b/types/consola/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for consola 1.x +// Project: https://github.com/nuxt/consola +// Definitions by: Jungwoo An +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +export interface LevelType { + level: number; + color: string; + isError?: boolean; +} + +export interface Reporter { + log(logObj: any): void; +} + +export interface Option { + level?: number; + types?: LevelType; + reporters?: Reporter[]; +} + +export class Consola { + constructor(option?: Option); + + add(reporter: Reporter): Consola; + remove(reporter: Reporter): Consola; + clear(): Consola; + withScope(scope: string): void; + start(...arguments: string[]): void; + success(...arguments: string[]): void; + info(...arguments: string[]): void; + error(...arguments: Array): void; +} + +export function start(...arguments: string[]): void; +export function success(...arguments: string[]): void; +export function info(...arguments: string[]): void; +export function error(...arguments: Array): void; diff --git a/types/consola/tsconfig.json b/types/consola/tsconfig.json new file mode 100644 index 0000000000..aab34c3363 --- /dev/null +++ b/types/consola/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "consola-tests.ts"] +} diff --git a/types/consola/tslint.json b/types/consola/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/consola/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/console-ui/console-ui-tests.ts b/types/console-ui/console-ui-tests.ts new file mode 100644 index 0000000000..0092ce60db --- /dev/null +++ b/types/console-ui/console-ui-tests.ts @@ -0,0 +1,60 @@ +import { Question } from 'inquirer'; +import UI = require('console-ui'); + +new UI({ + inputStream: process.stdin, + outputStream: process.stderr, + errorStream: process.stdout, + writeLevel: 'DEBUG', + ci: false +}); + +const ui = new UI(); + +ui.write(); // $ExpectError +ui.write('hello'); +ui.write('hello', 'DEBUG'); +ui.write('hello', 'INFO'); +ui.write('hello', 'WARNING'); +ui.write('hello', 'ERROR'); +ui.write('hello', 'NONEXISTENT'); // $ExpectError + +ui.writeLine(); // $ExpectError +ui.writeLine('hello'); +ui.writeLine('hello', 'DEBUG'); +ui.writeLine('hello', 'INFO'); +ui.writeLine('hello', 'WARNING'); +ui.writeLine('hello', 'ERROR'); +ui.writeLine('hello', 'NONEXISTENT'); // $ExpectError + +ui.writeDebugLine('hello'); + +ui.writeWarnLine('hello'); +ui.writeWarnLine('hello', true); +ui.writeWarnLine('hello', false, true); + +ui.writeDeprecateLine('hello'); +ui.writeDeprecateLine('hello', true); +ui.writeDeprecateLine('hello', false, true); + +ui.writeError(new Error('boom!')); +ui.writeError('boom!'); // $ExpectError + +ui.setWriteLevel('DEBUG'); +ui.setWriteLevel('INFO'); +ui.setWriteLevel('WARNING'); +ui.setWriteLevel('ERROR'); +ui.setWriteLevel('NONEXISTENT'); // $ExpectError + +ui.startProgress('hello'); +ui.stopProgress(); +ui.stopProgress('hello'); // $ExpectError + +const question: Question<{ answer: boolean }> = { + message: 'Yes / No?', + type: 'confirm' +}; + +ui.prompt(question).then(result => { + result.answer; // $ExpectType boolean +}); diff --git a/types/console-ui/index.d.ts b/types/console-ui/index.d.ts new file mode 100644 index 0000000000..a5a7cb994a --- /dev/null +++ b/types/console-ui/index.d.ts @@ -0,0 +1,93 @@ +// Type definitions for console-ui 2.2 +// Project: https://github.com/ember-cli/console-ui#readme +// Definitions by: Dan Freeman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Readable, Writable } from 'stream'; +import { Questions } from 'inquirer'; + +type WriteLevel = 'DEBUG' | 'INFO' | 'WARNING' | 'ERROR'; + +export = UI; + +/** + * The UI provides the CLI with a unified mechanism for providing output and + * requesting input from the user. This becomes useful when wanting to adjust + * logLevels, or mock input/output for tests. + */ +declare class UI { + constructor(options?: { + inputStream?: Readable; + outputStream?: Writable; + errorStream?: Writable; + writeLevel?: WriteLevel; + ci?: boolean; + }); + + /** + * Unified mechanism to write a string to the console. + * Optionally include a writeLevel, this is used to decide if the specific + * logging mechanism should or should not be printed. + */ + write(message: string, level?: WriteLevel): void; + + /** + * Unified mechanism to write a string and new line to the console. + * Optionally include a writeLevel, this is used to decide if the specific + * logging mechanism should or should not be printed. + */ + writeLine(message: string, level?: WriteLevel): void; + + /** + * Helper method to write a string with the DEBUG writeLevel and gray chalk + */ + writeDebugLine(message: string): void; + + /** + * Helper method to write a string with the INFO writeLevel and cyan chalk + */ + writeInfoLine(message: string): void; + + /** + * Helper method to write a string with the WARNING writeLevel and yellow chalk. + * Optionally include a test. If falsy, the warning will be printed. By default, warnings + * will be prepended with WARNING text when printed. + */ + writeWarnLine(message: string, test?: boolean, prepend?: boolean): void; + + /** + * Helper method to write a string with the WARNING writeLevel and yellow chalk. + * Optionally include a test. If falsy, the deprecation will be printed. By default deprecations + * will be prepended with DEPRECATION text when printed. + */ + writeDeprecateLine(message: string, test?: boolean, prepend?: boolean): void; + + /** + * Unified mechanism to an Error to the console. + * This will occure at a writeLevel of ERROR + */ + writeError(error: object): void; + + /** + * Sets the write level for the UI. Valid write levels are 'DEBUG', 'INFO', + * 'WARNING', and 'ERROR'. + */ + setWriteLevel(level: WriteLevel): void; + + /** + * Begins a progress spinner with a message (only if the INFO write level is visible). + */ + startProgress(message: string): void; + + /** + * Ends the current progress spinner. + */ + stopProgress(): void; + + /** + * Launch the prompt interface (inquiry session) with (Array of Questions || Question) + * See [Inquirer.js#question](https://github.com/SBoudrias/Inquirer.js#question) for Question properties + */ + prompt(questions: Questions, callback?: (answers: T) => void): Promise; +} diff --git a/types/console-ui/tsconfig.json b/types/console-ui/tsconfig.json new file mode 100644 index 0000000000..fbb24995c7 --- /dev/null +++ b/types/console-ui/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "console-ui-tests.ts" + ] +} diff --git a/types/console-ui/tslint.json b/types/console-ui/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/console-ui/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/consul/index.d.ts b/types/consul/index.d.ts index 3d344ae983..096a906c8b 100644 --- a/types/consul/index.d.ts +++ b/types/consul/index.d.ts @@ -625,6 +625,7 @@ declare namespace Consul { dc?: string; tag?: string; passing?: boolean; + near?: string; } interface StateOptions extends CommonOptions { diff --git a/types/copy-text-to-clipboard/tslint.json b/types/copy-text-to-clipboard/tslint.json index 3db14f85ea..1c36270d47 100644 --- a/types/copy-text-to-clipboard/tslint.json +++ b/types/copy-text-to-clipboard/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-angle-bracket-type-assertion": false + } +} diff --git a/types/cordova-plugin-bluetoothclassic-serial/cordova-plugin-bluetoothclassic-serial-tests.ts b/types/cordova-plugin-bluetoothclassic-serial/cordova-plugin-bluetoothclassic-serial-tests.ts new file mode 100644 index 0000000000..72925fe5ba --- /dev/null +++ b/types/cordova-plugin-bluetoothclassic-serial/cordova-plugin-bluetoothclassic-serial-tests.ts @@ -0,0 +1,63 @@ +let BluetoothClassicSerial: BluetoothClassicSerial = + window.BluetoothClassicSerial; + +BluetoothClassicSerial.connect( + "", + [""] +); +BluetoothClassicSerial.connect( + "", + [""], + results => {} +); +BluetoothClassicSerial.connect( + "", + [""], + results => {}, + error => {} +); +BluetoothClassicSerial.connectInsecure("", [""]); +BluetoothClassicSerial.connectInsecure("", [""], results => {}); +BluetoothClassicSerial.connectInsecure("", [""], results => {}, error => {}); +BluetoothClassicSerial.register(() => {}); +BluetoothClassicSerial.disconnect(results => {}); +BluetoothClassicSerial.disconnect(results => {}, error => {}); +BluetoothClassicSerial.write("", ""); +BluetoothClassicSerial.write("", "", results => {}); +BluetoothClassicSerial.write("", "", results => {}, error => {}); +BluetoothClassicSerial.available(""); +BluetoothClassicSerial.available("", results => {}); +BluetoothClassicSerial.available("", results => {}, error => {}); +BluetoothClassicSerial.read(""); +BluetoothClassicSerial.read("", results => {}); +BluetoothClassicSerial.read("", results => {}, error => {}); +BluetoothClassicSerial.readUntil("", ""); +BluetoothClassicSerial.readUntil("", "", results => {}); +BluetoothClassicSerial.readUntil("", "", results => {}, error => {}); +BluetoothClassicSerial.subscribe("", ""); +BluetoothClassicSerial.subscribe("", "", results => {}); +BluetoothClassicSerial.subscribe("", "", results => {}, error => {}); +BluetoothClassicSerial.unsubscribe(""); +BluetoothClassicSerial.unsubscribe("", results => {}); +BluetoothClassicSerial.unsubscribe("", results => {}, error => {}); +BluetoothClassicSerial.subscribeRawData(""); +BluetoothClassicSerial.subscribeRawData("", results => {}); +BluetoothClassicSerial.subscribeRawData("", results => {}, error => {}); +BluetoothClassicSerial.unsubscribeRawData(""); +BluetoothClassicSerial.unsubscribeRawData("", results => {}); +BluetoothClassicSerial.unsubscribeRawData("", results => {}, error => {}); +BluetoothClassicSerial.clear(""); +BluetoothClassicSerial.clear("", results => {}); +BluetoothClassicSerial.clear("", results => {}, error => {}); +BluetoothClassicSerial.list(results => {}); +BluetoothClassicSerial.list(results => {}, error => {}); +BluetoothClassicSerial.isConnected(results => {}); +BluetoothClassicSerial.isConnected(results => {}, error => {}); +BluetoothClassicSerial.isEnabled(results => {}); +BluetoothClassicSerial.isEnabled(results => {}, error => {}); +BluetoothClassicSerial.showBluetoothSettings(results => {}); +BluetoothClassicSerial.showBluetoothSettings(results => {}, error => {}); +BluetoothClassicSerial.enable(results => {}); +BluetoothClassicSerial.enable(results => {}, error => {}); +BluetoothClassicSerial.discoverUnpaired(results => {}); +BluetoothClassicSerial.discoverUnpaired(results => {}, error => {}); diff --git a/types/cordova-plugin-bluetoothclassic-serial/index.d.ts b/types/cordova-plugin-bluetoothclassic-serial/index.d.ts new file mode 100644 index 0000000000..2dfe8c94ae --- /dev/null +++ b/types/cordova-plugin-bluetoothclassic-serial/index.d.ts @@ -0,0 +1,105 @@ +// Type definitions for cordova-plugin-bluetoothClassic-serial 0.9 +// Project: https://github.com/soltius/BluetoothClassicSerial +// Definitions by: Wouter Roosendaal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Global object bluetoothClassicSerial. + */ +interface Window { + BluetoothClassicSerial: BluetoothClassicSerial; +} + +interface BluetoothClassicSerial { + connect: ( + deviceId: string, + interfaceArray: [any], + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + connectInsecure: ( + deviceId: string, + interfaceArray: [any], + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + register: (data_cb?: () => any) => void; + disconnect: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + write: ( + interfaceId: string, + data: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + available: ( + interfaceId: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + read: ( + interfaceId: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + readUntil: ( + interfaceId: string, + delimiter: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + subscribe: ( + interfaceId: string, + delimiter: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + unsubscribe: ( + interfaceId: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + subscribeRawData: ( + interfaceId: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + unsubscribeRawData: ( + interfaceId: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + clear: ( + interfaceId: string, + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + list: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + isConnected: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + isEnabled: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + showBluetoothSettings: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + enable: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; + discoverUnpaired: ( + success_cb?: (results: any) => any, + fail_cb?: (error: any) => any + ) => void; +} + +declare var bluetoothClassicSerial: BluetoothClassicSerial; diff --git a/types/cordova-plugin-bluetoothclassic-serial/tsconfig.json b/types/cordova-plugin-bluetoothclassic-serial/tsconfig.json new file mode 100644 index 0000000000..5cd12b710a --- /dev/null +++ b/types/cordova-plugin-bluetoothclassic-serial/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cordova-plugin-bluetoothclassic-serial-tests.ts" + ] +} diff --git a/types/cordova-plugin-bluetoothclassic-serial/tslint.json b/types/cordova-plugin-bluetoothclassic-serial/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/cordova-plugin-bluetoothclassic-serial/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/cordova/tslint.json b/types/cordova/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/cordova/tslint.json +++ b/types/cordova/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/core-object/-private/utils.d.ts b/types/core-object/-private/utils.d.ts new file mode 100644 index 0000000000..35e3880150 --- /dev/null +++ b/types/core-object/-private/utils.d.ts @@ -0,0 +1,40 @@ +export type Constructor = new (...args: any[]) => Instance; +export type Mix = U & Pick>; +export type Values = T[keyof T]; + +/** Just the strings corresponding to method names on the given type */ +export type MethodNames = Values<{ [K in keyof T]: T[K] extends (...args: any[]) => any ? K : never }>; + +/** + * Given a `this` type, arg types tuple and return type, creates a function-ish + * type that can only be only be invoked via `.call` or `.apply`. Because of the + * way CoreObject's `_super` works, it's an error to write e.g. `this._super.init()`; + */ +export interface CallOrApply { + apply: (thisArg: This, args: Args extends undefined ? any[] : Args | IArguments) => Return; + + // TODO support this properly with `...args: Args` once we can restrict to 3.0+ on DT + call: + Args extends undefined ? (thisArg: This) => Return : + Args extends [infer A] ? (thisArg: This, a: A) => Return : + Args extends [infer A, infer B] ? (thisArg: This, a: A, b: B) => Return : + Args extends [infer A, infer B, infer C] ? (thisArg: This, a: A, b: B, c: C) => Return : + Args extends [infer A, infer B, infer C, infer D] ? (thisArg: This, a: A, b: B, c: C, d: D) => Return : + (thisArg: This, ...args: any[]) => Return; +} + +/** + * The type of `this._super`, which has keys for all methods appearing in the given + * type, but forces the caller to use `.call` or `.apply` to invoke them. + */ +export type Super = { + // TODO just do `infer Args` once we can restrict to 3.0+ on DT + [K in MethodNames]: + T[K] extends () => infer Return ? CallOrApply : + T[K] extends (a: infer A) => infer Return ? CallOrApply : + T[K] extends (a: infer A, b: infer B) => infer Return ? CallOrApply : + T[K] extends (a: infer A, b: infer B, c: infer C) => infer Return ? CallOrApply : + T[K] extends (a: infer A, b: infer B, c: infer C, d: infer D) => infer Return ? CallOrApply : + T[K] extends (...args: any[]) => infer Return ? CallOrApply : + never; +}; diff --git a/types/core-object/core-object-tests.ts b/types/core-object/core-object-tests.ts new file mode 100644 index 0000000000..b434ee97fc --- /dev/null +++ b/types/core-object/core-object-tests.ts @@ -0,0 +1,163 @@ +import { Mix, MethodNames } from 'core-object/-private/utils'; +import CoreObject, { ExtendOptions, ExtendThisType } from 'core-object'; + +//////////// Mix //////////// + +declare const mix1: Mix<{ a: number }, { b: string }>; +mix1.a; // $ExpectType number +mix1.b; // $ExpectType string + +declare const mix2: Mix<{ a: number }, { a: string }>; +mix2.a; // $ExpectType string +mix2.b; // $ExpectError + +//////////// MethodNames //////////// + +declare const names1: MethodNames<{ a: string }>; +names1; // $ExpectType never + +declare const names2: MethodNames<{ a: () => number; b(arg: number): void }>; +names2; // $ExpectType "a" | "b" + +declare const names3: MethodNames<{ a: () => 'hi'; b: null }>; +names3; // $ExpectType "a" + +//////////// ExtendOptions //////////// + +const extendOptions1: ExtendOptions<{}> = { a: 1, b: 'hi' }; +const extendOptions2: ExtendOptions<{ a: number }> = { b: 'hi' }; +const extendOptions3: ExtendOptions<{ a: number }> = { a: 5 }; +const extendOptions4: ExtendOptions<{ a: number }> = { a: 'hi' }; // $ExpectError + +//////////// ExtendThisType //////////// + +declare function extendThisType1(options: T & ExtendThisType<{ prop: string; method: () => number }, T>): void; +extendThisType1({ + otherMethod() { + this.prop; // $ExpectType string + this.random; // $ExpectError + + this._super.method.call(this); // $ExpectType number + this._super.random; // $ExpectError + } +}); + +//////////// CoreObject //////////// + +const A = CoreObject.extend({ + foo: 'hello', + + method(): string { + return this.foo; + } +}); + +const a = new A(); +a.foo; // $ExpectType string +a.bar; // $ExpectError +a.method(); // $ExpectType string + +const B = A.extend({ + bar: 123, + + other(): string { + return this._super.method.call(this) + this.foo; + } +}); + +const b = new B(); +b.foo; // $ExpectType string +b.bar; // $ExpectType number +b.method(); // $ExpectType string +b.other(); // $ExpectType string + +class ClassWithMethods extends CoreObject.extend({ + extendMethod(arg: number): string { + return 'ok'; + } +}) { + esMethod(arg: string): number { + return 123; + } +} + +const ExtendSubclass = ClassWithMethods.extend({ + anotherMethod() { + this._super.extendMethod(1); // $ExpectError + this._super.esMethod('hi'); // $ExpectError + + this._super.extendMethod.call(this, 1); // $ExpectType string + this._super.extendMethod.apply(this, [1]); // $ExpectType string + + this._super.esMethod.call(this, 'hi'); // $ExpectType number + this._super.esMethod.apply(this, ['hi']); // $ExpectType number + } +}); + +class ESSubclass extends ClassWithMethods { + anotherMethod() { + this._super; // $ExpectError + + super.extendMethod(1); // $ExpectType string + super.esMethod('hi'); // $ExpectType number + } +} + +ClassWithMethods.extend({ extendMethod: null }); // $ExpectError +ClassWithMethods.extend({ extendMethod() {} }); // $ExpectError +ClassWithMethods.extend({ esMethod: null }); // $ExpectError +ClassWithMethods.extend({ esMethod() {} }); // $ExpectError + +ClassWithMethods.extend({ + extendMethod(arg: number): string { + const result = this._super.extendMethod.call(this, arg); + result; // $ExpectType string + return result; + }, + + esMethod(arg: string): number { + const result = this._super.esMethod.call(this, arg); + result; // $ExpectType number + return result; + } +}); + +declare class ClassWithManyMethods extends CoreObject { + method0(): 0; + method1(a: 'a'): 1; + method2(a: 'a', b: 'b'): 2; + method3(a: 'a', b: 'b', c: 'c'): 3; + method4(a: 'a', b: 'b', c: 'c', d: 'd'): 4; + method5(a: 'a', b: 'b', c: 'c', d: 'd', e: 'e'): 5; +} + +ClassWithManyMethods.extend({ + child(): void { + this._super.method0.call(this); // $ExpectType 0 + this._super.method0.apply(this, []); // $ExpectType 0 + + this._super.method1.call(this, 'a'); // $ExpectType 1 + this._super.method1.apply(this, ['a']); // $ExpectType 1 + this._super.method1.call(this, 'x'); // $ExpectError + this._super.method1.apply(this, ['x']); // $ExpectError + + this._super.method2.call(this, 'a', 'b'); // $ExpectType 2 + this._super.method2.apply(this, ['a', 'b']); // $ExpectType 2 + this._super.method2.call(this, 'a', 'x'); // $ExpectError + this._super.method2.apply(this, ['a', 'x']); // $ExpectError + + this._super.method3.call(this, 'a', 'b', 'c'); // $ExpectType 3 + this._super.method3.apply(this, ['a', 'b', 'c']); // $ExpectType 3 + this._super.method3.call(this, 'a', 'b', 'x'); // $ExpectError + this._super.method3.apply(this, ['a', 'b', 'x']); // $ExpectError + + this._super.method4.call(this, 'a', 'b', 'c', 'd'); // $ExpectType 4 + this._super.method4.apply(this, ['a', 'b', 'c', 'd']); // $ExpectType 4 + this._super.method4.call(this, 'a', 'b', 'c', 'x'); // $ExpectError + this._super.method4.apply(this, ['a', 'b', 'c', 'x']); // $ExpectError + + // Arity 4 is as high as we go for arg checking + this._super.method5.call(this, 'foo', 'bar', 'baz'); // $ExpectType 5 + this._super.method5.apply(this, ['foo', 'bar', 'baz']); // $ExpectType 5 + } +}); diff --git a/types/core-object/index.d.ts b/types/core-object/index.d.ts new file mode 100644 index 0000000000..aa4566cac2 --- /dev/null +++ b/types/core-object/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for core-object 3.0 +// Project: https://github.com/ember-cli/core-object +// Definitions by: Dan Freeman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Mix, Super, Constructor } from './-private/utils'; + +/** The type of options allowed to be passed to `Base.extend()` */ +export type ExtendOptions = { [K in keyof Base]?: Base[K] } & Record; + +/** The `this` type for any methods on the options passed to `Base.extend()` */ +export type ExtendThisType = ThisType & { _super: Super }>; + +export default class CoreObject { + // TODO restrict to `Record` once we can restrict to 3.0+ on DT + init(options?: Record): void; + + static extend, Ext extends ExtendOptions>>( + this: BaseClass, + options: Ext & ExtendThisType, Ext> + ): BaseClass & Constructor, Ext>>; +} diff --git a/types/core-object/tsconfig.json b/types/core-object/tsconfig.json new file mode 100644 index 0000000000..908527fc38 --- /dev/null +++ b/types/core-object/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "-private/utils.d.ts", + "core-object-tests.ts" + ] +} diff --git a/types/core-object/tslint.json b/types/core-object/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/core-object/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cote/cote-tests.ts b/types/cote/cote-tests.ts index 8fd52a73a4..1851654625 100644 --- a/types/cote/cote-tests.ts +++ b/types/cote/cote-tests.ts @@ -80,10 +80,10 @@ class Readme { payload: { val: number }; } - randomResponder.on('randomRequest', (req: RandomRequest, callback: (answer: number) => void) => { + randomResponder.on('randomRequest', (req: RandomRequest, callback: (error: any, answer?: number) => void) => { const answer = Math.floor(Math.random() * 10); console.log('request', req.payload.val, 'answering with', answer); - callback(answer); + callback(null, answer); }); } diff --git a/types/cote/index.d.ts b/types/cote/index.d.ts index f6c60c54a2..4c959af76b 100644 --- a/types/cote/index.d.ts +++ b/types/cote/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for cote 0.14 +// Type definitions for cote 0.17 // Project: https://github.com/dashersw/cote#readme // Definitions by: makepost +// Labat Robin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import { EventEmitter2 } from "eventemitter2"; @@ -55,7 +56,7 @@ export class Requester extends Component { * @param event Request. * @param callback Function to execute after getting a result. */ - send(event: T, callback: (result: any) => void): void; + send(event: T, callback: (error: any, result: any) => void): void; } /** @@ -100,7 +101,7 @@ export class Responder extends Component { on( type: string | string[], listener: ( - ((event: T, callback: (result: any) => void) => void) | + ((event: T, callback: (error: any, result: any) => void) => void) | ((event: T) => Promise) ) ): this; diff --git a/types/countdown/tslint.json b/types/countdown/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/countdown/tslint.json +++ b/types/countdown/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/countup.js/countup.js-tests.ts b/types/countup.js/countup.js-tests.ts new file mode 100644 index 0000000000..4b0dfc36d6 --- /dev/null +++ b/types/countup.js/countup.js-tests.ts @@ -0,0 +1,32 @@ +const b = new CountUp(".foo", 0, 100); + +const options: CountUp.CountUpOptions = { + decimal: ",", + useGrouping: true, + suffix: "-", + prefix: "=", + separator: "/", + useEasing: true, + formattingFn: number => number + "-", + easingFn: (t, b, c, d) => t + b + c + d, + numerals: ["q", 2, "e", [3], "t", 0, "u", 7, "o", "p"] +}; + +const element = document.getElementById("#id"); +if (element) { + const instance2 = new CountUp(element, 2, "3", 0, "5", options); +} + +const instance = new CountUp(".js-target", 2, "3", 0, "5", options); + +instance.start(); + +instance.start(() => { + console.log(instance.version()); +}); + +instance.update(999); + +instance.pauseResume(); + +if (instance.paused) instance.reset(); diff --git a/types/countup.js/index.d.ts b/types/countup.js/index.d.ts new file mode 100644 index 0000000000..e74376d75b --- /dev/null +++ b/types/countup.js/index.d.ts @@ -0,0 +1,124 @@ +// Type definitions for countup.js 1.9 +// Project: https://github.com/inorganik/CountUp.js +// Definitions by: Rostislav Shermenyov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class CountUp { + /** + * @param target Id of html element or var of previously selected html element where counting occurs + * @param startVal The value you want to begin at + * @param endVal The value you want to arrive at + * @param decimals Number of decimal places, default 0 + * @param duration Duration of animation in seconds, default 2 + * @param options Object of options + */ + constructor( + target: string | HTMLElement, + startVal: number | string, + endVal: number | string, + decimals?: number | string, + duration?: number | string, + options?: CountUp.CountUpOptions + ); + // #region Dynamic params + // Will appear(or not) in the CountUpInstance object once the other functions fire + // i.e. paused will return undefined instead of boolean unless the pauseResume() was called before + countDown?: boolean; + d?: any; + dec?: number; + decimals?: number; + duration?: number; + endVal?: number; + error?: string; + frameVal?: number; + initialized?: boolean; + options?: CountUp.CountUpOptions; + paused?: boolean; + rAF?: number; + remaining?: number; + startTime?: number; + startVal?: number; + timestamp?: number; + callback?(): void; + // #endregion + /** + * @param timestamp + */ + count(timestamp: number): void; + initialize(): boolean; + /** + * Toggles pause/resume animation. + */ + pauseResume(): void; + /** + * Print value to target. + * @param value number that will be passed to formattingFn and then printed to the target + */ + printValue(value: number): void; + /** + * Reset to startVal so animation can be run again. + */ + reset(): void; + /** + * Start your animation. + * @param callback Option callback to run on animation end + */ + start(callback?: () => void): void; + /** + * Pass a new endVal and start animation. + * @param newEndVal new value + */ + update(newEndVal: number | string): void; + version(): string; +} + +declare namespace CountUp { + interface CountUpOptions { + /** + * Character to use as a decimal + */ + decimal?: string; + /** + * Optional custom easing function, default is Robert Penner's easeOutExpo + * @param t current time + * @param b start value + * @param c change in value + * @param d duration + * @return calculated value + */ + easingFn?(t: number, b: number, c: number, d: number): number; + /** + * Optional custom formatting function + * @param num + * @return + */ + formattingFn?(num: number): string; + /** + * Optionally pass an array of custom numerals for 0-9 + */ + numerals?: any[]; + /** + * Optional text before the result + */ + prefix?: string; + /** + * Character to use as a separator + */ + separator?: string; + /** + * Optional text after the result + */ + suffix?: string; + /** + * Toggle easing + */ + useEasing?: boolean; + /** + * 1,000,000 vs 1000000 + */ + useGrouping?: boolean; + } +} + +export = CountUp; +export as namespace CountUp; diff --git a/types/countup.js/tsconfig.json b/types/countup.js/tsconfig.json new file mode 100644 index 0000000000..dc6a91b4a2 --- /dev/null +++ b/types/countup.js/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "countup.js-tests.ts" + ] +} diff --git a/types/countup.js/tslint.json b/types/countup.js/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/countup.js/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/critters-webpack-plugin/critters-webpack-plugin-tests.ts b/types/critters-webpack-plugin/critters-webpack-plugin-tests.ts new file mode 100644 index 0000000000..69d520eaff --- /dev/null +++ b/types/critters-webpack-plugin/critters-webpack-plugin-tests.ts @@ -0,0 +1,14 @@ +import Critters from 'critters-webpack-plugin'; + +new Critters({ + compress: true, + external: true, + inlineFonts: false, + preloadFonts: true, + keyframes: 'critical', + noscriptFallback: true, + inlineThreshold: 0, + mergeStylesheets: true, + pruneSource: true, + minimumExternalSize: 0, +}); diff --git a/types/critters-webpack-plugin/index.d.ts b/types/critters-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..daf9b3c218 --- /dev/null +++ b/types/critters-webpack-plugin/index.d.ts @@ -0,0 +1,85 @@ +// Type definitions for critters-webpack-plugin 2.0 +// Project: https://github.com/GoogleChromeLabs/critters +// Definitions by: Juan José González Giraldo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Plugin } from 'webpack'; + +export default Critters; +declare class Critters extends Plugin { + constructor(options?: Critters.CrittersOptions); +} + +declare namespace Critters { + interface CrittersOptions { + /** + * Inline styles from external stylesheets. + * @default true + */ + external?: boolean; + /** + * Inline external stylesheets smaller than a given size. + * @default 0 + */ + inlineThreshold?: number; + /** + * If the non-critical external stylesheet would be below this size, just inline it. + * @default 0 + */ + minimumExternalSize?: number; + /** + * Remove inlined rules from the external stylesheet. + * @default true + */ + pruneSource?: boolean; + /** + * Merged inlined stylesheets into a single + + + +​ +

​ + +​ + + +``` + */ + length: number; + /** + * Create a new jQuery object with elements added to the set of matched elements. + * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. + * @param context The point in the document at which the selector should begin matching; similar to the context + * argument of the $(selector, context) method. + * @see \`{@link https://api.jquery.com/add/ }\` + * @since 1.4 + */ + add(selector: JQuery.Selector, context: Element): this; + /** + * Create a new jQuery object with elements added to the set of matched elements. + * @param selector_elements_html_selection _@param_ `selector_elements_html_selection` + *
+ * * `selector` — A string representing a selector expression to find additional elements to add to the set of matched elements.
+ * * `elements` — One or more elements to add to the set of matched elements.
+ * * `html` — An HTML fragment to add to the set of matched elements.
+ * * `selection` — An existing jQuery object to add to the set of matched elements. + * @see \`{@link https://api.jquery.com/add/ }\` + * @since 1.0 + * @since 1.3.2 + * @example ​ ````Finds all divs and makes a border. Then adds all paragraphs to the jQuery object to set their backgrounds yellow. +```html + + + + + add demo + + + + +​ +
+
+
+
+
+
+​ +

Added this... (notice no border)

+​ + +​ + + +``` + * @example ​ ````Adds more elements, matched by the given expression, to the set of matched elements. +```html + + + + + add demo + + + +​ +

Hello

+Hello Again +​ + +​ + + +``` + * @example ​ ````Adds more elements, created on the fly, to the set of matched elements. +```html + + + + + add demo + + + +​ +

Hello

+​ + +​ + + +``` + * @example ​ ````Adds one or more Elements to the set of matched elements. +```html + + + + + add demo + + + +​ +

Hello

+Hello Again +​ + +​ + + +``` + * @example ​ ````Demonstrates how to add (or push) elements to an existing collection +```html + + + + + add demo + + + +​ +

Hello

+Hello Again +​ + +​ + + +``` + */ + add(selector_elements_html_selection: JQuery.Selector | JQuery.TypeOrArray | JQuery.htmlString | JQuery): this; + /** + * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. + * @param selector A string containing a selector expression to match the current set of elements against. + * @see \`{@link https://api.jquery.com/addBack/ }\` + * @since 1.8 + * @example ​ ````The .addBack() method causes the previous set of DOM elements in the traversal stack to be added to the current set. In the first example, the top stack contains the set resulting from .find("p"). In the second example, .addBack() adds the previous set of elements on the stack — in this case $("div.after-addback") — to the current set, selecting both the div and its enclosed paragraphs. +```html + + + + + addBack demo + + + + +​ +
+

Before addBack()

+
+

First Paragraph

+

Second Paragraph

+
+
+
+

After addBack()

+
+

First Paragraph

+

Second Paragraph

+
+
+​ + +​ + + +``` + */ + addBack(selector?: JQuery.Selector): this; + /** + * Adds the specified class(es) to each element in the set of matched elements. + * @param className_function _@param_ `className_function` + *
+ * * `className` — One or more space-separated classes to be added to the class attribute of each matched element.
+ * * `function` — A function returning one or more space-separated class names to be added to the existing class + * name(s). Receives the index position of the element in the set and the existing class name(s) as + * arguments. Within the function, `this` refers to the current element in the set. + * @see \`{@link https://api.jquery.com/addClass/ }\` + * @since 1.0 + * @since 1.4 + * @since 3.3 + * @example ​ ````Add the class "selected" to the matched elements. +```html + + + + + addClass demo + + + + +​ +

Hello

+

and

+

Goodbye

+​ + +​ + + +``` + * @example ​ ````Add the classes "selected" and "highlight" to the matched elements. +```html + + + + + addClass demo + + + + +​ +

Hello

+

and

+

Goodbye

+​ + +​ + + +``` + * @example ​ ````Pass in a function to .addClass() to add the "green" class to a div that already has a "red" class. +```html + + + + + addClass demo + + + + +​ +
This div should be white
+
This div will be green because it now has the "green" and "red" classes. + It would be red if the addClass function failed.
+
This div should be white
+

There are zero green divs

+​ + +​ + + +``` + */ + addClass(className_function: JQuery.TypeOrArray | ((this: TElement, index: number, currentClassName: string) => string)): this; + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or + * jQuery objects to insert after each element in the set of matched elements. + * @see \`{@link https://api.jquery.com/after/ }\` + * @since 1.0 + * @example ​ ````Inserts some HTML after all paragraphs. +```html + + + + + after demo + + + + +​ +

I would like to say:

+​ + +​ + + +``` + * @example ​ ````Inserts a DOM element after all paragraphs. +```html + + + + + after demo + + + + +​ +

I would like to say:

+​ + +​ + + +``` + * @example ​ ````Inserts a jQuery object (similar to an Array of DOM Elements) after all paragraphs. +```html + + + + + after demo + + + + +​ +Hello +

I would like to say:

+​ + +​ + + +``` + */ + after(...contents: Array>>): this; + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * @param function_functionーhtml _@param_ `function_functionーhtml` + *
+ * * `function` — A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert + * after each element in the set of matched elements. Receives the index position of the element in the + * set as an argument. Within the function, `this` refers to the current element in the set.
+ * * `functionーhtml` — A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert + * after each element in the set of matched elements. Receives the index position of the element in the + * set and the old HTML value of the element as arguments. Within the function, `this` refers to the + * current element in the set. + * @see \`{@link https://api.jquery.com/after/ }\` + * @since 1.4 + * @since 1.10 + */ + after(function_functionーhtml: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; + /** + * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. + * @param handler The function to be invoked. + * @see \`{@link https://api.jquery.com/ajaxComplete/ }\` + * @since 1.0 + * @example ​ ````Show a message when an Ajax request completes. +```javascript +$( document ).ajaxComplete(function( event, request, settings ) { + $( "#msg" ).append( "
  • Request Complete.
  • " ); +}); +``` + */ + ajaxComplete(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings) => void | false): this; + /** + * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + * @param handler The function to be invoked. + * @see \`{@link https://api.jquery.com/ajaxError/ }\` + * @since 1.0 + * @example ​ ````Show a message when an Ajax request fails. +```javascript +$( document ).ajaxError(function( event, request, settings ) { + $( "#msg" ).append( "
  • Error requesting page " + settings.url + "
  • " ); +}); +``` + */ + ajaxError(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxSettings: JQuery.AjaxSettings, thrownError: string) => void | false): this; + /** + * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + * @param handler The function to be invoked. + * @see \`{@link https://api.jquery.com/ajaxSend/ }\` + * @since 1.0 + * @example ​ ````Show a message before an Ajax request is sent. +```javascript +$( document ).ajaxSend(function( event, request, settings ) { + $( "#msg" ).append( "
  • Starting request at " + settings.url + "
  • " ); +}); +``` + */ + ajaxSend(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings) => void | false): this; + /** + * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + * @param handler The function to be invoked. + * @see \`{@link https://api.jquery.com/ajaxStart/ }\` + * @since 1.0 + * @example ​ ````Show a loading message whenever an Ajax request starts (and none is already active). +```javascript +$( document ).ajaxStart(function() { + $( "#loading" ).show(); +}); +``` + */ + ajaxStart(handler: (this: Document) => void | false): this; + /** + * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + * @param handler The function to be invoked. + * @see \`{@link https://api.jquery.com/ajaxStop/ }\` + * @since 1.0 + * @example ​ ````Hide a loading message after all the Ajax requests have stopped. +```javascript +$( document ).ajaxStop(function() { + $( "#loading" ).hide(); +}); +``` + */ + ajaxStop(handler: (this: Document) => void | false): this; + /** + * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + * @param handler The function to be invoked. + * @see \`{@link https://api.jquery.com/ajaxSuccess/ }\` + * @since 1.0 + * @example ​ ````Show a message when an Ajax request completes successfully. +```javascript +$( document ).ajaxSuccess(function( event, request, settings ) { + $( "#msg" ).append( "
  • Successful Request!
  • " ); +}); +``` + */ + ajaxSuccess(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings, data: JQuery.PlainObject) => void | false): this; + /** + * Perform a custom animation of a set of CSS properties. + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/animate/ }\` + * @since 1.0 + * @example ​ ````An example of using an 'easing' function to provide a different style of animation. This will only work if you have a plugin that provides this easing function. Note, this code will do nothing unless the paragraph element is hidden. +```javascript +$( "p" ).animate({ + opacity: "show" +}, "slow", "easein" ); +``` + * @example ​ ````Animate all paragraphs and execute a callback function when the animation is complete. The first argument is an object of CSS properties, the second specifies that the animation should take 1000 milliseconds to complete, the third states the easing type, and the fourth argument is an anonymous callback function. +```javascript +$( "p" ).animate({ + height: 200, + width: 400, + opacity: 0.5 +}, 1000, "linear", function() { + alert( "all done" ); +}); +``` + */ + animate(properties: JQuery.PlainObject, + duration: JQuery.Duration, + easing: string, + complete?: (this: TElement) => void): this; + /** + * Perform a custom animation of a set of CSS properties. + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration_easing _@param_ `duration_easing` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/animate/ }\` + * @since 1.0 + * @example ​ ````Click the button to animate the div with a number of different properties. +```html + + + + + animate demo + + + + +​ + +
    Hello!
    +​ + +​ + + +``` + * @example ​ ````Animates a div's left property with a relative value. Click several times on the buttons to see the relative animations queued up. +```html + + + + + animate demo + + + + +​ + + +
    +​ + +​ + + +``` + * @example ​ ````Animate all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. +```javascript +$( "p" ).animate({ + height: "toggle", + opacity: "toggle" +}, "slow" ); +``` + * @example ​ ````Animate all paragraphs to a left style of 50 and opacity of 1 (opaque, visible), completing the animation within 500 milliseconds. +```javascript +$( "p" ).animate({ + left: 50, + opacity: 1 +}, 500 ); +``` + */ + animate(properties: JQuery.PlainObject, + duration_easing: JQuery.Duration | string, + complete?: (this: TElement) => void): this; + /** + * Perform a custom animation of a set of CSS properties. + * @param properties An object of CSS properties and values that the animation will move toward. + * @param options A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/animate/ }\` + * @since 1.0 + * @example ​ ````The first button shows how an unqueued animation works. It expands the div out to 90% width while the font-size is increasing. Once the font-size change is complete, the border animation will begin. + +The second button starts a traditional chained animation, where each animation will start once the previous animation on the element has completed. +```html + + + + + animate demo + + + + +​ + + + + +
    Block1
    +
    Block2
    +​ + +​ + + +``` + * @example ​ ````Animates the first div's left property and synchronizes the remaining divs, using the step function to set their left properties at each stage of the animation. +```html + + + + + animate demo + + + + +​ +

    +
    +
    +
    +
    +
    +
    +​ + +​ + + +``` + * @example ​ ````Animate the left and opacity style properties of all paragraphs; run the animation outside the queue, so that it will automatically start without waiting for its turn. +```javascript +$( "p" ).animate({ + left: "50px", + opacity: 1 +}, { + duration: 500, + queue: false +}); +``` + * @example ​ ````Animates all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. +```javascript +$( "p" ).animate({ + height: "toggle", + opacity: "toggle" +}, { + duration: "slow" +}); +``` + * @example ​ ````Use an easing function to provide a different style of animation. This will only work if you have a plugin that provides this easing function. +```javascript +$( "p" ).animate({ + opacity: "show" +}, { + duration: "slow", + easing: "easein" +}); +``` + */ + animate(properties: JQuery.PlainObject, + options: JQuery.EffectsOptions): this; + /** + * Perform a custom animation of a set of CSS properties. + * @param properties An object of CSS properties and values that the animation will move toward. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/animate/ }\` + * @since 1.0 + */ + animate(properties: JQuery.PlainObject, + complete?: (this: TElement) => void): this; + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or + * jQuery objects to insert at the end of each element in the set of matched elements. + * @see \`{@link https://api.jquery.com/append/ }\` + * @since 1.0 + * @example ​ ````Appends some HTML to all paragraphs. +```html + + + + + append demo + + + + +​ +

    I would like to say:

    +​ + +​ + + +``` + * @example ​ ````Appends an Element to all paragraphs. +```html + + + + + append demo + + + + +​ +

    I would like to say:

    +​ + +​ + + +``` + * @example ​ ````Appends a jQuery object (similar to an Array of DOM Elements) to all paragraphs. +```html + + + + + append demo + + + + +​ +Hello world!!! +

    I would like to say:

    +​ + +​ + + +``` + */ + append(...contents: Array>>): this; + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * @param funÑtion A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at + * the end of each element in the set of matched elements. Receives the index position of the element + * in the set and the old HTML value of the element as arguments. Within the function, `this` refers to + * the current element in the set. + * @see \`{@link https://api.jquery.com/append/ }\` + * @since 1.4 + */ + append(funÑtion: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; + /** + * Insert every element in the set of matched elements to the end of the target. + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements + * will be inserted at the end of the element(s) specified by this parameter. + * @see \`{@link https://api.jquery.com/appendTo/ }\` + * @since 1.0 + * @example ​ ````Append all spans to the element with the ID "foo" (Check append() documentation for more examples) +```html + + + + + appendTo demo + + + + +​ +I have nothing more to say... +​ +
    FOO!
    +​ + +​ + + +``` + */ + appendTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Set one or more attributes for the set of matched elements. + * @param attributeName The name of the attribute to set. + * @param value_function _@param_ `value_function` + *
    + * * `value` — A value to set for the attribute. If `null`, the specified attribute will be removed (as in \`{@link removeAttr .removeAttr()}`).
    + * * `function` — A function returning the value to set. `this` is the current element. Receives the index position of + * the element in the set and the old attribute value as arguments. + * @see \`{@link https://api.jquery.com/attr/ }\` + * @since 1.0 + * @since 1.1 + * @example ​ ````Set the id for divs based on the position in the page. +```html + + + + + attr demo + + + + +​ +
    Zero-th
    +
    First
    +
    Second
    +​ + +​ + + +``` + * @example ​ ````Set the src attribute from title attribute on the image. +```html + + + + + attr demo + + + +​ + +​ + +​ + + +``` + */ + attr(attributeName: string, + value_function: string | number | null | ((this: TElement, index: number, attr: string) => string | number | void | undefined)): this; + /** + * Set one or more attributes for the set of matched elements. + * @param attributes An object of attribute-value pairs to set. + * @see \`{@link https://api.jquery.com/attr/ }\` + * @since 1.0 + * @example ​ ````Set some attributes for all <img>s in the page. +```html + + + + + attr demo + + + + +​ + + + +​ +
    Attribute of Ajax
    +​ + +​ + + +``` + */ + attr(attributes: JQuery.PlainObject): this; + /** + * Get the value of an attribute for the first element in the set of matched elements. + * @param attributeName The name of the attribute to get. + * @see \`{@link https://api.jquery.com/attr/ }\` + * @since 1.0 + * @example ​ ````Display the checked attribute and property of a checkbox as it changes. +```html + + + + + attr demo + + + + +​ + + +

    +​ + +​ + + +``` + * @example ​ ````Find the title attribute of the first <em> in the page. +```html + + + + + attr demo + + + + +​ +

    Once there was a large dinosaur...

    +​ +The title of the emphasis is:
    +​ + +​ + + +``` + */ + attr(attributeName: string): string | undefined; + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or + * jQuery objects to insert before each element in the set of matched elements. + * @see \`{@link https://api.jquery.com/before/ }\` + * @since 1.0 + * @example ​ ````Inserts some HTML before all paragraphs. +```html + + + + + before demo + + + + +​ +

    is what I said...

    +​ + +​ + + +``` + * @example ​ ````Inserts a DOM element before all paragraphs. +```html + + + + + before demo + + + + +​ +

    is what I said...

    +​ + +​ + + +``` + * @example ​ ````Inserts a jQuery object (similar to an Array of DOM Elements) before all paragraphs. +```html + + + + + before demo + + + + +​ +

    is what I said...

    Hello +​ + +​ + + +``` + */ + before(...contents: Array>>): this; + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * @param function_functionーhtml _@param_ `function_functionーhtml` + *
    + * * `function` — A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert + * before each element in the set of matched elements. Receives the index position of the element in + * the set as an argument. Within the function, `this` refers to the current element in the set.
    + * * `functionーhtml` — A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert + * before each element in the set of matched elements. Receives the index position of the element in + * the set and the old HTML value of the element as arguments. Within the function, `this` refers to the + * current element in the set. + * @see \`{@link https://api.jquery.com/before/ }\` + * @since 1.4 + * @since 1.10 + */ + before(function_functionーhtml: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; + // [bind() overloads] https://github.com/jquery/api.jquery.com/issues/1048 + /** + * Attach a handler to an event for the elements. + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/bind/ }\` + * @since 1.0 + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.0. Use \`{@link on }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + */ + bind(eventType: string, + eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Attach a handler to an event for the elements. + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler_preventBubble _@param_ `handler_preventBubble` + *
    + * * `handler` — A function to execute each time the event is triggered.
    + * * `preventBubble` — Setting the third argument to false will attach a function that prevents the default action from + * occurring and stops the event from bubbling. The default is `true`. + * @see \`{@link https://api.jquery.com/bind/ }\` + * @since 1.0 + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.0. Use \`{@link on }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````Handle click and double-click for the paragraph. Note: the coordinates are window relative, so in this case relative to the demo iframe. +```html + + + + + bind demo + + + + +​ +

    Click or double click here.

    + +​ + +​ + + +``` + * @example ​ ````To display each paragraph's text in an alert box whenever it is clicked: +```javascript +$( "p" ).bind( "click", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````Cancel a default action and prevent it from bubbling up by returning false: +```javascript +$( "form" ).bind( "submit", function() { + return false; +}) +``` + * @example ​ ````Cancel only the default action by using the .preventDefault() method. +```javascript +$( "form" ).bind( "submit", function( event ) { + event.preventDefault(); +}); +``` + * @example ​ ````Stop an event from bubbling without preventing the default action by using the .stopPropagation() method. +```javascript +$( "form" ).bind( "submit", function( event ) { + event.stopPropagation(); +}); +``` + * @example ​ ````Bind custom events. +```html + + + + + bind demo + + + + +​ +

    Has an attached custom event.

    + + +​ + +​ + + +``` + */ + bind(eventType: string, + handler_preventBubble: JQuery.EventHandler | JQuery.EventHandlerBase> | false | null | undefined): this; + /** + * Attach a handler to an event for the elements. + * @param events An object containing one or more DOM event types and functions to execute for them. + * @see \`{@link https://api.jquery.com/bind/ }\` + * @since 1.4 + * @deprecated ​ Deprecated since 3.0. Use \`{@link on }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````Bind multiple events simultaneously. +```javascript +$( "div.test" ).bind({ + click: function() { + $( this ).addClass( "active" ); + }, + mouseenter: function() { + $( this ).addClass( "inside" ); + }, + mouseleave: function() { + $( this ).removeClass( "inside" ); + } +}); +``` + */ + bind(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; + /** + * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/blur/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + blur(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/blur/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````To trigger the blur event on all paragraphs: +```javascript +$( "p" ).blur(); +``` + */ + blur(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/change/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + change(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/change/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Attaches a change event to the select that gets the text for each selected option and writes them in the div. It then triggers the event for the initial text draw. +```html + + + + + change demo + + + + +​ + +
    +​ + +​ + + +``` + * @example ​ ````To add a validity test to all text input elements: +```javascript +$( "input[type='text']" ).change(function() { + // Check input( $( this ).val() ) for validity here +}); +``` + */ + change(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Get the children of each element in the set of matched elements, optionally filtered by a selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/children/ }\` + * @since 1.0 + * @example ​ ````Find all children of the clicked element. +```html + + + + + children demo + + + + +​ +
    +
    +

    This is the way we + write the demo,

    +
    +​ +
    + write the demo, demo, +
    +​ +
    + This the way we write the demo so + in +
    +​ +

    + the morning. + Found 0 children in TAG. +

    +
    +​ + +​ + + +``` + * @example ​ ````Find all children of each div. +```html + + + + + children demo + + + + +​ +

    Hello (this is a paragraph)

    +​ +
    Hello Again (this span is a child of the a div)
    +

    And Again (in another paragraph)

    +​ +
    And One Last Time (most text directly in a div)
    +​ + +​ + + +``` + * @example ​ ````Find all children with a class "selected" of each div. +```html + + + + + children demo + + + + +​ +
    + Hello +

    Hello Again

    +
    And Again
    +

    And One Last Time

    +
    +​ + +​ + + +``` + */ + children(selector?: JQuery.Selector): this; + /** + * Remove from the queue all items that have not yet been run. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see \`{@link https://api.jquery.com/clearQueue/ }\` + * @since 1.4 + * @example ​ ````Empty the queue. +```html + + + + + clearQueue demo + + + + +​ + + +
    +​ + +​ + + +``` + */ + clearQueue(queueName?: string): this; + /** + * Bind an event handler to the "click" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/click/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + click(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "click" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/click/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Hide paragraphs on a page when they are clicked: +```html + + + + + click demo + + + + +​ +

    First Paragraph

    +

    Second Paragraph

    +

    Yet one more Paragraph

    +​ + +​ + + +``` + * @example ​ ````Trigger the click event on all of the paragraphs on the page: +```javascript +$( "p" ).click(); +``` + */ + click(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Create a deep copy of the set of matched elements. + * @param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The + * default value is false. *In jQuery 1.5.0 the default value was incorrectly true; it was changed back + * to false in 1.5.1 and up. + * @param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should + * be copied. By default its value matches the first argument's value (which defaults to false). + * @see \`{@link https://api.jquery.com/clone/ }\` + * @since 1.0 + * @since 1.5 + * @example ​ ````Clones all b elements (and selects the clones) and prepends them to all paragraphs. +```html + + + + + clone demo + + + +​ +Hello

    , how are you?

    +​ + +​ + + +``` + */ + clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): this; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * @param selector A string containing a selector expression to match elements against. + * @param context A DOM element within which a matching element may be found. + * @see \`{@link https://api.jquery.com/closest/ }\` + * @since 1.4 + */ + closest(selector: JQuery.Selector, context: Element): this; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * @param selector_selection_element _@param_ `selector_selection_element` + *
    + * * `selector` — A string containing a selector expression to match elements against.
    + * * `selection` — A jQuery object to match elements against.
    + * * `element` — An element to match elements against. + * @see \`{@link https://api.jquery.com/closest/ }\` + * @since 1.3 + * @since 1.6 + * @example ​ ````Show how event delegation can be done with closest. The closest list element toggles a yellow background when it or its descendent is clicked. +```html + + + + + closest demo + + + + +​ +
      +
    • Click me!
    • +
    • You can also Click me!
    • +
    +​ + +​ + + +``` + * @example ​ ````Pass a jQuery object to closest. The closest list element toggles a yellow background when it or its descendent is clicked. +```html + + + + + closest demo + + + + +​ +
      +
    • Click me!
    • +
    • You can also Click me!
    • +
    +​ + +​ + + +``` + */ + closest(selector_selection_element: JQuery.Selector | Element | JQuery): this; + /** + * Get the children of each element in the set of matched elements, including text and comment nodes. + * @see \`{@link https://api.jquery.com/contents/ }\` + * @since 1.2 + * @example ​ ````Find all the text nodes inside a paragraph and wrap them with a bold tag. +```html + + + + + contents demo + + + +​ +

    Hello John, how are you doing?

    +​ + +​ + + +``` + * @example ​ ````Change the background color of links inside of an iframe. +```html + + + + + contents demo + + + +​ + +​ + +​ + + +``` + */ + contents(): JQuery; + /** + * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/contextmenu/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + contextmenu(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/contextmenu/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````To show a "Hello World!" alert box when the contextmenu event is triggered on a paragraph on the page: +```javascript +$( "p" ).contextmenu(function() { + alert( "Hello World!" ); +}); +``` + * @example ​ ````Right click to toggle background color. +```html + + + + + contextmenu demo + + + + +​ +
    +Right click the block +​ + +​ + + +``` + */ + contextmenu(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Set one or more CSS properties for the set of matched elements. + * @param propertyName A CSS property name. + * @param value_function _@param_ `value_function` + *
    + * * `value` — A value to set for the property.
    + * * `function` — A function returning the value to set. `this` is the current element. Receives the index position of + * the element in the set and the old value as arguments. + * @see \`{@link https://api.jquery.com/css/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Change the color of any paragraph to red on mouseover event. +```html + + + + + css demo + + + + +​ +

    Just roll the mouse over me.

    +​ +

    Or me to see a color change.

    +​ + +​ + + +``` + * @example ​ ````Increase the width of #box by 200 pixels the first time it is clicked. +```html + + + + + css demo + + + + +​ +
    Click me to grow
    +​ + +​ + + +``` + * @example ​ ````Highlight a clicked word in the paragraph. +```html + + + + + css demo + + + + +​ +

    + Once upon a time there was a man + who lived in a pizza parlor. This + man just loved pizza and ate it all + the time. He went on to be the + happiest man in the world. The end. +

    +​ + +​ + + +``` + */ + css(propertyName: string, + value_function: string | number | ((this: TElement, index: number, value: string) => string | number | void | undefined)): this; + /** + * Set one or more CSS properties for the set of matched elements. + * @param properties An object of property-value pairs to set. + * @see \`{@link https://api.jquery.com/css/ }\` + * @since 1.0 + * @example ​ ````Change the font weight and background color on mouseenter and mouseleave. +```html + + + + + css demo + + + + +​ +

    Move the mouse over a paragraph.

    +

    Like this one or the one above.

    +​ + +​ + + +``` + * @example ​ ````Increase the size of a div when you click it. +```html + + + + + css demo + + + + +​ +
    click
    +
    click
    +​ + +​ + + +``` + */ + css(properties: JQuery.PlainObject string | number | void | undefined)>): this; + /** + * Get the computed style properties for the first element in the set of matched elements. + * @param propertyName A CSS property. + * @see \`{@link https://api.jquery.com/css/ }\` + * @since 1.0 + * @example ​ ````Get the background color of a clicked div. +```html + + + + + css demo + + + + +​ +  +
    +
    +
    +
    +​ + +​ + + +``` + */ + css(propertyName: string): string; + /** + * Get the computed style properties for the first element in the set of matched elements. + * @param propertyNames An array of one or more CSS properties. + * @see \`{@link https://api.jquery.com/css/ }\` + * @since 1.9 + * @example ​ ````Get the width, height, text color, and background color of a clicked div. +```html + + + + + css demo + + + + +​ +

     

    +
    1
    +
    2
    +
    3
    +
    4
    +​ + +​ + + +``` + */ + css(propertyNames: string[]): JQuery.PlainObject; + /** + * Store arbitrary data associated with the matched elements. + * @param key A string naming the piece of data to set. + * @param value The new data value; this can be any Javascript type except `undefined`. + * @see \`{@link https://api.jquery.com/data/ }\` + * @since 1.2.3 + * @example ​ ````Store then retrieve a value from the div element. +```html + + + + + data demo + + + + +​ +
    + The values stored were + + and + +
    +​ + +​ + + +``` + */ + data(key: string, value: string | number | boolean | symbol | object | null): this; + /** + * Store arbitrary data associated with the matched elements. + * @param obj An object of key-value pairs of data to update. + * @see \`{@link https://api.jquery.com/data/ }\` + * @since 1.4.3 + */ + data(obj: JQuery.PlainObject): this; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + * @param key Name of the data stored. + * @param value `undefined` is not recognized as a data value. Calls such as `.data( "name", undefined )` + * will return the jQuery object that it was called on, allowing for chaining. + * @see \`{@link https://api.jquery.com/data/ }\` + * @since 1.2.3 + */ + // `unified-signatures` is disabled so that behavior when passing `undefined` to `value` can be documented. Unifying the signatures + // results in potential confusion for users from an unexpected parameter. + // tslint:disable-next-line:unified-signatures + data(key: string, value: undefined): any; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + * @param key Name of the data stored. + * @see \`{@link https://api.jquery.com/data/ }\` + * @since 1.2.3 + * @example ​ ````Get the data named "blah" stored at for an element. +```html + + + + + data demo + + + + +​ +
    A div
    + + + + +

    The "blah" value of this div is ?

    +​ + +​ + + +``` + */ + data(key: string): any; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + * @see \`{@link https://api.jquery.com/data/ }\` + * @since 1.4 + */ + data(): JQuery.PlainObject; + /** + * Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/dblclick/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + dblclick(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/dblclick/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````To bind a "Hello World!" alert box to the dblclick event on every paragraph on the page: +```javascript +$( "p" ).dblclick(function() { + alert( "Hello World!" ); +}); +``` + * @example ​ ````Double click to toggle background color. +```html + + + + + dblclick demo + + + + +​ +
    +Double click the block +​ + +​ + + +``` + */ + dblclick(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Set a timer to delay execution of subsequent items in the queue. + * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see \`{@link https://api.jquery.com/delay/ }\` + * @since 1.4 + * @example ​ ````Animate the hiding and showing of two divs, delaying the first before showing it. +```html + + + + + delay demo + + + + +​ +

    +
    +
    +​ + +​ + + +``` + */ + delay(duration: JQuery.Duration, queueName?: string): this; + /** + * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. + * @param selector A selector to filter the elements that trigger the event. + * @param eventType A string containing one or more space-separated JavaScript event types, such as "click" or + * "keydown," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/delegate/ }\` + * @since 1.4.2 + * @deprecated ​ Deprecated since 3.0. Use \`{@link on }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + */ + delegate(selector: JQuery.Selector, + eventType: string, + eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. + * @param selector A selector to filter the elements that trigger the event. + * @param eventType A string containing one or more space-separated JavaScript event types, such as "click" or + * "keydown," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/delegate/ }\` + * @since 1.4.2 + * @deprecated ​ Deprecated since 3.0. Use \`{@link on }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````Click a paragraph to add another. Note that .delegate() attaches a click event handler to all paragraphs - even new ones. +```html + + + + + delegate demo + + + + +​ +

    Click me!

    +​ + +​ + +​ + + +``` + * @example ​ ````To display each paragraph's text in an alert box whenever it is clicked: +```javascript +$( "body" ).delegate( "p", "click", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````To cancel a default action and prevent it from bubbling up, return false: +```javascript +$( "body" ).delegate( "a", "click", function() { + return false; +}); +``` + * @example ​ ````To cancel only the default action by using the preventDefault method. +```javascript +$( "body" ).delegate( "a", "click", function( event ) { + event.preventDefault(); +}); +``` + * @example ​ ````Can bind custom events too. +```html + + + + + delegate demo + + + + +​ +

    Has an attached custom event.

    + + +​ + +​ + + +``` + */ + delegate(selector: JQuery.Selector, + eventType: string, + handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. + * @param selector A selector to filter the elements that trigger the event. + * @param events A plain object of one or more event types and functions to execute for them. + * @see \`{@link https://api.jquery.com/delegate/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.0. Use \`{@link on }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + */ + delegate(selector: JQuery.Selector, + events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; + /** + * Execute the next function on the queue for the matched elements. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see \`{@link https://api.jquery.com/dequeue/ }\` + * @since 1.2 + * @example ​ ````Use dequeue to end a custom queue function which allows the queue to keep going. +```html + + + + + dequeue demo + + + + +​ + +
    +​ + +​ + + +``` + */ + dequeue(queueName?: string): this; + /** + * Remove the set of matched elements from the DOM. + * @param selector A selector expression that filters the set of matched elements to be removed. + * @see \`{@link https://api.jquery.com/detach/ }\` + * @since 1.4 + * @example ​ ````Detach all paragraphs from the DOM +```html + + + + + detach demo + + + + +​ +

    Hello

    +how are +

    you?

    + +​ + +​ + + +``` + */ + detach(selector?: JQuery.Selector): this; + /** + * Iterate over a jQuery object, executing a function for each matched element. + * @param funÑtion A function to execute for each matched element. + * @see \`{@link https://api.jquery.com/each/ }\` + * @since 1.0 + * @example ​ ````Iterate over three divs and sets their color property. +```html + + + + + each demo + + + + +​ +
    Click here
    +
    to iterate through
    +
    these divs.
    +​ + +​ + + +``` + * @example ​ ````To access a jQuery object instead of the regular DOM element, use $( this ). For example: +```html + + + + + each demo + + + + +​ +To do list: (click here to change) +
      +
    • Eat
    • +
    • Sleep
    • +
    • Be merry
    • +
    +​ + +​ + + +``` + * @example ​ ````Use return false to break out of each() loops early. +```html + + + + + each demo + + + + +​ + + +
    +
    +
    +
    +
    Stop here
    +
    +
    +
    +​ + +​ + + +``` + */ + each(funÑtion: (this: TElement, index: number, element: TElement) => void | false): this; + /** + * Remove all child nodes of the set of matched elements from the DOM. + * @see \`{@link https://api.jquery.com/empty/ }\` + * @since 1.0 + * @example ​ ````Removes all child nodes (including text nodes) from all paragraphs +```html + + + + + empty demo + + + + +​ +

    + Hello, Person and person. +

    +​ + +​ + +​ + + +``` + */ + empty(): this; + /** + * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. + * @see \`{@link https://api.jquery.com/end/ }\` + * @since 1.0 + * @example ​ ````Selects all paragraphs, finds span elements inside these, and reverts the selection back to the paragraphs. +```html + + + + + end demo + + + + +​ +

    + Hi there how are you doing? +

    +​ +

    + This span is one of + several spans in this + sentence. +

    +​ +
    + Tags in jQuery object initially: +
    +​ +
    + Tags in jQuery object after find: +
    +​ +
    + Tags in jQuery object after end: +
    +​ + +​ + + +``` + * @example ​ ````Selects all paragraphs, finds span elements inside these, and reverts the selection back to the paragraphs. +```html + + + + + end demo + + + + +​ +

    Hello, how are you?

    +​ + +​ + + +``` + */ + end(): this; + /** + * Reduce the set of matched elements to the one at the specified index. + * @param index An integer indicating the 0-based position of the element. + * An integer indicating the position of the element, counting backwards from the last element in the set. + * @see \`{@link https://api.jquery.com/eq/ }\` + * @since 1.1.2 + * @since 1.4 + * @example ​ ````Turn the div with index 2 blue by adding an appropriate class. +```html + + + + + eq demo + + + + +​ +
    +
    +
    +
    +
    +
    +​ + +​ + + +``` + */ + eq(index: number): this; + /** + * Merge the contents of an object onto the jQuery prototype to provide new jQuery instance methods. + * @param obj An object to merge onto the jQuery prototype. + * @see \`{@link https://api.jquery.com/jQuery.fn.extend/ }\` + * @since 1.0 + * @example ​ ````Add two methods to the jQuery prototype ($.fn) object and then use one of them. +```html + + + + + jQuery.fn.extend demo + + + + +​ + + +​ + +​ + + +``` + */ + extend(obj: object): this; + /** + * Display the matched elements by fading them to opaque. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeIn/ }\` + * @since 1.4.3 + */ + fadeIn(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display the matched elements by fading them to opaque. + * @param duration_easing _@param_ `duration_easing` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeIn/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Fades a red block in over the text. Once the animation is done, it quickly fades in more text on top. +```html + + + + + fadeIn demo + + + + +​ +

    + Let it be known that the party of the first part + and the party of the second part are henceforth + and hereto directed to assess the allegations + for factual correctness... (click!) +

    CENSORED!
    +

    +​ + +​ + + +``` + */ + fadeIn(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; + /** + * Display the matched elements by fading them to opaque. + * @param duration_easing_complete_options _@param_ `duration_easing_complete_options` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition.
    + * * `complete` — A function to call once the animation is complete, called once per matched element.
    + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/fadeIn/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates hidden divs to fade in one by one, completing each animation within 600 milliseconds. +```html + + + + + fadeIn demo + + + + +​ +Click here... +
    +
    +
    +​ + +​ + + +``` + */ + fadeIn(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Hide the matched elements by fading them to transparent. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeOut/ }\` + * @since 1.4.3 + * @example ​ ````Fades out two divs, one with a "linear" easing and one with the default, "swing," easing. +```html + + + + + fadeOut demo + + + + +​ + + +​ +
    +​ +
    linear
    +
    swing
    +​ + +​ + + +``` + */ + fadeOut(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Hide the matched elements by fading them to transparent. + * @param duration_easing _@param_ `duration_easing` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeOut/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Fades out spans in one section that you click on. +```html + + + + + fadeOut demo + + + + +​ +

    Find the modifiers -

    +

    + If you really want to go outside + in the cold then make sure to wear + your warm jacket given to you by + your favorite teacher. +

    +​ + +​ + + +``` + */ + fadeOut(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; + /** + * Hide the matched elements by fading them to transparent. + * @param duration_easing_complete_options _@param_ `duration_easing_complete_options` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition.
    + * * `complete` — A function to call once the animation is complete, called once per matched element.
    + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/fadeOut/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates all paragraphs to fade out, completing the animation within 600 milliseconds. +```html + + + + + fadeOut demo + + + + +​ +

    + If you click on this paragraph + you'll see it just fade away. +

    +​ + +​ + + +``` + */ + fadeOut(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Adjust the opacity of the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeTo/ }\` + * @since 1.4.3 + */ + fadeTo(duration: JQuery.Duration, opacity: number, easing: string, complete?: (this: TElement) => void): this; + /** + * Adjust the opacity of the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeTo/ }\` + * @since 1.0 + * @example ​ ````Animates first paragraph to fade to an opacity of 0.33 (33%, about one third visible), completing the animation within 600 milliseconds. +```html + + + + + fadeTo demo + + + +​ +

    +Click this paragraph to see it fade. +

    +​ +

    +Compare to this one that won't fade. +

    +​ + +​ + + +``` + * @example ​ ````Fade div to a random opacity on each click, completing the animation within 200 milliseconds. +```html + + + + + fadeTo demo + + + + +​ +

    And this is the library that John built...

    +​ +
    +
    +
    +​ + +​ + + +``` + * @example ​ ````Find the right answer! The fade will take 250 milliseconds and change various styles when it completes. +```html + + + + + fadeTo demo + + + + +​ +

    Wrong

    +
    +

    Wrong

    +
    +

    Right!

    +
    +​ + +​ + + +``` + */ + fadeTo(duration: JQuery.Duration, opacity: number, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements by animating their opacity. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeToggle/ }\` + * @since 1.4.4 + * @example ​ ````Fades first paragraph in or out, completing the animation within 600 milliseconds and using a linear easing. Fades last paragraph in or out for 200 milliseconds, inserting a "finished" message upon completion. +```html + + + + + fadeToggle demo + + + +​ + + +

    This paragraph has a slow, linear fade.

    +

    This paragraph has a fast animation.

    +
    +​ + +​ + + +``` + */ + fadeToggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements by animating their opacity. + * @param duration_easing _@param_ `duration_easing` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/fadeToggle/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Fades first paragraph in or out, completing the animation within 600 milliseconds and using a linear easing. Fades last paragraph in or out for 200 milliseconds, inserting a "finished" message upon completion. +```html + + + + + fadeToggle demo + + + +​ + + +

    This paragraph has a slow, linear fade.

    +

    This paragraph has a fast animation.

    +
    +​ + +​ + + +``` + */ + fadeToggle(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; + /** + * Display or hide the matched elements by animating their opacity. + * @param duration_easing_complete_options _@param_ `duration_easing_complete_options` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `easing` — A string indicating which easing function to use for the transition.
    + * * `complete` — A function to call once the animation is complete, called once per matched element.
    + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/fadeToggle/ }\` + * @since 1.0 + * @since 1.4.3 + */ + fadeToggle(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * @param selector_elements_selection_function _@param_ `selector_elements_selection_function` + *
    + * * `selector` — A string containing a selector expression to match the current set of elements against.
    + * * `elements` — One or more DOM elements to match the current set of elements against.
    + * * `selection` — An existing jQuery object to match the current set of elements against.
    + * * `function` — A function used as a test for each element in the set. this is the current DOM element. + * @see \`{@link https://api.jquery.com/filter/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Change the color of all divs; then add a border to those with a "middle" class. +```html + + + + + filter demo + + + + +​ +
    +
    +
    +
    +
    +
    +​ + +​ + + +``` + * @example ​ ````Change the color of all divs; then add a border to the second one (index == 1) and the div with an id of "fourth." +```html + + + + + filter demo + + + + +​ +
    +
    +
    +
    +
    +
    +​ + +​ + + +``` + * @example ​ ````Select all divs and filter the selection with a DOM element, keeping only the one with an id of "unique". +```javascript +$( "div" ).filter( document.getElementById( "unique" ) ); +``` + * @example ​ ````Select all divs and filter the selection with a jQuery object, keeping only the one with an id of "unique". +```javascript +$( "div" ).filter( $( "#unique" ) ); +``` + */ + filter(selector_elements_selection_function: + JQuery.Selector | + JQuery.TypeOrArray | + JQuery | + ((this: TElement, index: number, element: TElement) => boolean) + ): this; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * @param selector_element _@param_ `selector_element` + *
    + * * `selector` — A string containing a selector expression to match elements against.
    + * * `element` — An element or a jQuery object to match elements against. + * @see \`{@link https://api.jquery.com/find/ }\` + * @since 1.0 + * @since 1.6 + * @example ​ ````Starts with all paragraphs and searches for descendant span elements, same as $( "p span" ) +```html + + + + + find demo + + + +​ +

    Hello, how are you?

    +

    Me? I'm good.

    +​ + +​ + + +``` + * @example ​ ````A selection using a jQuery collection of all span tags. Only spans within p tags are changed to red while others are left blue. +```html + + + + + find demo + + + + +​ +

    Hello, how are you?

    +

    Me? I'm good.

    +
    Did you eat yet?
    +​ + +​ + + +``` + * @example ​ ````Add spans around each word then add a hover and italicize words with the letter t. +```html + + + + + find demo + + + + +​ +

    + When the day is short + find that which matters to you + or stop believing +

    +​ + +​ + + +``` + */ + find(selector_element: JQuery.Selector | Element | JQuery): this; + /** + * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. + * @param queue The name of the queue in which to stop animations. + * @see \`{@link https://api.jquery.com/finish/ }\` + * @since 1.9 + * @example ​ ````Click the Go button once to start the animation, and then click the other buttons to see how they affect the current and queued animations. +```html + + + + + finish demo + + + + +​ +
    +
    + +
    + + +
    + + +
    + + +
    + +
    + +
    +​ + +​ + + +``` + */ + finish(queue?: string): this; + /** + * Reduce the set of matched elements to the first in the set. + * @see \`{@link https://api.jquery.com/first/ }\` + * @since 1.4 + * @example ​ ````Highlight the first span in a paragraph. +```html + + + + + first demo + + + + +​ +

    + Look: + This is some text in a paragraph. + This is a note about it. +

    +​ + +​ + + +``` + */ + first(): this; + /** + * Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/focus/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + focus(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/focus/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Fire focus. +```html + + + + + focus demo + + + + +​ +

    focus fire

    +

    focus fire

    +​ + +​ + + +``` + * @example ​ ````To stop people from writing in text input boxes, try: +```javascript +$( "input[type=text]" ).focus(function() { + $( this ).blur(); +}); +``` + * @example ​ ````To focus on a login input box with id 'login' on page startup, try: +```javascript +$( document ).ready(function() { + $( "#login" ).focus(); +}); +``` + */ + focus(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "focusin" event. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/focusin/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + focusin(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "focusin" event. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/focusin/ }\` + * @since 1.4 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Watch for a focus to occur within the paragraphs on the page. +```html + + + + + focusin demo + + + + +​ +

    focusin fire

    +

    focusin fire

    +​ + +​ + + +``` + */ + focusin(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "focusout" JavaScript event. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/focusout/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + focusout(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "focusout" JavaScript event. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/focusout/ }\` + * @since 1.4 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Watch for a loss of focus to occur inside paragraphs and note the difference between the focusout count and the blur count. (The blur count does not change because those events do not bubble.) +```html + + + + + focusout demo + + + + +​ +
    +

    +
    + +

    +

    + +

    +
    +
    focusout fire
    +
    blur fire
    +​ + +​ + + +``` + */ + focusout(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Retrieve one of the elements matched by the jQuery object. + * @param index A zero-based integer indicating which element to retrieve. + * @see \`{@link https://api.jquery.com/get/ }\` + * @since 1.0 + * @example ​ ````Display the tag name of the click element. +```html + + + + + get demo + + + + +​ +  +

    In this paragraph is an important section

    +
    +​ + +​ + + +``` + */ + get(index: number): TElement; + /** + * Retrieve the elements matched by the jQuery object. + * @see \`{@link https://api.jquery.com/get/ }\` + * @since 1.0 + * @example ​ ````Select all divs in the document and return the DOM Elements as an Array; then use the built-in reverse() method to reverse that array. +```html + + + + + get demo + + + + +​ +Reversed - +​ +
    One
    +
    Two
    +
    Three
    +​ + +​ + + +``` + */ + get(): TElement[]; + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * @param selector_contained _@param_ `selector_contained` + *
    + * * `selector` — A string containing a selector expression to match elements against.
    + * * `contained` — A DOM element to match elements against. + * @see \`{@link https://api.jquery.com/has/ }\` + * @since 1.4 + * @example ​ ````Check if an element is inside another. +```html + + + + + has demo + + + + +​ +
    • Does the UL contain an LI?
    +​ + +​ + + +``` + */ + has(selector_contained: string | Element): this; + /** + * Determine whether any of the matched elements are assigned the given class. + * @param className The class name to search for. + * @see \`{@link https://api.jquery.com/hasClass/ }\` + * @since 1.2 + * @example ​ ````Looks for the paragraph that contains 'selected' as a class. +```html + + + + + hasClass demo + + + + +​ +

    This paragraph is black and is the first paragraph.

    +

    This paragraph is red and is the second paragraph.

    +
    First paragraph has selected class:
    +
    Second paragraph has selected class:
    +
    At least one paragraph has selected class:
    +​ + +​ + + +``` + */ + hasClass(className: string): boolean; + /** + * Set the CSS height of every matched element. + * @param value_function _@param_ `value_function` + *
    + * * `value` — An integer representing the number of pixels, or an integer with an optional unit of measure + * appended (as a string).
    + * * `function` — A function returning the height to set. Receives the index position of the element in the set and + * the old height as arguments. Within the function, `this` refers to the current element in the set. + * @see \`{@link https://api.jquery.com/height/ }\` + * @since 1.0 + * @since 1.4.1 + * @example ​ ````To set the height of each div on click to 30px plus a color change. +```html + + + + + height demo + + + + +​ +
    +
    +
    +
    +
    +​ + +​ + + +``` + */ + height(value_function: string | number | ((this: TElement, index: number, height: number) => string | number)): this; + /** + * Get the current computed height for the first element in the set of matched elements. + * @see \`{@link https://api.jquery.com/height/ }\` + * @since 1.0 + * @example ​ ````Show various heights. Note the values are from the iframe so might be smaller than you expected. The yellow highlight shows the iframe body. +```html + + + + + height demo + + + + +​ + + + +​ +
     
    +

    + Sample paragraph to test height +

    +​ + +​ + + +``` + */ + height(): number | undefined; + /** + * Hide the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/hide/ }\` + * @since 1.4.3 + */ + hide(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): this; + /** + * Hide the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param easing_complete _@param_ `easing_complete` + *
    + * * `easing` — A string indicating which easing function to use for the transition.
    + * * `complete` — A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/hide/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates all spans (words in this case) to hide fastly, completing each animation within 200 milliseconds. Once each animation is done, it starts the next one. +```html + + + + + hide demo + + + + +​ + + +
    + Once upon a + time there were + three programmers... +
    +​ + +​ + + +``` + * @example ​ ````Hides the divs when clicked over 2 seconds, then removes the div element when its hidden. Try clicking on more than one box at a time. +```html + + + + + hide demo + + + + +​ +
    +​ + +​ + + +``` + */ + hide(duration: JQuery.Duration, easing_complete: string | ((this: TElement) => void)): this; + /** + * Hide the matched elements. + * @param duration_complete_options _@param_ `duration_complete_options` + *
    + * * `duration` — A string or number determining how long the animation will run.
    + * * `complete` — A function to call once the animation is complete, called once per matched element.
    + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/hide/ }\` + * @since 1.0 + * @example ​ ````Hides all paragraphs then the link on click. +```html + + + + + hide demo + + + +​ +

    Hello

    +Click to hide me too +

    Here is another paragraph

    +​ + +​ + + +``` + * @example ​ ````Animates all shown paragraphs to hide slowly, completing the animation within 600 milliseconds. +```html + + + + + hide demo + + + + +​ + +

    Hiya

    +

    Such interesting text, eh?

    +​ + +​ + + +``` + */ + hide(duration_complete_options?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Bind one or two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. + * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. + * @param handlerOut A function to execute when the mouse pointer leaves the element. + * @see \`{@link https://api.jquery.com/hover/ }\` + * @since 1.0 + * @since 1.4 + * @deprecated ​ Deprecated. + * + * **Cause**: The `.hover()` method is a shorthand for the use of the `mouseover`/`mouseout` events. It is often a poor user interface choice because it does not allow for any small amounts of delay between when the mouse enters or exits an area and when the event fires. This can make it quite difficult to use with UI widgets such as drop-down menus. For more information on the problems of hovering, see the \`{@link http://cherne.net/brian/resources/jquery.hoverIntent.html hoverIntent plugin}\`. + * + * **Solution**: Review uses of `.hover()` to determine if they are appropriate, and consider use of plugins such as `hoverIntent` as an alternative. The direct replacement for `.hover(fn1, fn2)`, is `.on("mouseenter", fn1).on("mouseleave", fn2)`. + * @example ​ ````To add a special style to list items that are being hovered over, try: +```html + + + + + hover demo + + + + +​ +
      +
    • Milk
    • +
    • Bread
    • +
    • Chips
    • +
    • Socks
    • +
    +​ + +​ + + +``` + * @example ​ ````To add a special style to table cells that are being hovered over, try: +```javascript +$( "td" ).hover( + function() { + $( this ).addClass( "hover" ); + }, function() { + $( this ).removeClass( "hover" ); + } +); +``` + * @example ​ ````To unbind the above example use: +```javascript +$( "td" ).off( "mouseenter mouseleave" ); +``` + * @example ​ ````Slide the next sibling LI up or down on hover, and toggle a class. +```html + + + + + hover demo + + + + +​ +
      +
    • Milk
    • +
    • White
    • +
    • Carrots
    • +
    • Orange
    • +
    • Broccoli
    • +
    • Green
    • +
    +​ + +​ + + +``` + */ + // HACK: The type parameter T is not used but ensures the 'event' callback parameter is typed correctly. + // tslint:disable-next-line:no-unnecessary-generics + hover(handlerInOut: JQuery.EventHandler | JQuery.EventHandlerBase> | false, + handlerOut?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Set the HTML contents of each element in the set of matched elements. + * @param htmlString_function _@param_ `htmlString_function` + *
    + * * `htmlString` — A string of HTML to set as the content of each matched element.
    + * * `function` — A function returning the HTML content to set. Receives the index position of the element in the set + * and the old HTML value as arguments. jQuery empties the element before calling the function; use the + * oldhtml argument to reference the previous content. Within the function, `this` refers to the current + * element in the set. + * @see \`{@link https://api.jquery.com/html/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Add some html to each div. +```html + + + + + html demo + + + + +​ +Hello +
    +
    +
    +​ + +​ + + +``` + * @example ​ ````Add some html to each div then immediately do further manipulations to the inserted html. +```html + + + + + html demo + + + + +​ +
    +
    +
    +​ + +​ + + +``` + */ + html(htmlString_function: JQuery.htmlString | ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString)): this; + /** + * Get the HTML contents of the first element in the set of matched elements. + * @see \`{@link https://api.jquery.com/html/ }\` + * @since 1.0 + * @example ​ ````Click a paragraph to convert it from html to text. +```html + + + + + html demo + + + + +​ +

    + Click to change the html +

    +

    + to a text node. +

    +

    + This does nothing. +

    +​ + +​ + + +``` + */ + html(): string; + /** + * Search for a given element from among the matched elements. + * @param selector_element _@param_ `selector_element` + *
    + * * `selector` — A selector representing a jQuery collection in which to look for an element.
    + * * `element` — The DOM element or first element within the jQuery object to look for. + * @see \`{@link https://api.jquery.com/index/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````On click, returns the index (zero-based) of that div in the page. +```html + + + + + index demo + + + + +​ +Click a div! +
    First div
    +
    Second div
    +
    Third div
    +​ + +​ + + +``` + * @example ​ ````Returns the index for the element with ID bar. +```html + + + + + index demo + + + + +​ +
      +
    • foo
    • +
    • bar
    • +
    • baz
    • +
    +
    +​ + +​ + + +``` + * @example ​ ````Returns the index for the first item in the jQuery collection. +```html + + + + + index demo + + + + +​ +
      +
    • foo
    • +
    • bar
    • +
    • baz
    • +
    +
    +​ + +​ + + +``` + * @example ​ ````Returns the index for the element with ID bar in relation to all <li> elements. +```html + + + + + index demo + + + + +​ +
      +
    • foo
    • +
    • bar
    • +
    • baz
    • +
    +
    +​ + +​ + + +``` + * @example ​ ````Returns the index for the element with ID bar in relation to its siblings. +```html + + + + + index demo + + + + +​ +
      +
    • foo
    • +
    • bar
    • +
    • baz
    • +
    +
    +​ + +​ + + +``` + * @example ​ ````Returns -1, as there is no element with ID foobar. +```html + + + + + index demo + + + + +​ +
      +
    • foo
    • +
    • bar
    • +
    • baz
    • +
    +
    +​ + +​ + + +``` + */ + index(selector_element?: JQuery.Selector | Element | JQuery): number; + /** + * Set the CSS inner height of each element in the set of matched elements. + * @param value_function _@param_ `value_function` + *
    + * * `value` — A number representing the number of pixels, or a number along with an optional unit of measure + * appended (as a string).
    + * * `function` — A function returning the inner height (including padding but not border) to set. Receives the index + * position of the element in the set and the old inner height as arguments. Within the function, `this` + * refers to the current element in the set. + * @see \`{@link https://api.jquery.com/innerHeight/ }\` + * @since 1.8.0 + * @example ​ ````Change the inner height of each div the first time it is clicked (and change its color). +```html + + + + + innerHeight demo + + + + +​ +
    d
    +
    d
    +
    d
    +
    d
    +
    d
    +​ + +​ + + +``` + */ + innerHeight(value_function: string | number | ((this: TElement, index: number, height: number) => string | number)): this; + /** + * Get the current computed height for the first element in the set of matched elements, including padding but not border. + * @see \`{@link https://api.jquery.com/innerHeight/ }\` + * @since 1.2.6 + * @example ​ ````Get the innerHeight of a paragraph. +```html + + + + + innerHeight demo + + + + +​ +

    Hello

    +

    +​ + +​ + + +``` + */ + innerHeight(): number | undefined; + /** + * Set the CSS inner width of each element in the set of matched elements. + * @param value_function _@param_ `value_function` + *
    + * * `value` — A number representing the number of pixels, or a number along with an optional unit of measure + * appended (as a string).
    + * * `function` — A function returning the inner width (including padding but not border) to set. Receives the index + * position of the element in the set and the old inner width as arguments. Within the function, `this` + * refers to the current element in the set. + * @see \`{@link https://api.jquery.com/innerWidth/ }\` + * @since 1.8.0 + * @example ​ ````Change the inner width of each div the first time it is clicked (and change its color). +```html + + + + + innerWidth demo + + + + +​ +
    d
    +
    d
    +
    d
    +
    d
    +
    d
    +​ + +​ + + +``` + */ + innerWidth(value_function: string | number | ((this: TElement, index: number, width: number) => string | number)): this; + /** + * Get the current computed inner width for the first element in the set of matched elements, including padding but not border. + * @see \`{@link https://api.jquery.com/innerWidth/ }\` + * @since 1.2.6 + * @example ​ ````Get the innerWidth of a paragraph. +```html + + + + + innerWidth demo + + + + +​ +

    Hello

    +

    +​ + +​ + + +``` + */ + innerWidth(): number | undefined; + /** + * Insert every element in the set of matched elements after the target. + * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements + * will be inserted after the element(s) specified by this parameter. + * @see \`{@link https://api.jquery.com/insertAfter/ }\` + * @since 1.0 + * @example ​ ````Insert all paragraphs after an element with id of "foo". Same as $( "#foo" ).after( "p" ) +```html + + + + + insertAfter demo + + + + +​ +

    is what I said...

    +
    FOO!
    +​ + +​ + + +``` + */ + insertAfter(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Insert every element in the set of matched elements before the target. + * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements + * will be inserted before the element(s) specified by this parameter. + * @see \`{@link https://api.jquery.com/insertBefore/ }\` + * @since 1.0 + * @example ​ ````Insert all paragraphs before an element with id of "foo". Same as $( "#foo" ).before( "p" ) +```html + + + + + insertBefore demo + + + + +​ +
    FOO!
    +

    I would like to say:

    +​ + +​ + + +``` + */ + insertBefore(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * @param selector_function_selection_elements _@param_ `selector_function_selection_elements` + *
    + * * `selector` — A string containing a selector expression to match elements against.
    + * * `function` — A function used as a test for every element in the set. It accepts two arguments, `index`, which is + * the element's index in the jQuery collection, and `element`, which is the DOM element. Within the + * function, `this` refers to the current DOM element.
    + * * `selection` — An existing jQuery object to match the current set of elements against.
    + * * `elements` — One or more elements to match the current set of elements against. + * @see \`{@link https://api.jquery.com/is/ }\` + * @since 1.0 + * @since 1.6 + * @example ​ ````Shows a few ways is() can be used inside an event handler. +```html + + + + + is demo + + + + +​ +
    +
    +
    +
    +

    Peter
    +
    +

     

    +​ + +​ + + +``` + * @example ​ ````Returns true, because the parent of the input is a form element. +```html + + + + + is demo + + + + +​ +
    + +
    +
    +​ + +​ + + +``` + * @example ​ ````Returns false, because the parent of the input is a p element. +```html + + + + + is demo + + + + +​ +
    +

    +
    +
    +​ + +​ + + +``` + * @example ​ ````Checks against an existing collection of alternating list elements. Blue, alternating list elements slide up while others turn red. +```html + + + + + is demo + + + + +​ +
      +
    • Chrome
    • +
    • Safari
    • +
    • Firefox
    • +
    • Opera
    • +
    +​ + +​ + + +``` + * @example ​ ````An alternate way to achieve the above example using an element rather than a jQuery object. Checks against an existing collection of alternating list elements. Blue, alternating list elements slide up while others turn red. +```html + + + + + is demo + + + + +​ +
      +
    • Chrome
    • +
    • Safari
    • +
    • Firefox
    • +
    • Opera
    • +
    +​ + +​ + + +``` + */ + is(selector_function_selection_elements: JQuery.Selector | JQuery.TypeOrArray | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): boolean; + /** + * Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/keydown/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + keydown(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/keydown/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show the event object for the keydown handler when a key is pressed in the input. +```html + + + + + keydown demo + + + + +​ +
    +
    + + +
    +
    + + +​ + +​ + + +``` + */ + keydown(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/keypress/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + keypress(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/keypress/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show the event object when a key is pressed in the input. Note: This demo relies on a simple $.print() plugin (https://api.jquery.com/resources/events.js) for the event object's output. +```html + + + + + keypress demo + + + + +​ +
    +
    + + +
    +
    + + +​ + +​ + + +``` + */ + keypress(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/keyup/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + keyup(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/keyup/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show the event object for the keyup handler (using a simple $.print plugin) when a key is released in the input. +```html + + + + + keyup demo + + + + +​ +
    +
    + + +
    +
    + + +​ + +​ + + +``` + */ + keyup(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Reduce the set of matched elements to the final one in the set. + * @see \`{@link https://api.jquery.com/last/ }\` + * @since 1.4 + * @example ​ ````Highlight the last span in a paragraph. +```html + + + + + last demo + + + + +​ +

    Look: This is some text in a paragraph. This is a note about it.

    +​ + +​ + + +``` + */ + last(): this; + /** + * Load data from the server and place the returned HTML into the matched element. + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param complete A callback function that is executed when the request completes. + * @see \`{@link https://api.jquery.com/load/ }\` + * @since 1.0 + * @example ​ ````Same as above, but will POST the additional parameters to the server and a callback that is executed when the server is finished responding. +```javascript +$( "#feeds" ).load( "feeds.php", { limit: 25 }, function() { + alert( "The last 25 entries in the feed have been loaded" ); +}); +``` + */ + load(url: string, + data: string | JQuery.PlainObject, + complete: (this: TElement, responseText: string, textStatus: JQuery.Ajax.TextStatus, jqXHR: JQuery.jqXHR) => void): this; + /** + * Load data from the server and place the returned HTML into the matched element. + * @param url A string containing the URL to which the request is sent. + * @param complete_data _@param_ `complete_data` + *
    + * * `complete` — A callback function that is executed when the request completes.
    + * * `data` — A plain object or string that is sent to the server with the request. + * @see \`{@link https://api.jquery.com/load/ }\` + * @since 1.0 + * @example ​ ````Load another page's list items into an ordered list. +```html + + + + + load demo + + + + +​ +Projects: +
      +​ + +​ + + +``` + * @example ​ ````Display a notice if the Ajax request encounters an error. +```html + + + + + load demo + + + + +​ +Successful Response (should be blank): +
      +Error Response: +
      +​ + +​ + + +``` + * @example ​ ````Load the feeds.html file into the div with the ID of feeds. +```javascript +$( "#feeds" ).load( "feeds.html" ); +``` + * @example ​ ````pass arrays of data to the server. +```javascript +$( "#objectID" ).load( "test.php", { "choices[]": [ "Jon", "Susan" ] } ); +``` + */ + load(url: string, + complete_data?: ((this: TElement, responseText: string, textStatus: JQuery.Ajax.TextStatus, jqXHR: JQuery.jqXHR) => void) | string | JQuery.PlainObject): this; + /** + * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. + * @param callback A function object that will be invoked for each element in the current set. + * @see \`{@link https://api.jquery.com/map/ }\` + * @since 1.2 + * @example ​ ````Build a list of all the values within a form. +```html + + + + + map demo + + + + +​ +

      Values:

      +
      + + + +
      +​ + +​ + + +``` + * @example ​ ````A contrived example to show some functionality. +```html + + + + + map demo + + + + +​ +
        +
      • First
      • +
      • Second
      • +
      • Third
      • +
      • Fourth
      • +
      • Fifth
      • +
      +
        +
      +​ + +​ + + +``` + * @example ​ ````Equalize the heights of the divs. +```html + + + + + map demo + + + + +​ + +
      +
      +
      +​ + +​ + + +``` + */ + map(callback: (this: TElement, index: number, domElement: TElement) => JQuery.TypeOrArray | null | undefined): JQuery; + /** + * Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mousedown/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mousedown(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mousedown/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show texts when mouseup and mousedown event triggering. +```html + + + + + mousedown demo + + + +​ +

      Press mouse and release here.

      +​ + +​ + + +``` + */ + mousedown(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseenter/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mouseenter(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseenter/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show texts when mouseenter and mouseout event triggering. + mouseover fires when the pointer moves into the child element as well, while mouseenter fires only when the pointer moves into the bound element. +```html + + + + + mouseenter demo + + + + +​ +
      +

      move your mouse

      +

      move your mouse

      0

      +

      0

      +
      +​ +
      +

      move your mouse

      +

      move your mouse

      0

      +

      0

      +
      +​ + +​ + + +``` + */ + mouseenter(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseleave/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mouseleave(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseleave/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show number of times mouseout and mouseleave events are triggered. mouseout fires when the pointer moves out of child element as well, while mouseleave fires only when the pointer moves out of the bound element. +```html + + + + + mouseleave demo + + + + +​ +
      +

      move your mouse

      +

      move your mouse

      0

      +

      0

      +
      +
      +

      move your mouse

      +

      move your mouse

      0

      +

      0

      +
      +​ + +​ + + +``` + */ + mouseleave(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mousemove/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mousemove(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mousemove/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show the mouse coordinates when the mouse is moved over the yellow div. Coordinates are relative to the window, which in this case is the iframe. +```html + + + + + mousemove demo + + + + +​ +

      + Move the mouse over the div. +   +

      +
      +​ + +​ + + +``` + */ + mousemove(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseout/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mouseout(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseout/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show the number of times mouseout and mouseleave events are triggered. + mouseout fires when the pointer moves out of the child element as well, while mouseleave fires only when the pointer moves out of the bound element. +```html + + + + + mouseout demo + + + + +​ +
      +

      move your mouse

      +

      move your mouse

      0

      +

      0

      +
      +​ +
      +

      move your mouse

      +

      move your mouse

      0

      +

      0

      +
      +​ + +​ + + +``` + */ + mouseout(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseover/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mouseover(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseover/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show the number of times mouseover and mouseenter events are triggered. +mouseover fires when the pointer moves into the child element as well, while mouseenter fires only when the pointer moves into the bound element. +```html + + + + + mouseover demo + + + + +​ +
      + move your mouse +
      +
      +
      +​ +
      + move your mouse +
      +
      +
      +​ + +​ + + +``` + */ + mouseover(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseup/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + mouseup(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/mouseup/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````Show texts when mouseup and mousedown event triggering. +```html + + + + + mouseup demo + + + +​ +

      Press mouse and release here.

      +​ + +​ + + +``` + */ + mouseup(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/next/ }\` + * @since 1.0 + * @example ​ ````Find the very next sibling of each disabled button and change its text "this button is disabled". +```html + + + + + next demo + + + + +​ +
      -
      +
      -
      +
      -
      +​ + +​ + + +``` + * @example ​ ````Find the very next sibling of each paragraph. Keep only the ones with a class "selected". +```html + + + + + next demo + + + +​ +

      Hello

      +

      Hello Again

      +
      And Again
      +​ + +​ + + +``` + */ + next(selector?: JQuery.Selector): this; + /** + * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/nextAll/ }\` + * @since 1.2 + * @example ​ ````Locate all the divs after the first and give them a class. +```html + + + + + nextAll demo + + + + +​ +
      first
      +
      sibling
      child
      +
      sibling
      +
      sibling
      ​ + +​ + + +``` + * @example ​ ````Locate all the paragraphs after the second child in the body and give them a class. +```html + + + + + nextAll demo + + + + +​ +

      p

      +
      div
      +

      p

      +

      p

      +
      div
      +

      p

      +
      div
      +​ + +​ + + +``` + */ + nextAll(selector?: string): this; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * @param selector_element _@param_ `selector_element` + *
      + * * `selector` — A string containing a selector expression to indicate where to stop matching following sibling elements.
      + * * `element` — A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/nextUntil/ }\` + * @since 1.4 + * @since 1.6 + * @example ​ ````Find the siblings that follow <dt id="term-2"> up to the next <dt> and give them a red background color. Also, find <dd> siblings that follow <dt id="term-1"> up to <dt id="term-3"> and give them a green text color. +```html + + + + + nextUntil demo + + + +​ +
      +
      term 1
      +
      definition 1-a
      +
      definition 1-b
      +
      definition 1-c
      +
      definition 1-d
      +
      term 2
      +
      definition 2-a
      +
      definition 2-b
      +
      definition 2-c
      +
      term 3
      +
      definition 3-a
      +
      definition 3-b
      +
      +​ + +​ + + +``` + */ + nextUntil(selector_element?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; + /** + * Remove elements from the set of matched elements. + * @param selector_function_selection _@param_ `selector_function_selection` + *
      + * * `selector` — A string containing a selector expression, a DOM element, or an array of elements to match against the set.
      + * * `function` — A function used as a test for each element in the set. It accepts two arguments, `index`, which is + * the element's index in the jQuery collection, and `element`, which is the DOM element. Within the + * function, `this` refers to the current DOM element.
      + * * `selection` — An existing jQuery object to match the current set of elements against. + * @see \`{@link https://api.jquery.com/not/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Adds a border to divs that are not green or blue. +```html + + + + + not demo + + + + +​ +
      +
      +
      +
      +
      +
      +
      +​ + +​ + + +``` + * @example ​ ````Removes the element with the ID "selected" from the set of all paragraphs. +```javascript +$( "p" ).not( $( "#selected" )[ 0 ] ); +``` + * @example ​ ````Removes the element with the ID "selected" from the set of all paragraphs. +```javascript +$( "p" ).not( "#selected" ); +``` + * @example ​ ````Removes all elements that match "div p.selected" from the total set of all paragraphs. +```javascript +$( "p" ).not( $( "div p.selected" ) ); +``` + */ + not(selector_function_selection: JQuery.Selector | JQuery.TypeOrArray | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): this; + /** + * Remove an event handler. + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as + * "click", "keydown.myPlugin", or ".myPlugin". + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/off/ }\` + * @since 1.7 + * @example ​ ````Add and remove event handlers on the colored button. +```html + + + + + off demo + + + + +​ + + + +
      Click!
      +​ + +​ + + +``` + * @example ​ ````Remove just one previously bound handler by passing it as the third argument: +```javascript +var foo = function() { + // Code to handle some kind of event +}; +​ +// ... Now foo will be called when paragraphs are clicked ... +$( "body" ).on( "click", "p", foo ); +​ +// ... Foo will no longer be called. +$( "body" ).off( "click", "p", foo ); +``` + */ + off(events: string, selector: JQuery.Selector, handler: JQuery.EventHandlerBase> | false): this; + /** + * Remove an event handler. + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as + * "click", "keydown.myPlugin", or ".myPlugin". + * @param selector_handler _@param_ `selector_handler` + *
      + * * `selector` — A selector which should match the one originally passed to `.on()` when attaching event handlers.
      + * * `handler` — A handler function previously attached for the event(s), or the special value `false`. + * @see \`{@link https://api.jquery.com/off/ }\` + * @since 1.7 + * @example ​ ````Remove all delegated click handlers from all paragraphs: +```javascript +$( "p" ).off( "click", "**" ); +``` + * @example ​ ````Unbind all delegated event handlers by their namespace: +```javascript +var validate = function() { + // Code to validate form entries +}; +​ +// Delegate events under the ".validator" namespace +$( "form" ).on( "click.validator", "button", validate ); +​ +$( "form" ).on( "keypress.validator", "input[type='text']", validate ); +​ +// Remove event handlers in the ".validator" namespace +$( "form" ).off( ".validator" ); +``` + */ + off(events: string, selector_handler?: JQuery.Selector | JQuery.EventHandlerBase> | false): this; + /** + * Remove an event handler. + * @param events An object where the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent handler functions previously attached for the event(s). + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + * @see \`{@link https://api.jquery.com/off/ }\` + * @since 1.7 + */ + off(events: JQuery.PlainObject> | false>, selector?: JQuery.Selector): this; + /** + * Remove an event handler. + * @param event A jQuery.Event object. + * @see \`{@link https://api.jquery.com/off/ }\` + * @since 1.7 + * @example ​ ````Remove all event handlers from all paragraphs: +```javascript +$( "p" ).off(); +``` + */ + off(event?: JQuery.Event): this; + /** + * Set the current coordinates of every element in the set of matched elements, relative to the document. + * @param coordinates_function _@param_ `coordinates_function` + *
      + * * `coordinates` — An object containing the properties `top` and `left`, which are numbers indicating the new top and + * left coordinates for the elements.
      + * * `function` — A function to return the coordinates to set. Receives the index of the element in the collection as + * the first argument and the current coordinates as the second argument. The function should return an + * object with the new `top` and `left` properties. + * @see \`{@link https://api.jquery.com/offset/ }\` + * @since 1.4 + * @example ​ ````Set the offset of the second paragraph: +```html + + + + + offset demo + + + + +​ +

      Hello

      2nd Paragraph

      +​ + +​ + + +``` + */ + offset(coordinates_function: JQuery.CoordinatesPartial | ((this: TElement, index: number, coords: JQuery.Coordinates) => JQuery.CoordinatesPartial)): this; + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the document. + * @see \`{@link https://api.jquery.com/offset/ }\` + * @since 1.2 + * @example ​ ````Access the offset of the second paragraph: +```html + + + + + offset demo + + + + +​ +

      Hello

      2nd Paragraph

      +​ + +​ + + +``` + * @example ​ ````Click to see the offset. +```html + + + + + offset demo + + + + +​ +
      Click an element.
      +

      + This is the best way to find an offset. +

      +
      +
      +​ + +​ + + +``` + */ + offset(): JQuery.Coordinates | undefined; + /** + * Get the closest ancestor element that is positioned. + * @see \`{@link https://api.jquery.com/offsetParent/ }\` + * @since 1.2.6 + * @example ​ ````Find the offsetParent of item "A." +```html + + + + + offsetParent demo + + + +​ +
        +
      • I
      • +
      • II +
          +
        • A
        • +
        • B +
            +
          • 1
          • +
          • 2
          • +
          • 3
          • +
          +
        • +
        • C
        • +
        +
      • +
      • III
      • +
      +​ + +​ + + +``` + */ + offsetParent(): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + */ + on(events: string, + selector: JQuery.Selector | null, + data: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\` in place of \`{@link JQueryEventObject }\`. + */ + on(events: string, + selector: JQuery.Selector | null, + data: any, + handler: ((event: JQueryEventObject) => void)): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @example ​ ````Click any paragraph to add another after it. Note that .on() allows a click event on any paragraph--even new ones--since the event is handled by the ever-present body element after it bubbles to there. +```html + + + + + on demo + + + + +​ +

      Click me!

      + +​ + +​ + + +``` + * @example ​ ````Display each paragraph's text in an alert box whenever it is clicked: +```javascript +$( "body" ).on( "click", "p", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````Cancel a link's default action using the .preventDefault() method: +```javascript +$( "body" ).on( "click", "a", function( event ) { + event.preventDefault(); +}); +``` + */ + on(events: string, + selector: JQuery.Selector, + handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\` in place of \`{@link JQueryEventObject }\`. + * @example ​ ````Click any paragraph to add another after it. Note that .on() allows a click event on any paragraph--even new ones--since the event is handled by the ever-present body element after it bubbles to there. +```html + + + + + on demo + + + + +​ +

      Click me!

      + +​ + +​ + + +``` + * @example ​ ````Display each paragraph's text in an alert box whenever it is clicked: +```javascript +$( "body" ).on( "click", "p", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````Cancel a link's default action using the .preventDefault() method: +```javascript +$( "body" ).on( "click", "a", function( event ) { + event.preventDefault(); +}); +``` + */ + on(events: string, + selector: JQuery.Selector, + // tslint:disable-next-line:unified-signatures + handler: ((event: JQueryEventObject) => void)): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @example ​ ````Pass data to the event handler, which is specified here by name: +```javascript +function myHandler( event ) { + alert( event.data.foo ); +} +$( "p" ).on( "click", { foo: "bar" }, myHandler ); +``` + */ + on(events: string, + data: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\` in place of \`{@link JQueryEventObject }\`. + * @example ​ ````Pass data to the event handler, which is specified here by name: +```javascript +function myHandler( event ) { + alert( event.data.foo ); +} +$( "p" ).on( "click", { foo: "bar" }, myHandler ); +``` + */ + on(events: string, + // tslint:disable-next-line:unified-signatures + data: any, + handler: ((event: JQueryEventObject) => void)): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @example ​ ````Display a paragraph's text in an alert when it is clicked: +```javascript +$( "p" ).on( "click", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: +```javascript +$( "form" ).on( "submit", false ); +``` + * @example ​ ````Cancel only the default action by using .preventDefault(). +```javascript +$( "form" ).on( "submit", function( event ) { + event.preventDefault(); +}); +``` + * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). +```javascript +$( "form" ).on( "submit", function( event ) { + event.stopPropagation(); +}); +``` + * @example ​ ````Pass data to the event handler using the second argument to .trigger() +```javascript +$( "div" ).on( "click", function( event, person ) { + alert( "Hello, " + person.name ); +}); +$( "div" ).trigger( "click", { name: "Jim" } ); +``` + * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler +```javascript +$( "div" ).on( "click", function( event, salutation, name ) { + alert( salutation + ", " + name ); +}); +$( "div" ).trigger( "click", [ "Goodbye", "Jim" ] ); +``` + * @example ​ ````Attach and trigger custom (non-browser) events. +```html + + + + + on demo + + + + +​ +

      Has an attached custom event.

      + + +​ + +​ + + +``` + * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: +```javascript +$( "#cart" ).on( "mouseenter mouseleave", function( event ) { + $( this ).toggleClass( "active" ); +}); +``` + */ + on(events: string, + handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\` in place of \`{@link JQueryEventObject }\`. + * @example ​ ````Display a paragraph's text in an alert when it is clicked: +```javascript +$( "p" ).on( "click", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: +```javascript +$( "form" ).on( "submit", false ); +``` + * @example ​ ````Cancel only the default action by using .preventDefault(). +```javascript +$( "form" ).on( "submit", function( event ) { + event.preventDefault(); +}); +``` + * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). +```javascript +$( "form" ).on( "submit", function( event ) { + event.stopPropagation(); +}); +``` + * @example ​ ````Pass data to the event handler using the second argument to .trigger() +```javascript +$( "div" ).on( "click", function( event, person ) { + alert( "Hello, " + person.name ); +}); +$( "div" ).trigger( "click", { name: "Jim" } ); +``` + * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler +```javascript +$( "div" ).on( "click", function( event, salutation, name ) { + alert( salutation + ", " + name ); +}); +$( "div" ).trigger( "click", [ "Goodbye", "Jim" ] ); +``` + * @example ​ ````Attach and trigger custom (non-browser) events. +```html + + + + + on demo + + + + +​ +

      Has an attached custom event.

      + + +​ + +​ + + +``` + * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: +```javascript +$( "#cart" ).on( "mouseenter mouseleave", function( event ) { + $( this ).toggleClass( "active" ); +}); +``` + */ + on(events: string, + // tslint:disable-next-line:unified-signatures + handler: ((event: JQueryEventObject) => void)): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If + * the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + */ + on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, + selector: JQuery.Selector | null, + data: TData): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If + * the selector is null or omitted, the handler is always called when it reaches the selected element. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + */ + on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, + // tslint:disable-next-line:unified-signatures + selector: JQuery.Selector): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + */ + on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, + data: TData): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @see \`{@link https://api.jquery.com/on/ }\` + * @since 1.7 + * @example ​ ````Attach multiple event handlers simultaneously using a plain object. +```html + + + + + on demo + + + + +​ +
      test div
      +​ + +​ + + +``` + */ + on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: string, + selector: JQuery.Selector | null, + data: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: string, + selector: JQuery.Selector, + handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: string, + data: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand + * for a function that simply does return false. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + * @example ​ ````Tie a one-time click to each div. +```html + + + + + one demo + + + + +​ +
      +
      +
      +
      +
      +

      Click a green square...

      +​ + +​ + + +``` + * @example ​ ````To display the text of all paragraphs in an alert box the first time each of them is clicked: +```javascript +$( "p" ).one( "click", function() { + alert( $( this ).text() ); +}); +``` + * @example ​ ````Event handlers will trigger once per element per event type +```html + + + + + one demo + + + +​ +
      0
      +
      Hover/click me
      +​ + +​ + + +``` + */ + one(events: string, + handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If + * the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, + selector: JQuery.Selector | null, + data: TData): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If + * the selector is null or omitted, the handler is always called when it reaches the selected element. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, + // tslint:disable-next-line:unified-signatures + selector: JQuery.Selector): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, + data: TData): this; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * @param events An object in which the string keys represent one or more space-separated event types and optional + * namespaces, and the values represent a handler function to be called for the event(s). + * @see \`{@link https://api.jquery.com/one/ }\` + * @since 1.7 + */ + one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; + /** + * Set the CSS outer height of each element in the set of matched elements. + * @param value_function _@param_ `value_function` + *
      + * * `value` — A number representing the number of pixels, or a number along with an optional unit of measure + * appended (as a string).
      + * * `function` — A function returning the outer height to set. Receives the index position of the element in the set + * and the old outer height as arguments. Within the function, `this` refers to the current element in + * the set. + * @see \`{@link https://api.jquery.com/outerHeight/ }\` + * @since 1.8.0 + * @example ​ ````Change the outer height of each div the first time it is clicked (and change its color). +```html + + + + + outerHeight demo + + + + +​ +
      d
      +
      d
      +
      d
      +
      d
      +
      d
      +​ + +​ + + +``` + */ + outerHeight(value_function: string | number | ((this: TElement, index: number, height: number) => string | number), + includeMargin?: boolean): this; + /** + * Get the current computed outer height (including padding, border, and optionally margin) for the first element in the set of matched elements. + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + * @see \`{@link https://api.jquery.com/outerHeight/ }\` + * @since 1.2.6 + * @example ​ ````Get the outerHeight of a paragraph. +```html + + + + + outerHeight demo + + + + +​ +

      Hello

      +​ + +​ + + +``` + */ + outerHeight(includeMargin?: boolean): number | undefined; + /** + * Set the CSS outer width of each element in the set of matched elements. + * @param value_function _@param_ `value_function` + *
      + * * `value` — A number representing the number of pixels, or a number along with an optional unit of measure + * appended (as a string).
      + * * `function` — A function returning the outer width to set. Receives the index position of the element in the set + * and the old outer width as arguments. Within the function, `this` refers to the current element in + * the set. + * @see \`{@link https://api.jquery.com/outerWidth/ }\` + * @since 1.8.0 + * @example ​ ````Change the outer width of each div the first time it is clicked (and change its color). +```html + + + + + outerWidth demo + + + + +​ +
      d
      +
      d
      +
      d
      +
      d
      +
      d
      +​ + +​ + + +``` + */ + outerWidth(value_function: string | number | ((this: TElement, index: number, width: number) => string | number), + includeMargin?: boolean): this; + /** + * Get the current computed outer width (including padding, border, and optionally margin) for the first element in the set of matched elements. + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + * @see \`{@link https://api.jquery.com/outerWidth/ }\` + * @since 1.2.6 + * @example ​ ````Get the outerWidth of a paragraph. +```html + + + + + outerWidth demo + + + + +​ +

      Hello

      +​ + +​ + + +``` + */ + outerWidth(includeMargin?: boolean): number | undefined; + /** + * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/parent/ }\` + * @since 1.0 + * @example ​ ````Shows the parent of each element as (parent > child). Check the View Source to see the raw html. +```html + + + + + parent demo + + + + +​ +
      div, + span, + b +
      +​ +

      p, + span, + em + +

      +​ +
      div, + strong, + span, + em, + b, + + + b +
      +​ + +​ + + +``` + * @example ​ ````Find the parent element of each paragraph with a class "selected". +```html + + + + + parent demo + + + +​ +

      Hello

      +

      Hello Again

      +​ + +​ + + +``` + */ + parent(selector?: JQuery.Selector): this; + /** + * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/parents/ }\` + * @since 1.0 + * @example ​ ````Find all parent elements of each b. +```html + + + + + parents demo + + + + +​ +
      +

      + + My parents are: + +

      +
      +​ + +​ + + +``` + * @example ​ ````Click to find all unique div parent elements of each span. +```html + + + + + parents demo + + + + +​ +

      +

      +
      Hello
      + Hello Again +
      +
      + And Hello Again +
      +

      + Click Hellos to toggle their parents. +​ + +​ + + +``` + */ + parents(selector?: JQuery.Selector): this; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * @param selector_element _@param_ `selector_element` + *
      + * * `selector` — A string containing a selector expression to indicate where to stop matching ancestor elements.
      + * * `element` — A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/parentsUntil/ }\` + * @since 1.4 + * @since 1.6 + * @example ​ ````Find the ancestors of <li class="item-a"> up to <ul class="level-1"> and give them a red background color. Also, find ancestors of <li class="item-2"> that have a class of "yes" up to <ul class="level-1"> and give them a green border. +```html + + + + + parentsUntil demo + + + +​ +
        +
      • I
      • +
      • II +
          +
        • A
        • +
        • B +
            +
          • 1
          • +
          • 2
          • +
          • 3
          • +
          +
        • +
        • C
        • +
        +
      • +
      • III
      • +
      +​ + +​ + + +``` + */ + parentsUntil(selector_element?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. + * @see \`{@link https://api.jquery.com/position/ }\` + * @since 1.2 + * @example ​ ````Access the position of the second paragraph: +```html + + + + + position demo + + + + +​ +
      +

      Hello

      +
      +

      +​ + +​ + + +``` + */ + position(): JQuery.Coordinates; + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or + * jQuery objects to insert at the beginning of each element in the set of matched elements. + * @see \`{@link https://api.jquery.com/prepend/ }\` + * @since 1.0 + * @example ​ ````Prepends some HTML to all paragraphs. +```html + + + + + prepend demo + + + + +​ +

      there, friend!

      +

      amigo!

      +​ + +​ + + +``` + * @example ​ ````Prepends a DOM Element to all paragraphs. +```html + + + + + prepend demo + + + + +​ +

      is what I'd say

      +

      is what I said

      +​ + +​ + + +``` + * @example ​ ````Prepends a jQuery object (similar to an Array of DOM Elements) to all paragraphs. +```html + + + + + prepend demo + + + + +​ +

      is what was said.

      Hello +​ + +​ + + +``` + */ + prepend(...contents: Array>>): this; + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * @param funÑtion A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at + * the beginning of each element in the set of matched elements. Receives the index position of the + * element in the set and the old HTML value of the element as arguments. Within the function, `this` + * refers to the current element in the set. + * @see \`{@link https://api.jquery.com/prepend/ }\` + * @since 1.4 + */ + prepend(funÑtion: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; + /** + * Insert every element in the set of matched elements to the beginning of the target. + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements + * will be inserted at the beginning of the element(s) specified by this parameter. + * @see \`{@link https://api.jquery.com/prependTo/ }\` + * @since 1.0 + * @example ​ ````Prepend all spans to the element with the ID "foo" (Check .prepend() documentation for more examples) +```html + + + + + prependTo demo + + + + +​ +
      FOO!
      +I have something to say... +​ + +​ + + +``` + */ + prependTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + /** + * Get the immediately preceding sibling of each element in the set of matched elements. If a selector is provided, it retrieves the previous sibling only if it matches that selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/prev/ }\` + * @since 1.0 + * @example ​ ````Find the very previous sibling of each div. +```html + + + + + prev demo + + + + +​ +
      +
      +
      has child
      +
      +
      +
      +
      +
      +

      +​ + +​ + + +``` + * @example ​ ````For each paragraph, find the very previous sibling that has a class "selected". +```html + + + + + prev demo + + + +​ +
      Hello
      +

      Hello Again

      +

      And Again

      +​ + +​ + + +``` + */ + prev(selector?: JQuery.Selector): this; + /** + * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/prevAll/ }\` + * @since 1.2 + * @example ​ ````Locate all the divs preceding the last div and give them a class. +```html + + + + + prevAll demo + + + + +​ +
      +
      +
      +
      +​ + +​ + + +``` + */ + prevAll(selector?: JQuery.Selector): this; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * @param selector_element _@param_ `selector_element` + *
      + * * `selector` — A string containing a selector expression to indicate where to stop matching preceding sibling elements.
      + * * `element` — A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/prevUntil/ }\` + * @since 1.4 + * @since 1.6 + * @example ​ ````Find the siblings that precede <dt id="term-2"> up to the preceding <dt> and give them a red background color. Also, find previous <dd> siblings of <dt id="term-3"> up to <dt id="term-1"> and give them a green text color. +```html + + + + + prevUntil demo + + + +​ +
      +
      term 1
      +
      definition 1-a
      +
      definition 1-b
      +
      definition 1-c
      +
      definition 1-d
      +​ +
      term 2
      +
      definition 2-a
      +
      definition 2-b
      +
      definition 2-c
      +​ +
      term 3
      +
      definition 3-a
      +
      definition 3-b
      +
      +​ + +​ + + +``` + */ + prevUntil(selector_element?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. + * @param type The type of queue that needs to be observed. + * @param target Object onto which the promise methods have to be attached + * @see \`{@link https://api.jquery.com/promise/ }\` + * @since 1.6 + */ + promise(type: string, target: T): T & JQuery.Promise; + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. + * @param target Object onto which the promise methods have to be attached + * @see \`{@link https://api.jquery.com/promise/ }\` + * @since 1.6 + */ + promise(target: T): T & JQuery.Promise; + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. + * @param type The type of queue that needs to be observed. + * @see \`{@link https://api.jquery.com/promise/ }\` + * @since 1.6 + * @example ​ ````Using .promise() on a collection with no active animation returns a resolved Promise: +```javascript +var div = $( "
      " ); +​ +div.promise().done(function( arg1 ) { + // Will fire right away and alert "true" + alert( this === div && arg1 === div ); +}); +``` + * @example ​ ````Resolve the returned Promise when all animations have ended (including those initiated in the animation callback or added later on): +```html + + + + + promise demo + + + + +​ + +

      Ready...

      +
      +
      +
      +
      +​ + +​ + + +``` + * @example ​ ````Resolve the returned Promise using a $.when() statement (the .promise() method makes it possible to do this with jQuery collections): +```html + + + + + promise demo + + + + +​ + +

      Ready...

      +
      +
      +
      +
      +​ + +​ + + +``` + */ + promise(type?: string): JQuery.Promise; + /** + * Set one or more properties for the set of matched elements. + * @param propertyName The name of the property to set. + * @param value_function _@param_ `value_function` + *
      + * * `value` — A value to set for the property.
      + * * `function` — A function returning the value to set. Receives the index position of the element in the set and the + * old property value as arguments. Within the function, the keyword `this` refers to the current element. + * @see \`{@link https://api.jquery.com/prop/ }\` + * @since 1.6 + */ + prop(propertyName: string, + value_function: string | number | boolean | symbol | object | null | undefined | ((this: TElement, index: number, oldPropertyValue: any) => any)): this; + /** + * Set one or more properties for the set of matched elements. + * @param properties An object of property-value pairs to set. + * @see \`{@link https://api.jquery.com/prop/ }\` + * @since 1.6 + * @example ​ ````Disable all checkboxes on the page. +```html + + + + + prop demo + + + + +​ + + + + +​ + +​ + + +``` + */ + prop(properties: JQuery.PlainObject): this; + /** + * Get the value of a property for the first element in the set of matched elements. + * @param propertyName The name of the property to get. + * @see \`{@link https://api.jquery.com/prop/ }\` + * @since 1.6 + * @example ​ ````Display the checked property and attribute of a checkbox as it changes. +```html + + + + + prop demo + + + + +​ + + +

      +​ + +​ + + +``` + */ + prop(propertyName: string): any; + /** + * Add a collection of DOM elements onto the jQuery stack. + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + * @param name The name of a jQuery method that generated the array of elements. + * @param args The arguments that were passed in to the jQuery method (for serialization). + * @see \`{@link https://api.jquery.com/pushStack/ }\` + * @since 1.3 + */ + pushStack(elements: ArrayLike, name: string, args: any[]): this; + /** + * Add a collection of DOM elements onto the jQuery stack. + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + * @see \`{@link https://api.jquery.com/pushStack/ }\` + * @since 1.0 + * @example ​ ````Add some elements onto the jQuery stack, then pop back off again. +```javascript +jQuery([]) + .pushStack( document.getElementsByTagName( "div" ) ) + .remove() + .end(); +``` + */ + pushStack(elements: ArrayLike): this; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item. + * An array of functions to replace the current queue contents. + * @see \`{@link https://api.jquery.com/queue/ }\` + * @since 1.2 + * @example ​ ````Set a queue array to delete the queue. +```html + + + + + queue demo + + + + +​ + + +
      +​ + +​ + + +``` + */ + queue(queueName: string, newQueue: JQuery.TypeOrArray>): this; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item. + * An array of functions to replace the current queue contents. + * @see \`{@link https://api.jquery.com/queue/ }\` + * @since 1.2 + * @example ​ ````Queue a custom function. +```html + + + + + queue demo + + + + +​ +Click here... +
      +​ + +​ + + +``` + */ + queue(newQueue: JQuery.TypeOrArray>): this; + /** + * Show the queue of functions to be executed on the matched elements. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see \`{@link https://api.jquery.com/queue/ }\` + * @since 1.2 + * @example ​ ````Show the length of the queue. +```html + + + + + queue demo + + + + +​ +

      The queue length is:

      +
      +​ + +​ + + +``` + */ + queue(queueName?: string): JQuery.Queue; + /** + * Specify a function to execute when the DOM is fully loaded. + * @param handler A function to execute after the DOM is ready. + * @see \`{@link https://api.jquery.com/ready/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.0. Use `jQuery(function() { })`. + * @example ​ ````Display a message when the DOM is loaded. +```html + + + + + ready demo + + + + + +​ +

      Not loaded yet.

      +​ + + +``` + */ + ready(handler: ($: JQueryStatic) => void): this; + /** + * Remove the set of matched elements from the DOM. + * @param selector A selector expression that filters the set of matched elements to be removed. + * @see \`{@link https://api.jquery.com/remove/ }\` + * @since 1.0 + * @example ​ ````Removes all paragraphs from the DOM +```html + + + + + remove demo + + + + +​ +

      Hello

      +how are +

      you?

      + +​ + +​ + + +``` + * @example ​ ````Removes all paragraphs that contain "Hello" from the DOM. Analogous to doing $("p").filter(":contains('Hello')").remove(). +```html + + + + + remove demo + + + + +​ +

      Hello

      +how are +

      you?

      + +​ + +​ + + +``` + */ + remove(selector?: string): this; + /** + * Remove an attribute from each element in the set of matched elements. + * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. + * @see \`{@link https://api.jquery.com/removeAttr/ }\` + * @since 1.0 + * @example ​ ````Clicking the button changes the title of the input next to it. Move the mouse pointer over the text input to see the effect of adding and removing the title attribute. +```html + + + + + removeAttr demo + + + +​ + + +
      +​ + +​ + + +``` + */ + removeAttr(attributeName: string): this; + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * @param className_function _@param_ `className_function` + *
      + * * `className` — One or more space-separated classes to be removed from the class attribute of each matched element.
      + * * `function` — A function returning one or more space-separated class names to be removed. Receives the index + * position of the element in the set and the old class value as arguments. + * @see \`{@link https://api.jquery.com/removeClass/ }\` + * @since 1.0 + * @since 1.4 + * @since 3.3 + * @example ​ ````Remove the class 'blue' from the matched elements. +```html + + + + + removeClass demo + + + + +​ +

      Hello

      +

      and

      +

      then

      +

      Goodbye

      +​ + +​ + + +``` + * @example ​ ````Remove the class 'blue' and 'under' from the matched elements. +```html + + + + + removeClass demo + + + + +​ +

      Hello

      +

      and

      +

      then

      +

      Goodbye

      +​ + +​ + + +``` + * @example ​ ````Remove all the classes from the matched elements. +```html + + + + + removeClass demo + + + + +​ +

      Hello

      +

      and

      +

      then

      +

      Goodbye

      +​ + +​ + + +``` + */ + removeClass(className_function?: JQuery.TypeOrArray | ((this: TElement, index: number, className: string) => string)): this; + /** + * Remove a previously-stored piece of data. + * @param name A string naming the piece of data to delete. + * An array or space-separated string naming the pieces of data to delete. + * @see \`{@link https://api.jquery.com/removeData/ }\` + * @since 1.2.3 + * @since 1.7 + * @example ​ ````Set a data store for 2 names then remove one of them. +```html + + + + + removeData demo + + + + +​ +
      value1 before creation:
      +
      value1 after creation:
      +
      value1 after removal:
      +
      value2 after removal:
      +​ + +​ + + +``` + */ + removeData(name?: JQuery.TypeOrArray): this; + /** + * Remove a property for the set of matched elements. + * @param propertyName The name of the property to remove. + * @see \`{@link https://api.jquery.com/removeProp/ }\` + * @since 1.6 + * @example ​ ````Set a numeric property on a paragraph and then remove it. +```html + + + + + removeProp demo + + + + +​ +

      +​ + +​ + + +``` + */ + removeProp(propertyName: string): this; + /** + * Replace each target element with the set of matched elements. + * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. + * @see \`{@link https://api.jquery.com/replaceAll/ }\` + * @since 1.2 + * @example ​ ````Replace all the paragraphs with bold words. +```html + + + + + replaceAll demo + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + */ + replaceAll(target: JQuery.Selector | JQuery | JQuery.TypeOrArray): this; + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * @param newContent_function _@param_ `newContent_function` + *
      + * * `newContent` — The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
      + * * `function` — A function that returns content with which to replace the set of matched elements. + * @see \`{@link https://api.jquery.com/replaceWith/ }\` + * @since 1.2 + * @since 1.4 + * @example ​ ````On click, replace the button with a div containing the same word. +```html + + + + + replaceWith demo + + + + +​ + + + +​ + +​ + + +``` + * @example ​ ````Replace all paragraphs with bold words. +```html + + + + + replaceWith demo + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````On click, replace each paragraph with a div that is already in the DOM and selected with the $() function. Notice it doesn't clone the object but rather moves it to replace the paragraph. +```html + + + + + replaceWith demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +
      Replaced!
      +​ + +​ + + +``` + * @example ​ ````On button click, replace the containing div with its child divs and append the class name of the selected element to the paragraph. +```html + + + + + replaceWith demo + + + + +​ +

      + +

      +
      +
      Scooby
      +
      Dooby
      +
      Doo
      +
      +​ + +​ + + +``` + */ + replaceWith(newContent_function: JQuery.htmlString | JQuery | JQuery.TypeOrArray | ((this: TElement) => any)): this; + /** + * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/resize/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + resize(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/resize/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````To see the window width while (or after) it is resized, try: +```javascript +$( window ).resize(function() { + $( "body" ).prepend( "
      " + $( window ).width() + "
      " ); +}); +``` + */ + resize(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/scroll/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + scroll(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/scroll/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````To do something when your page is scrolled: +```html + + + + + scroll demo + + + + +​ +
      Try scrolling the iframe.
      +

      Paragraph - Scroll happened!

      +​ + +​ + + +``` + */ + scroll(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Set the current horizontal position of the scroll bar for each of the set of matched elements. + * @param value An integer indicating the new position to set the scroll bar to. + * @see \`{@link https://api.jquery.com/scrollLeft/ }\` + * @since 1.2.6 + * @example ​ ````Set the scrollLeft of a div. +```html + + + + + scrollLeft demo + + + + +​ +

      lalala

      Hello

      +​ + +​ + + +``` + */ + scrollLeft(value: number): this; + /** + * Get the current horizontal position of the scroll bar for the first element in the set of matched elements. + * @see \`{@link https://api.jquery.com/scrollLeft/ }\` + * @since 1.2.6 + * @example ​ ````Get the scrollLeft of a paragraph. +```html + + + + + scrollLeft demo + + + + +​ +

      Hello

      +​ + +​ + + +``` + */ + scrollLeft(): number | undefined; + /** + * Set the current vertical position of the scroll bar for each of the set of matched elements. + * @param value A number indicating the new position to set the scroll bar to. + * @see \`{@link https://api.jquery.com/scrollTop/ }\` + * @since 1.2.6 + * @example ​ ````Set the scrollTop of a div. +```html + + + + + scrollTop demo + + + + +​ +

      lalala

      Hello

      +​ + +​ + + +``` + */ + scrollTop(value: number): this; + /** + * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. + * @see \`{@link https://api.jquery.com/scrollTop/ }\` + * @since 1.2.6 + * @example ​ ````Get the scrollTop of a paragraph. +```html + + + + + scrollTop demo + + + + +​ +

      Hello

      +​ + +​ + + +``` + */ + scrollTop(): number | undefined; + /** + * Bind an event handler to the "select" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/select/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + select(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "select" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/select/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````To do something when text in input boxes is selected: +```html + + + + + select demo + + + + +​ +

      Click and drag the mouse to select text in the inputs.

      + + +
      + ​ + +​ + + +``` + * @example ​ ````To trigger the select event on all input elements, try: +```javascript +$( "input" ).select(); +``` + */ + select(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Encode a set of form elements as a string for submission. + * @see \`{@link https://api.jquery.com/serialize/ }\` + * @since 1.0 + * @example ​ ````Serialize a form to a query string that could be sent to a server in an Ajax request. +```html + + + + + serialize demo + + + + +​ +
      + +​ +
      + +​ +
      + + + + +​ +
      + + + + +
      +​ +

      +​ + +​ + + +``` + */ + serialize(): string; + /** + * Encode a set of form elements as an array of names and values. + * @see \`{@link https://api.jquery.com/serializeArray/ }\` + * @since 1.2 + * @example ​ ````Get the values from a form, iterate through them, and append them to a results display. +```html + + + + + serializeArray demo + + + + +​ +

      Results:

      +
      + + +
      + + + + + + + + +
      +​ + +​ + + +``` + */ + serializeArray(): JQuery.NameValuePair[]; + /** + * Display the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/show/ }\` + * @since 1.4.3 + */ + show(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): this; + /** + * Display the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param easing_complete _@param_ `easing_complete` + *
      + * * `easing` — A string indicating which easing function to use for the transition.
      + * * `complete` — A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/show/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Show the first div, followed by each next adjacent sibling div in order, with a 200ms animation. Each animation starts when the previous sibling div's animation ends. +```html + + + + + show demo + + + + +​ + + +
      Hello 3,
      +
      how
      +
      are
      +
      you?
      +​ + +​ + + +``` + * @example ​ ````Show all span and input elements with an animation. Change the text once the animation is done. +```html + + + + + show demo + + + + +​ + +Are you sure? (type 'yes' if you are) +
      +
      + +
      +
      +

      I'm hidden...

      +​ + +​ + + +``` + */ + show(duration: JQuery.Duration, easing_complete: string | ((this: TElement) => void)): this; + /** + * Display the matched elements. + * @param duration_complete_options _@param_ `duration_complete_options` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `complete` — A function to call once the animation is complete, called once per matched element.
      + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/show/ }\` + * @since 1.0 + * @example ​ ````Animates all hidden paragraphs to show slowly, completing the animation within 600 milliseconds. +```html + + + + + show demo + + + + +​ + +

      Hello 2

      +​ + +​ + + +``` + */ + show(duration_complete_options?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. + * @param selector A string containing a selector expression to match elements against. + * @see \`{@link https://api.jquery.com/siblings/ }\` + * @since 1.0 + * @example ​ ````Find the unique siblings of all yellow li elements in the 3 lists (including other yellow li elements if appropriate). +```html + + + + + siblings demo + + + + +​ +
        +
      • One
      • +
      • Two
      • +
      • Three
      • +
      • Four
      • +
      +​ +
        +
      • Five
      • +
      • Six
      • +
      • Seven
      • +
      +​ +
        +
      • Eight
      • +
      • Nine
      • +
      • Ten
      • +
      • Eleven
      • +
      +​ +

      Unique siblings:

      +​ + +​ + + +``` + * @example ​ ````Find all siblings with a class "selected" of each div. +```html + + + + + siblings demo + + + +​ +
      Hello
      +

      Hello Again

      +

      And Again

      +​ + +​ + + +``` + */ + siblings(selector?: JQuery.Selector): this; + /** + * Reduce the set of matched elements to a subset specified by a range of indices. + * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, + * it indicates an offset from the end of the set. + * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, + * it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. + * @see \`{@link https://api.jquery.com/slice/ }\` + * @since 1.1.4 + * @example ​ ````Turns divs yellow based on a random slice. +```html + + + + + slice demo + + + + +​ +

      + Click the button!

      +
      +
      +
      +
      +
      +
      +
      +
      +
      + ​ + +​ + + +``` + * @example ​ ````Selects all paragraphs, then slices the selection to include only the first element. +```javascript +$( "p" ).slice( 0, 1 ).wrapInner( "" ); +``` + * @example ​ ````Selects all paragraphs, then slices the selection to include only the first and second element. +```javascript +$( "p" ).slice( 0, 2 ).wrapInner( "" ); +``` + * @example ​ ````Selects all paragraphs, then slices the selection to include only the second element. +```javascript +$( "p" ).slice( 1, 2 ).wrapInner( "" ); +``` + * @example ​ ````Selects all paragraphs, then slices the selection to include only the second and third element. +```javascript +$( "p" ).slice( 1 ).wrapInner( "" ); +``` + * @example ​ ````Selects all paragraphs, then slices the selection to include only the third element. +```javascript +$( "p" ).slice( -1 ).wrapInner( "" ); +``` + */ + slice(start: number, end?: number): this; + /** + * Display the matched elements with a sliding motion. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/slideDown/ }\` + * @since 1.4.3 + */ + slideDown(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display the matched elements with a sliding motion. + * @param duration_easing _@param_ `duration_easing` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/slideDown/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates all inputs to slide down, completing the animation within 1000 milliseconds. Once the animation is done, the input look is changed especially if it is the middle input which gets the focus. +```html + + + + + slideDown demo + + + + +​ +
      Push!
      + + + + ​ + +​ + + +``` + */ + slideDown(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; + /** + * Display the matched elements with a sliding motion. + * @param duration_easing_complete_options _@param_ `duration_easing_complete_options` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `easing` — A string indicating which easing function to use for the transition.
      + * * `complete` — A function to call once the animation is complete, called once per matched element.
      + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/slideDown/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates all divs to slide down and show themselves over 600 milliseconds. +```html + + + + + slideDown demo + + + + +​ +Click me! +
      +
      +
      +​ + +​ + + +``` + */ + slideDown(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Display or hide the matched elements with a sliding motion. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/slideToggle/ }\` + * @since 1.4.3 + */ + slideToggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements with a sliding motion. + * @param duration_easing _@param_ `duration_easing` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/slideToggle/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates divs between dividers with a toggle that makes some appear and some disappear. +```html + + + + + slideToggle demo + + + + +​ +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +

      There have been 0 toggled divs.

      +​ + +​ + + +``` + */ + slideToggle(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; + /** + * Display or hide the matched elements with a sliding motion. + * @param duration_easing_complete_options _@param_ `duration_easing_complete_options` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `easing` — A string indicating which easing function to use for the transition.
      + * * `complete` — A function to call once the animation is complete, called once per matched element.
      + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/slideToggle/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates all paragraphs to slide up or down, completing the animation within 600 milliseconds. +```html + + + + + slideToggle demo + + + + +​ + +

      + This is the paragraph to end all paragraphs. You + should feel lucky to have seen such a paragraph in + your life. Congratulations! +

      +​ + +​ + + +``` + */ + slideToggle(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Hide the matched elements with a sliding motion. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/slideUp/ }\` + * @since 1.4.3 + */ + slideUp(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Hide the matched elements with a sliding motion. + * @param duration_easing _@param_ `duration_easing` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `easing` — A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/slideUp/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates the parent paragraph to slide up, completing the animation within 200 milliseconds. Once the animation is done, it displays an alert. +```html + + + + + slideUp demo + + + + +​ +
      + + +
      +​ +
      + + +
      +​ +
      + + +
      +​ +
      +​ + +​ + + +``` + */ + slideUp(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; + /** + * Hide the matched elements with a sliding motion. + * @param duration_easing_complete_options _@param_ `duration_easing_complete_options` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `easing` — A string indicating which easing function to use for the transition.
      + * * `complete` — A function to call once the animation is complete, called once per matched element.
      + * * `options` — A map of additional options to pass to the method. + * @see \`{@link https://api.jquery.com/slideUp/ }\` + * @since 1.0 + * @since 1.4.3 + * @example ​ ````Animates all divs to slide up, completing the animation within 400 milliseconds. +```html + + + + + slideUp demo + + + + +​ +Click me! +
      +
      +
      +
      +
      +​ + +​ + + +``` + */ + slideUp(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; + /** + * Stop the currently-running animation on the matched elements. + * @param queue The name of the queue in which to stop animations. + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + * @see \`{@link https://api.jquery.com/stop/ }\` + * @since 1.7 + */ + stop(queue: string, clearQueue?: boolean, jumpToEnd?: boolean): this; + /** + * Stop the currently-running animation on the matched elements. + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + * @see \`{@link https://api.jquery.com/stop/ }\` + * @since 1.2 + * @example ​ ````Click the Go button once to start the animation, then click the STOP button to stop it where it's currently positioned. Another option is to click several buttons to queue them up and see that stop just kills the currently playing one. +```html + + + + + stop demo + + + + +​ + + + +
      +​ + +​ + + +``` + * @example ​ ````Click the slideToggle button to start the animation, then click again before the animation is completed. The animation will toggle the other direction from the saved starting point. +```html + + + + + stop demo + + + + +​ + +
      +​ + +​ + + +``` + */ + stop(clearQueue?: boolean, jumpToEnd?: boolean): this; + /** + * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/submit/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + */ + submit(eventData: TData, + handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/submit/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.3. Use \`{@link on }\` or \`{@link trigger }\`. + * + * **Cause**: The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu. + * + * **Solution**: Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`. + * @example ​ ````If you'd like to prevent forms from being submitted unless a flag variable is set, try: +```html + + + + + submit demo + + + + +​ +

      Type 'correct' to validate.

      +
      +
      + + +
      +
      + +​ + +​ + + +``` + * @example ​ ````If you'd like to prevent forms from being submitted unless a flag variable is set, try: +```javascript +$( "form" ).submit(function() { + return this.some_flag_variable; +}); +``` + * @example ​ ````To trigger the submit event on the first form on the page, try: +```javascript +$( "form:first" ).submit(); +``` + */ + submit(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Set the content of each element in the set of matched elements to the specified text. + * @param text_function _@param_ `text_function` + *
      + * * `text` — The text to set as the content of each matched element. When Number or Boolean is supplied, it will + * be converted to a String representation.
      + * * `function` — A function returning the text content to set. Receives the index position of the element in the set + * and the old text value as arguments. + * @see \`{@link https://api.jquery.com/text/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Add text to the paragraph (notice the bold tag is escaped). +```html + + + + + text demo + + + + +​ +

      Test Paragraph.

      +​ + +​ + + +``` + */ + text(text_function: string | number | boolean | ((this: TElement, index: number, text: string) => string | number | boolean)): this; + /** + * Get the combined text contents of each element in the set of matched elements, including their descendants. + * @see \`{@link https://api.jquery.com/text/ }\` + * @since 1.0 + * @example ​ ````Find the text in the first paragraph (stripping out the html), then set the html of the last paragraph to show it is just text (the red bold is gone). +```html + + + + + text demo + + + + +​ +

      Test Paragraph.

      +

      +​ + +​ + + +``` + */ + text(): string; + /** + * Retrieve all the elements contained in the jQuery set, as an array. + * @see \`{@link https://api.jquery.com/toArray/ }\` + * @since 1.4 + * @example ​ ````Select all divs in the document and return the DOM Elements as an Array; then use the built-in reverse() method to reverse that array. +```html + + + + + toArray demo + + + + +​ +Reversed - +​ +
      One
      +
      Two
      +
      Three
      ​ + +​ + + +``` + */ + toArray(): TElement[]; + /** + * Display or hide the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/toggle/ }\` + * @since 1.4.3 + */ + toggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; + /** + * Display or hide the matched elements. + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/toggle/ }\` + * @since 1.0 + */ + toggle(duration: JQuery.Duration, complete: (this: TElement) => void): this; + /** + * Display or hide the matched elements. + * @param duration_complete_options_display _@param_ `duration_complete_options_display` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `complete` — A function to call once the animation is complete, called once per matched element.
      + * * `options` — A map of additional options to pass to the method.
      + * * `display` — Use true to show the element or false to hide it. + * @see \`{@link https://api.jquery.com/toggle/ }\` + * @since 1.0 + * @since 1.3 + * @example ​ ````Toggles all paragraphs. +```html + + + + + toggle demo + + + +​ + +

      Hello

      +

      Good Bye

      +​ + +​ + + +``` + * @example ​ ````Animates all paragraphs to be shown if they are hidden and hidden if they are visible, completing the animation within 600 milliseconds. +```html + + + + + toggle demo + + + + +​ + +

      Hiya

      +

      Such interesting text, eh?

      +​ + +​ + + +``` + * @example ​ ````Shows all paragraphs, then hides them all, back and forth. +```html + + + + + toggle demo + + + +​ + +

      Hello

      +

      Good Bye

      +​ + +​ + + +``` + */ + toggle(duration_complete_options_display?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions | boolean): this; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument. + * @param className_function _@param_ `className_function` + *
      + * * `className` — One or more class names (separated by spaces) to be toggled for each element in the matched set.
      + * * `function` — A function that returns class names to be toggled in the class attribute of each element in the + * matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. + * @param state A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. + * @see \`{@link https://api.jquery.com/toggleClass/ }\` + * @since 1.0 + * @since 1.3 + * @since 1.4 + * @since 3.3 + * @example ​ ````Toggle the class 'highlight' when a paragraph is clicked. +```html + + + + + toggleClass demo + + + + +​ +

      Click to toggle

      +

      highlight

      +

      on these

      +

      paragraphs

      +​ + +​ + + +``` + * @example ​ ````Add the "highlight" class to the clicked paragraph on every third click of that paragraph, remove it every first and second click. +```html + + + + + toggleClass demo + + + + +​ +

      Click to toggle (clicks: 0)

      +

      highlight (clicks: 0)

      +

      on these (clicks: 0)

      +

      paragraphs (clicks: 0)

      +​ + +​ + + +``` + * @example ​ ````Toggle the class name(s) indicated on the buttons for each div. +```html + + + + + toggleClass demo + + + + +​ +
      + + + + + reset +
      +
      +
      +
      +
      +
      +
      +​ + +​ + + +``` + */ + toggleClass(className_function: JQuery.TypeOrArray | ((this: TElement, index: number, className: string, state: TState) => string), + state?: TState): this; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument. + * @param state A boolean value to determine whether the class should be added or removed. + * @see \`{@link https://api.jquery.com/toggleClass/ }\` + * @since 1.4 + * @deprecated ​ Deprecated since 3.0. See \`{@link https://github.com/jquery/jquery/pull/2618 }\`. + * + * **Cause**: Calling `.toggleClass()` with no arguments, or with a single Boolean `true` or `false` argument, has been deprecated. Its behavior was poorly documented, but essentially the method saved away the current class value in a data item when the class was removed and restored the saved value when it was toggled back. If you do not believe you are specificially trying to use this form of the method, it is possible you are accidentally doing so via an inadvertent undefined value, as `.toggleClass( undefined )` toggles all classes. + * + * **Solution**: If this functionality is still needed, save the current full `.attr( "class" )` value in a data item and restore it when required. + */ + toggleClass(state?: boolean): this; + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * @param eventType_event _@param_ `eventType_event` + *
      + * * `eventType` — A string containing a JavaScript event type, such as `click` or `submit`.
      + * * `event` — A \`{@link https://api.jquery.com/category/events/event-object/ jQuery.Event}\` object. + * @param extraParameters Additional parameters to pass along to the event handler. + * @see \`{@link https://api.jquery.com/trigger/ }\` + * @since 1.0 + * @since 1.3 + * @example ​ ````Clicks to button #2 also trigger a click for button #1. +```html + + + + + trigger demo + + + + +​ + + +
      0 button #1 clicks.
      +
      0 button #2 clicks.
      +​ + +​ + + +``` + * @example ​ ````To submit the first form without using the submit() function, try: +```javascript +$( "form:first" ).trigger( "submit" ); +``` + * @example ​ ````To submit the first form without using the submit() function, try: +```javascript +var event = jQuery.Event( "submit" ); +$( "form:first" ).trigger( event ); +if ( event.isDefaultPrevented() ) { + // Perform an action... +} +``` + * @example ​ ````To pass arbitrary data to an event: +```javascript +$( "p" ) + .click(function( event, a, b ) { + // When a normal click fires, a and b are undefined + // for a trigger like below a refers to "foo" and b refers to "bar" + }) + .trigger( "click", [ "foo", "bar" ] ); +``` + * @example ​ ````To pass arbitrary data through an event object: +```javascript +var event = jQuery.Event( "logged" ); +event.user = "foo"; +event.pass = "bar"; +$( "body" ).trigger( event ); +``` + * @example ​ ````Alternative way to pass data through an event object: +```javascript +$( "body" ).trigger({ + type:"logged", + user:"foo", + pass:"bar" +}); +``` + */ + trigger(eventType_event: string | JQuery.Event, extraParameters?: any[] | JQuery.PlainObject | string | number | boolean): this; + /** + * Execute all handlers attached to an element for an event. + * @param eventType_event _@param_ `eventType_event` + *
      + * * `eventType` — A string containing a JavaScript event type, such as `click` or `submit`.
      + * * `event` — A \`{@link https://api.jquery.com/category/events/event-object/ jQuery.Event}\` object. + * @param extraParameters Additional parameters to pass along to the event handler. + * @see \`{@link https://api.jquery.com/triggerHandler/ }\` + * @since 1.2 + * @since 1.3 + * @example ​ ````If you called .triggerHandler() on a focus event - the browser's default focus action would not be triggered, only the event handlers bound to the focus event. +```html + + + + + triggerHandler demo + + + +​ + +

      +​ + +​ + +​ + + +``` + */ + triggerHandler(eventType_event: string | JQuery.Event, extraParameters?: any[] | JQuery.PlainObject | string | number | boolean): any; + /** + * Remove a previously-attached event handler from the elements. + * @param event A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/unbind/ }\` + * @since 1.0 + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.0. Use \`{@link off }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````Can bind and unbind events to the colored button. +```html + + + + + unbind demo + + + + +​ + + + +
      Click!
      +​ + +​ + + +``` + * @example ​ ````To unbind just one previously bound handler, pass the function in as the second argument: +```javascript +var foo = function() { + // Code to handle some kind of event +}; +​ +$( "p" ).bind( "click", foo ); // ... Now foo will be called when paragraphs are clicked ... +​ +$( "p" ).unbind( "click", foo ); // ... foo will no longer be called. +``` + */ + unbind(event: string, handler: JQuery.EventHandlerBase> | false): this; + /** + * Remove a previously-attached event handler from the elements. + * @param event A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * A jQuery.Event object. + * @see \`{@link https://api.jquery.com/unbind/ }\` + * @since 1.0 + * @deprecated ​ Deprecated since 3.0. Use \`{@link off }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````To unbind all events from all paragraphs, write: +```javascript +$( "p" ).unbind(); +``` + * @example ​ ````To unbind all click events from all paragraphs, write: +```javascript +$( "p" ).unbind( "click" ); +``` + */ + unbind(event?: string | JQuery.Event): this; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * @param selector A selector which will be used to filter the event results. + * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" + * @param handler A function to execute each time the event is triggered. + * @see \`{@link https://api.jquery.com/undelegate/ }\` + * @since 1.4.2 + * @deprecated ​ Deprecated since 3.0. Use \`{@link off }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````Can bind and unbind events to the colored button. +```html + + + + + undelegate demo + + + + +​ + + + +
      Click!
      +​ + +​ + + +``` + * @example ​ ````To undelegate just one previously bound handler, pass the function in as the third argument: +```javascript +var foo = function () { + // Code to handle some kind of event +}; +​ +// ... Now foo will be called when paragraphs are clicked ... +$( "body" ).delegate( "p", "click", foo ); +​ +// ... foo will no longer be called. +$( "body" ).undelegate( "p", "click", foo ); +``` + */ + undelegate(selector: JQuery.Selector, eventType: string, handler: JQuery.EventHandlerBase> | false): this; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * @param selector A selector which will be used to filter the event results. + * @param eventTypes A string containing a JavaScript event type, such as "click" or "keydown" + * An object of one or more event types and previously bound functions to unbind from them. + * @see \`{@link https://api.jquery.com/undelegate/ }\` + * @since 1.4.2 + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.0. Use \`{@link off }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + */ + undelegate(selector: JQuery.Selector, eventTypes: string | JQuery.PlainObject> | false>): this; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * @param namespace A selector which will be used to filter the event results. + * @see \`{@link https://api.jquery.com/undelegate/ }\` + * @since 1.4.2 + * @since 1.6 + * @deprecated ​ Deprecated since 3.0. Use \`{@link off }\`. + * + * **Cause**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update. + * + * **Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical. + * @example ​ ````To unbind all delegated events from all paragraphs, write: +```javascript +$( "p" ).undelegate(); +``` + * @example ​ ````To unbind all delegated click events from all paragraphs, write: +```javascript +$( "p" ).undelegate( "click" ); +``` + * @example ​ ````To unbind all delegated events by their namespace: +```javascript +var foo = function() { + // Code to handle some kind of event +}; +​ +// Delegate events under the ".whatever" namespace +$( "form" ).delegate( ":button", "click.whatever", foo ); +​ +$( "form" ).delegate( "input[type='text'] ", "keypress.whatever", foo ); +​ +// Unbind all events delegated under the ".whatever" namespace +$( "form" ).undelegate( ".whatever" ); +``` + */ + undelegate(namespace?: string): this; + /** + * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. + * @param selector A selector to check the parent element against. If an element's parent does not match the selector, + * the element won't be unwrapped. + * @see \`{@link https://api.jquery.com/unwrap/ }\` + * @since 1.4 + * @since 3.0 + * @example ​ ````Wrap/unwrap a div around each of the paragraphs. +```html + + + + + unwrap demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      ​ + +​ + + +``` + */ + unwrap(selector?: string): this; + /** + * Set the value of each element in the set of matched elements. + * @param value_function _@param_ `value_function` + *
      + * * `value` — A string of text, a number, or an array of strings corresponding to the value of each matched + * element to set as selected/checked.
      + * * `function` — A function returning the value to set. `this` is the current element. Receives the index position of + * the element in the set and the old value as arguments. + * @see \`{@link https://api.jquery.com/val/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Set the value of an input box. +```html + + + + + val demo + + + + +​ +
      + + + +
      + +​ + +​ + + +``` + * @example ​ ````Use the function argument to modify the value of an input box. +```html + + + + + val demo + + + +​ +

      Type something and then click or tab out of the input.

      + +​ + +​ + + +``` + * @example ​ ````Set a single select, a multiple select, checkboxes and a radio button . +```html + + + + + val demo + + + + +​ + +​ + +​ +
      + check1 + check2 + radio1 + radio2 +​ + +​ + + +``` + */ + val(value_function: string | number | string[] | ((this: TElement, index: number, value: string) => string)): this; + /** + * Get the current value of the first element in the set of matched elements. + * @see \`{@link https://api.jquery.com/val/ }\` + * @since 1.0 + * @example ​ ````Get the single value from a single select and an array of values from a multiple select and display their values. +```html + + + + + val demo + + + + +​ +

      +​ + +​ + +​ + +​ + + +``` + * @example ​ ````Find the value of an input box. +```html + + + + + val demo + + + + +​ + +

      +​ + +​ + + +``` + */ + val(): string | number | string[] | undefined; + /** + * Set the CSS width of each element in the set of matched elements. + * @param value_function _@param_ `value_function` + *
      + * * `value` — An integer representing the number of pixels, or an integer along with an optional unit of measure + * appended (as a string).
      + * * `function` — A function returning the width to set. Receives the index position of the element in the set and the + * old width as arguments. Within the function, `this` refers to the current element in the set. + * @see \`{@link https://api.jquery.com/width/ }\` + * @since 1.0 + * @since 1.4.1 + * @example ​ ````Change the width of each div the first time it is clicked (and change its color). +```html + + + + + width demo + + + + +​ +
      d
      +
      d
      +
      d
      +
      d
      +
      d
      +​ + +​ + + +``` + */ + width(value_function: string | number | ((this: TElement, index: number, value: number) => string | number)): this; + /** + * Get the current computed width for the first element in the set of matched elements. + * @see \`{@link https://api.jquery.com/width/ }\` + * @since 1.0 + * @example ​ ````Show various widths. Note the values are from the iframe so might be smaller than you expected. The yellow highlight shows the iframe body. +```html + + + + + width demo + + + + +​ + + + +
       
      +

      + Sample paragraph to test width +

      +​ + +​ + + +``` + */ + width(): number | undefined; + /** + * Wrap an HTML structure around each element in the set of matched elements. + * @param wrappingElement_function _@param_ `wrappingElement_function` + *
      + * * `wrappingElement` — A selector, element, HTML string, or jQuery object specifying the structure to wrap around the + * matched elements. When you pass a jQuery collection containing more than one element, or a selector + * matching more than one element, the first element will be used.
      + * * `function` — A callback function returning the HTML content or jQuery object to wrap around the matched elements. + * Receives the index position of the element in the set as an argument. Within the function, `this` + * refers to the current element in the set. + * @see \`{@link https://api.jquery.com/wrap/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Wrap a new div around all of the paragraphs. +```html + + + + + wrap demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````Wraps a newly created tree of objects around the spans. Notice anything in between the spans gets left out like the <strong> (red text) in this example. Even the white space between spans is left out. Click View Source to see the original html.> +```html + + + + + wrap demo + + + + +​ +Span Text +What about me? +Another One +​ + +​ + + +``` + * @example ​ ````Wrap a new div around all of the paragraphs. +```html + + + + + wrap demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````Wrap a jQuery object double depth div around all of the paragraphs. Notice it doesn't move the object but just clones it to wrap around its target. +```html + + + + + wrap demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +
      +​ + +​ + + +``` + */ + wrap(wrappingElement_function: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement, index: number) => string | JQuery)): this; + /** + * Wrap an HTML structure around all elements in the set of matched elements. + * @param wrappingElement_function _@param_ `wrappingElement_function` + *
      + * * `wrappingElement` — A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
      + * * `function` — A callback function returning the HTML content or jQuery object to wrap around all the matched + * elements. Within the function, `this` refers to the first element in the set. **Prior to jQuery + * 3.0**, the callback was incorrectly called for every element in the set and received the index + * position of the element in the set as an argument. + * @see \`{@link https://api.jquery.com/wrapAll/ }\` + * @since 1.2 + * @since 1.4 + * @example ​ ````Wrap a new div around all of the paragraphs. +```html + + + + + wrapAll demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````Wraps a newly created tree of objects around the spans. Notice anything in between the spans gets left out like the <strong> (red text) in this example. Even the white space between spans is left out. Click View Source to see the original html. +```html + + + + + wrapAll demo + + + + +​ +Span Text +What about me? +Another One +​ + +​ + + +``` + * @example ​ ````Wrap a new div around all of the paragraphs. +```html + + + + + wrapAll demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````Wrap a jQuery object double depth div around all of the paragraphs. Notice it doesn't move the object but just clones it to wrap around its target. +```html + + + + + wrapAll demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +
      +​ + +​ + + +``` + */ + wrapAll(wrappingElement_function: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement) => string | JQuery)): this; + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * @param wrappingElement_function _@param_ `wrappingElement_function` + *
      + * * `wrappingElement` — An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap + * around the content of the matched elements.
      + * * `function` — A callback function which generates a structure to wrap around the content of the matched elements. + * Receives the index position of the element in the set as an argument. Within the function, `this` + * refers to the current element in the set. + * @see \`{@link https://api.jquery.com/wrapInner/ }\` + * @since 1.2 + * @since 1.4 + * @example ​ ````Selects all paragraphs and wraps a bold tag around each of its contents. +```html + + + + + wrapInner demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````Wraps a newly created tree of objects around the inside of the body. +```html + + + + + wrapInner demo + + + + +​ +Plain old text, or is it? +​ + +​ + + +``` + * @example ​ ````Selects all paragraphs and wraps a bold tag around each of its contents. +```html + + + + + wrapInner demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + * @example ​ ````Selects all paragraphs and wraps a jQuery object around each of its contents. +```html + + + + + wrapInner demo + + + + +​ +

      Hello

      +

      cruel

      +

      World

      +​ + +​ + + +``` + */ + wrapInner(wrappingElement_function: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement, index: number) => string | JQuery | Element)): this; + + [n: number]: TElement; +} diff --git a/types/jquery/JQueryStatic.d.ts b/types/jquery/JQueryStatic.d.ts new file mode 100644 index 0000000000..20d3a9e8c5 --- /dev/null +++ b/types/jquery/JQueryStatic.d.ts @@ -0,0 +1,13516 @@ +// tslint:disable:jsdoc-format +// tslint:disable:max-line-length +// tslint:disable:no-irregular-whitespace + +interface JQueryStatic { + /** + * @see \`{@link https://api.jquery.com/jquery.ajax/#jQuery-ajax1 }\` + * @deprecated ​ Deprecated. Use \`{@link ajaxSetup }\`. + */ + ajaxSettings: JQuery.AjaxSettings; + Animation: JQuery.AnimationStatic; + Callbacks: JQuery.CallbacksStatic; + /** + * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. + * @see \`{@link https://api.jquery.com/jQuery.cssHooks/ }\` + * @since 1.4.3 + */ + cssHooks: JQuery.CSSHooks; + /** + * An object containing all CSS properties that may be used without a unit. The .css() method uses this object to see if it may append px to unitless values. + * @see \`{@link https://api.jquery.com/jQuery.cssNumber/ }\` + * @since 1.4.3 + */ + cssNumber: JQuery.PlainObject; + Deferred: JQuery.DeferredStatic; + easing: JQuery.Easings; + Event: JQuery.EventStatic; + /** + * @see \`{@link https://learn.jquery.com/events/event-extensions/ }\` + */ + event: JQuery.EventExtensions; + expr: JQuery.Selectors; + // Set to HTMLElement to minimize breaks but should probably be Element. + readonly fn: JQuery; + fx: JQuery.Effects; + /** + * A Promise-like object (or "thenable") that resolves when the document is ready. + * @see \`{@link https://api.jquery.com/jQuery.ready/ }\` + * @since 1.8 + * @example ​ ````Listen for document ready using jQuery.when. +```javascript +$.when( $.ready ).then(function() { + // Document is ready. +}); +``` + * @example ​ ````Typical usage involving another promise, using jQuery.when. +```javascript +$.when( + $.getJSON( "ajax/test.json" ), + $.ready +).done(function( data ) { + // Document is ready. + // Value of test.json is passed as `data`. +}); +``` + */ + ready: JQuery.Thenable; + /** + * A collection of properties that represent the presence of different browser features or bugs. Intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance. For your own project's feature-detection needs, we strongly recommend the use of an external library such as Modernizr instead of dependency on properties in jQuery.support. + * @see \`{@link https://api.jquery.com/jQuery.support/ }\` + * @since 1.3 + * @deprecated ​ Deprecated since 1.9. See \`{@link https://api.jquery.com/jQuery.support/ }\`. + */ + support: JQuery.PlainObject; + timers: Array>; + Tween: JQuery.TweenStatic; + valHooks: JQuery.ValHooks; + // HACK: This is the factory function returned when importing jQuery without a DOM. Declaring it separately breaks using the type parameter on JQueryStatic. + // HACK: The discriminator parameter handles the edge case of passing a Window object to JQueryStatic. It doesn't actually exist on the factory function. + (window: Window, discriminator: boolean): JQueryStatic; + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * @param html _@param_ `html` + *
      + * * `html (ownerDocument)` — A string of HTML to create on the fly. Note that this parses HTML, not XML.
      + * * `html (attributes)` — A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>). + * @param ownerDocument_attributes _@param_ `ownerDocument_attributes` + *
      + * * `ownerDocument` — A document in which the new elements will be created.
      + * * `attributes` — An object of attributes, events, and methods to call on the newly-created element. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + * @since 1.4 + * @example ​ ````Create a div element (and all of its contents) dynamically and append it to the body element. Internally, an element is created and its innerHTML property set to the given markup. +```javascript +$( "

      Hello

      " ).appendTo( "body" ) +``` + * @example ​ ````Create some DOM elements. +```javascript +$( "
      ", { + "class": "test", + text: "Click me!", + click: function() { + $( this ).toggleClass( "test" ); + } +}) + .appendTo( "body" ); +``` + */ + // tslint:disable-next-line:no-unnecessary-generics + (html: JQuery.htmlString, ownerDocument_attributes?: Document | JQuery.PlainObject): JQuery; + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * @param selector A string containing a selector expression + * @param context A DOM Element, Document, or jQuery to use as context + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + * @example ​ ````Find all p elements that are children of a div element and apply a border to them. +```html + + + + + jQuery demo + + + +​ +

      one

      +

      two

      +

      three

      +​ + + + +``` + * @example ​ ````Find all inputs of type radio within the first form in the document. +```javascript +$( "input:radio", document.forms[ 0 ] ); +``` + * @example ​ ````Find all div elements within an XML document from an Ajax response. +```javascript +$( "div", xml.responseXML ); +``` +​ + */ + // tslint:disable-next-line:no-unnecessary-generics + (selector: JQuery.Selector, context?: Element | Document | JQuery): JQuery; + /** + * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string. + * @param element A DOM element to wrap in a jQuery object. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + * @example ​ ````Set the background color of the page to black. +```javascript +$( document.body ).css( "background", "black" ); +``` + */ + // Using a unified signature is not possible due to a TypeScript 2.4 bug (DefinitelyTyped#27810) + (element: T): JQuery; + /** + * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string. + * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + * @example ​ ````Hide all the input elements within a form. +```javascript +$( myForm.elements ).hide(); +``` + */ + // Using a unified signature is not possible due to a TypeScript 2.4 bug (DefinitelyTyped#27810) + // tslint:disable-next-line:unified-signatures + (elementArray: T[]): JQuery; + /** + * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string. + * @param selection An existing jQuery object to clone. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + */ + (selection: JQuery): JQuery; + /** + * Binds a function to be executed when the DOM has finished loading. + * @param callback The function to execute when the DOM is ready. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + * @example ​ ````Execute the function when the DOM is ready to be used. +```javascript +$(function() { + // Document is ready +}); +``` + * @example ​ ````Use both the shortcut for $(document).ready() and the argument to write failsafe jQuery code using the $ alias, without relying on the global alias. +```javascript +jQuery(function( $ ) { + // Your code using failsafe $ alias here... +}); +``` + */ + // tslint:disable-next-line:no-unnecessary-generics unified-signatures + (callback: ((this: Document, $: JQueryStatic) => void)): JQuery; + /** + * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string. + * @param object A plain object to wrap in a jQuery object. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.0 + */ + (object: T): JQuery; + /** + * Returns an empty jQuery set. + * @see \`{@link https://api.jquery.com/jQuery/ }\` + * @since 1.4 + */ + // tslint:disable-next-line:no-unnecessary-generics + (): JQuery; + /** + * Perform an asynchronous HTTP (Ajax) request. + * @param url A string containing the URL to which the request is sent. + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can + * be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings. + * @see \`{@link https://api.jquery.com/jQuery.ajax/ }\` + * @since 1.5 + */ + ajax(url: string, settings?: JQuery.AjaxSettings): JQuery.jqXHR; + /** + * Perform an asynchronous HTTP (Ajax) request. + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can + * be set for any option with $.ajaxSetup(). + * @see \`{@link https://api.jquery.com/jQuery.ajax/ }\` + * @since 1.0 + * @example ​ ````Save some data to the server and notify the user once it's complete. +```javascript +$.ajax({ + method: "POST", + url: "some.php", + data: { name: "John", location: "Boston" } +}) + .done(function( msg ) { + alert( "Data Saved: " + msg ); + }); +``` + * @example ​ ````Retrieve the latest version of an HTML page. +```javascript +$.ajax({ + url: "test.html", + cache: false +}) + .done(function( html ) { + $( "#results" ).append( html ); + }); +``` + * @example ​ ````Send an xml document as data to the server. By setting the processData + option to false, the automatic conversion of data to strings is prevented. +```javascript +var xmlDocument = [create xml document]; +var xmlRequest = $.ajax({ + url: "page.php", + processData: false, + data: xmlDocument +}); +​ +xmlRequest.done( handleResponse ); +``` + * @example ​ ````Send an id as data to the server, save some data to the server, and notify the user once it's complete. If the request fails, alert the user. +```javascript +var menuId = $( "ul.nav" ).first().attr( "id" ); +var request = $.ajax({ + url: "script.php", + method: "POST", + data: { id : menuId }, + dataType: "html" +}); +​ +request.done(function( msg ) { + $( "#log" ).html( msg ); +}); +​ +request.fail(function( jqXHR, textStatus ) { + alert( "Request failed: " + textStatus ); +}); +``` + * @example ​ ````Load and execute a JavaScript file. +```javascript +$.ajax({ + method: "GET", + url: "test.js", + dataType: "script" +}); +``` + */ + ajax(settings?: JQuery.AjaxSettings): JQuery.jqXHR; + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * @param dataTypes An optional string containing one or more space-separated dataTypes + * @param handler A handler to set default values for future Ajax requests. + * @see \`{@link https://api.jquery.com/jQuery.ajaxPrefilter/ }\` + * @since 1.5 + */ + ajaxPrefilter(dataTypes: string, + handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * @param handler A handler to set default values for future Ajax requests. + * @see \`{@link https://api.jquery.com/jQuery.ajaxPrefilter/ }\` + * @since 1.5 + */ + ajaxPrefilter(handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; + /** + * Set default values for future Ajax requests. Its use is not recommended. + * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. + * @see \`{@link https://api.jquery.com/jQuery.ajaxSetup/ }\` + * @since 1.1 + * @example ​ ````Sets the defaults for Ajax requests to the url "/xmlhttp/", disables global handlers and uses POST instead of GET. The following Ajax requests then sends some data without having to set anything else. +```javascript +$.ajaxSetup({ + url: "/xmlhttp/", + global: false, + type: "POST" +}); +$.ajax({ data: myData }); +``` + */ + ajaxSetup(options: JQuery.AjaxSettings): JQuery.AjaxSettings; + /** + * Creates an object that handles the actual transmission of Ajax data. + * @param dataType A string identifying the data type to use + * @param handler A handler to return the new transport object to use with the data type provided in the first argument. + * @see \`{@link https://api.jquery.com/jQuery.ajaxTransport/ }\` + * @since 1.5 + */ + ajaxTransport(dataType: string, + handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => JQuery.Transport | void): void; + /** + * @deprecated ​ Deprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/3384 }\`. + */ + camelCase(value: string): string; + cleanData(elems: ArrayLike): void; + /** + * Check to see if a DOM element is a descendant of another DOM element. + * @param container The DOM element that may contain the other element. + * @param contained The DOM element that may be contained by (a descendant of) the other element. + * @see \`{@link https://api.jquery.com/jQuery.contains/ }\` + * @since 1.4 + * @example ​ ````Check if an element is a descendant of another. +```javascript +$.contains( document.documentElement, document.body ); // true +$.contains( document.body, document.documentElement ); // false +``` + */ + contains(container: Element, contained: Element): boolean; + css(elem: Element, name: string): any; + /** + * Store arbitrary data associated with the specified element. Returns the value that was set. + * @param element The DOM element to associate with the data. + * @param key A string naming the piece of data to set. + * @param value The new data value; this can be any Javascript type except `undefined`. + * @see \`{@link https://api.jquery.com/jQuery.data/ }\` + * @since 1.2.3 + * @example ​ ````Get the data named "blah" stored at for an element. +```html + + + + + jQuery.data demo + + + + +​ +
      A div
      + + + + +

      The "blah" value of this div is ?

      +​ + +​ + + +``` + */ + data(element: Element | Document | Window | JQuery.PlainObject, key: string, value: T): T; + /** + * Returns value at named data store for the element, as set by `jQuery.data(element, name, value)`, or the full data store for the element. + * @param element The DOM element to query for the data. + * @param key Name of the data stored. + * @param value `undefined` is not recognized as a data value. Calls such as `jQuery.data( el, "name", undefined )` + * will return the corresponding data for "name", and is therefore the same as `jQuery.data( el, "name" )` + * @see \`{@link https://api.jquery.com/jQuery.data/ }\` + * @since 1.2.3 + */ + // `unified-signatures` is disabled so that behavior when passing `undefined` to `value` can be documented. Unifying the signatures + // results in potential confusion for users from an unexpected parameter. + // tslint:disable-next-line:unified-signatures + data(element: Element | Document | Window | JQuery.PlainObject, key: string, value: undefined): any; + /** + * Returns value at named data store for the element, as set by `jQuery.data(element, name, value)`, or the full data store for the element. + * @param element The DOM element to query for the data. + * @param key Name of the data stored. + * @see \`{@link https://api.jquery.com/jQuery.data/ }\` + * @since 1.2.3 + * @since 1.4 + * @example ​ ````Store then retrieve a value from the div element. +```html + + + + + jQuery.data demo + + + + +​ +
      + The values stored were + + and + +
      +​ + +​ + + +``` + */ + data(element: Element | Document | Window | JQuery.PlainObject, key?: string): any; + /** + * Execute the next function on the queue for the matched element. + * @param element A DOM element from which to remove and execute a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @see \`{@link https://api.jquery.com/jQuery.dequeue/ }\` + * @since 1.3 + * @example ​ ````Use jQuery.dequeue() to end a custom queue function which allows the queue to keep going. +```html + + + + + jQuery.dequeue demo + + + + +​ + +
      +​ + +​ + + +``` + */ + dequeue(element: Element, queueName?: string): void; + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * @param array The array to iterate over. + * @param callback The function that will be executed on every object. + * @see \`{@link https://api.jquery.com/jQuery.each/ }\` + * @since 1.0 + * @example ​ ````Iterates through the array displaying each number as both a word and numeral +```html + + + + + jQuery.each demo + + + + +​ +
      +
      +
      +
      +
      +​ + +​ + + +``` + * @example ​ ````Iterates over items in an array, accessing both the current item and its index. +```javascript +$.each( [ "a", "b", "c" ], function( i, l ){ + alert( "Index #" + i + ": " + l ); +}); +``` + */ + each(array: ArrayLike, callback: (this: T, indexInArray: number, value: T) => any): ArrayLike; + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * @param obj The object to iterate over. + * @param callback The function that will be executed on every object. + * @see \`{@link https://api.jquery.com/jQuery.each/ }\` + * @since 1.0 + * @example ​ ````Iterates through the array displaying each number as both a word and numeral +```html + + + + + jQuery.each demo + + + + +​ +
      +
      +
      +
      +
      +​ + +​ + + +``` + * @example ​ ````Iterates over the properties in an object, accessing both the current item and its key. +```javascript +$.each({ name: "John", lang: "JS" }, function( k, v ) { + alert( "Key: " + k + ", Value: " + v ); +}); +``` + */ + each(obj: T, callback: (this: T[K], propertyName: K, valueOfProperty: T[K]) => any): T; + /** + * Takes a string and throws an exception containing it. + * @param message The message to send out. + * @see \`{@link https://api.jquery.com/jQuery.error/ }\` + * @since 1.4.1 + * @example ​ ````Override jQuery.error for display in Firebug. +```javascript +jQuery.error = console.error; +``` + */ + error(message: string): any; + /** + * Escapes any character that has a special meaning in a CSS selector. + * @param selector A string containing a selector expression to escape. + * @see \`{@link https://api.jquery.com/jQuery.escapeSelector/ }\` + * @since 3.0 + * @example ​ ````Escape an ID containing a hash. +```javascript +$.escapeSelector( "#target" ); // "\#target" +``` + * @example ​ ````Select all the elements having a class name of .box inside a div. +```javascript +$( "div" ).find( "." + $.escapeSelector( ".box" ) ); +``` + */ + escapeSelector(selector: JQuery.Selector): JQuery.Selector; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @param object4 An object containing additional properties to merge in. + * @param object5 An object containing additional properties to merge in. + * @param object6 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @param object4 An object containing additional properties to merge in. + * @param object5 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @param object4 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: T, object1: U, object2: V, object3: W): T & U & V & W; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: T, object1: U, object2: V): T & U & V; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: T, object1: U): T & U; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + */ + extend(deep: true, target: T): this & T; + /** + * Merge the contents of two or more objects together into the first object. + * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.1.4 + * @example ​ ````Merge two objects recursively, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(deep: true, target: any, object1: any, ...objectN: any[]): any; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @param object4 An object containing additional properties to merge in. + * @param object5 An object containing additional properties to merge in. + * @param object6 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @param object4 An object containing additional properties to merge in. + * @param object5 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @param object4 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @param object3 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: T, object1: U, object2: V, object3: W): T & U & V & W; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param object2 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: T, object1: U, object2: V): T & U & V; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: T, object1: U): T & U; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + */ + extend(target: T): this & T; + /** + * Merge the contents of two or more objects together into the first object. + * @param target An object that will receive the new properties if additional objects are passed in or that will + * extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` + * @since 1.0 + * @example ​ ````Merge two objects, modifying the first. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern. +```html + + + + + jQuery.extend demo + + + +​ +
      +​ + +​ + + +``` + */ + extend(target: any, object1: any, ...objectN: any[]): any; + /** + * Load data from the server using a HTTP GET request. + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. Required if `dataType` is provided, + * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see \`{@link https://api.jquery.com/jQuery.get/ }\` + * @since 1.0 + */ + get(url: string, + data: JQuery.PlainObject | string, + success: JQuery.jqXHR.DoneCallback | null, + dataType?: string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP GET request. + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. Required if `dataType` is provided, + * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see \`{@link https://api.jquery.com/jQuery.get/ }\` + * @since 1.0 + * @example ​ ````Get the test.php page contents, which has been returned in json format (<?php echo json_encode( array( "name"=>"John","time"=>"2pm" ) ); ?>), and add it to the page. +```javascript +$.get( "test.php", function( data ) { + $( "body" ) + .append( "Name: " + data.name ) // John + .append( "Time: " + data.time ); // 2pm +}, "json" ); +``` + */ + get(url: string, + success: JQuery.jqXHR.DoneCallback | null, + dataType: string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP GET request. + * @param url A string containing the URL to which the request is sent. + * @param success_data _@param_ `success_data` + *
      + * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided, + * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder.
      + * * `data` — A plain object or string that is sent to the server with the request. + * @see \`{@link https://api.jquery.com/jQuery.get/ }\` + * @since 1.0 + * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results). +```javascript +$.get( "test.php", { name: "John", time: "2pm" } ); +``` + * @example ​ ````Pass arrays of data to the server (while still ignoring the return results). +```javascript +$.get( "test.php", { "choices[]": ["Jon", "Susan"] } ); +``` + * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned). +```javascript +$.get( "test.php", function( data ) { + alert( "Data Loaded: " + data ); +}); +``` + * @example ​ ````Alert the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned). +```javascript +$.get( "test.cgi", { name: "John", time: "2pm" } ) + .done(function( data ) { + alert( "Data Loaded: " + data ); + }); +``` + */ + get(url: string, + success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP GET request. + * @param url_settings _@param_ `url_settings` + *
      + * * `url` — A string containing the URL to which the request is sent.
      + * * `settings` — A set of key/value pairs that configure the Ajax request. All properties except for `url` are + * optional. A default can be set for any option with \`{@link ajaxSetup $.ajaxSetup()}\`. See \`{@link https://api.jquery.com/jquery.ajax/#jQuery-ajax-settings jQuery.ajax( settings )}\` + * for a complete list of all settings. The type option will automatically be set to `GET`. + * @see \`{@link https://api.jquery.com/jQuery.get/ }\` + * @since 1.0 + * @since 1.12 + * @since 2.2 + * @example ​ ````Request the test.php page, but ignore the return results. +```javascript +$.get( "test.php" ); +``` + */ + get(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + * @see \`{@link https://api.jquery.com/jQuery.getJSON/ }\` + * @since 1.0 + */ + getJSON(url: string, + data: JQuery.PlainObject | string, + success: JQuery.jqXHR.DoneCallback): JQuery.jqXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * @param url A string containing the URL to which the request is sent. + * @param success_data _@param_ `url_settings` + *
      + * * `success` — A callback function that is executed if the request succeeds.
      + * * `data` — A plain object or string that is sent to the server with the request. + * @see \`{@link https://api.jquery.com/jQuery.getJSON/ }\` + * @since 1.0 + * @example ​ ````Loads the four most recent pictures of Mount Rainier from the Flickr JSONP API. +```html + + + + + jQuery.getJSON demo + + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Load the JSON data from test.js and access a name from the returned JSON data. +```javascript +$.getJSON( "test.js", function( json ) { + console.log( "JSON Data: " + json.users[ 3 ].name ); + }); + ``` + * @example ​ ````Load the JSON data from test.js, passing along additional data, and access a name from the returned JSON data. + If an error occurs, log an error message instead. +```javascript +$.getJSON( "test.js", { name: "John", time: "2pm" } ) + .done(function( json ) { + console.log( "JSON Data: " + json.users[ 3 ].name ); + }) + .fail(function( jqxhr, textStatus, error ) { + var err = textStatus + ", " + error; + console.log( "Request Failed: " + err ); +}); +``` + */ + getJSON(url: string, + success_data?: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; + /** + * Load a JavaScript file from the server using a GET HTTP request, then execute it. + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + * @see \`{@link https://api.jquery.com/jQuery.getScript/ }\` + * @since 1.0 + * @example ​ ````Define a $.cachedScript() method that allows fetching a cached script: +```javascript +jQuery.cachedScript = function( url, options ) { +​ + // Allow user to set any option except for dataType, cache, and url + options = $.extend( options || {}, { + dataType: "script", + cache: true, + url: url + }); +​ + // Use $.ajax() since it is more flexible than $.getScript + // Return the jqXHR object so we can chain callbacks + return jQuery.ajax( options ); +}; +​ +// Usage +$.cachedScript( "ajax/test.js" ).done(function( script, textStatus ) { + console.log( textStatus ); +}); +``` + * @example ​ ````Load the official jQuery Color Animation plugin dynamically and bind some color animations to occur once the new functionality is loaded. +```html + + + + + jQuery.getScript demo + + + + +​ + +
      +​ + +​ + + +``` + */ + getScript(url: string, + success?: JQuery.jqXHR.DoneCallback): JQuery.jqXHR; + /** + * Load a JavaScript file from the server using a GET HTTP request, then execute it. + * @see \`{@link https://api.jquery.com/jQuery.getScript/ }\` + * @since 1.12 + * @since 2.2 + */ + getScript(options: JQuery.UrlAjaxSettings): JQuery.jqXHR; + /** + * Execute some JavaScript code globally. + * @param code The JavaScript code to execute. + * @see \`{@link https://api.jquery.com/jQuery.globalEval/ }\` + * @since 1.0.4 + * @example ​ ````Execute a script in the global context. +```javascript +function test() { + jQuery.globalEval( "var newVar = true;" ) +} +test(); +// newVar === true +``` + */ + globalEval(code: string): void; + /** + * Finds the elements of an array which satisfy a filter function. The original array is not affected. + * @param array The array-like object to search through. + * @param funÑtion The function to process each item against. The first argument to the function is the item, and the + * second argument is the index. The function should return a Boolean value. `this` will be the global + * window object. + * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements + * for which "callback" returns true. If "invert" is true, then the function returns an array + * consisting of all elements for which "callback" returns false. + * @see \`{@link https://api.jquery.com/jQuery.grep/ }\` + * @since 1.0 + * @example ​ ````Filters the original array of numbers leaving that are not 5 and have an index greater than 4. Then it removes all 9s. +```html + + + + + jQuery.grep demo + + + + +​ +
      +

      + +​ + +​ + + +``` + * @example ​ ````Filter an array of numbers to include only numbers bigger then zero. +```javascript +$.grep( [ 0, 1, 2 ], function( n, i ) { + return n > 0; +}); +``` + * @example ​ ````Filter an array of numbers to include numbers that are not bigger than zero. +```javascript +$.grep( [ 0, 1, 2 ], function( n, i ) { + return n > 0; +}, true ); +``` + */ + grep(array: ArrayLike, + funÑtion: (elementOfArray: T, indexInArray: number) => boolean, + invert?: boolean): T[]; + /** + * Determine whether an element has any jQuery data associated with it. + * @param element A DOM element to be checked for data. + * @see \`{@link https://api.jquery.com/jQuery.hasData/ }\` + * @since 1.5 + * @example ​ ````Set data on an element and see the results of hasData. +```html + + + + + jQuery.hasData demo + + + +​ +

      Results:

      +​ + +​ + + +``` + */ + hasData(element: Element | Document | Window | JQuery.PlainObject): boolean; + /** + * Holds or releases the execution of jQuery's ready event. + * @param hold Indicates whether the ready hold is being requested or released + * @see \`{@link https://api.jquery.com/jQuery.holdReady/ }\` + * @since 1.6 + * @deprecated ​ Deprecated since 3.2. See \`{@link https://github.com/jquery/jquery/issues/3288 }\`. + * + * **Cause**: The `jQuery.holdReady()` method has been deprecated due to its detrimental effect on the global performance of the page. This method can prevent all the code on the page from initializing for extended lengths of time. + * + * **Solution**: Rewrite the page so that it does not require all jQuery ready handlers to be delayed. This might be accomplished, for example, by late-loading only the code that requires the delay when it is safe to run. Due to the complexity of this method, jQuery Migrate does not attempt to fill the functionality. If the underlying version of jQuery used with jQuery Migrate no longer contains `jQuery.holdReady()` the code will fail shortly after this warning appears. + * @example ​ ````Delay the ready event until a custom plugin has loaded. +```javascript +$.holdReady( true ); +$.getScript( "myplugin.js", function() { + $.holdReady( false ); +}); +``` + */ + holdReady(hold: boolean): void; + /** + * Modify and filter HTML strings passed through jQuery manipulation methods. + * @param html The HTML string on which to operate. + * @see \`{@link https://api.jquery.com/jQuery.htmlPrefilter/ }\` + * @since 1.12 + * @since 2.2 + */ + htmlPrefilter(html: JQuery.htmlString): JQuery.htmlString; + /** + * Search for a specified value within an array and return its index (or -1 if not found). + * @param value The value to search for. + * @param array An array through which to search. + * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array. + * @see \`{@link https://api.jquery.com/jQuery.inArray/ }\` + * @since 1.2 + * @example ​ ````Report the index of some elements in the array. +```html + + + + + jQuery.inArray demo + + + + +​ +
      "John" found at
      +
      4 found at
      +
      "Karl" not found, so
      +
      "Pete" is in the array, but not at or after index 2, so
      +​ + +​ + + +``` + */ + inArray(value: T, array: T[], fromIndex?: number): number; + /** + * Determine whether the argument is an array. + * @param obj Object to test whether or not it is an array. + * @see \`{@link https://api.jquery.com/jQuery.isArray/ }\` + * @since 1.3 + * @deprecated ​ Deprecated since 3.2. Use \`{@link ArrayConstructor.isArray Array.isArray}\`. + * @example ​ ````Finds out if the parameter is an array. +```html + + + + + jQuery.isArray demo + + + +​ +Is [] an Array? +​ + +​ + + +``` + */ + isArray(obj: any): obj is any[]; + /** + * Check to see if an object is empty (contains no enumerable properties). + * @param obj The object that will be checked to see if it's empty. + * @see \`{@link https://api.jquery.com/jQuery.isEmptyObject/ }\` + * @since 1.4 + * @example ​ ````Check an object to see if it's empty. +```javascript +jQuery.isEmptyObject({}); // true +jQuery.isEmptyObject({ foo: "bar" }); // false +``` + */ + isEmptyObject(obj: any): boolean; + /** + * Determine if the argument passed is a JavaScript function object. + * @param obj Object to test whether or not it is a function. + * @see \`{@link https://api.jquery.com/jQuery.isFunction/ }\` + * @since 1.2 + * @deprecated ​ Deprecated since 3.3. Use `typeof x === "function"`. + * @example ​ ````Test a few parameter examples. +```html + + + + + jQuery.isFunction demo + + + + +​ +
      jQuery.isFunction( objs[ 0 ] ) =
      +
      jQuery.isFunction( objs[ 1 ] ) =
      +
      jQuery.isFunction( objs[ 2 ] ) =
      +
      jQuery.isFunction( objs[ 3 ] ) =
      +
      jQuery.isFunction( objs[ 4 ] ) =
      +​ + +​ + + +``` + * @example ​ ````Finds out if the parameter is a function. +```javascript +$.isFunction(function() {}); +``` + */ + // tslint:disable-next-line:ban-types + isFunction(obj: any): obj is Function; + /** + * Determines whether its argument represents a JavaScript number. + * @param value The value to be tested. + * @see \`{@link https://api.jquery.com/jQuery.isNumeric/ }\` + * @since 1.7 + * @deprecated ​ Deprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/2960 }\`. + * @example ​ ````Sample return values of $.isNumeric with various inputs. +```javascript +// true (numeric) +$.isNumeric( "-10" ) +$.isNumeric( "0" ) +$.isNumeric( 0xFF ) +$.isNumeric( "0xFF" ) +$.isNumeric( "8e5" ) +$.isNumeric( "3.1415" ) +$.isNumeric( +10 ) +$.isNumeric( 0144 ) +​ +// false (non-numeric) +$.isNumeric( "-0x42" ) +$.isNumeric( "7.2acdgs" ) +$.isNumeric( "" ) +$.isNumeric( {} ) +$.isNumeric( NaN ) +$.isNumeric( null ) +$.isNumeric( true ) +$.isNumeric( Infinity ) +$.isNumeric( undefined ) +``` + */ + isNumeric(value: any): boolean; + /** + * Check to see if an object is a plain object (created using "{}" or "new Object"). + * @param obj The object that will be checked to see if it's a plain object. + * @see \`{@link https://api.jquery.com/jQuery.isPlainObject/ }\` + * @since 1.4 + * @example ​ ````Check an object to see if it's a plain object. +```javascript +jQuery.isPlainObject({}) // true +jQuery.isPlainObject( "test" ) // false +``` + */ + isPlainObject(obj: any): boolean; + /** + * Determine whether the argument is a window. + * @param obj Object to test whether or not it is a window. + * @see \`{@link https://api.jquery.com/jQuery.isWindow/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/3629 }\`. + * + * **Cause**: This method returns `true` if its argument is thought to be a `window` element. It was created for internal use and is not a reliable way of detecting `window` for public needs. + * + * **Solution**: Remove any use of `jQuery.isWindow()` from code. If it is truly needed it can be replaced with a check for `obj != null && obj === obj.window` which was the test used inside this method. + * @example ​ ````Finds out if the parameter is a window. +```html + + + + + jQuery.isWindow demo + + + +​ +Is 'window' a window? +​ + +​ + + +``` + */ + isWindow(obj: any): obj is Window; + /** + * Check to see if a DOM node is within an XML document (or is an XML document). + * @param node The DOM node that will be checked to see if it's in an XML document. + * @see \`{@link https://api.jquery.com/jQuery.isXMLDoc/ }\` + * @since 1.1.4 + * @example ​ ````Check an object to see if it's in an XML document. +```javascript +jQuery.isXMLDoc( document ) // false +jQuery.isXMLDoc( document.body ) // false +``` + */ + isXMLDoc(node: Node): boolean; + /** + * Convert an array-like object into a true JavaScript array. + * @param obj Any object to turn into a native Array. + * @see \`{@link https://api.jquery.com/jQuery.makeArray/ }\` + * @since 1.2 + * @example ​ ````Turn a collection of HTMLElements into an Array of them. +```html + + + + + jQuery.makeArray demo + + + + +​ +
      First
      +
      Second
      +
      Third
      +
      Fourth
      +​ + +​ + + +``` + * @example ​ ````Turn a jQuery object into an array +```javascript +var obj = $( "li" ); +var arr = $.makeArray( obj ); +``` + */ + makeArray(obj: ArrayLike): T[]; + /** + * Translate all items in an array or object to new array of items. + * @param array The Array to translate. + * @param callback The function to process each item against. The first argument to the function is the array item, the + * second argument is the index in array The function can return any value. A returned array will be + * flattened into the resulting array. Within the function, this refers to the global (window) object. + * @see \`{@link https://api.jquery.com/jQuery.map/ }\` + * @since 1.0 + * @example ​ ````Use $.map() to change the values of an array. +```html + + + + + jQuery.map demo + + + + +​ +
      +

      + +​ + +​ + + +``` + * @example ​ ````Map the original array to a new one and add 4 to each value. +```javascript +$.map( [ 0, 1, 2 ], function( n ) { + return n + 4; +}); +``` + * @example ​ ````Map the original array to a new one, adding 1 to each value if it is bigger then zero and removing it if not. +```javascript +$.map( [ 0, 1, 2 ], function( n ) { + return n > 0 ? n + 1 : null; +}); +``` + * @example ​ ````Map the original array to a new one; each element is added with its original value and the value plus one. +```javascript +$.map( [ 0, 1, 2 ], function( n ) { + return [ n, n + 1 ]; +}); +``` + * @example ​ ````Map the original array to a new one; each element is squared. +```javascript +$.map( [ 0, 1, 2, 3 ], function( a ) { + return a * a; +}); +``` + * @example ​ ````Map the original array to a new one, removing numbers less than 50 by returning null and subtracting 45 from the rest. +```javascript +$.map( [ 0, 1, 52, 97 ], function( a ) { + return (a > 50 ? a - 45 : null); +}); +``` + * @example ​ ````Augment the resulting array by returning an array inside the function. +```javascript +var array = [ 0, 1, 52, 97 ]; +array = $.map( array, function( a, index ) { + return [ a - 45, index ]; +}); +``` + */ + map(array: T[], callback: (this: Window, elementOfArray: T, indexInArray: number) => JQuery.TypeOrArray | null | undefined): TReturn[]; + /** + * Translate all items in an array or object to new array of items. + * @param obj The Object to translate. + * @param callback The function to process each item against. The first argument to the function is the value; the + * second argument is the key of the object property. The function can return any value to add to the + * array. A returned array will be flattened into the resulting array. Within the function, this refers + * to the global (window) object. + * @see \`{@link https://api.jquery.com/jQuery.map/ }\` + * @since 1.6 + * @example ​ ````Map the original object to a new array and double each value. +```javascript +var dimensions = { width: 10, height: 15, length: 20 }; +dimensions = $.map( dimensions, function( value, index ) { + return value * 2; +}); +``` + * @example ​ ````Map an object's keys to an array. +```javascript +var dimensions = { width: 10, height: 15, length: 20 }; +var keys = $.map( dimensions, function( value, key ) { + return key; +}); +``` + */ + map(obj: T, callback: (this: Window, propertyOfObject: T[K], key: K) => JQuery.TypeOrArray | null | undefined): TReturn[]; + /** + * Merge the contents of two arrays together into the first array. + * @param first The first array-like object to merge, the elements of second added. + * @param second The second array-like object to merge into the first, unaltered. + * @see \`{@link https://api.jquery.com/jQuery.merge/ }\` + * @since 1.0 + * @example ​ ````Merges two arrays, altering the first argument. +```javascript +$.merge( [ 0, 1, 2 ], [ 2, 3, 4 ] ) +``` + * @example ​ ````Merges two arrays, altering the first argument. +```javascript +$.merge( [ 3, 2, 1 ], [ 4, 3, 2 ] ) +``` + * @example ​ ````Merges two arrays, but uses a copy, so the original isn't altered. +```javascript +var first = [ "a", "b", "c" ]; +var second = [ "d", "e", "f" ]; +$.merge( $.merge( [], first ), second ); +``` + */ + merge(first: ArrayLike, second: ArrayLike): Array; + /** + * Relinquish jQuery's control of the $ variable. + * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). + * @see \`{@link https://api.jquery.com/jQuery.noConflict/ }\` + * @since 1.0 + * @example ​ ````Map the original object that was referenced by $ back to $. +```javascript +jQuery.noConflict(); +// Do something with jQuery +jQuery( "div p" ).hide(); +// Do something with another library's $() +$( "content" ).style.display = "none"; +``` + * @example ​ ````Revert the $ alias and then create and execute a function to provide the $ as a jQuery alias inside the function's scope. Inside the function the original $ object is not available. This works well for most plugins that don't rely on any other library. +```javascript +jQuery.noConflict(); +(function( $ ) { + $(function() { + // More code using $ as alias to jQuery + }); +})(jQuery); +​ +// Other code using $ as an alias to the other library +``` + * @example ​ ````Create a different alias instead of jQuery to use in the rest of the script. +```javascript +var j = jQuery.noConflict(); +​ +// Do something with jQuery +j( "div p" ).hide(); +​ +// Do something with another library's $() +$( "content" ).style.display = "none"; +``` + * @example ​ ````Completely move jQuery to a new namespace in another object. +```javascript +var dom = {}; +dom.query = jQuery.noConflict( true ); +``` + * @example ​ ````Load two versions of jQuery (not recommended). Then, restore jQuery's globally scoped variables to the first loaded jQuery. +```html + + + + + jQuery.noConflict demo + + + +​ +
      +

      Before $.noConflict(true)

      +
      + +​ + +​ + + +``` + */ + noConflict(removeAll?: boolean): this; + /** + * @deprecated ​ Deprecated since 3.2. + * + * **Cause**: This public but never-documented method has been deprecated as of jQuery 3.2.0. + * + * **Solution**: Replace calls such as `jQuery.nodeName( elem, "div" )` with a test such as `elem.nodeName.toLowerCase() === "div"`. + */ + nodeName(elem: Node, name: string): boolean; + /** + * An empty function. + * @see \`{@link https://api.jquery.com/jQuery.noop/ }\` + * @since 1.4 + */ + noop(): undefined; + /** + * Return a number representing the current time. + * @see \`{@link https://api.jquery.com/jQuery.now/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.3. Use \`{@link DateConstructor.now Date.now}\`. + */ + now(): number; + /** + * Create a serialized representation of an array, a plain object, or a jQuery object suitable for use in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input elements with name/value properties. + * @param obj An array, a plain object, or a jQuery object to serialize. + * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. + * @see \`{@link https://api.jquery.com/jQuery.param/ }\` + * @since 1.2 + * @since 1.4 + * @example ​ ````Serialize a key/value object. +```html + + + + + jQuery.param demo + + + + +​ +
      +​ + +​ + + +``` + * @example ​ ````Serialize a few complex objects +```html + + + + + jQuery.param demo + + + + +​​ + +​ + + +``` + */ + param(obj: any[] | JQuery.PlainObject | JQuery, traditional?: boolean): string; + /** + * Parses a string into an array of DOM nodes. + * @param data HTML string to be parsed + * @param context Document element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + * @see \`{@link https://api.jquery.com/jQuery.parseHTML/ }\` + * @since 1.8 + */ + parseHTML(data: string, context: Document | null | undefined, keepScripts: boolean): JQuery.Node[]; + /** + * Parses a string into an array of DOM nodes. + * @param data HTML string to be parsed + * @param context_keepScripts _@param_ `context_keepScripts` + *
      + * * `context` — Document element to serve as the context in which the HTML fragment will be created
      + * * `keepScripts` — A Boolean indicating whether to include scripts passed in the HTML string + * @see \`{@link https://api.jquery.com/jQuery.parseHTML/ }\` + * @since 1.8 + * @example ​ ````Create an array of DOM nodes using an HTML string and insert it into a div. +```html + + + + + jQuery.parseHTML demo + + + +​ +
      +

      Content:

      +
      +​ + +​ + + +``` + */ + parseHTML(data: string, context_keepScripts?: Document | null | boolean): JQuery.Node[]; + /** + * Takes a well-formed JSON string and returns the resulting JavaScript value. + * @param json The JSON string to parse. + * @see \`{@link https://api.jquery.com/jQuery.parseJSON/ }\` + * @since 1.4.1 + * @deprecated ​ Deprecated since 3.0. Use \`{@link JSON.parse }\`. + * + * **Cause**: The `jQuery.parseJSON` method in recent jQuery is identical to the native `JSON.parse`. As of jQuery 3.0 `jQuery.parseJSON` is deprecated. + * + * **Solution**: Replace any use of `jQuery.parseJSON` with `JSON.parse`. + * @example ​ ````Parse a JSON string. +```javascript +var obj = jQuery.parseJSON( '{ "name": "John" }' ); +alert( obj.name === "John" ); +``` + */ + parseJSON(json: string): any; + /** + * Parses a string into an XML document. + * @param data a well-formed XML string to be parsed + * @see \`{@link https://api.jquery.com/jQuery.parseXML/ }\` + * @since 1.5 + * @example ​ ````Create a jQuery object using an XML string and obtain the value of the title node. +```html + + + + + jQuery.parseXML demo + + + +​ +

      +

      +​ + +​ + + +``` + */ + parseXML(data: string): XMLDocument; + /** + * Load data from the server using a HTTP POST request. + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but + * can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see \`{@link https://api.jquery.com/jQuery.post/ }\` + * @since 1.0 + * @example ​ ````Post to the test.php page and get content which has been returned in json format (<?php echo json_encode(array("name"=>"John","time"=>"2pm")); ?>). +```javascript +$.post( "test.php", { func: "getNameAndTime" }, function( data ) { + console.log( data.name ); // John + console.log( data.time ); // 2pm +}, "json"); +``` + */ + post(url: string, + data: JQuery.PlainObject | string, + success: JQuery.jqXHR.DoneCallback | null, + dataType?: string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP POST request. + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but + * can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + * @see \`{@link https://api.jquery.com/jQuery.post/ }\` + * @since 1.0 + */ + post(url: string, + success: JQuery.jqXHR.DoneCallback | null, + dataType: string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP POST request. + * @param url A string containing the URL to which the request is sent. + * @param success_data _@param_ `success_data` + *
      + * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided, + * but can be `null` in that case.
      + * * `data` — A plain object or string that is sent to the server with the request. + * @see \`{@link https://api.jquery.com/jQuery.post/ }\` + * @since 1.0 + * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results). +```javascript +$.post( "test.php", { name: "John", time: "2pm" } ); +``` + * @example ​ ````Pass arrays of data to the server (while still ignoring the return results). +```javascript +$.post( "test.php", { 'choices[]': [ "Jon", "Susan" ] } ); +``` + * @example ​ ````Send form data using Ajax requests +```javascript +$.post( "test.php", $( "#testform" ).serialize() ); +``` + * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned). +```javascript +$.post( "test.php", function( data ) { + alert( "Data Loaded: " + data ); +}); +``` + * @example ​ ````Alert the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned). +```javascript +$.post( "test.php", { name: "John", time: "2pm" }) + .done(function( data ) { + alert( "Data Loaded: " + data ); + }); +``` + * @example ​ ````Post a form using Ajax and put results in a div +```html + + + + + jQuery.post demo + + + +​ +
      + + +
      + +
      +​ + +​ + + +``` + */ + post(url: string, + success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; + /** + * Load data from the server using a HTTP POST request. + * @param url_settings _@param_ `url_settings` + *
      + * * `url` — A string containing the URL to which the request is sent.
      + * * `settings` — A set of key/value pairs that configure the Ajax request. All properties except for `url` are optional. + * A default can be set for any option with \`{@link ajaxSetup $.ajaxSetup()}\`. See \`{@link https://api.jquery.com/jquery.ajax/#jQuery-ajax-settings jQuery.ajax( settings )}\` + * for a complete list of all settings. Type will automatically be set to `POST`. + * @see \`{@link https://api.jquery.com/jQuery.post/ }\` + * @since 1.0 + * @since 1.12 + * @since 2.2 + * @example ​ ````Request the test.php page, but ignore the return results. +```javascript +$.post( "test.php" ); +``` + */ + post(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR; + + // region proxy + // #region proxy + + // region (funÑtion, null | undefined) + // #region (funÑtion, null | undefined) + + // region 0 to 7 additional arguments + // #region 0 to 7 additional arguments + + // region 0 parameters + // #region 0 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C) => TReturn, + context: null | undefined, + a: A, b: B, c: C): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B) => TReturn, + context: null | undefined, + a: A, b: B): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A) => TReturn, + context: null | undefined, + a: A): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: () => TReturn, + context: null | undefined): () => TReturn; + + // #endregion + + // region 1 parameters + // #region 1 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T) => TReturn, + context: null | undefined, + a: A, b: B): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T) => TReturn, + context: null | undefined, + a: A): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T) => TReturn, + context: null | undefined): (t: T) => TReturn; + + // #endregion + + // region 2 parameters + // #region 2 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T, u: U) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T, u: U) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T, u: U) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T, u: U) => TReturn, + context: null | undefined, + a: A, b: B): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T, u: U) => TReturn, + context: null | undefined, + a: A): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T, u: U) => TReturn, + context: null | undefined): (t: T, u: U) => TReturn; + + // #endregion + + // region 3 parameters + // #region 3 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A, b: B): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T, u: U, v: V) => TReturn, + context: null | undefined, + a: A): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T, u: U, v: V) => TReturn, + context: null | undefined): (t: T, u: U, v: V) => TReturn; + + // #endregion + + // region 4 parameters + // #region 4 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A, b: B): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined, + a: A): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T, u: U, v: V, w: W) => TReturn, + context: null | undefined): (t: T, u: U, v: V, w: W) => TReturn; + + // #endregion + + // region 5 parameters + // #region 5 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A, b: B): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined, + a: A): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T, u: U, v: V, w: W, x: X) => TReturn, + context: null | undefined): (t: T, u: U, v: V, w: W, x: X) => TReturn; + + // #endregion + + // region 6 parameters + // #region 6 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined, + a: A): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + + // #endregion + + // region 7+ parameters + // #region 7+ parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, c: C, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, b: B, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (a: A, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined, + a: A): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + + // #endregion + + // #endregion + + // region 8+ additional arguments + // #region 8+ additional arguments + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.9 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + */ + proxy(funÑtion: (...args: any[]) => TReturn, + context: null | undefined, + ...additionalArguments: any[]): (...args: any[]) => TReturn; + + // #endregion + + // #endregion + + // region (funÑtion, context) + // #region (funÑtion, context) + + // region 0 to 7 additional arguments + // #region 0 to 7 additional arguments + + // region 0 parameters + // #region 0 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C) => TReturn, + context: TContext, + a: A, b: B, c: C): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B) => TReturn, + context: TContext, + a: A, b: B): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4` + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A) => TReturn, + context: TContext, + a: A): () => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext) => TReturn, + context: TContext): () => TReturn; + + // #endregion + + // region 1 parameters + // #region 1 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T) => TReturn, + context: TContext, + a: A, b: B): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T) => TReturn, + context: TContext, + a: A): (t: T) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T) => TReturn, + context: TContext): (t: T) => TReturn; + + // #endregion + + // region 2 parameters + // #region 2 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T, u: U) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T, u: U) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T, u: U) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T, u: U) => TReturn, + context: TContext, + a: A, b: B): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T, u: U) => TReturn, + context: TContext, + a: A): (t: T, u: U) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T, u: U) => TReturn, + context: TContext): (t: T, u: U) => TReturn; + + // #endregion + + // region 3 parameters + // #region 3 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A, b: B): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T, u: U, v: V) => TReturn, + context: TContext, + a: A): (t: T, u: U, v: V) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T, u: U, v: V) => TReturn, + context: TContext): (t: T, u: U, v: V) => TReturn; + + // #endregion + + // region 4 parameters + // #region 4 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A, b: B): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T, u: U, v: V, w: W) => TReturn, + context: TContext, + a: A): (t: T, u: U, v: V, w: W) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T, u: U, v: V, w: W) => TReturn, + context: TContext): (t: T, u: U, v: V, w: W) => TReturn; + + // #endregion + + // region 5 parameters + // #region 5 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A, b: B): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext, + a: A): (t: T, u: U, v: V, w: W, x: X) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn, + context: TContext): (t: T, u: U, v: V, w: W, x: X) => TReturn; + + // #endregion + + // region 6 parameters + // #region 6 parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext, + a: A): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, + context: TContext): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; + + // #endregion + + // region 7+ parameters + // #region 7+ parameters + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @param g An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @param f An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @param e An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @param d An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, d: D, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @param c An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, c: C, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @param b An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, b: B, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param a An argument to be passed to the function referenced in the `function` argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, a: A, + t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext, + a: A): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, + context: TContext): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; + + // #endregion + + // #endregion + + // region 8+ additional arguments + // #region 8+ additional arguments + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param funÑtion The function whose context will be changed. + * @param context The object to which the context (`this`) of the function should be set. + * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + * @example ​ ````Change the context of a function bound to the click handler, +```html + + + + + jQuery.proxy demo + + + +​ +

      +
      +​ + +​ + + +``` + */ + proxy(funÑtion: (this: TContext, ...args: any[]) => TReturn, + context: TContext, + ...additionalArguments: any[]): (...args: any[]) => TReturn; + + // #endregion + + // #endregion + + // region (context, name) + // #region (context, name) + + /** + * Takes a function and returns a new one that will always have a particular context. + * @param context The object to which the context of the function should be set. + * @param name The name of the function whose context will be changed (should be a property of the context object). + * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. + * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` + * @since 1.4 + * @since 1.6 + * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`. + * @example ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the handler after first click. +```html + + + + + jQuery.proxy demo + + + +​ +

      +

      +​ + +​ + + +``` + */ + proxy(context: TContext, + name: keyof TContext, + ...additionalArguments: any[]): (...args: any[]) => any; + + // #endregion + + // #endregion + + /** + * Manipulate the queue of functions to be executed on the matched element. + * @param element A DOM element where the array of queued functions is attached. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue The new function to add to the queue. + * An array of functions to replace the current queue contents. + * @see \`{@link https://api.jquery.com/jQuery.queue/ }\` + * @since 1.3 + * @example ​ ````Show the length of the queue. +```html + + + + + jQuery.queue demo + + + + +​ + + +
      + ​ + +​ + + +``` + * @example ​ ````Queue a custom function. +```html + + + + + jQuery.queue demo + + + + +​ +Click here... +
      +​ + +​ + + +``` + * @example ​ ````Set a queue array to delete the queue. +```html + + + + + jQuery.queue demo + + + + +​ + + +
      +​ + +​ + + +``` + */ + queue(element: T, queueName?: string, newQueue?: JQuery.TypeOrArray>): JQuery.Queue; + /** + * Handles errors thrown synchronously in functions wrapped in jQuery(). + * @param error An error thrown in the function wrapped in jQuery(). + * @see \`{@link https://api.jquery.com/jQuery.readyException/ }\` + * @since 3.1 + * @example ​ ````Pass the received error to console.error. +```javascript +jQuery.readyException = function( error ) { + console.error( error ); +}; +``` + */ + readyException(error: Error): any; + /** + * Remove a previously-stored piece of data. + * @param element A DOM element from which to remove data. + * @param name A string naming the piece of data to remove. + * @see \`{@link https://api.jquery.com/jQuery.removeData/ }\` + * @since 1.2.3 + * @example ​ ````Set a data store for 2 names then remove one of them. +```html + + + + + jQuery.removeData demo + + + + +​ +
      value1 before creation:
      +
      value1 after creation:
      +
      value1 after removal:
      +
      value2 after removal:
      +​ + +​ + + +``` + */ + removeData(element: Element | Document | Window | JQuery.PlainObject, name?: string): void; + /** + * Creates an object containing a set of properties ready to be used in the definition of custom animations. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/jQuery.speed/ }\` + * @since 1.1 + */ + speed(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): JQuery.EffectsOptions; + /** + * Creates an object containing a set of properties ready to be used in the definition of custom animations. + * @param duration A string or number determining how long the animation will run. + * @param easing_complete _@param_ `easing_complete` + *
      + * * `easing` — A string indicating which easing function to use for the transition.
      + * * `complete` — A function to call once the animation is complete, called once per matched element. + * @see \`{@link https://api.jquery.com/jQuery.speed/ }\` + * @since 1.0 + * @since 1.1 + */ + speed(duration: JQuery.Duration, + easing_complete: string | ((this: TElement) => void)): JQuery.EffectsOptions; + /** + * Creates an object containing a set of properties ready to be used in the definition of custom animations. + * @param duration_complete_settings _@param_ `duration_complete_settings` + *
      + * * `duration` — A string or number determining how long the animation will run.
      + * * `complete` — A function to call once the animation is complete, called once per matched element.
      + * * `settings` — + * @see \`{@link https://api.jquery.com/jQuery.speed/ }\` + * @since 1.0 + * @since 1.1 + */ + speed(duration_complete_settings?: JQuery.Duration | ((this: TElement) => void) | JQuery.SpeedSettings): JQuery.EffectsOptions; + /** + * Remove the whitespace from the beginning and end of a string. + * @param str The string to trim. + * @see \`{@link https://api.jquery.com/jQuery.trim/ }\` + * @since 1.0 + * @example ​ ````Remove the white spaces at the start and at the end of the string. +```html + + + + + jQuery.trim demo + + + +​ +
      
      +
      
      +​
      +
      +​
      +
      +
      +```
      +     * @example ​ ````Remove the white spaces at the start and at the end of the string.
      +```javascript
      +$.trim("    hello, how are you?    ");
      +```
      +     * @example ​ ````Remove the white spaces at the start and at the end of the string.
      +```javascript
      +$.trim("    hello, how are you?    ");
      +```
      +     */
      +    trim(str: string): string;
      +    /**
      +     * Determine the internal JavaScript [[Class]] of an object.
      +     * @param obj Object to get the internal JavaScript [[Class]] of.
      +     * @see \`{@link https://api.jquery.com/jQuery.type/ }\`
      +     * @since 1.4.3
      +     * @deprecated ​ Deprecated since 3.3. See \`{@link https://github.com/jquery/jquery/issues/3605 }\`.
      +     * @example ​ ````Find out if the parameter is a RegExp.
      +```html
      +
      +
      +
      +  
      +  jQuery.type demo
      +  
      +
      +
      +​
      +Is it a RegExp? 
      +​
      +
      +​
      +
      +
      +```
      +     */
      +    type(obj: any): 'array' | 'boolean' | 'date' | 'error' | 'function' | 'null' | 'number' | 'object' | 'regexp' | 'string' | 'symbol' | 'undefined';
      +    /**
      +     * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers.
      +     * @param array The Array of DOM elements.
      +     * @see \`{@link https://api.jquery.com/jQuery.unique/ }\`
      +     * @since 1.1.3
      +     * @deprecated ​ Deprecated since 3.0. Use \`{@link uniqueSort }\`.
      +     *
      +     * **Cause**: The fact that `jQuery.unique` sorted its results in DOM order was surprising to many who did not read the documentation carefully. As of jQuery 3.0 this function is being renamed to make it clear.
      +     *
      +     * **Solution**: Replace all uses of `jQuery.unique` with `jQuery.uniqueSort` which is the same function with a better name.
      +     * @example ​ ````Removes any duplicate elements from the array of divs.
      +```html
      +
      +
      +
      +  
      +  jQuery.unique demo
      +  
      +  
      +
      +
      +​
      +
      There are 6 divs in this document.
      +
      +
      +
      +
      +
      +​ + +​ + + +``` + */ + unique(array: T[]): T[]; + /** + * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. + * @param array The Array of DOM elements. + * @see \`{@link https://api.jquery.com/jQuery.uniqueSort/ }\` + * @since 1.12 + * @since 2.2 + * @example ​ ````Removes any duplicate elements from the array of divs. +```html + + + + + jQuery.uniqueSort demo + + + + +​ +
      There are 6 divs in this document.
      +
      +
      +
      +
      +
      +​ + +​ + + +``` + */ + uniqueSort(array: T[]): T[]; + /** + * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events. + * @see \`{@link https://api.jquery.com/jQuery.when/ }\` + * @since 1.5 + * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) { + // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively. + // Each argument is an array with the following structure: [ data, statusText, jqXHR ] + var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It" + if ( /Whip It/.test( data ) ) { + alert( "We got what we came for!" ); + } +}); +``` + * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ) + .then( myFunc, myFailure ); +``` + */ + when( + deferredT: JQuery.Promise | JQuery.Thenable | TR1, + deferredU: JQuery.Promise | JQuery.Thenable | UR1, + deferredV: JQuery.Promise | JQuery.Thenable | VR1, + ): JQuery.Promise3< + TR1, TJ1, never, + UR1, UJ1, never, + VR1, VJ1, never>; + /** + * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events. + * @see \`{@link https://api.jquery.com/jQuery.when/ }\` + * @since 1.5 + * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) { + // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively. + // Each argument is an array with the following structure: [ data, statusText, jqXHR ] + var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It" + if ( /Whip It/.test( data ) ) { + alert( "We got what we came for!" ); + } +}); +``` + * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ) + .then( myFunc, myFailure ); +``` + */ + when( + deferredT: JQuery.Promise | JQuery.Thenable | TR1, + deferredU: JQuery.Promise | JQuery.Thenable | UR1, + ): JQuery.Promise2< + TR1, TJ1, never, + UR1, UJ1, never>; + /** + * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events. + * @see \`{@link https://api.jquery.com/jQuery.when/ }\` + * @since 1.5 + * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) { + // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively. + // Each argument is an array with the following structure: [ data, statusText, jqXHR ] + var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It" + if ( /Whip It/.test( data ) ) { + alert( "We got what we came for!" ); + } +}); +``` + * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ) + .then( myFunc, myFailure ); +``` + */ + when( + deferredT: JQuery.Promise3 | + JQuery.Promise2 + ): JQuery.Promise3< + TR1, TJ1, never, + TR2, TJ2, never, + TR3, TJ3, never>; + /** + * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events. + * @see \`{@link https://api.jquery.com/jQuery.when/ }\` + * @since 1.5 + * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) { + // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively. + // Each argument is an array with the following structure: [ data, statusText, jqXHR ] + var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It" + if ( /Whip It/.test( data ) ) { + alert( "We got what we came for!" ); + } +}); +``` + * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ) + .then( myFunc, myFailure ); +``` + */ + when(deferred: JQuery.Promise | JQuery.Thenable | TR1): JQuery.Promise; + /** + * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events. + * @param deferreds Zero or more Thenable objects. + * @see \`{@link https://api.jquery.com/jQuery.when/ }\` + * @since 1.5 + * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) { + // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively. + // Each argument is an array with the following structure: [ data, statusText, jqXHR ] + var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It" + if ( /Whip It/.test( data ) ) { + alert( "We got what we came for!" ); + } +}); +``` + * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ) + .then( myFunc, myFailure ); +``` + */ + when(...deferreds: Array | JQuery.Thenable | TR1>): JQuery.Promise; + /** + * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events. + * @param deferreds Zero or more Thenable objects. + * @see \`{@link https://api.jquery.com/jQuery.when/ }\` + * @since 1.5 + * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) { + // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively. + // Each argument is an array with the following structure: [ data, statusText, jqXHR ] + var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It" + if ( /Whip It/.test( data ) ) { + alert( "We got what we came for!" ); + } +}); +``` + * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. +```javascript +$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ) + .then( myFunc, myFailure ); +``` + */ + when(...deferreds: any[]): JQuery.Promise; +} diff --git a/types/jquery/dist/jquery.slim.d.ts b/types/jquery/dist/jquery.slim.d.ts new file mode 100644 index 0000000000..bdd21a7523 --- /dev/null +++ b/types/jquery/dist/jquery.slim.d.ts @@ -0,0 +1,3 @@ +/// + +export = jQuery; diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index 45eae24d5d..2d4171320b 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -25,8424 +25,10 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -declare module 'jquery' { - export = jQuery; -} +/// +/// +/// +/// +/// -declare module 'jquery/dist/jquery.slim' { - export = jQuery; -} - -declare const jQuery: JQueryStatic; -declare const $: JQueryStatic; - -// Used by JQuery.Event -type _Event = Event; - -interface JQueryStatic { - /** - * @see \`{@link http://api.jquery.com/jquery.ajax/#jQuery-ajax1 }\` - * - * @deprecated Use \`{@link JQueryStatic.ajaxSetup }\`. - */ - ajaxSettings: JQuery.AjaxSettings; - /** - * A factory function that returns a chainable utility object with methods to register multiple - * callbacks into callback queues, invoke callback queues, and relay the success or failure state of - * any synchronous or asynchronous function. - * - * @param beforeStart A function that is called just before the constructor returns. - * @see \`{@link https://api.jquery.com/jQuery.Deferred/ }\` - * @since 1.5 - */ - Deferred: JQuery.DeferredStatic; - Event: JQuery.EventStatic; - /** - * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize - * CSS property naming, or create custom properties. - * - * @see \`{@link https://api.jquery.com/jQuery.cssHooks/ }\` - * @since 1.4.3 - */ - // Set to HTMLElement to minimize breaks but should probably be Element. - cssHooks: JQuery.PlainObject>; - /** - * An object containing all CSS properties that may be used without a unit. The .css() method uses this - * object to see if it may append px to unitless values. - * - * @see \`{@link https://api.jquery.com/jQuery.cssNumber/ }\` - * @since 1.4.3 - */ - cssNumber: JQuery.PlainObject; - // Set to HTMLElement to minimize breaks but should probably be Element. - readonly fn: JQuery; - fx: { - /** - * The rate (in milliseconds) at which animations fire. - * - * @see \`{@link https://api.jquery.com/jQuery.fx.interval/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.0. See \`{@link https://api.jquery.com/jQuery.fx.interval/ }\`. - */ - interval: number; - /** - * Globally disable all animations. - * - * @see \`{@link https://api.jquery.com/jQuery.fx.off/ }\` - * @since 1.3 - */ - off: boolean; - step: JQuery.PlainObject>; - }; - /** - * A Promise-like object (or "thenable") that resolves when the document is ready. - * - * @see \`{@link https://api.jquery.com/jQuery.ready/ }\` - * @since 1.8 - */ - ready: JQuery.Thenable; - /** - * A collection of properties that represent the presence of different browser features or bugs. - * Intended for jQuery's internal use; specific properties may be removed when they are no longer - * needed internally to improve page startup performance. For your own project's feature-detection - * needs, we strongly recommend the use of an external library such as Modernizr instead of dependency - * on properties in jQuery.support. - * - * @see \`{@link https://api.jquery.com/jQuery.support/ }\` - * @since 1.3 - * - * @deprecated Deprecated since 1.9. See \`{@link https://api.jquery.com/jQuery.support/ }\`. - */ - support: JQuery.PlainObject; - // Set to HTMLElement to minimize breaks but should probably be Element. - valHooks: JQuery.PlainObject>; - // HACK: This is the factory function returned when importing jQuery without a DOM. Declaring it separately breaks using the type parameter on JQueryStatic. - // HACK: The discriminator parameter handles the edge case of passing a Window object to JQueryStatic. It doesn't actually exist on the factory function. - (window: Window, discriminator: boolean): JQueryStatic; - /** - * Creates DOM elements on the fly from the provided string of raw HTML. - * - * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. - * A string defining a single, standalone, HTML element (e.g.
      or
      ). - * @param ownerDocument_attributes A document in which the new elements will be created. - * An object of attributes, events, and methods to call on the newly-created element. - * @see \`{@link https://api.jquery.com/jQuery/ }\` - * @since 1.0 - * @since 1.4 - */ - // tslint:disable-next-line:no-unnecessary-generics - (html: JQuery.htmlString, ownerDocument_attributes?: Document | JQuery.PlainObject): JQuery; - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param selector A string containing a selector expression - * @param context A DOM Element, Document, or jQuery to use as context - * @see \`{@link https://api.jquery.com/jQuery/ }\` - * @since 1.0 - */ - // tslint:disable-next-line:no-unnecessary-generics - (selector: JQuery.Selector, context?: Element | Document | JQuery): JQuery; - /** - * Return a collection of matched elements either found in the DOM based on passed argument(s) or created - * by passing an HTML string. - * - * @param element A DOM element to wrap in a jQuery object. - * @see \`{@link https://api.jquery.com/jQuery/ }\` - * @since 1.0 - */ - // Using a unified signature is not possible due to a TypeScript 2.4 bug (DefinitelyTyped#27810) - // tslint:disable-next-line:unified-signatures - (element: T): JQuery; - /** - * Return a collection of matched elements either found in the DOM based on passed argument(s) or created - * by passing an HTML string. - * - * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. - * @see \`{@link https://api.jquery.com/jQuery/ }\` - * @since 1.0 - */ - // Using a unified signature is not possible due to a TypeScript 2.4 bug (DefinitelyTyped#27810) - // tslint:disable-next-line:unified-signatures - (elementArray: T[]): JQuery; - /** - * Return a collection of matched elements either found in the DOM based on passed argument(s) or created - * by passing an HTML string. - * - * @param selection An existing jQuery object to clone. - * @see \`{@link https://api.jquery.com/jQuery/ }\` - * @since 1.0 - */ - (selection: JQuery): JQuery; - /** - * Binds a function to be executed when the DOM has finished loading. - * - * @param callback The function to execute when the DOM is ready. - * @see \`{@link https://api.jquery.com/jQuery/ }\` - * @since 1.0 - */ - // tslint:disable-next-line:no-unnecessary-generics unified-signatures - (callback: ((this: Document, $: JQueryStatic) => void)): JQuery; - /** - * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string. - * - * @param object A plain object to wrap in a jQuery object. - * @see \`{@link https://api.jquery.com/jQuery/ }\` - * @since 1.0 - */ - (object: T): JQuery; - /** - * Returns an empty jQuery set. - * - * @see \`{@link https://api.jquery.com/jQuery/ }\` - * @since 1.4 - */ - // tslint:disable-next-line:no-unnecessary-generics - (): JQuery; - /** - * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. - * - * @param flags An optional list of space-separated flags that change how the callback list behaves. - * @see \`{@link https://api.jquery.com/jQuery.Callbacks/ }\` - * @since 1.7 - */ - // tslint:disable-next-line:ban-types no-unnecessary-generics - Callbacks(flags?: string): JQuery.Callbacks; - /** - * Perform an asynchronous HTTP (Ajax) request. - * - * @param url A string containing the URL to which the request is sent. - * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can - * be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings. - * @see \`{@link https://api.jquery.com/jQuery.ajax/ }\` - * @since 1.5 - */ - ajax(url: string, settings?: JQuery.AjaxSettings): JQuery.jqXHR; - /** - * Perform an asynchronous HTTP (Ajax) request. - * - * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can - * be set for any option with $.ajaxSetup(). - * @see \`{@link https://api.jquery.com/jQuery.ajax/ }\` - * @since 1.0 - */ - ajax(settings?: JQuery.AjaxSettings): JQuery.jqXHR; - /** - * Handle custom Ajax options or modify existing options before each request is sent and before they - * are processed by $.ajax(). - * - * @param dataTypes An optional string containing one or more space-separated dataTypes - * @param handler A handler to set default values for future Ajax requests. - * @see \`{@link https://api.jquery.com/jQuery.ajaxPrefilter/ }\` - * @since 1.5 - */ - ajaxPrefilter(dataTypes: string, - handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; - /** - * Handle custom Ajax options or modify existing options before each request is sent and before they - * are processed by $.ajax(). - * - * @param handler A handler to set default values for future Ajax requests. - * @see \`{@link https://api.jquery.com/jQuery.ajaxPrefilter/ }\` - * @since 1.5 - */ - ajaxPrefilter(handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; - /** - * Set default values for future Ajax requests. Its use is not recommended. - * - * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. - * @see \`{@link https://api.jquery.com/jQuery.ajaxSetup/ }\` - * @since 1.1 - */ - ajaxSetup(options: JQuery.AjaxSettings): JQuery.AjaxSettings; - /** - * Creates an object that handles the actual transmission of Ajax data. - * - * @param dataType A string identifying the data type to use - * @param handler A handler to return the new transport object to use with the data type provided in the first argument. - * @see \`{@link https://api.jquery.com/jQuery.ajaxTransport/ }\` - * @since 1.5 - */ - ajaxTransport(dataType: string, - handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => JQuery.Transport | void): void; - /** - * @deprecated Deprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/3384 }\`. - */ - camelCase(value: string): string; - /** - * Check to see if a DOM element is a descendant of another DOM element. - * - * @param container The DOM element that may contain the other element. - * @param contained The DOM element that may be contained by (a descendant of) the other element. - * @see \`{@link https://api.jquery.com/jQuery.contains/ }\` - * @since 1.4 - */ - contains(container: Element, contained: Element): boolean; - css(elem: Element, unknown: any): any; - /** - * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or - * the full data store for the element. - * - * @param element The DOM element to query for the data. - * @param key Name of the data stored. - * @see \`{@link https://api.jquery.com/jQuery.data/ }\` - * @since 1.2.3 - */ - data(element: Element, key: string, undefined: undefined): any; // tslint:disable-line:unified-signatures - /** - * Store arbitrary data associated with the specified element. Returns the value that was set. - * - * @param element The DOM element to associate with the data. - * @param key A string naming the piece of data to set. - * @param value The new data value; this can be any Javascript type except undefined. - * @see \`{@link https://api.jquery.com/jQuery.data/ }\` - * @since 1.2.3 - */ - data(element: Element, key: string, value: T): T; - /** - * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or - * the full data store for the element. - * - * @param element The DOM element to query for the data. - * @param key Name of the data stored. - * @see \`{@link https://api.jquery.com/jQuery.data/ }\` - * @since 1.2.3 - * @since 1.4 - */ - data(element: Element, key?: string): any; - /** - * Execute the next function on the queue for the matched element. - * - * @param element A DOM element from which to remove and execute a queued function. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see \`{@link https://api.jquery.com/jQuery.dequeue/ }\` - * @since 1.3 - */ - dequeue(element: Element, queueName?: string): void; - /** - * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. - * Arrays and array-like objects with a length property (such as a function's arguments object) are - * iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. - * - * @param array The array to iterate over. - * @param callback The function that will be executed on every object. - * @see \`{@link https://api.jquery.com/jQuery.each/ }\` - * @since 1.0 - */ - each(array: ArrayLike, callback: (this: T, indexInArray: number, value: T) => false | any): ArrayLike; - /** - * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. - * Arrays and array-like objects with a length property (such as a function's arguments object) are - * iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. - * - * @param obj The object to iterate over. - * @param callback The function that will be executed on every object. - * @see \`{@link https://api.jquery.com/jQuery.each/ }\` - * @since 1.0 - */ - each(obj: T, callback: (this: T[K], propertyName: K, valueOfProperty: T[K]) => false | any): T; - /** - * Takes a string and throws an exception containing it. - * - * @param message The message to send out. - * @see \`{@link https://api.jquery.com/jQuery.error/ }\` - * @since 1.4.1 - */ - error(message: string): any; - /** - * Escapes any character that has a special meaning in a CSS selector. - * - * @param selector A string containing a selector expression to escape. - * @see \`{@link https://api.jquery.com/jQuery.escapeSelector/ }\` - * @since 3.0 - */ - escapeSelector(selector: JQuery.Selector): JQuery.Selector; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.1.4 - */ - extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.1.4 - */ - extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.1.4 - */ - extend(deep: true, target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.1.4 - */ - extend(deep: true, target: T, object1: U, object2: V, object3: W): T & U & V & W; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.1.4 - */ - extend(deep: true, target: T, object1: U, object2: V): T & U & V; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.1.4 - */ - extend(deep: true, target: T, object1: U): T & U; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. - * @param target The object to extend. It will receive the new properties. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.1.4 - */ - extend(deep: true, target: any, object1: any, ...objects: any[]): any; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.0 - */ - extend(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.0 - */ - extend(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.0 - */ - extend(target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.0 - */ - extend(target: T, object1: U, object2: V, object3: W): T & U & V & W; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.0 - */ - extend(target: T, object1: U, object2: V): T & U & V; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.0 - */ - extend(target: T, object1: U): T & U; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will - * extend the jQuery namespace if it is the sole argument. - * @see \`{@link https://api.jquery.com/jQuery.extend/ }\` - * @since 1.0 - */ - extend(target: any, object1: any, ...objects: any[]): any; - /** - * Load data from the server using a HTTP GET request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but - * you can use null or jQuery.noop as a placeholder. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - * @see \`{@link https://api.jquery.com/jQuery.get/ }\` - * @since 1.0 - */ - get(url: string, - data: JQuery.PlainObject | string, - success: JQuery.jqXHR.DoneCallback | null, - dataType?: string): JQuery.jqXHR; - /** - * Load data from the server using a HTTP GET request. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but - * you can use null or jQuery.noop as a placeholder. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - * @see \`{@link https://api.jquery.com/jQuery.get/ }\` - * @since 1.0 - */ - get(url: string, - success: JQuery.jqXHR.DoneCallback | null, - dataType: string): JQuery.jqXHR; - /** - * Load data from the server using a HTTP GET request. - * - * @param url A string containing the URL to which the request is sent. - * @param success_data A callback function that is executed if the request succeeds. Required if dataType is provided, but - * you can use null or jQuery.noop as a placeholder. - * A plain object or string that is sent to the server with the request. - * @see \`{@link https://api.jquery.com/jQuery.get/ }\` - * @since 1.0 - */ - get(url: string, - success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; - /** - * Load data from the server using a HTTP GET request. - * - * @param url_settings A string containing the URL to which the request is sent. - * A set of key/value pairs that configure the Ajax request. All properties except for url are - * optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a - * complete list of all settings. The type option will automatically be set to GET. - * @see \`{@link https://api.jquery.com/jQuery.get/ }\` - * @since 1.0 - * @since 1.12 - * @since 2.2 - */ - get(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR; - /** - * Load JSON-encoded data from the server using a GET HTTP request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. - * @see \`{@link https://api.jquery.com/jQuery.getJSON/ }\` - * @since 1.0 - */ - getJSON(url: string, - data: JQuery.PlainObject | string, - success: JQuery.jqXHR.DoneCallback): JQuery.jqXHR; - /** - * Load JSON-encoded data from the server using a GET HTTP request. - * - * @param url A string containing the URL to which the request is sent. - * @param success_data A callback function that is executed if the request succeeds. - * A plain object or string that is sent to the server with the request. - * @see \`{@link https://api.jquery.com/jQuery.getJSON/ }\` - * @since 1.0 - */ - getJSON(url: string, - success_data?: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; - /** - * Load a JavaScript file from the server using a GET HTTP request, then execute it. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. - * @see \`{@link https://api.jquery.com/jQuery.getScript/ }\` - * @since 1.0 - */ - getScript(url: string, - success?: JQuery.jqXHR.DoneCallback): JQuery.jqXHR; - /** - * Execute some JavaScript code globally. - * - * @param code The JavaScript code to execute. - * @see \`{@link https://api.jquery.com/jQuery.globalEval/ }\` - * @since 1.0.4 - */ - globalEval(code: string): void; - /** - * Finds the elements of an array which satisfy a filter function. The original array is not affected. - * - * @param array The array-like object to search through. - * @param fn The function to process each item against. The first argument to the function is the item, and the - * second argument is the index. The function should return a Boolean value. this will be the global window object. - * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements - * for which "callback" returns true. If "invert" is true, then the function returns an array - * consisting of all elements for which "callback" returns false. - * @see \`{@link https://api.jquery.com/jQuery.grep/ }\` - * @since 1.0 - */ - grep(array: ArrayLike, - fn: (elementOfArray: T, indexInArray: number) => boolean, - invert?: boolean): T[]; - /** - * Determine whether an element has any jQuery data associated with it. - * - * @param element A DOM element to be checked for data. - * @see \`{@link https://api.jquery.com/jQuery.hasData/ }\` - * @since 1.5 - */ - hasData(element: Element): boolean; - /** - * Holds or releases the execution of jQuery's ready event. - * - * @param hold Indicates whether the ready hold is being requested or released - * @see \`{@link https://api.jquery.com/jQuery.holdReady/ }\` - * @since 1.6 - * - * @deprecated Deprecated since 3.2. See \`{@link https://github.com/jquery/jquery/issues/3288 }\`. - */ - holdReady(hold: boolean): void; - /** - * Modify and filter HTML strings passed through jQuery manipulation methods. - * - * @param html The HTML string on which to operate. - * @see \`{@link https://api.jquery.com/jQuery.htmlPrefilter/ }\` - * @since 1.12/2.2 - */ - htmlPrefilter(html: JQuery.htmlString): JQuery.htmlString; - /** - * Search for a specified value within an array and return its index (or -1 if not found). - * - * @param value The value to search for. - * @param array An array through which to search. - * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array. - * @see \`{@link https://api.jquery.com/jQuery.inArray/ }\` - * @since 1.2 - */ - inArray(value: T, array: T[], fromIndex?: number): number; - /** - * Determine whether the argument is an array. - * - * @param obj Object to test whether or not it is an array. - * @see \`{@link https://api.jquery.com/jQuery.isArray/ }\` - * @since 1.3 - * - * @deprecated Deprecated since 3.2. Use \`{@link Array.isArray }\`. - */ - isArray(obj: any): obj is any[]; - /** - * Check to see if an object is empty (contains no enumerable properties). - * - * @param obj The object that will be checked to see if it's empty. - * @see \`{@link https://api.jquery.com/jQuery.isEmptyObject/ }\` - * @since 1.4 - */ - isEmptyObject(obj: any): boolean; - /** - * Determine if the argument passed is a JavaScript function object. - * - * @param obj Object to test whether or not it is a function. - * @see \`{@link https://api.jquery.com/jQuery.isFunction/ }\` - * @since 1.2 - * - * @deprecated Deprecated since 3.3. Use `typeof x === "function"`. - */ - // tslint:disable-next-line:ban-types - isFunction(obj: any): obj is Function; - /** - * Determines whether its argument represents a JavaScript number. - * - * @param value The value to be tested. - * @see \`{@link https://api.jquery.com/jQuery.isNumeric/ }\` - * @since 1.7 - * - * @deprecated Deprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/2960 }\`. - */ - isNumeric(value: any): value is number; - /** - * Check to see if an object is a plain object (created using "{}" or "new Object"). - * - * @param obj The object that will be checked to see if it's a plain object. - * @see \`{@link https://api.jquery.com/jQuery.isPlainObject/ }\` - * @since 1.4 - */ - isPlainObject(obj: any): obj is JQuery.PlainObject; - /** - * Determine whether the argument is a window. - * - * @param obj Object to test whether or not it is a window. - * @see \`{@link https://api.jquery.com/jQuery.isWindow/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/3629 }\`. - */ - isWindow(obj: any): obj is Window; - /** - * Check to see if a DOM node is within an XML document (or is an XML document). - * - * @param node The DOM node that will be checked to see if it's in an XML document. - * @see \`{@link https://api.jquery.com/jQuery.isXMLDoc/ }\` - * @since 1.1.4 - */ - isXMLDoc(node: Node): boolean; - /** - * Convert an array-like object into a true JavaScript array. - * - * @param obj Any object to turn into a native Array. - * @see \`{@link https://api.jquery.com/jQuery.makeArray/ }\` - * @since 1.2 - */ - makeArray(obj: ArrayLike): T[]; - /** - * Translate all items in an array or object to new array of items. - * - * @param array The Array to translate. - * @param callback The function to process each item against. The first argument to the function is the array item, the - * second argument is the index in array The function can return any value. A returned array will be - * flattened into the resulting array. Within the function, this refers to the global (window) object. - * @see \`{@link https://api.jquery.com/jQuery.map/ }\` - * @since 1.0 - */ - map(array: T[], callback: (this: Window, elementOfArray: T, indexInArray: number) => JQuery.TypeOrArray | null | undefined): TReturn[]; - /** - * Translate all items in an array or object to new array of items. - * - * @param obj The Object to translate. - * @param callback The function to process each item against. The first argument to the function is the value; the - * second argument is the key of the object property. The function can return any value to add to the - * array. A returned array will be flattened into the resulting array. Within the function, this refers - * to the global (window) object. - * @see \`{@link https://api.jquery.com/jQuery.map/ }\` - * @since 1.6 - */ - map(obj: T, callback: (this: Window, propertyOfObject: T[K], key: K) => JQuery.TypeOrArray | null | undefined): TReturn[]; - /** - * Merge the contents of two arrays together into the first array. - * - * @param first The first array-like object to merge, the elements of second added. - * @param second The second array-like object to merge into the first, unaltered. - * @see \`{@link https://api.jquery.com/jQuery.merge/ }\` - * @since 1.0 - */ - merge(first: ArrayLike, second: ArrayLike): Array; - /** - * Relinquish jQuery's control of the $ variable. - * - * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). - * @see \`{@link https://api.jquery.com/jQuery.noConflict/ }\` - * @since 1.0 - */ - noConflict(removeAll?: boolean): this; - /** - * An empty function. - * - * @see \`{@link https://api.jquery.com/jQuery.noop/ }\` - * @since 1.4 - */ - noop(): undefined; - /** - * Return a number representing the current time. - * - * @see \`{@link https://api.jquery.com/jQuery.now/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link Date.now }\`. - */ - now(): number; - /** - * Create a serialized representation of an array, a plain object, or a jQuery object suitable for use - * in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input - * elements with name/value properties. - * - * @param obj An array, a plain object, or a jQuery object to serialize. - * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. - * @see \`{@link https://api.jquery.com/jQuery.param/ }\` - * @since 1.2 - * @since 1.4 - */ - param(obj: any[] | JQuery.PlainObject | JQuery, traditional?: boolean): string; - /** - * Parses a string into an array of DOM nodes. - * - * @param data HTML string to be parsed - * @param context Document element to serve as the context in which the HTML fragment will be created - * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string - * @see \`{@link https://api.jquery.com/jQuery.parseHTML/ }\` - * @since 1.8 - */ - parseHTML(data: string, context: Document | null | undefined, keepScripts: boolean): JQuery.Node[]; - /** - * Parses a string into an array of DOM nodes. - * - * @param data HTML string to be parsed - * @param context_keepScripts Document element to serve as the context in which the HTML fragment will be created - * A Boolean indicating whether to include scripts passed in the HTML string - * @see \`{@link https://api.jquery.com/jQuery.parseHTML/ }\` - * @since 1.8 - */ - parseHTML(data: string, context_keepScripts?: Document | null | boolean): JQuery.Node[]; - /** - * Takes a well-formed JSON string and returns the resulting JavaScript value. - * - * @param json The JSON string to parse. - * @see \`{@link https://api.jquery.com/jQuery.parseJSON/ }\` - * @since 1.4.1 - * - * @deprecated Deprecated since 3.0. Use \`{@link JSON.parse }\`. - */ - parseJSON(json: string): any; - /** - * Parses a string into an XML document. - * - * @param data a well-formed XML string to be parsed - * @see \`{@link https://api.jquery.com/jQuery.parseXML/ }\` - * @since 1.5 - */ - parseXML(data: string): XMLDocument; - /** - * Load data from the server using a HTTP POST request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but - * can be null in that case. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - * @see \`{@link https://api.jquery.com/jQuery.post/ }\` - * @since 1.0 - */ - post(url: string, - data: JQuery.PlainObject | string, - success: JQuery.jqXHR.DoneCallback | null, - dataType?: string): JQuery.jqXHR; - /** - * Load data from the server using a HTTP POST request. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but - * can be null in that case. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - * @see \`{@link https://api.jquery.com/jQuery.post/ }\` - * @since 1.0 - */ - post(url: string, - success: JQuery.jqXHR.DoneCallback | null, - dataType: string): JQuery.jqXHR; - /** - * Load data from the server using a HTTP POST request. - * - * @param url A string containing the URL to which the request is sent. - * @param success_data A callback function that is executed if the request succeeds. Required if dataType is provided, but - * can be null in that case. - * A plain object or string that is sent to the server with the request. - * @see \`{@link https://api.jquery.com/jQuery.post/ }\` - * @since 1.0 - */ - post(url: string, - success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; - /** - * Load data from the server using a HTTP POST request. - * - * @param url_settings A string containing the URL to which the request is sent. - * A set of key/value pairs that configure the Ajax request. All properties except for url are - * optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a - * complete list of all settings. Type will automatically be set to POST. - * @see \`{@link https://api.jquery.com/jQuery.post/ }\` - * @since 1.0 - * @since 1.12 - * @since 2.2 - */ - post(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR; - - // #region proxy - - // #region (fn, null | undefined) - - // #region 0 to 7 arguments - - // #region 0 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C) => TReturn, - context: null | undefined, - a: A, b: B, c: C): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B) => TReturn, - context: null | undefined, - a: A, b: B): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4` - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A) => TReturn, - context: null | undefined, - a: A): () => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: () => TReturn, - context: null | undefined): () => TReturn; - - // #endregion - - // #region 1 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T) => TReturn, - context: null | undefined, - a: A, b: B): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T) => TReturn, - context: null | undefined, - a: A): (t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T) => TReturn, - context: null | undefined): (t: T) => TReturn; - - // #endregion - - // #region 2 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T, u: U) => TReturn, - context: null | undefined, - a: A, b: B): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T, u: U) => TReturn, - context: null | undefined, - a: A): (t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T, u: U) => TReturn, - context: null | undefined): (t: T, u: U) => TReturn; - - // #endregion - - // #region 3 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A, b: B): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T, u: U, v: V) => TReturn, - context: null | undefined, - a: A): (t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T, u: U, v: V) => TReturn, - context: null | undefined): (t: T, u: U, v: V) => TReturn; - - // #endregion - - // #region 4 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A, b: B): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined, - a: A): (t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T, u: U, v: V, w: W) => TReturn, - context: null | undefined): (t: T, u: U, v: V, w: W) => TReturn; - - // #endregion - - // #region 5 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A, b: B): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined, - a: A): (t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T, u: U, v: V, w: W, x: X) => TReturn, - context: null | undefined): (t: T, u: U, v: V, w: W, x: X) => TReturn; - - // #endregion - - // #region 6 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined, - a: A): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - - // #endregion - - // #region 7+ parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined, - a: A): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - - // #endregion - - // #endregion - - // #region 8+ arguments - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.9 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (...args: any[]) => TReturn, - context: null | undefined, - ...additionalArguments: any[]): (...args: any[]) => TReturn; - - // #endregion - - // #endregion - - // #region (fn, context) - - // #region 0 to 7 arguments - - // #region 0 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B) => TReturn, - context: TContext, - a: A, b: B): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4` - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A) => TReturn, - context: TContext, - a: A): (this: TContext) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: () => TReturn, - context: TContext): (this: TContext) => TReturn; - - // #endregion - - // #region 1 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T) => TReturn, - context: TContext, - a: A): (this: TContext, t: T) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T) => TReturn, - context: TContext): (this: TContext, t: T) => TReturn; - - // #endregion - - // #region 2 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T, u: U) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T, u: U) => TReturn, - context: TContext, - a: A): (this: TContext, t: T, u: U) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T, u: U) => TReturn, - context: TContext): (this: TContext, t: T, u: U) => TReturn; - - // #endregion - - // #region 3 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T, u: U, v: V) => TReturn, - context: TContext, - a: A): (this: TContext, t: T, u: U, v: V) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T, u: U, v: V) => TReturn, - context: TContext): (this: TContext, t: T, u: U, v: V) => TReturn; - - // #endregion - - // #region 4 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W) => TReturn, - context: TContext, - a: A): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T, u: U, v: V, w: W) => TReturn, - context: TContext): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; - - // #endregion - - // #region 5 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext, - a: A): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T, u: U, v: V, w: W, x: X) => TReturn, - context: TContext): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; - - // #endregion - - // #region 6 parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext, - a: A): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, - context: TContext): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; - - // #endregion - - // #region 7+ parameters - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, e: E, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, d: D, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, c: C, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, b: B, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A, b: B): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (a: A, - t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext, - a: A): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, - context: TContext): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; - - // #endregion - - // #endregion - - // #region 8+ arguments - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param fn The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(fn: (...args: any[]) => TReturn, - context: TContext, - ...additionalArguments: any[]): (this: TContext, ...args: any[]) => TReturn; - - // #endregion - - // #endregion - - // #region (context, name) - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param context The object to which the context of the function should be set. - * @param name The name of the function whose context will be changed (should be a property of the context object). - * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. - * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\` - * @since 1.4 - * @since 1.6 - * - * @deprecated Deprecated since 3.3. Use \`{@link Function.bind }\`. - */ - proxy(context: TContext, - name: keyof TContext, - ...additionalArguments: any[]): (this: TContext, ...args: any[]) => any; - - // #endregion - - // #endregion - - /** - * Manipulate the queue of functions to be executed on the matched element. - * - * @param element A DOM element where the array of queued functions is attached. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param newQueue The new function to add to the queue. - * An array of functions to replace the current queue contents. - * @see \`{@link https://api.jquery.com/jQuery.queue/ }\` - * @since 1.3 - */ - queue(element: T, queueName?: string, newQueue?: JQuery.TypeOrArray>): JQuery.Queue; - /** - * Handles errors thrown synchronously in functions wrapped in jQuery(). - * - * @param error An error thrown in the function wrapped in jQuery(). - * @see \`{@link https://api.jquery.com/jQuery.readyException/ }\` - * @since 3.1 - */ - readyException(error: Error): any; - /** - * Remove a previously-stored piece of data. - * - * @param element A DOM element from which to remove data. - * @param name A string naming the piece of data to remove. - * @see \`{@link https://api.jquery.com/jQuery.removeData/ }\` - * @since 1.2.3 - */ - removeData(element: Element, name?: string): void; - /** - * Creates an object containing a set of properties ready to be used in the definition of custom animations. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/jQuery.speed/ }\` - * @since 1.1 - */ - speed(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): JQuery.EffectsOptions; - /** - * Creates an object containing a set of properties ready to be used in the definition of custom animations. - * - * @param duration A string or number determining how long the animation will run. - * @param easing_complete A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/jQuery.speed/ }\` - * @since 1.0 - * @since 1.1 - */ - speed(duration: JQuery.Duration, - easing_complete: string | ((this: TElement) => void)): JQuery.EffectsOptions; - /** - * Creates an object containing a set of properties ready to be used in the definition of custom animations. - * - * @param duration_complete_settings A string or number determining how long the animation will run. - * A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/jQuery.speed/ }\` - * @since 1.0 - * @since 1.1 - */ - speed(duration_complete_settings?: JQuery.Duration | ((this: TElement) => void) | JQuery.SpeedSettings): JQuery.EffectsOptions; - /** - * Remove the whitespace from the beginning and end of a string. - * - * @param str The string to trim. - * @see \`{@link https://api.jquery.com/jQuery.trim/ }\` - * @since 1.0 - */ - trim(str: string): string; - /** - * Determine the internal JavaScript [[Class]] of an object. - * - * @param obj Object to get the internal JavaScript [[Class]] of. - * @see \`{@link https://api.jquery.com/jQuery.type/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. See \`{@link https://github.com/jquery/jquery/issues/3605 }`. - */ - type(obj: any): 'array' | 'boolean' | 'date' | 'error' | 'function' | 'null' | 'number' | 'object' | 'regexp' | 'string' | 'symbol' | 'undefined'; - /** - * @description Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on - * arrays of DOM elements, not strings or numbers. - * - * @param array The Array of DOM elements. - * @see \`{@link https://api.jquery.com/jQuery.unique/ }\` - * @since 1.1.3 - * - * @deprecated Deprecated since 3.0. Use \`{@link JQueryStatic.uniqueSort }`. - */ - unique(array: T[]): T[]; - /** - * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on - * arrays of DOM elements, not strings or numbers. - * - * @param array The Array of DOM elements. - * @see \`{@link https://api.jquery.com/jQuery.uniqueSort/ }\` - * @since 1.12 - * @since 2.2 - */ - uniqueSort(array: T[]): T[]; - /** - * Provides a way to execute callback functions based on zero or more Thenable objects, usually - * Deferred objects that represent asynchronous events. - * - * @see \`{@link https://api.jquery.com/jQuery.when/ }\` - * @since 1.5 - */ - when( - deferredT: JQuery.Promise | JQuery.Thenable | TR1, // tslint:disable-line:use-default-type-parameter - deferredU: JQuery.Promise | JQuery.Thenable | UR1, // tslint:disable-line:use-default-type-parameter - deferredV: JQuery.Promise | JQuery.Thenable | VR1): JQuery.Promise3; - /** - * Provides a way to execute callback functions based on zero or more Thenable objects, usually - * Deferred objects that represent asynchronous events. - * - * @see \`{@link https://api.jquery.com/jQuery.when/ }\` - * @since 1.5 - */ - when( - deferredT: JQuery.Promise | JQuery.Thenable | TR1, // tslint:disable-line:use-default-type-parameter - deferredU: JQuery.Promise | JQuery.Thenable | UR1): JQuery.Promise2; - /** - * Provides a way to execute callback functions based on zero or more Thenable objects, usually - * Deferred objects that represent asynchronous events. - * - * @see \`{@link https://api.jquery.com/jQuery.when/ }\` - * @since 1.5 - */ - when( - deferredT: JQuery.Promise3 | - JQuery.Promise2): JQuery.Promise3; - /** - * Provides a way to execute callback functions based on zero or more Thenable objects, usually - * Deferred objects that represent asynchronous events. - * - * @see \`{@link https://api.jquery.com/jQuery.when/ }\` - * @since 1.5 - */ - when(deferred: JQuery.Promise | JQuery.Thenable | TR1): JQuery.Promise; // tslint:disable-line:use-default-type-parameter - /** - * Provides a way to execute callback functions based on zero or more Thenable objects, usually - * Deferred objects that represent asynchronous events. - * - * @param deferreds Zero or more Thenable objects. - * @see \`{@link https://api.jquery.com/jQuery.when/ }\` - * @since 1.5 - */ - when(...deferreds: Array | JQuery.Thenable | TR1>): JQuery.Promise; // tslint:disable-line:use-default-type-parameter - /** - * Provides a way to execute callback functions based on zero or more Thenable objects, usually - * Deferred objects that represent asynchronous events. - * - * @param deferreds Zero or more Thenable objects. - * @see \`{@link https://api.jquery.com/jQuery.when/ }\` - * @since 1.5 - */ - when(...deferreds: any[]): JQuery.Promise; -} - -interface JQuery extends Iterable { - /** - * A string containing the jQuery version number. - * - * @see \`{@link https://api.jquery.com/jquery/ }\` - * @since 1.0 - */ - jquery: string; - /** - * The number of elements in the jQuery object. - * - * @see \`{@link https://api.jquery.com/length/ }\` - * @since 1.0 - */ - length: number; - /** - * Create a new jQuery object with elements added to the set of matched elements. - * - * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. - * @param context The point in the document at which the selector should begin matching; similar to the context - * argument of the $(selector, context) method. - * @see \`{@link https://api.jquery.com/add/ }\` - * @since 1.4 - */ - add(selector: JQuery.Selector, context: Element): this; - /** - * Create a new jQuery object with elements added to the set of matched elements. - * - * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. - * One or more elements to add to the set of matched elements. - * An HTML fragment to add to the set of matched elements. - * An existing jQuery object to add to the set of matched elements. - * @see \`{@link https://api.jquery.com/add/ }\` - * @since 1.0 - * @since 1.3.2 - */ - add(selector: JQuery.Selector | JQuery.TypeOrArray | JQuery.htmlString | JQuery): this; - /** - * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match the current set of elements against. - * @see \`{@link https://api.jquery.com/addBack/ }\` - * @since 1.8 - */ - addBack(selector?: JQuery.Selector): this; - /** - * Adds the specified class(es) to each element in the set of matched elements. - * - * @param className One or more space-separated classes to be added to the class attribute of each matched element. - * An array of classes to be added to the class attribute of each matched element. - * A function returning one or more space-separated class names to be added to the existing class - * name(s). Receives the index position of the element in the set and the existing class name(s) as - * arguments. Within the function, this refers to the current element in the set. - * @see \`{@link https://api.jquery.com/addClass/ }\` - * @since 1.0 - * @since 1.4 - * @since 3.3 - */ - addClass(className: JQuery.TypeOrArray | ((this: TElement, index: number, currentClassName: string) => string)): this; - /** - * Insert content, specified by the parameter, after each element in the set of matched elements. - * - * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or - * jQuery objects to insert after each element in the set of matched elements. - * @see \`{@link https://api.jquery.com/after/ }\` - * @since 1.0 - */ - after(...contents: Array>>): this; - /** - * Insert content, specified by the parameter, after each element in the set of matched elements. - * - * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert - * after each element in the set of matched elements. Receives the index position of the element in the - * set and the old HTML value of the element as arguments. Within the function, this refers to the - * current element in the set. - * @see \`{@link https://api.jquery.com/after/ }\` - * @since 1.4 - * @since 1.10 - */ - after(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; - /** - * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. - * - * @param handler The function to be invoked. - * @see \`{@link https://api.jquery.com/ajaxComplete/ }\` - * @since 1.0 - */ - ajaxComplete(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings) => void | false): this; - /** - * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see \`{@link https://api.jquery.com/ajaxError/ }\` - * @since 1.0 - */ - ajaxError(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxSettings: JQuery.AjaxSettings, thrownError: string) => void | false): this; - /** - * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see \`{@link https://api.jquery.com/ajaxSend/ }\` - * @since 1.0 - */ - ajaxSend(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings) => void | false): this; - /** - * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see \`{@link https://api.jquery.com/ajaxStart/ }\` - * @since 1.0 - */ - ajaxStart(handler: (this: Document) => void | false): this; - /** - * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see \`{@link https://api.jquery.com/ajaxStop/ }\` - * @since 1.0 - */ - ajaxStop(handler: (this: Document) => void | false): this; - /** - * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see \`{@link https://api.jquery.com/ajaxSuccess/ }\` - * @since 1.0 - */ - ajaxSuccess(handler: (this: Document, event: JQuery.Event, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings, data: JQuery.PlainObject) => void | false): this; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/animate/ }\` - * @since 1.0 - */ - animate(properties: JQuery.PlainObject, - duration: JQuery.Duration, - easing: string, - complete?: (this: TElement) => void): this; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/animate/ }\` - * @since 1.0 - */ - animate(properties: JQuery.PlainObject, - duration_easing: JQuery.Duration | string, - complete?: (this: TElement) => void): this; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param options A map of additional options to pass to the method. - * @see \`{@link https://api.jquery.com/animate/ }\` - * @since 1.0 - */ - animate(properties: JQuery.PlainObject, - options: JQuery.EffectsOptions): this; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/animate/ }\` - * @since 1.0 - */ - animate(properties: JQuery.PlainObject, - complete?: (this: TElement) => void): this; - /** - * Insert content, specified by the parameter, to the end of each element in the set of matched elements. - * - * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or - * jQuery objects to insert at the end of each element in the set of matched elements. - * @see \`{@link https://api.jquery.com/append/ }\` - * @since 1.0 - */ - append(...contents: Array>>): this; - /** - * Insert content, specified by the parameter, to the end of each element in the set of matched elements. - * - * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at - * the end of each element in the set of matched elements. Receives the index position of the element - * in the set and the old HTML value of the element as arguments. Within the function, this refers to - * the current element in the set. - * @see \`{@link https://api.jquery.com/append/ }\` - * @since 1.4 - */ - append(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; - /** - * Insert every element in the set of matched elements to the end of the target. - * - * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements - * will be inserted at the end of the element(s) specified by this parameter. - * @see \`{@link https://api.jquery.com/appendTo/ }\` - * @since 1.0 - */ - appendTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; - /** - * Set one or more attributes for the set of matched elements. - * - * @param attributeName The name of the attribute to set. - * @param value A value to set for the attribute. If null, the specified attribute will be removed (as in .removeAttr()). - * A function returning the value to set. this is the current element. Receives the index position of - * the element in the set and the old attribute value as arguments. - * @see \`{@link https://api.jquery.com/attr/ }\` - * @since 1.0 - * @since 1.1 - */ - attr(attributeName: string, - value: string | number | null | ((this: TElement, index: number, attr: string) => string | number | void | undefined)): this; - /** - * Set one or more attributes for the set of matched elements. - * - * @param attributes An object of attribute-value pairs to set. - * @see \`{@link https://api.jquery.com/attr/ }\` - * @since 1.0 - */ - attr(attributes: JQuery.PlainObject): this; - /** - * Get the value of an attribute for the first element in the set of matched elements. - * - * @param attributeName The name of the attribute to get. - * @see \`{@link https://api.jquery.com/attr/ }\` - * @since 1.0 - */ - attr(attributeName: string): string | undefined; - /** - * Insert content, specified by the parameter, before each element in the set of matched elements. - * - * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or - * jQuery objects to insert before each element in the set of matched elements. - * @see \`{@link https://api.jquery.com/before/ }\` - * @since 1.0 - */ - before(...contents: Array>>): this; - /** - * Insert content, specified by the parameter, before each element in the set of matched elements. - * - * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert - * before each element in the set of matched elements. Receives the index position of the element in - * the set and the old HTML value of the element as arguments. Within the function, this refers to the - * current element in the set. - * @see \`{@link https://api.jquery.com/before/ }\` - * @since 1.4 - * @since 1.10 - */ - before(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; - // [bind() overloads] https://github.com/jquery/api.jquery.com/issues/1048 - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/bind/ }\` - * @since 1.0 - * @since 1.4.3 - * - * @deprecated Deprecated since 3.0. Use \`{@link JQuery.on }\`. - */ - bind(eventType: string, - eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param handler A function to execute each time the event is triggered. - * Setting the second argument to false will attach a function that prevents the default action from - * occurring and stops the event from bubbling. - * @see \`{@link https://api.jquery.com/bind/ }\` - * @since 1.0 - * @since 1.4.3 - * - * @deprecated Deprecated since 3.0. Use \`{@link JQuery.on }\`. - */ - bind(eventType: string, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false | null | undefined): this; - /** - * Attach a handler to an event for the elements. - * - * @param events An object containing one or more DOM event types and functions to execute for them. - * @see \`{@link https://api.jquery.com/bind/ }\` - * @since 1.4 - * - * @deprecated Deprecated since 3.0. Use \`{@link JQuery.on }\`. - */ - bind(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; - /** - * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/blur/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - blur(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/blur/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - blur(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/change/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - change(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/change/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - change(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Get the children of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see \`{@link https://api.jquery.com/children/ }\` - * @since 1.0 - */ - children(selector?: JQuery.Selector): this; - /** - * Remove from the queue all items that have not yet been run. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see \`{@link https://api.jquery.com/clearQueue/ }\` - * @since 1.4 - */ - clearQueue(queueName?: string): this; - /** - * Bind an event handler to the "click" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/click/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - click(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "click" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/click/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - click(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Create a deep copy of the set of matched elements. - * - * @param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The - * default value is false. *In jQuery 1.5.0 the default value was incorrectly true; it was changed back - * to false in 1.5.1 and up. - * @param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should - * be copied. By default its value matches the first argument's value (which defaults to false). - * @see \`{@link https://api.jquery.com/clone/ }\` - * @since 1.0 - * @since 1.5 - */ - clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): this; - /** - * For each element in the set, get the first element that matches the selector by testing the element - * itself and traversing up through its ancestors in the DOM tree. - * - * @param selector A string containing a selector expression to match elements against. - * @param context A DOM element within which a matching element may be found. - * @see \`{@link https://api.jquery.com/closest/ }\` - * @since 1.4 - */ - closest(selector: JQuery.Selector, context: Element): this; - /** - * For each element in the set, get the first element that matches the selector by testing the element - * itself and traversing up through its ancestors in the DOM tree. - * - * @param selector A string containing a selector expression to match elements against. - * A jQuery object to match elements against. - * An element to match elements against. - * @see \`{@link https://api.jquery.com/closest/ }\` - * @since 1.3 - * @since 1.6 - */ - closest(selector: JQuery.Selector | Element | JQuery): this; - /** - * Get the children of each element in the set of matched elements, including text and comment nodes. - * - * @see \`{@link https://api.jquery.com/contents/ }\` - * @since 1.2 - */ - contents(): JQuery; - /** - * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/contextmenu/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - contextmenu(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/contextmenu/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - contextmenu(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Set one or more CSS properties for the set of matched elements. - * - * @param propertyName A CSS property name. - * @param value A value to set for the property. - * A function returning the value to set. this is the current element. Receives the index position of - * the element in the set and the old value as arguments. - * @see \`{@link https://api.jquery.com/css/ }\` - * @since 1.0 - * @since 1.4 - */ - css(propertyName: string, - value: string | number | ((this: TElement, index: number, value: string) => string | number | void | undefined)): this; - /** - * Set one or more CSS properties for the set of matched elements. - * - * @param properties An object of property-value pairs to set. - * @see \`{@link https://api.jquery.com/css/ }\` - * @since 1.0 - */ - css(properties: JQuery.PlainObject string | number | void | undefined)>): this; - /** - * Get the computed style properties for the first element in the set of matched elements. - * - * @param propertyName A CSS property. - * An array of one or more CSS properties. - * @see \`{@link https://api.jquery.com/css/ }\` - * @since 1.0 - */ - css(propertyName: string): string; - /** - * Get the computed style properties for the first element in the set of matched elements. - * - * @param propertyNames An array of one or more CSS properties. - * @see \`{@link https://api.jquery.com/css/ }\` - * @since 1.9 - */ - css(propertyNames: string[]): JQuery.PlainObject; - /** - * Return the value at the named data store for the first element in the jQuery collection, as set by - * data(name, value) or by an HTML5 data-* attribute. - * - * @param key Name of the data stored. - * @see \`{@link https://api.jquery.com/data/ }\` - * @since 1.2.3 - */ - data(key: string, undefined: undefined): any; // tslint:disable-line:unified-signatures - /** - * Store arbitrary data associated with the matched elements. - * - * @param key A string naming the piece of data to set. - * @param value The new data value; this can be any Javascript type except undefined. - * @see \`{@link https://api.jquery.com/data/ }\` - * @since 1.2.3 - */ - data(key: string, value: any): this; - /** - * Store arbitrary data associated with the matched elements. - * - * @param obj An object of key-value pairs of data to update. - * @see \`{@link https://api.jquery.com/data/ }\` - * @since 1.4.3 - */ - data(obj: JQuery.PlainObject): this; - /** - * Return the value at the named data store for the first element in the jQuery collection, as set by - * data(name, value) or by an HTML5 data-* attribute. - * - * @param key Name of the data stored. - * @see \`{@link https://api.jquery.com/data/ }\` - * @since 1.2.3 - */ - data(key: string): any; - /** - * Return the value at the named data store for the first element in the jQuery collection, as set by - * data(name, value) or by an HTML5 data-* attribute. - * - * @see \`{@link https://api.jquery.com/data/ }\` - * @since 1.4 - */ - data(): JQuery.PlainObject; - /** - * Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/dblclick/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - dblclick(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/dblclick/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - dblclick(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Set a timer to delay execution of subsequent items in the queue. - * - * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see \`{@link https://api.jquery.com/delay/ }\` - * @since 1.4 - */ - delay(duration: JQuery.Duration, queueName?: string): this; - /** - * Attach a handler to one or more events for all elements that match the selector, now or in the - * future, based on a specific set of root elements. - * - * @param selector A selector to filter the elements that trigger the event. - * @param eventType A string containing one or more space-separated JavaScript event types, such as "click" or - * "keydown," or custom event names. - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/delegate/ }\` - * @since 1.4.2 - * - * @deprecated Deprecated since 3.0. Use \`{@link JQuery.on }\`. - */ - delegate(selector: JQuery.Selector, - eventType: string, - eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Attach a handler to one or more events for all elements that match the selector, now or in the - * future, based on a specific set of root elements. - * - * @param selector A selector to filter the elements that trigger the event. - * @param eventType A string containing one or more space-separated JavaScript event types, such as "click" or - * "keydown," or custom event names. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/delegate/ }\` - * @since 1.4.2 - * - * @deprecated Deprecated since 3.0. Use \`{@link JQuery.on }\`. - */ - delegate(selector: JQuery.Selector, - eventType: string, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Attach a handler to one or more events for all elements that match the selector, now or in the - * future, based on a specific set of root elements. - * - * @param selector A selector to filter the elements that trigger the event. - * @param events A plain object of one or more event types and functions to execute for them. - * @see \`{@link https://api.jquery.com/delegate/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.0. Use \`{@link JQuery.on }\`. - */ - delegate(selector: JQuery.Selector, - events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; - /** - * Execute the next function on the queue for the matched elements. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see \`{@link https://api.jquery.com/dequeue/ }\` - * @since 1.2 - */ - dequeue(queueName?: string): this; - /** - * Remove the set of matched elements from the DOM. - * - * @param selector A selector expression that filters the set of matched elements to be removed. - * @see \`{@link https://api.jquery.com/detach/ }\` - * @since 1.4 - */ - detach(selector?: JQuery.Selector): this; - /** - * Iterate over a jQuery object, executing a function for each matched element. - * - * @param fn A function to execute for each matched element. - * @see \`{@link https://api.jquery.com/each/ }\` - * @since 1.0 - */ - each(fn: (this: TElement, index: number, element: TElement) => void | false): this; - /** - * Remove all child nodes of the set of matched elements from the DOM. - * - * @see \`{@link https://api.jquery.com/empty/ }\` - * @since 1.0 - */ - empty(): this; - /** - * End the most recent filtering operation in the current chain and return the set of matched elements - * to its previous state. - * - * @see \`{@link https://api.jquery.com/end/ }\` - * @since 1.0 - */ - end(): this; - /** - * Reduce the set of matched elements to the one at the specified index. - * - * @param index An integer indicating the 0-based position of the element. - * An integer indicating the position of the element, counting backwards from the last element in the set. - * @see \`{@link https://api.jquery.com/eq/ }\` - * @since 1.1.2 - * @since 1.4 - */ - eq(index: number): this; - /** - * Merge the contents of an object onto the jQuery prototype to provide new jQuery instance methods. - * - * @param obj An object to merge onto the jQuery prototype. - * @see \`{@link https://api.jquery.com/jQuery.fn.extend/ }\` - * @since 1.0 - */ - extend(obj: object): this; - /** - * Display the matched elements by fading them to opaque. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/fadeIn/ }\` - * @since 1.4.3 - */ - fadeIn(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Display the matched elements by fading them to opaque. - * - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/fadeIn/ }\` - * @since 1.0 - * @since 1.4.3 - */ - fadeIn(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; - /** - * Display the matched elements by fading them to opaque. - * - * @param duration_easing_complete_options A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see \`{@link https://api.jquery.com/fadeIn/ }\` - * @since 1.0 - * @since 1.4.3 - */ - fadeIn(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Hide the matched elements by fading them to transparent. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/fadeOut/ }\` - * @since 1.4.3 - */ - fadeOut(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Hide the matched elements by fading them to transparent. - * - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/fadeOut/ }\` - * @since 1.0 - * @since 1.4.3 - */ - fadeOut(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; - /** - * Hide the matched elements by fading them to transparent. - * - * @param duration_easing_complete_options A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see \`{@link https://api.jquery.com/fadeOut/ }\` - * @since 1.0 - * @since 1.4.3 - */ - fadeOut(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Adjust the opacity of the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param opacity A number between 0 and 1 denoting the target opacity. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/fadeTo/ }\` - * @since 1.4.3 - */ - fadeTo(duration: JQuery.Duration, opacity: number, easing: string, complete?: (this: TElement) => void): this; - /** - * Adjust the opacity of the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param opacity A number between 0 and 1 denoting the target opacity. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/fadeTo/ }\` - * @since 1.0 - */ - fadeTo(duration: JQuery.Duration, opacity: number, complete?: (this: TElement) => void): this; - /** - * Display or hide the matched elements by animating their opacity. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/fadeToggle/ }\` - * @since 1.4.4 - */ - fadeToggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Display or hide the matched elements by animating their opacity. - * - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/fadeToggle/ }\` - * @since 1.0 - * @since 1.4.3 - */ - fadeToggle(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; - /** - * Display or hide the matched elements by animating their opacity. - * - * @param duration_easing_complete_options A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see \`{@link https://api.jquery.com/fadeToggle/ }\` - * @since 1.0 - * @since 1.4.3 - */ - fadeToggle(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param selector A string containing a selector expression to match the current set of elements against. - * One or more DOM elements to match the current set of elements against. - * An existing jQuery object to match the current set of elements against. - * A function used as a test for each element in the set. this is the current DOM element. - * @see \`{@link https://api.jquery.com/filter/ }\` - * @since 1.0 - * @since 1.4 - */ - filter(selector: JQuery.Selector | JQuery.TypeOrArray | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): this; - /** - * Get the descendants of each element in the current set of matched elements, filtered by a selector, - * jQuery object, or element. - * - * @param selector A string containing a selector expression to match elements against. - * An element or a jQuery object to match elements against. - * @see \`{@link https://api.jquery.com/find/ }\` - * @since 1.0 - * @since 1.6 - */ - find(selector: JQuery.Selector | Element | JQuery): this; - /** - * Stop the currently-running animation, remove all queued animations, and complete all animations for - * the matched elements. - * - * @param queue The name of the queue in which to stop animations. - * @see \`{@link https://api.jquery.com/finish/ }\` - * @since 1.9 - */ - finish(queue?: string): this; - /** - * Reduce the set of matched elements to the first in the set. - * - * @see \`{@link https://api.jquery.com/first/ }\` - * @since 1.4 - */ - first(): this; - /** - * Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/focus/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - focus(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/focus/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - focus(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "focusin" event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/focusin/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - focusin(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "focusin" event. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/focusin/ }\` - * @since 1.4 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - focusin(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "focusout" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/focusout/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - focusout(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "focusout" JavaScript event. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/focusout/ }\` - * @since 1.4 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - focusout(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Retrieve one of the elements matched by the jQuery object. - * - * @param index A zero-based integer indicating which element to retrieve. - * @see \`{@link https://api.jquery.com/get/ }\` - * @since 1.0 - */ - get(index: number): TElement; - /** - * Retrieve the elements matched by the jQuery object. - * - * @see \`{@link https://api.jquery.com/get/ }\` - * @since 1.0 - */ - get(): TElement[]; - /** - * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. - * - * @param selector A string containing a selector expression to match elements against. - * A DOM element to match elements against. - * @see \`{@link https://api.jquery.com/has/ }\` - * @since 1.4 - */ - has(selector: string | Element): this; - /** - * Determine whether any of the matched elements are assigned the given class. - * - * @param className The class name to search for. - * @see \`{@link https://api.jquery.com/hasClass/ }\` - * @since 1.2 - */ - hasClass(className: string): boolean; - /** - * Set the CSS height of every matched element. - * - * @param value An integer representing the number of pixels, or an integer with an optional unit of measure - * appended (as a string). - * A function returning the height to set. Receives the index position of the element in the set and - * the old height as arguments. Within the function, this refers to the current element in the set. - * @see \`{@link https://api.jquery.com/height/ }\` - * @since 1.0 - * @since 1.4.1 - */ - height(value: string | number | ((this: TElement, index: number, height: number) => string | number)): this; - /** - * Get the current computed height for the first element in the set of matched elements. - * - * @see \`{@link https://api.jquery.com/height/ }\` - * @since 1.0 - */ - height(): number | undefined; - /** - * Hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/hide/ }\` - * @since 1.4.3 - */ - hide(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): this; - /** - * Hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing_complete A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/hide/ }\` - * @since 1.0 - * @since 1.4.3 - */ - hide(duration: JQuery.Duration, easing_complete: string | ((this: TElement) => void)): this; - /** - * Hide the matched elements. - * - * @param duration_complete_options A string or number determining how long the animation will run. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see \`{@link https://api.jquery.com/hide/ }\` - * @since 1.0 - */ - hide(duration_complete_options?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Bind one or two handlers to the matched elements, to be executed when the mouse pointer enters and - * leaves the elements. - * - * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. - * @param handlerOut A function to execute when the mouse pointer leaves the element. - * @see \`{@link https://api.jquery.com/hover/ }\` - * @since 1.0 - * @since 1.4 - */ - // HACK: The type parameter T is not used but ensures the 'event' callback parameter is typed correctly. - // tslint:disable-next-line:no-unnecessary-generics - hover(handlerInOut: JQuery.EventHandler | JQuery.EventHandlerBase> | false, - handlerOut?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Set the HTML contents of each element in the set of matched elements. - * - * @param htmlString A string of HTML to set as the content of each matched element. - * A function returning the HTML content to set. Receives the index position of the element in the set - * and the old HTML value as arguments. jQuery empties the element before calling the function; use the - * oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. - * @see \`{@link https://api.jquery.com/html/ }\` - * @since 1.0 - * @since 1.4 - */ - html(htmlString: JQuery.htmlString | ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString)): this; - /** - * Get the HTML contents of the first element in the set of matched elements. - * - * @see \`{@link https://api.jquery.com/html/ }\` - * @since 1.0 - */ - html(): string; - /** - * Search for a given element from among the matched elements. - * - * @param element The DOM element or first element within the jQuery object to look for. - * A selector representing a jQuery collection in which to look for an element. - * @see \`{@link https://api.jquery.com/index/ }\` - * @since 1.0 - * @since 1.4 - */ - index(element?: JQuery.Selector | Element | JQuery): number; - /** - * Set the CSS inner height of each element in the set of matched elements. - * - * @param value A number representing the number of pixels, or a number along with an optional unit of measure - * appended (as a string). - * A function returning the inner height (including padding but not border) to set. Receives the index - * position of the element in the set and the old inner height as arguments. Within the function, this - * refers to the current element in the set. - * @see \`{@link https://api.jquery.com/innerHeight/ }\` - * @since 1.8.0 - */ - innerHeight(value: string | number | ((this: TElement, index: number, height: number) => string | number)): this; - /** - * Get the current computed height for the first element in the set of matched elements, including - * padding but not border. - * - * @see \`{@link https://api.jquery.com/innerHeight/ }\` - * @since 1.2.6 - */ - innerHeight(): number | undefined; - /** - * Set the CSS inner width of each element in the set of matched elements. - * - * @param value A number representing the number of pixels, or a number along with an optional unit of measure - * appended (as a string). - * A function returning the inner width (including padding but not border) to set. Receives the index - * position of the element in the set and the old inner width as arguments. Within the function, this - * refers to the current element in the set. - * @see \`{@link https://api.jquery.com/innerWidth/ }\` - * @since 1.8.0 - */ - innerWidth(value: string | number | ((this: TElement, index: number, width: number) => string | number)): this; - /** - * Get the current computed inner width for the first element in the set of matched elements, including - * padding but not border. - * - * @see \`{@link https://api.jquery.com/innerWidth/ }\` - * @since 1.2.6 - */ - innerWidth(): number | undefined; - /** - * Insert every element in the set of matched elements after the target. - * - * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements - * will be inserted after the element(s) specified by this parameter. - * @see \`{@link https://api.jquery.com/insertAfter/ }\` - * @since 1.0 - */ - insertAfter(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; - /** - * Insert every element in the set of matched elements before the target. - * - * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements - * will be inserted before the element(s) specified by this parameter. - * @see \`{@link https://api.jquery.com/insertBefore/ }\` - * @since 1.0 - */ - insertBefore(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return - * true if at least one of these elements matches the given arguments. - * - * @param selector A string containing a selector expression to match elements against. - * A function used as a test for every element in the set. It accepts two arguments, index, which is - * the element's index in the jQuery collection, and element, which is the DOM element. Within the - * function, this refers to the current DOM element. - * An existing jQuery object to match the current set of elements against. - * One or more elements to match the current set of elements against. - * @see \`{@link https://api.jquery.com/is/ }\` - * @since 1.0 - * @since 1.6 - */ - is(selector: JQuery.Selector | JQuery.TypeOrArray | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): boolean; - /** - * Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/keydown/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - keydown(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/keydown/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - keydown(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/keypress/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - keypress(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/keypress/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - keypress(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/keyup/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - keyup(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/keyup/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - keyup(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Reduce the set of matched elements to the final one in the set. - * - * @see \`{@link https://api.jquery.com/last/ }\` - * @since 1.4 - */ - last(): this; - /** - * Load data from the server and place the returned HTML into the matched element. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param complete A callback function that is executed when the request completes. - * @see \`{@link https://api.jquery.com/load/ }\` - * @since 1.0 - */ - load(url: string, - data: string | JQuery.PlainObject, - complete: (this: TElement, responseText: string, textStatus: JQuery.Ajax.TextStatus, jqXHR: JQuery.jqXHR) => void): this; - /** - * Load data from the server and place the returned HTML into the matched element. - * - * @param url A string containing the URL to which the request is sent. - * @param complete_data A callback function that is executed when the request completes. - * A plain object or string that is sent to the server with the request. - * @see \`{@link https://api.jquery.com/load/ }\` - * @since 1.0 - */ - load(url: string, - complete_data?: ((this: TElement, responseText: string, textStatus: JQuery.Ajax.TextStatus, jqXHR: JQuery.jqXHR) => void) | string | JQuery.PlainObject): this; - /** - * Pass each element in the current matched set through a function, producing a new jQuery object - * containing the return values. - * - * @param callback A function object that will be invoked for each element in the current set. - * @see \`{@link https://api.jquery.com/map/ }\` - * @since 1.2 - */ - map(callback: (this: TElement, index: number, domElement: TElement) => JQuery.TypeOrArray | null | undefined): JQuery; - /** - * Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mousedown/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mousedown(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mousedown/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mousedown(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mouseenter/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mouseenter(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mouseenter/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mouseenter(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mouseleave/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mouseleave(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mouseleave/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mouseleave(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mousemove/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mousemove(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mousemove/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mousemove(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mouseout/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mouseout(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mouseout/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mouseout(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mouseover/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mouseover(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mouseover/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mouseover(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mouseup/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mouseup(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/mouseup/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - mouseup(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Get the immediately following sibling of each element in the set of matched elements. If a selector - * is provided, it retrieves the next sibling only if it matches that selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see \`{@link https://api.jquery.com/next/ }\` - * @since 1.0 - */ - next(selector?: JQuery.Selector): this; - /** - * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see \`{@link https://api.jquery.com/nextAll/ }\` - * @since 1.2 - */ - nextAll(selector?: string): this; - /** - * Get all following siblings of each element up to but not including the element matched by the - * selector, DOM node, or jQuery object passed. - * - * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. - * A DOM node or jQuery object indicating where to stop matching following sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see \`{@link https://api.jquery.com/nextUntil/ }\` - * @since 1.4 - * @since 1.6 - */ - nextUntil(selector?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; - /** - * Remove elements from the set of matched elements. - * - * @param selector A string containing a selector expression, a DOM element, or an array of elements to match against the set. - * A function used as a test for each element in the set. It accepts two arguments, index, which is the - * element's index in the jQuery collection, and element, which is the DOM element. Within the - * function, this refers to the current DOM element. - * An existing jQuery object to match the current set of elements against. - * @see \`{@link https://api.jquery.com/not/ }\` - * @since 1.0 - * @since 1.4 - */ - not(selector: JQuery.Selector | JQuery.TypeOrArray | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): this; - /** - * Remove an event handler. - * - * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as - * "click", "keydown.myPlugin", or ".myPlugin". - * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/off/ }\` - * @since 1.7 - */ - off(events: string, selector: JQuery.Selector, handler: JQuery.EventHandlerBase> | false): this; - /** - * Remove an event handler. - * - * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as - * "click", "keydown.myPlugin", or ".myPlugin". - * @param selector_handler A selector which should match the one originally passed to .on() when attaching event handlers. - * A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/off/ }\` - * @since 1.7 - */ - off(events: string, selector_handler?: JQuery.Selector | JQuery.EventHandlerBase> | false): this; - /** - * Remove an event handler. - * - * @param events An object where the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent handler functions previously attached for the event(s). - * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. - * @see \`{@link https://api.jquery.com/off/ }\` - * @since 1.7 - */ - off(events: JQuery.PlainObject> | false>, selector?: JQuery.Selector): this; - /** - * Remove an event handler. - * - * @param event A jQuery.Event object. - * @see \`{@link https://api.jquery.com/off/ }\` - * @since 1.7 - */ - off(event?: JQuery.Event): this; - /** - * Set the current coordinates of every element in the set of matched elements, relative to the document. - * - * @param coordinates An object containing the properties top and left, which are numbers indicating the new top and left - * coordinates for the elements. - * A function to return the coordinates to set. Receives the index of the element in the collection as - * the first argument and the current coordinates as the second argument. The function should return an - * object with the new top and left properties. - * @see \`{@link https://api.jquery.com/offset/ }\` - * @since 1.4 - */ - offset(coordinates: JQuery.CoordinatesPartial | ((this: TElement, index: number, coords: JQuery.Coordinates) => JQuery.CoordinatesPartial)): this; - /** - * Get the current coordinates of the first element in the set of matched elements, relative to the document. - * - * @see \`{@link https://api.jquery.com/offset/ }\` - * @since 1.2 - */ - offset(): JQuery.Coordinates | undefined; - /** - * Get the closest ancestor element that is positioned. - * - * @see \`{@link https://api.jquery.com/offsetParent/ }\` - * @since 1.2.6 - */ - offsetParent(): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the - * selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. - * @see \`{@link https://api.jquery.com/on/ }\` - * @since 1.7 - */ - on(events: string, - selector: JQuery.Selector | null, - data: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the - * selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. - * @see \`{@link https://api.jquery.com/on/ }\` - * @since 1.7 - */ - on(events: string, - selector: JQuery.Selector | null, - data: any, - handler: ((event: JQueryEventObject) => void)): this; // tslint:disable-line:unified-signatures - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the - * selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand - * for a function that simply does return false. - * @see \`{@link https://api.jquery.com/on/ }\` - * @since 1.7 - */ - on(events: string, - selector: JQuery.Selector, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the - * selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param handler A function to execute when the event is triggered. - * @see \`{@link https://api.jquery.com/on/ }\` - * @since 1.7 - */ - on(events: string, - selector: JQuery.Selector, - handler: ((event: JQueryEventObject) => void)): this; // tslint:disable-line:unified-signatures - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. - * @see \`{@link https://api.jquery.com/on/ }\` - * @since 1.7 - */ - on(events: string, - data: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. - * @see \`{@link https://api.jquery.com/on/ }\` - * @since 1.7 - */ - on(events: string, - data: any, // tslint:disable-line:unified-signatures - handler: ((event: JQueryEventObject) => void)): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand - * for a function that simply does return false. - * @see \`{@link https://api.jquery.com/on/ }\` - * @since 1.7 - */ - on(events: string, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param handler A function to execute when the event is triggered. - * @see \`{@link https://api.jquery.com/on/ }\` - * @since 1.7 - */ - on(events: string, - handler: ((event: JQueryEventObject) => void)): this; // tslint:disable-line:unified-signatures - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If - * the selector is null or omitted, the handler is always called when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see \`{@link https://api.jquery.com/on/ }\` - * @since 1.7 - */ - on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, - selector: JQuery.Selector | null, - data: TData): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If - * the selector is null or omitted, the handler is always called when it reaches the selected element. - * @see \`{@link https://api.jquery.com/on/ }\` - * @since 1.7 - */ - on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, - selector: JQuery.Selector): this; // tslint:disable-line:unified-signatures - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see \`{@link https://api.jquery.com/on/ }\` - * @since 1.7 - */ - on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, - data: TData): this; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @see \`{@link https://api.jquery.com/on/ }\` - * @since 1.7 - */ - on(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the - * selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. - * @see \`{@link https://api.jquery.com/one/ }\` - * @since 1.7 - */ - one(events: string, - selector: JQuery.Selector | null, - data: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the - * selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand - * for a function that simply does return false. - * @see \`{@link https://api.jquery.com/one/ }\` - * @since 1.7 - */ - one(events: string, - selector: JQuery.Selector, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. - * @see \`{@link https://api.jquery.com/one/ }\` - * @since 1.7 - */ - one(events: string, - data: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand - * for a function that simply does return false. - * @see \`{@link https://api.jquery.com/one/ }\` - * @since 1.7 - */ - one(events: string, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If - * the selector is null or omitted, the handler is always called when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see \`{@link https://api.jquery.com/one/ }\` - * @since 1.7 - */ - one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, - selector: JQuery.Selector | null, - data: TData): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If - * the selector is null or omitted, the handler is always called when it reaches the selected element. - * @see \`{@link https://api.jquery.com/one/ }\` - * @since 1.7 - */ - one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, - selector: JQuery.Selector): this; // tslint:disable-line:unified-signatures - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see \`{@link https://api.jquery.com/one/ }\` - * @since 1.7 - */ - one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>, - data: TData): this; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional - * namespaces, and the values represent a handler function to be called for the event(s). - * @see \`{@link https://api.jquery.com/one/ }\` - * @since 1.7 - */ - one(events: JQuery.PlainObject | JQuery.EventHandlerBase> | false>): this; - /** - * Set the CSS outer height of each element in the set of matched elements. - * - * @param value A number representing the number of pixels, or a number along with an optional unit of measure - * appended (as a string). - * @see \`{@link https://api.jquery.com/outerHeight/ }\` - * @since 1.8.0 - */ - outerHeight(value: string | number | ((this: TElement, index: number, height: number) => string | number)): this; - /** - * Get the current computed outer height (including padding, border, and optionally margin) for the - * first element in the set of matched elements. - * - * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. - * @see \`{@link https://api.jquery.com/outerHeight/ }\` - * @since 1.2.6 - */ - outerHeight(includeMargin?: boolean): number | undefined; - /** - * Set the CSS outer width of each element in the set of matched elements. - * - * @param value A number representing the number of pixels, or a number along with an optional unit of measure - * appended (as a string). - * A function returning the outer width to set. Receives the index position of the element in the set - * and the old outer width as arguments. Within the function, this refers to the current element in the set. - * @see \`{@link https://api.jquery.com/outerWidth/ }\` - * @since 1.8.0 - */ - outerWidth(value: string | number | ((this: TElement, index: number, width: number) => string | number)): this; - /** - * Get the current computed outer width (including padding, border, and optionally margin) for the - * first element in the set of matched elements. - * - * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. - * @see \`{@link https://api.jquery.com/outerWidth/ }\` - * @since 1.2.6 - */ - outerWidth(includeMargin?: boolean): number | undefined; - /** - * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see \`{@link https://api.jquery.com/parent/ }\` - * @since 1.0 - */ - parent(selector?: JQuery.Selector): this; - /** - * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see \`{@link https://api.jquery.com/parents/ }\` - * @since 1.0 - */ - parents(selector?: JQuery.Selector): this; - /** - * Get the ancestors of each element in the current set of matched elements, up to but not including - * the element matched by the selector, DOM node, or jQuery object. - * - * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. - * A DOM node or jQuery object indicating where to stop matching ancestor elements. - * @param filter A string containing a selector expression to match elements against. - * @see \`{@link https://api.jquery.com/parentsUntil/ }\` - * @since 1.4 - * @since 1.6 - */ - parentsUntil(selector?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; - /** - * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. - * - * @see \`{@link https://api.jquery.com/position/ }\` - * @since 1.2 - */ - position(): JQuery.Coordinates; - /** - * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. - * - * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or - * jQuery objects to insert at the beginning of each element in the set of matched elements. - * @see \`{@link https://api.jquery.com/prepend/ }\` - * @since 1.0 - */ - prepend(...contents: Array>>): this; - /** - * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. - * - * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at - * the beginning of each element in the set of matched elements. Receives the index position of the - * element in the set and the old HTML value of the element as arguments. Within the function, this - * refers to the current element in the set. - * @see \`{@link https://api.jquery.com/prepend/ }\` - * @since 1.4 - */ - prepend(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray>): this; - /** - * Insert every element in the set of matched elements to the beginning of the target. - * - * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements - * will be inserted at the beginning of the element(s) specified by this parameter. - * @see \`{@link https://api.jquery.com/prependTo/ }\` - * @since 1.0 - */ - prependTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; - /** - * Get the immediately preceding sibling of each element in the set of matched elements. If a selector - * is provided, it retrieves the previous sibling only if it matches that selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see \`{@link https://api.jquery.com/prev/ }\` - * @since 1.0 - */ - prev(selector?: JQuery.Selector): this; - /** - * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see \`{@link https://api.jquery.com/prevAll/ }\` - * @since 1.2 - */ - prevAll(selector?: JQuery.Selector): this; - /** - * Get all preceding siblings of each element up to but not including the element matched by the - * selector, DOM node, or jQuery object. - * - * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. - * A DOM node or jQuery object indicating where to stop matching preceding sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see \`{@link https://api.jquery.com/prevUntil/ }\` - * @since 1.4 - * @since 1.6 - */ - prevUntil(selector?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; - /** - * Return a Promise object to observe when all actions of a certain type bound to the collection, - * queued or not, have finished. - * - * @param type The type of queue that needs to be observed. - * @param target Object onto which the promise methods have to be attached - * @see \`{@link https://api.jquery.com/promise/ }\` - * @since 1.6 - */ - promise(type: string, target: T): T & JQuery.Promise; - /** - * Return a Promise object to observe when all actions of a certain type bound to the collection, - * queued or not, have finished. - * - * @param target Object onto which the promise methods have to be attached - * @see \`{@link https://api.jquery.com/promise/ }\` - * @since 1.6 - */ - promise(target: T): T & JQuery.Promise; - /** - * Return a Promise object to observe when all actions of a certain type bound to the collection, - * queued or not, have finished. - * - * @param type The type of queue that needs to be observed. - * @see \`{@link https://api.jquery.com/promise/ }\` - * @since 1.6 - */ - promise(type?: string): JQuery.Promise; - /** - * Set one or more properties for the set of matched elements. - * - * @param propertyName The name of the property to set. - * @param value A function returning the value to set. Receives the index position of the element in the set and the - * old property value as arguments. Within the function, the keyword this refers to the current element. - * @see \`{@link https://api.jquery.com/prop/ }\` - * @since 1.6 - */ - prop(propertyName: string, value: (this: TElement, index: number, oldPropertyValue: any) => any): this; - /** - * Set one or more properties for the set of matched elements. - * - * @param propertyName The name of the property to set. - * @param value A value to set for the property. - * @see \`{@link https://api.jquery.com/prop/ }\` - * @since 1.6 - */ - prop(propertyName: string, value: any): this; // tslint:disable-line:unified-signatures - /** - * Set one or more properties for the set of matched elements. - * - * @param properties An object of property-value pairs to set. - * @see \`{@link https://api.jquery.com/prop/ }\` - * @since 1.6 - */ - prop(properties: JQuery.PlainObject): this; - /** - * Get the value of a property for the first element in the set of matched elements. - * - * @param propertyName The name of the property to get. - * @see \`{@link https://api.jquery.com/prop/ }\` - * @since 1.6 - */ - prop(propertyName: string): any | undefined; - /** - * Add a collection of DOM elements onto the jQuery stack. - * - * @param elements An array of elements to push onto the stack and make into a new jQuery object. - * @param name The name of a jQuery method that generated the array of elements. - * @param args The arguments that were passed in to the jQuery method (for serialization). - * @see \`{@link https://api.jquery.com/pushStack/ }\` - * @since 1.3 - */ - pushStack(elements: ArrayLike, name: string, args: any[]): this; - /** - * Add a collection of DOM elements onto the jQuery stack. - * - * @param elements An array of elements to push onto the stack and make into a new jQuery object. - * @see \`{@link https://api.jquery.com/pushStack/ }\` - * @since 1.0 - */ - pushStack(elements: ArrayLike): this; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item. - * An array of functions to replace the current queue contents. - * @see \`{@link https://api.jquery.com/queue/ }\` - * @since 1.2 - */ - queue(queueName: string, newQueue: JQuery.TypeOrArray>): this; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item. - * An array of functions to replace the current queue contents. - * @see \`{@link https://api.jquery.com/queue/ }\` - * @since 1.2 - */ - queue(newQueue: JQuery.TypeOrArray>): this; - /** - * Show the queue of functions to be executed on the matched elements. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see \`{@link https://api.jquery.com/queue/ }\` - * @since 1.2 - */ - queue(queueName?: string): JQuery.Queue; - /** - * Specify a function to execute when the DOM is fully loaded. - * - * @param handler A function to execute after the DOM is ready. - * @see \`{@link https://api.jquery.com/ready/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.0. Use `jQuery(function() { })`. - */ - ready(handler: ($: JQueryStatic) => void): this; - /** - * Remove the set of matched elements from the DOM. - * - * @param selector A selector expression that filters the set of matched elements to be removed. - * @see \`{@link https://api.jquery.com/remove/ }\` - * @since 1.0 - */ - remove(selector?: string): this; - /** - * Remove an attribute from each element in the set of matched elements. - * - * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. - * @see \`{@link https://api.jquery.com/removeAttr/ }\` - * @since 1.0 - */ - removeAttr(attributeName: string): this; - /** - * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. - * - * @param className One or more space-separated classes to be removed from the class attribute of each matched element. - * An array of classes to be removed from the class attribute of each matched element. - * A function returning one or more space-separated class names to be removed. Receives the index - * position of the element in the set and the old class value as arguments. - * @see \`{@link https://api.jquery.com/removeClass/ }\` - * @since 1.0 - * @since 1.4 - * @since 3.3 - */ - removeClass(className?: JQuery.TypeOrArray | ((this: TElement, index: number, className: string) => string)): this; - /** - * Remove a previously-stored piece of data. - * - * @param name A string naming the piece of data to delete. - * An array or space-separated string naming the pieces of data to delete. - * @see \`{@link https://api.jquery.com/removeData/ }\` - * @since 1.2.3 - * @since 1.7 - */ - removeData(name?: JQuery.TypeOrArray): this; - /** - * Remove a property for the set of matched elements. - * - * @param propertyName The name of the property to remove. - * @see \`{@link https://api.jquery.com/removeProp/ }\` - * @since 1.6 - */ - removeProp(propertyName: string): this; - /** - * Replace each target element with the set of matched elements. - * - * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. - * @see \`{@link https://api.jquery.com/replaceAll/ }\` - * @since 1.2 - */ - replaceAll(target: JQuery.Selector | JQuery | JQuery.TypeOrArray): this; - /** - * Replace each element in the set of matched elements with the provided new content and return the set - * of elements that was removed. - * - * @param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. - * A function that returns content with which to replace the set of matched elements. - * @see \`{@link https://api.jquery.com/replaceWith/ }\` - * @since 1.2 - * @since 1.4 - */ - replaceWith(newContent: JQuery.htmlString | JQuery | JQuery.TypeOrArray | ((this: TElement) => any)): this; - /** - * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/resize/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - resize(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/resize/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - resize(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/scroll/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - scroll(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/scroll/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - scroll(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Set the current horizontal position of the scroll bar for each of the set of matched elements. - * - * @param value An integer indicating the new position to set the scroll bar to. - * @see \`{@link https://api.jquery.com/scrollLeft/ }\` - * @since 1.2.6 - */ - scrollLeft(value: number): this; - /** - * Get the current horizontal position of the scroll bar for the first element in the set of matched elements. - * - * @see \`{@link https://api.jquery.com/scrollLeft/ }\` - * @since 1.2.6 - */ - scrollLeft(): number | undefined; - /** - * Set the current vertical position of the scroll bar for each of the set of matched elements. - * - * @param value A number indicating the new position to set the scroll bar to. - * @see \`{@link https://api.jquery.com/scrollTop/ }\` - * @since 1.2.6 - */ - scrollTop(value: number): this; - /** - * Get the current vertical position of the scroll bar for the first element in the set of matched - * elements or set the vertical position of the scroll bar for every matched element. - * - * @see \`{@link https://api.jquery.com/scrollTop/ }\` - * @since 1.2.6 - */ - scrollTop(): number | undefined; - /** - * Bind an event handler to the "select" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/select/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - select(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "select" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/select/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - select(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Encode a set of form elements as a string for submission. - * - * @see \`{@link https://api.jquery.com/serialize/ }\` - * @since 1.0 - */ - serialize(): string; - /** - * Encode a set of form elements as an array of names and values. - * - * @see \`{@link https://api.jquery.com/serializeArray/ }\` - * @since 1.2 - */ - serializeArray(): JQuery.NameValuePair[]; - /** - * Display the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/show/ }\` - * @since 1.4.3 - */ - show(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): this; - /** - * Display the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing_complete A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/show/ }\` - * @since 1.0 - * @since 1.4.3 - */ - show(duration: JQuery.Duration, easing_complete: string | ((this: TElement) => void)): this; - /** - * Display the matched elements. - * - * @param duration_complete_options A string or number determining how long the animation will run. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see \`{@link https://api.jquery.com/show/ }\` - * @since 1.0 - */ - show(duration_complete_options?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see \`{@link https://api.jquery.com/siblings/ }\` - * @since 1.0 - */ - siblings(selector?: JQuery.Selector): this; - /** - * Reduce the set of matched elements to a subset specified by a range of indices. - * - * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, - * it indicates an offset from the end of the set. - * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, - * it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. - * @see \`{@link https://api.jquery.com/slice/ }\` - * @since 1.1.4 - */ - slice(start: number, end?: number): this; - /** - * Display the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/slideDown/ }\` - * @since 1.4.3 - */ - slideDown(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Display the matched elements with a sliding motion. - * - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/slideDown/ }\` - * @since 1.0 - * @since 1.4.3 - */ - slideDown(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; - /** - * Display the matched elements with a sliding motion. - * - * @param duration_easing_complete_options A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see \`{@link https://api.jquery.com/slideDown/ }\` - * @since 1.0 - * @since 1.4.3 - */ - slideDown(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Display or hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/slideToggle/ }\` - * @since 1.4.3 - */ - slideToggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Display or hide the matched elements with a sliding motion. - * - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/slideToggle/ }\` - * @since 1.0 - * @since 1.4.3 - */ - slideToggle(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; - /** - * Display or hide the matched elements with a sliding motion. - * - * @param duration_easing_complete_options A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see \`{@link https://api.jquery.com/slideToggle/ }\` - * @since 1.0 - * @since 1.4.3 - */ - slideToggle(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/slideUp/ }\` - * @since 1.4.3 - */ - slideUp(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Hide the matched elements with a sliding motion. - * - * @param duration_easing A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/slideUp/ }\` - * @since 1.0 - * @since 1.4.3 - */ - slideUp(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; - /** - * Hide the matched elements with a sliding motion. - * - * @param duration_easing_complete_options A string or number determining how long the animation will run. - * A string indicating which easing function to use for the transition. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * @see \`{@link https://api.jquery.com/slideUp/ }\` - * @since 1.0 - * @since 1.4.3 - */ - slideUp(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions): this; - /** - * Stop the currently-running animation on the matched elements. - * - * @param queue The name of the queue in which to stop animations. - * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. - * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. - * @see \`{@link https://api.jquery.com/stop/ }\` - * @since 1.7 - */ - stop(queue: string, clearQueue?: boolean, jumpToEnd?: boolean): this; - /** - * Stop the currently-running animation on the matched elements. - * - * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. - * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. - * @see \`{@link https://api.jquery.com/stop/ }\` - * @since 1.2 - */ - stop(clearQueue?: boolean, jumpToEnd?: boolean): this; - /** - * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/submit/ }\` - * @since 1.4.3 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - submit(eventData: TData, - handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** - * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. - * - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/submit/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.3. Use \`{@link JQuery.on }\` or \`{@link JQuery.trigger }\`. - */ - submit(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; - /** - * Set the content of each element in the set of matched elements to the specified text. - * - * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will - * be converted to a String representation. - * A function returning the text content to set. Receives the index position of the element in the set - * and the old text value as arguments. - * @see \`{@link https://api.jquery.com/text/ }\` - * @since 1.0 - * @since 1.4 - */ - text(text: string | number | boolean | ((this: TElement, index: number, text: string) => string | number | boolean)): this; - /** - * Get the combined text contents of each element in the set of matched elements, including their descendants. - * - * @see \`{@link https://api.jquery.com/text/ }\` - * @since 1.0 - */ - text(): string; - /** - * Retrieve all the elements contained in the jQuery set, as an array. - * - * @see \`{@link https://api.jquery.com/toArray/ }\` - * @since 1.4 - */ - toArray(): TElement[]; - /** - * Display or hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/toggle/ }\` - * @since 1.4.3 - */ - toggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; - /** - * Display or hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete, called once per matched element. - * @see \`{@link https://api.jquery.com/toggle/ }\` - * @since 1.0 - */ - toggle(duration: JQuery.Duration, complete: (this: TElement) => void): this; - /** - * Display or hide the matched elements. - * - * @param duration_complete_options_display A string or number determining how long the animation will run. - * A function to call once the animation is complete, called once per matched element. - * A map of additional options to pass to the method. - * Use true to show the element or false to hide it. - * @see \`{@link https://api.jquery.com/toggle/ }\` - * @since 1.0 - * @since 1.3 - */ - toggle(duration_complete_options_display?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions | boolean): this; - /** - * Add or remove one or more classes from each element in the set of matched elements, depending on - * either the class's presence or the value of the state argument. - * - * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. - * An array of classes to be toggled for each element in the matched set. - * A function that returns class names to be toggled in the class attribute of each element in the - * matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. - * @param state A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. - * @see \`{@link https://api.jquery.com/toggleClass/ }\` - * @since 1.0 - * @since 1.3 - * @since 1.4 - * @since 3.3 - */ - toggleClass(className: JQuery.TypeOrArray | ((this: TElement, index: number, className: string, state: TState) => string), - state?: TState): this; - /** - * Add or remove one or more classes from each element in the set of matched elements, depending on - * either the class's presence or the value of the state argument. - * - * @param state A boolean value to determine whether the class should be added or removed. - * @see \`{@link https://api.jquery.com/toggleClass/ }\` - * @since 1.4 - * - * @deprecated Deprecated since 3.0. See \`{@link https://github.com/jquery/jquery/pull/2618 }\`. - */ - toggleClass(state?: boolean): this; - /** - * Execute all handlers and behaviors attached to the matched elements for the given event type. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * A jQuery.Event object. - * @param extraParameters Additional parameters to pass along to the event handler. - * @see \`{@link https://api.jquery.com/trigger/ }\` - * @since 1.0 - * @since 1.3 - */ - trigger(eventType: string | JQuery.Event, extraParameters?: any[] | JQuery.PlainObject | string | number): this; - /** - * Execute all handlers attached to an element for an event. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * A jQuery.Event object. - * @param extraParameters Additional parameters to pass along to the event handler. - * @see \`{@link https://api.jquery.com/triggerHandler/ }\` - * @since 1.2 - * @since 1.3 - */ - triggerHandler(eventType: string | JQuery.Event, extraParameters?: any[] | JQuery.PlainObject | string | number): undefined | any; - /** - * Remove a previously-attached event handler from the elements. - * - * @param event A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/unbind/ }\` - * @since 1.0 - * @since 1.4.3 - * - * @deprecated Deprecated since 3.0. Use \`{@link JQuery.off }\`. - */ - unbind(event: string, handler: JQuery.EventHandlerBase> | false): this; - /** - * Remove a previously-attached event handler from the elements. - * - * @param event A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * A jQuery.Event object. - * @see \`{@link https://api.jquery.com/unbind/ }\` - * @since 1.0 - * - * @deprecated Deprecated since 3.0. Use \`{@link JQuery.off }\`. - */ - unbind(event?: string | JQuery.Event): this; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a - * specific set of root elements. - * - * @param selector A selector which will be used to filter the event results. - * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" - * @param handler A function to execute each time the event is triggered. - * @see \`{@link https://api.jquery.com/undelegate/ }\` - * @since 1.4.2 - * - * @deprecated Deprecated since 3.0. Use \`{@link JQuery.off }\`. - */ - undelegate(selector: JQuery.Selector, eventType: string, handler: JQuery.EventHandlerBase> | false): this; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a - * specific set of root elements. - * - * @param selector A selector which will be used to filter the event results. - * @param eventTypes A string containing a JavaScript event type, such as "click" or "keydown" - * An object of one or more event types and previously bound functions to unbind from them. - * @see \`{@link https://api.jquery.com/undelegate/ }\` - * @since 1.4.2 - * @since 1.4.3 - * - * @deprecated Deprecated since 3.0. Use \`{@link JQuery.off }\`. - */ - undelegate(selector: JQuery.Selector, eventTypes: string | JQuery.PlainObject> | false>): this; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a - * specific set of root elements. - * - * @param namespace A selector which will be used to filter the event results. - * @see \`{@link https://api.jquery.com/undelegate/ }\` - * @since 1.4.2 - * @since 1.6 - * - * @deprecated Deprecated since 3.0. Use \`{@link JQuery.off }\`. - */ - undelegate(namespace?: string): this; - /** - * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. - * - * @param selector A selector to check the parent element against. If an element's parent does not match the selector, - * the element won't be unwrapped. - * @see \`{@link https://api.jquery.com/unwrap/ }\` - * @since 1.4 - * @since 3.0 - */ - unwrap(selector?: string): this; - /** - * Set the value of each element in the set of matched elements. - * - * @param value A string of text, a number, or an array of strings corresponding to the value of each matched - * element to set as selected/checked. - * A function returning the value to set. this is the current element. Receives the index position of - * the element in the set and the old value as arguments. - * @see \`{@link https://api.jquery.com/val/ }\` - * @since 1.0 - * @since 1.4 - */ - val(value: string | number | string[] | ((this: TElement, index: number, value: string) => string)): this; - /** - * Get the current value of the first element in the set of matched elements. - * - * @see \`{@link https://api.jquery.com/val/ }\` - * @since 1.0 - */ - val(): string | number | string[] | undefined; - /** - * Set the CSS width of each element in the set of matched elements. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure - * appended (as a string). - * A function returning the width to set. Receives the index position of the element in the set and the - * old width as arguments. Within the function, this refers to the current element in the set. - * @see \`{@link https://api.jquery.com/width/ }\` - * @since 1.0 - * @since 1.4.1 - */ - width(value: string | number | ((this: TElement, index: number, value: number) => string | number)): this; - /** - * Get the current computed width for the first element in the set of matched elements. - * - * @see \`{@link https://api.jquery.com/width/ }\` - * @since 1.0 - */ - width(): number | undefined; - /** - * Wrap an HTML structure around each element in the set of matched elements. - * - * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the - * matched elements. When you pass a jQuery collection containing more than one element, or a selector - * matching more than one element, the first element will be used. - * A callback function returning the HTML content or jQuery object to wrap around the matched elements. - * Receives the index position of the element in the set as an argument. Within the function, this - * refers to the current element in the set. - * @see \`{@link https://api.jquery.com/wrap/ }\` - * @since 1.0 - * @since 1.4 - */ - wrap(wrappingElement: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement, index: number) => string | JQuery)): this; - /** - * Wrap an HTML structure around all elements in the set of matched elements. - * - * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. - * A callback function returning the HTML content or jQuery object to wrap around all the matched - * elements. Within the function, this refers to the first element in the set. Prior to jQuery 3.0, the - * callback was incorrectly called for every element in the set and received the index position of the - * element in the set as an argument. - * @see \`{@link https://api.jquery.com/wrapAll/ }\` - * @since 1.2 - * @since 1.4 - */ - wrapAll(wrappingElement: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement) => string | JQuery)): this; - /** - * Wrap an HTML structure around the content of each element in the set of matched elements. - * - * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap - * around the content of the matched elements. - * A callback function which generates a structure to wrap around the content of the matched elements. - * Receives the index position of the element in the set as an argument. Within the function, this - * refers to the current element in the set. - * @see \`{@link https://api.jquery.com/wrapInner/ }\` - * @since 1.2 - * @since 1.4 - */ - wrapInner(wrappingElement: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement, index: number) => string | JQuery | Element)): this; - - [n: number]: TElement; -} - -// #region ES5 compatibility - -// tslint:disable-next-line:no-empty-interface -interface Iterable { } - -interface SymbolConstructor { - /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built-in method Object.prototype.toString. - */ - readonly toStringTag: symbol; -} - -declare var Symbol: SymbolConstructor; - -// #endregion - -declare namespace JQuery { - type TypeOrArray = T | T[]; - type Node = Element | Text | Comment | DocumentFragment; - - /** - * A string is designated htmlString in jQuery documentation when it is used to represent one or more - * DOM elements, typically to be created and inserted in the document. When passed as an argument of - * the jQuery() function, the string is identified as HTML if it starts with ) and is parsed - * as such until the final > character. Prior to jQuery 1.9, a string was considered to be HTML if it - * contained anywhere within the string. - */ - type htmlString = string; - /** - * A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most - * cases, the DOM document present in all browsers, but can also be an XML document received via Ajax. - */ - type Selector = string; - - /** - * The PlainObject type is a JavaScript object containing zero or more key-value pairs. The plain - * object is, in other words, an Object object. It is designated "plain" in jQuery documentation to - * distinguish it from other kinds of JavaScript objects: for example, null, user-defined arrays, and - * host objects such as document, all of which have a typeof value of "object." - */ - interface PlainObject { - [key: string]: T; - } - - // #region Ajax - - interface AjaxSettings extends Ajax.AjaxSettingsBase { - /** - * A string containing the URL to which the request is sent. - */ - url?: string; - /** - * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, - * XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and - * settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend - * function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless - * of the type of request. - */ - beforeSend?(this: TContext, jqXHR: jqXHR, settings: AjaxSettings): false | void; - } - - interface UrlAjaxSettings extends Ajax.AjaxSettingsBase { - /** - * A string containing the URL to which the request is sent. - */ - url: string; - /** - * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, - * XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and - * settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend - * function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless - * of the type of request. - */ - beforeSend?(this: TContext, jqXHR: jqXHR, settings: UrlAjaxSettings): false | void; - } - - namespace Ajax { - type SuccessTextStatus = 'success' | 'notmodified' | 'nocontent'; - type ErrorTextStatus = 'timeout' | 'error' | 'abort' | 'parsererror'; - type TextStatus = SuccessTextStatus | ErrorTextStatus; - - interface SuccessCallback { - (this: TContext, data: any, textStatus: SuccessTextStatus, jqXHR: jqXHR): void; - } - - interface ErrorCallback { - (this: TContext, jqXHR: jqXHR, textStatus: ErrorTextStatus, errorThrown: string): void; - } - - interface CompleteCallback { - (this: TContext, jqXHR: jqXHR, textStatus: TextStatus): void; - } - - /** - * @see \`{@link http://api.jquery.com/jquery.ajax/#jQuery-ajax-settings }\` - */ - interface AjaxSettingsBase { - /** - * A set of key/value pairs that map a given dataType to its MIME type, which gets sent in the Accept - * request header. This header tells the server what kind of response it will accept in return. - */ - accepts?: PlainObject; - /** - * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need - * synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests - * do not support synchronous operation. Note that synchronous requests may temporarily lock the - * browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: - * false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback - * options instead of the corresponding methods of the jqXHR object such as jqXHR.done(). - */ - async?: boolean; - /** - * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, - * XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and - * settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend - * function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless - * of the type of request. - */ - beforeSend?(this: TContext, jqXHR: jqXHR, settings: AjaxSettingsBase): false | void; - /** - * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache - * to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" - * to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a - * POST is made to a URL that has already been requested by a GET. - */ - cache?: boolean; - /** - * A function to be called when the request finishes (after success and error callbacks are executed). - * The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a - * string categorizing the status of the request ("success", "notmodified", "nocontent", "error", - * "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of - * functions. Each function will be called in turn. This is an Ajax Event. - */ - complete?: TypeOrArray>; - /** - * An object of string/regular-expression pairs that determine how jQuery will parse the response, - * given its content type. - */ - contents?: PlainObject; - /** - * When sending data to the server, use this content type. Default is - * "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly - * pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). - * As of jQuery 1.6 you can pass false to tell jQuery to not set any content type header. Note: The W3C - * XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset - * will not force the browser to change the encoding. Note: For cross-domain requests, setting the - * content type to anything other than application/x-www-form-urlencoded, multipart/form-data, or - * text/plain will trigger the browser to send a preflight OPTIONS request to the server. - */ - contentType?: string | false; - /** - * This object will be the context of all Ajax-related callbacks. By default, the context is an object - * that represents the Ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). - */ - context?: TContext; - /** - * An object containing dataType-to-dataType converters. Each converter's value is a function that - * returns the transformed value of the response. - */ - converters?: PlainObject<((value: any) => any) | true>; - /** - * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of - * crossDomain to true. This allows, for example, server-side redirection to another domain. - */ - crossDomain?: boolean; - /** - * Data to be sent to the server. It is converted to a query string, if not already a string. It's - * appended to the url for GET-requests. See processData option to prevent this automatic processing. - * Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same - * key based on the value of the traditional setting (described below). - */ - data?: PlainObject | string; - /** - * A function to be used to handle the raw response data of XMLHttpRequest. This is a pre-filtering - * function to sanitize the response. You should return the sanitized data. The function accepts two - * arguments: The raw data returned from the server and the 'dataType' parameter. - */ - dataFilter?(data: string, type: string): any; - /** - * The type of data that you're expecting back from the server. If none is specified, jQuery will try - * to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON - * will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be - * returned as a string). The available types (and the result passed as the first argument to your - * success callback) are: - * - * "xml": Returns a XML document that can be processed via jQuery. - * - * "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM. - * - * "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by - * appending a query string parameter, _=[TIMESTAMP], to the URL unless the cache option is set to - * true. Note: This will turn POSTs into GETs for remote-domain requests. - * - * "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests - * are converted to "jsonp" unless the request includes jsonp: false in its request options. The JSON - * data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of - * jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} - * instead. (See json.org for more information on proper JSON formatting.) - * - * "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to - * specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to - * the URL unless the cache option is set to true. - * - * "text": A plain text string. - * - * multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it - * received in the Content-Type header to what you require. For example, if you want a text response to - * be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it - * received as text, and interpreted by jQuery as XML: "jsonp text xml". Similarly, a shorthand string - * such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from - * jsonp to text, and then from text to xml. - */ - dataType?: 'xml' | 'html' | 'script' | 'json' | 'jsonp' | 'text' | string; - /** - * A function to be called if the request fails. The function receives three arguments: The jqXHR (in - * jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an - * optional exception object, if one occurred. Possible values for the second argument (besides null) - * are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives - * the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery - * 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: - * This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. - */ - error?: TypeOrArray>; - /** - * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to - * prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to - * control various Ajax Events. - */ - global?: boolean; - /** - * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest - * transport. The header X-Requested-With: XMLHttpRequest is always added, but its default - * XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from - * within the beforeSend function. - */ - headers?: PlainObject; - /** - * Allow the request to be successful only if the response has changed since the last request. This is - * done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery - * 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. - */ - ifModified?: boolean; - /** - * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery - * does not recognize it as such by default. The following protocols are currently recognized as local: - * file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so - * once in the $.ajaxSetup() method. - */ - isLocal?: boolean; - /** - * Override the callback function name in a JSONP request. This value will be used instead of - * 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would - * result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false - * prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for - * transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, - * { jsonp: false, jsonpCallback: "callbackName" }. If you don't trust the target of your Ajax - * requests, consider setting the jsonp property to false for security reasons. - */ - jsonp?: string | false; - /** - * Specify the callback function name for a JSONP request. This value will be used instead of the - * random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name - * as it'll make it easier to manage the requests and provide callbacks and error handling. You may - * want to specify the callback when you want to enable better browser caching of GET requests. As of - * jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback - * is set to the return value of that function. - */ - jsonpCallback?: string | ((this: TContext) => string); - /** - * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). - */ - method?: string; - /** - * A mime type to override the XHR mime type. - */ - mimeType?: string; - /** - * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. - */ - password?: string; - /** - * By default, data passed in to the data option as an object (technically, anything other than a - * string) will be processed and transformed into a query string, fitting to the default content-type - * "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, - * set this option to false. - */ - processData?: boolean; - /** - * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or - * "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. - * Used when the character set on the local page is not the same as the one on the remote script. - */ - scriptCharset?: string; - /** - * An object of numeric HTTP codes and functions to be called when the response has the corresponding - * code. - * - * If the request is successful, the status code functions take the same parameters as the success - * callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. - */ - statusCode?: StatusCodeCallbacks; - /** - * A function to be called if the request succeeds. The function gets passed three arguments: The data - * returned from the server, formatted according to the dataType parameter or the dataFilter callback - * function, if specified; a string describing the status; and the jqXHR (in jQuery 1.4.x, - * XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each - * function will be called in turn. This is an Ajax Event. - */ - success?: TypeOrArray>; - /** - * Set a timeout (in milliseconds) for the request. A value of 0 means there will be no timeout. This - * will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the - * $.ajax call is made; if several other requests are in progress and the browser has no connections - * available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and - * below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any - * object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be - * cancelled by a timeout; the script will run even if it arrives after the timeout period. - */ - timeout?: number; - /** - * Set this to true if you wish to use the traditional style of param serialization. - */ - traditional?: boolean; - /** - * An alias for method. You should use type if you're using versions of jQuery prior to 1.9.0. - */ - type?: string; - /** - * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. - */ - username?: string; - // ActiveXObject requires "lib": ["scripthost"] which consumers would also require - /** - * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), - * the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or - * enhancements to the factory. - */ - xhr?(): XMLHttpRequest; - /** - * An object of fieldName-fieldValue pairs to set on the native XHR object. - * - * In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS - * requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ - * should you require the use of it. - */ - xhrFields?: XHRFields; - } - - type StatusCodeCallbacks = { - // #region Success Status Codes - - // jQuery treats 2xx and 304 status codes as a success - - 200?: SuccessCallback; - 201?: SuccessCallback; - 202?: SuccessCallback; - 203?: SuccessCallback; - 204?: SuccessCallback; - 205?: SuccessCallback; - 206?: SuccessCallback; - 207?: SuccessCallback; - 208?: SuccessCallback; - 209?: SuccessCallback; - 210?: SuccessCallback; - 211?: SuccessCallback; - 212?: SuccessCallback; - 213?: SuccessCallback; - 214?: SuccessCallback; - 215?: SuccessCallback; - 216?: SuccessCallback; - 217?: SuccessCallback; - 218?: SuccessCallback; - 219?: SuccessCallback; - 220?: SuccessCallback; - 221?: SuccessCallback; - 222?: SuccessCallback; - 223?: SuccessCallback; - 224?: SuccessCallback; - 225?: SuccessCallback; - 226?: SuccessCallback; - 227?: SuccessCallback; - 228?: SuccessCallback; - 229?: SuccessCallback; - 230?: SuccessCallback; - 231?: SuccessCallback; - 232?: SuccessCallback; - 233?: SuccessCallback; - 234?: SuccessCallback; - 235?: SuccessCallback; - 236?: SuccessCallback; - 237?: SuccessCallback; - 238?: SuccessCallback; - 239?: SuccessCallback; - 240?: SuccessCallback; - 241?: SuccessCallback; - 242?: SuccessCallback; - 243?: SuccessCallback; - 244?: SuccessCallback; - 245?: SuccessCallback; - 246?: SuccessCallback; - 247?: SuccessCallback; - 248?: SuccessCallback; - 249?: SuccessCallback; - 250?: SuccessCallback; - 251?: SuccessCallback; - 252?: SuccessCallback; - 253?: SuccessCallback; - 254?: SuccessCallback; - 255?: SuccessCallback; - 256?: SuccessCallback; - 257?: SuccessCallback; - 258?: SuccessCallback; - 259?: SuccessCallback; - 260?: SuccessCallback; - 261?: SuccessCallback; - 262?: SuccessCallback; - 263?: SuccessCallback; - 264?: SuccessCallback; - 265?: SuccessCallback; - 266?: SuccessCallback; - 267?: SuccessCallback; - 268?: SuccessCallback; - 269?: SuccessCallback; - 270?: SuccessCallback; - 271?: SuccessCallback; - 272?: SuccessCallback; - 273?: SuccessCallback; - 274?: SuccessCallback; - 275?: SuccessCallback; - 276?: SuccessCallback; - 277?: SuccessCallback; - 278?: SuccessCallback; - 279?: SuccessCallback; - 280?: SuccessCallback; - 281?: SuccessCallback; - 282?: SuccessCallback; - 283?: SuccessCallback; - 284?: SuccessCallback; - 285?: SuccessCallback; - 286?: SuccessCallback; - 287?: SuccessCallback; - 288?: SuccessCallback; - 289?: SuccessCallback; - 290?: SuccessCallback; - 291?: SuccessCallback; - 292?: SuccessCallback; - 293?: SuccessCallback; - 294?: SuccessCallback; - 295?: SuccessCallback; - 296?: SuccessCallback; - 297?: SuccessCallback; - 298?: SuccessCallback; - 299?: SuccessCallback; - 304?: SuccessCallback; - - // #endregion - - // #region Error Status Codes - - 300?: ErrorCallback; - 301?: ErrorCallback; - 302?: ErrorCallback; - 303?: ErrorCallback; - 305?: ErrorCallback; - 306?: ErrorCallback; - 307?: ErrorCallback; - 308?: ErrorCallback; - 309?: ErrorCallback; - 310?: ErrorCallback; - 311?: ErrorCallback; - 312?: ErrorCallback; - 313?: ErrorCallback; - 314?: ErrorCallback; - 315?: ErrorCallback; - 316?: ErrorCallback; - 317?: ErrorCallback; - 318?: ErrorCallback; - 319?: ErrorCallback; - 320?: ErrorCallback; - 321?: ErrorCallback; - 322?: ErrorCallback; - 323?: ErrorCallback; - 324?: ErrorCallback; - 325?: ErrorCallback; - 326?: ErrorCallback; - 327?: ErrorCallback; - 328?: ErrorCallback; - 329?: ErrorCallback; - 330?: ErrorCallback; - 331?: ErrorCallback; - 332?: ErrorCallback; - 333?: ErrorCallback; - 334?: ErrorCallback; - 335?: ErrorCallback; - 336?: ErrorCallback; - 337?: ErrorCallback; - 338?: ErrorCallback; - 339?: ErrorCallback; - 340?: ErrorCallback; - 341?: ErrorCallback; - 342?: ErrorCallback; - 343?: ErrorCallback; - 344?: ErrorCallback; - 345?: ErrorCallback; - 346?: ErrorCallback; - 347?: ErrorCallback; - 348?: ErrorCallback; - 349?: ErrorCallback; - 350?: ErrorCallback; - 351?: ErrorCallback; - 352?: ErrorCallback; - 353?: ErrorCallback; - 354?: ErrorCallback; - 355?: ErrorCallback; - 356?: ErrorCallback; - 357?: ErrorCallback; - 358?: ErrorCallback; - 359?: ErrorCallback; - 360?: ErrorCallback; - 361?: ErrorCallback; - 362?: ErrorCallback; - 363?: ErrorCallback; - 364?: ErrorCallback; - 365?: ErrorCallback; - 366?: ErrorCallback; - 367?: ErrorCallback; - 368?: ErrorCallback; - 369?: ErrorCallback; - 370?: ErrorCallback; - 371?: ErrorCallback; - 372?: ErrorCallback; - 373?: ErrorCallback; - 374?: ErrorCallback; - 375?: ErrorCallback; - 376?: ErrorCallback; - 377?: ErrorCallback; - 378?: ErrorCallback; - 379?: ErrorCallback; - 380?: ErrorCallback; - 381?: ErrorCallback; - 382?: ErrorCallback; - 383?: ErrorCallback; - 384?: ErrorCallback; - 385?: ErrorCallback; - 386?: ErrorCallback; - 387?: ErrorCallback; - 388?: ErrorCallback; - 389?: ErrorCallback; - 390?: ErrorCallback; - 391?: ErrorCallback; - 392?: ErrorCallback; - 393?: ErrorCallback; - 394?: ErrorCallback; - 395?: ErrorCallback; - 396?: ErrorCallback; - 397?: ErrorCallback; - 398?: ErrorCallback; - 399?: ErrorCallback; - 400?: ErrorCallback; - 401?: ErrorCallback; - 402?: ErrorCallback; - 403?: ErrorCallback; - 404?: ErrorCallback; - 405?: ErrorCallback; - 406?: ErrorCallback; - 407?: ErrorCallback; - 408?: ErrorCallback; - 409?: ErrorCallback; - 410?: ErrorCallback; - 411?: ErrorCallback; - 412?: ErrorCallback; - 413?: ErrorCallback; - 414?: ErrorCallback; - 415?: ErrorCallback; - 416?: ErrorCallback; - 417?: ErrorCallback; - 418?: ErrorCallback; - 419?: ErrorCallback; - 420?: ErrorCallback; - 421?: ErrorCallback; - 422?: ErrorCallback; - 423?: ErrorCallback; - 424?: ErrorCallback; - 425?: ErrorCallback; - 426?: ErrorCallback; - 427?: ErrorCallback; - 428?: ErrorCallback; - 429?: ErrorCallback; - 430?: ErrorCallback; - 431?: ErrorCallback; - 432?: ErrorCallback; - 433?: ErrorCallback; - 434?: ErrorCallback; - 435?: ErrorCallback; - 436?: ErrorCallback; - 437?: ErrorCallback; - 438?: ErrorCallback; - 439?: ErrorCallback; - 440?: ErrorCallback; - 441?: ErrorCallback; - 442?: ErrorCallback; - 443?: ErrorCallback; - 444?: ErrorCallback; - 445?: ErrorCallback; - 446?: ErrorCallback; - 447?: ErrorCallback; - 448?: ErrorCallback; - 449?: ErrorCallback; - 450?: ErrorCallback; - 451?: ErrorCallback; - 452?: ErrorCallback; - 453?: ErrorCallback; - 454?: ErrorCallback; - 455?: ErrorCallback; - 456?: ErrorCallback; - 457?: ErrorCallback; - 458?: ErrorCallback; - 459?: ErrorCallback; - 460?: ErrorCallback; - 461?: ErrorCallback; - 462?: ErrorCallback; - 463?: ErrorCallback; - 464?: ErrorCallback; - 465?: ErrorCallback; - 466?: ErrorCallback; - 467?: ErrorCallback; - 468?: ErrorCallback; - 469?: ErrorCallback; - 470?: ErrorCallback; - 471?: ErrorCallback; - 472?: ErrorCallback; - 473?: ErrorCallback; - 474?: ErrorCallback; - 475?: ErrorCallback; - 476?: ErrorCallback; - 477?: ErrorCallback; - 478?: ErrorCallback; - 479?: ErrorCallback; - 480?: ErrorCallback; - 481?: ErrorCallback; - 482?: ErrorCallback; - 483?: ErrorCallback; - 484?: ErrorCallback; - 485?: ErrorCallback; - 486?: ErrorCallback; - 487?: ErrorCallback; - 488?: ErrorCallback; - 489?: ErrorCallback; - 490?: ErrorCallback; - 491?: ErrorCallback; - 492?: ErrorCallback; - 493?: ErrorCallback; - 494?: ErrorCallback; - 495?: ErrorCallback; - 496?: ErrorCallback; - 497?: ErrorCallback; - 498?: ErrorCallback; - 499?: ErrorCallback; - 500?: ErrorCallback; - 501?: ErrorCallback; - 502?: ErrorCallback; - 503?: ErrorCallback; - 504?: ErrorCallback; - 505?: ErrorCallback; - 506?: ErrorCallback; - 507?: ErrorCallback; - 508?: ErrorCallback; - 509?: ErrorCallback; - 510?: ErrorCallback; - 511?: ErrorCallback; - 512?: ErrorCallback; - 513?: ErrorCallback; - 514?: ErrorCallback; - 515?: ErrorCallback; - 516?: ErrorCallback; - 517?: ErrorCallback; - 518?: ErrorCallback; - 519?: ErrorCallback; - 520?: ErrorCallback; - 521?: ErrorCallback; - 522?: ErrorCallback; - 523?: ErrorCallback; - 524?: ErrorCallback; - 525?: ErrorCallback; - 526?: ErrorCallback; - 527?: ErrorCallback; - 528?: ErrorCallback; - 529?: ErrorCallback; - 530?: ErrorCallback; - 531?: ErrorCallback; - 532?: ErrorCallback; - 533?: ErrorCallback; - 534?: ErrorCallback; - 535?: ErrorCallback; - 536?: ErrorCallback; - 537?: ErrorCallback; - 538?: ErrorCallback; - 539?: ErrorCallback; - 540?: ErrorCallback; - 541?: ErrorCallback; - 542?: ErrorCallback; - 543?: ErrorCallback; - 544?: ErrorCallback; - 545?: ErrorCallback; - 546?: ErrorCallback; - 547?: ErrorCallback; - 548?: ErrorCallback; - 549?: ErrorCallback; - 550?: ErrorCallback; - 551?: ErrorCallback; - 552?: ErrorCallback; - 553?: ErrorCallback; - 554?: ErrorCallback; - 555?: ErrorCallback; - 556?: ErrorCallback; - 557?: ErrorCallback; - 558?: ErrorCallback; - 559?: ErrorCallback; - 560?: ErrorCallback; - 561?: ErrorCallback; - 562?: ErrorCallback; - 563?: ErrorCallback; - 564?: ErrorCallback; - 565?: ErrorCallback; - 566?: ErrorCallback; - 567?: ErrorCallback; - 568?: ErrorCallback; - 569?: ErrorCallback; - 570?: ErrorCallback; - 571?: ErrorCallback; - 572?: ErrorCallback; - 573?: ErrorCallback; - 574?: ErrorCallback; - 575?: ErrorCallback; - 576?: ErrorCallback; - 577?: ErrorCallback; - 578?: ErrorCallback; - 579?: ErrorCallback; - 580?: ErrorCallback; - 581?: ErrorCallback; - 582?: ErrorCallback; - 583?: ErrorCallback; - 584?: ErrorCallback; - 585?: ErrorCallback; - 586?: ErrorCallback; - 587?: ErrorCallback; - 588?: ErrorCallback; - 589?: ErrorCallback; - 590?: ErrorCallback; - 591?: ErrorCallback; - 592?: ErrorCallback; - 593?: ErrorCallback; - 594?: ErrorCallback; - 595?: ErrorCallback; - 596?: ErrorCallback; - 597?: ErrorCallback; - 598?: ErrorCallback; - 599?: ErrorCallback; - - // #endregion - } & { - // Status codes not listed require type annotations when defining the callback - [index: number]: SuccessCallback | ErrorCallback; - }; - - // Writable properties on XMLHttpRequest - interface XHRFields extends Partial> { - msCaching?: string; - } - } - - interface Transport { - send(headers: PlainObject, completeCallback: Transport.SuccessCallback): void; - abort(): void; - } - - namespace Transport { - interface SuccessCallback { - (status: number, statusText: Ajax.TextStatus, responses?: PlainObject, headers?: string): void; - } - } - - /** - * @see \`{@link http://api.jquery.com/jquery.ajax/#jqXHR }\` - */ - interface jqXHR extends Promise3, never, - Ajax.SuccessTextStatus, Ajax.ErrorTextStatus, never, - jqXHR, string, never>, - Pick, - Partial> { - responseJSON?: any; - - /** - * Determine the current state of a Deferred object. - * - * @see \`{@link https://api.jquery.com/deferred.state/ }\` - * @since 1.7 - */ - state(): 'pending' | 'resolved' | 'rejected'; - statusCode(map: Ajax.StatusCodeCallbacks): void; - } - - namespace jqXHR { - interface DoneCallback> extends Deferred.Callback3 { } - - interface FailCallback extends Deferred.Callback3 { } - - interface AlwaysCallback> extends Deferred.Callback3 { } - } - - // #endregion - - // #region Callbacks - - // tslint:disable-next-line:ban-types - interface Callbacks { - /** - * Add a callback or a collection of callbacks to a callback list. - * - * @param callback A function, or array of functions, that are to be added to the callback list. - * @param callbacks A function, or array of functions, that are to be added to the callback list. - * @see \`{@link https://api.jquery.com/callbacks.add/ }\` - * @since 1.7 - */ - add(callback: TypeOrArray, ...callbacks: Array>): this; - /** - * Disable a callback list from doing anything more. - * - * @see \`{@link https://api.jquery.com/callbacks.disable/ }\` - * @since 1.7 - */ - disable(): this; - /** - * Determine if the callbacks list has been disabled. - * - * @see \`{@link https://api.jquery.com/callbacks.disabled/ }\` - * @since 1.7 - */ - disabled(): boolean; - /** - * Remove all of the callbacks from a list. - * - * @see \`{@link https://api.jquery.com/callbacks.empty/ }\` - * @since 1.7 - */ - empty(): this; - /** - * Call all of the callbacks with the given arguments. - * - * @param args The argument or list of arguments to pass back to the callback list. - * @see \`{@link https://api.jquery.com/callbacks.fire/ }\` - * @since 1.7 - */ - fire(...args: any[]): this; - /** - * Call all callbacks in a list with the given context and arguments. - * - * @param context A reference to the context in which the callbacks in the list should be fired. - * @param args An argument, or array of arguments, to pass to the callbacks in the list. - * @see \`{@link https://api.jquery.com/callbacks.fireWith/ }\` - * @since 1.7 - */ - fireWith(context: object, args?: ArrayLike): this; - /** - * Determine if the callbacks have already been called at least once. - * - * @see \`{@link https://api.jquery.com/callbacks.fired/ }\` - * @since 1.7 - */ - fired(): boolean; - /** - * Determine whether or not the list has any callbacks attached. If a callback is provided as an - * argument, determine whether it is in a list. - * - * @param callback The callback to search for. - * @see \`{@link https://api.jquery.com/callbacks.has/ }\` - * @since 1.7 - */ - has(callback?: T): boolean; - /** - * Lock a callback list in its current state. - * - * @see \`{@link https://api.jquery.com/callbacks.lock/ }\` - * @since 1.7 - */ - lock(): this; - /** - * Determine if the callbacks list has been locked. - * - * @see \`{@link https://api.jquery.com/callbacks.locked/ }\` - * @since 1.7 - */ - locked(): boolean; - /** - * Remove a callback or a collection of callbacks from a callback list. - * - * @param callbacks A function, or array of functions, that are to be removed from the callback list. - * @see \`{@link https://api.jquery.com/callbacks.remove/ }\` - * @since 1.7 - */ - remove(...callbacks: T[]): this; - } - - // #endregion - - // #region CSS - - interface CSSHook { - get(this: this, elem: TElement, computed: any, extra: any): any; - set(this: this, elem: TElement, value: any): void; - } - - // #endregion - - // #region Deferred - - /** - * Any object that has a then method. - */ - interface Thenable extends PromiseLike { } - - // NOTE: This is a private copy of the global Promise interface. It is used by JQuery.PromiseBase to indicate compatibility with other Promise implementations. - // The global Promise interface cannot be used directly as it may be modified, as in the case of @types/bluebird-global. - /** - * Represents the completion of an asynchronous operation - */ - interface _Promise { - readonly [Symbol.toStringTag]: "Promise"; - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onrejected?: ((reason: any) => TResult2 | PromiseLike) | null): _Promise; - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | null): _Promise; - } - - // Type parameter guide - // -------------------- - // Each type parameter represents a parameter in one of the three possible callbacks. - // - // The first letter indicates which position the parameter is in. - // - // T = A = 1st position - // U = B = 2nd position - // V = C = 3rd position - // S = R = rest position - // - // The second letter indicates which whether it is a [R]esolve, Re[J]ect, or [N]otify value. - // - // The third letter indicates whether the value is returned in the [D]one filter, [F]ail filter, or [P]rogress filter. - - /** - * This object provides a subset of the methods of the Deferred object (then, done, fail, always, - * pipe, progress, state and promise) to prevent users from changing the state of the Deferred. - * - * @see \`{@link http://api.jquery.com/Types/#Promise }\` - */ - interface PromiseBase extends _Promise, PromiseLike { - /** - * Add handlers to be called when the Deferred object is either resolved or rejected. - * - * @param alwaysCallback A function, or array of functions, that is called when the Deferred is resolved or rejected. - * @param alwaysCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. - * @see \`{@link https://api.jquery.com/deferred.always/ }\` - * @since 1.6 - */ - always(alwaysCallback: TypeOrArray>, - ...alwaysCallbacks: Array>>): this; - /** - * Add handlers to be called when the Deferred object is resolved. - * - * @param doneCallback A function, or array of functions, that are called when the Deferred is resolved. - * @param doneCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. - * @see \`{@link https://api.jquery.com/deferred.done/ }\` - * @since 1.5 - */ - done(doneCallback: TypeOrArray>, - ...doneCallbacks: Array>>): this; - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failCallback A function, or array of functions, that are called when the Deferred is rejected. - * @param failCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. - * @see \`{@link https://api.jquery.com/deferred.fail/ }\` - * @since 1.5 - */ - fail(failCallback: TypeOrArray>, - ...failCallbacks: Array>>): this; - /** - * Add handlers to be called when the Deferred object generates progress notifications. - * - * @param progressCallback A function, or array of functions, to be called when the Deferred generates progress notifications. - * @param progressCallbacks Optional additional functions, or arrays of functions, to be called when the Deferred generates - * progress notifications. - * @see \`{@link https://api.jquery.com/deferred.progress/ }\` - * @since 1.7 - */ - progress(progressCallback: TypeOrArray>, - ...progressCallbacks: Array>>): this; - /** - * Return a Deferred's Promise object. - * - * @param target Object onto which the promise methods have to be attached - * @see \`{@link https://api.jquery.com/deferred.promise/ }\` - * @since 1.5 - */ - promise(target: TTarget): this & TTarget; - /** - * Return a Deferred's Promise object. - * - * @see \`{@link https://api.jquery.com/deferred.promise/ }\` - * @since 1.5 - */ - promise(): this; - /** - * Determine the current state of a Deferred object. - * - * @see \`{@link https://api.jquery.com/deferred.state/ }\` - * @since 1.7 - */ - state(): 'pending' | 'resolved' | 'rejected'; - - // #region pipe - - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link then JQuery.PromiseBase.then }\`. - */ - pipe( - doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, - progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link then JQuery.PromiseBase.then }\`. - */ - pipe( - doneFilter: null, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, - progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link then JQuery.PromiseBase.then }\`. - */ - pipe( - doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter: null, - progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link then JQuery.PromiseBase.then }\`. - */ - pipe( - doneFilter: null, - failFilter: null, - progressFilter?: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link then JQuery.PromiseBase.then }\`. - */ - pipe( - doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, - progressFilter?: null): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link then JQuery.PromiseBase.then }\`. - */ - pipe( - doneFilter: null, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, - progressFilter?: null): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link then JQuery.PromiseBase.then }\`. - */ - pipe( - doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter?: null, - progressFilter?: null): PromiseBase; - - // #endregion - - // #region then - - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, - progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: null, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, - progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter: null, - progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: null, - failFilter: null, - progressFilter?: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, - progressFilter?: null): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: null, - failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, - progressFilter?: null): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, - failFilter?: null, - progressFilter?: null): PromiseBase; - - // #endregion - - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failFilter A function that is called when the Deferred is rejected. - * @see \`{@link https://api.jquery.com/deferred.catch/ }\` - * @since 3.0 - */ - catch( - failFilter?: ((t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF) | null): PromiseBase; - } - - /** - * This object provides a subset of the methods of the Deferred object (then, done, fail, always, - * pipe, progress, state and promise) to prevent users from changing the state of the Deferred. - * - * @see \`{@link http://api.jquery.com/Types/#Promise }\` - */ - interface Promise3 extends PromiseBase { } - - /** - * This object provides a subset of the methods of the Deferred object (then, done, fail, always, - * pipe, progress, state and promise) to prevent users from changing the state of the Deferred. - * - * @see \`{@link http://api.jquery.com/Types/#Promise }\` - */ - interface Promise2 extends PromiseBase { } - - /** - * This object provides a subset of the methods of the Deferred object (then, done, fail, always, - * pipe, progress, state and promise) to prevent users from changing the state of the Deferred. - * - * @see \`{@link http://api.jquery.com/Types/#Promise }\` - */ - interface Promise extends PromiseBase { } - - interface DeferredStatic { - // https://jquery.com/upgrade-guide/3.0/#callback-exit - exceptionHook: any; - (beforeStart?: (this: Deferred, deferred: Deferred) => void): Deferred; - } - - interface Deferred { - /** - * Call the progressCallbacks on a Deferred object with the given args. - * - * @param args Optional arguments that are passed to the progressCallbacks. - * @see \`{@link https://api.jquery.com/deferred.notify/ }\` - * @since 1.7 - */ - notify(...args: TN[]): this; - /** - * Call the progressCallbacks on a Deferred object with the given context and args. - * - * @param context Context passed to the progressCallbacks as the this object. - * @param args An optional array of arguments that are passed to the progressCallbacks. - * @see \`{@link https://api.jquery.com/deferred.notifyWith/ }\` - * @since 1.7 - */ - notifyWith(context: object, args?: ArrayLike): this; - /** - * Reject a Deferred object and call any failCallbacks with the given args. - * - * @param args Optional arguments that are passed to the failCallbacks. - * @see \`{@link https://api.jquery.com/deferred.reject/ }\` - * @since 1.5 - */ - reject(...args: TJ[]): this; - /** - * Reject a Deferred object and call any failCallbacks with the given context and args. - * - * @param context Context passed to the failCallbacks as the this object. - * @param args An optional array of arguments that are passed to the failCallbacks. - * @see \`{@link https://api.jquery.com/deferred.rejectWith/ }\` - * @since 1.5 - */ - rejectWith(context: object, args?: ArrayLike): this; - /** - * Resolve a Deferred object and call any doneCallbacks with the given args. - * - * @param args Optional arguments that are passed to the doneCallbacks. - * @see \`{@link https://api.jquery.com/deferred.resolve/ }\` - * @since 1.5 - */ - resolve(...args: TR[]): this; - /** - * Resolve a Deferred object and call any doneCallbacks with the given context and args. - * - * @param context Context passed to the doneCallbacks as the this object. - * @param args An optional array of arguments that are passed to the doneCallbacks. - * @see \`{@link https://api.jquery.com/deferred.resolveWith/ }\` - * @since 1.5 - */ - resolveWith(context: object, args?: ArrayLike): this; - - /** - * Add handlers to be called when the Deferred object is either resolved or rejected. - * - * @param alwaysCallback A function, or array of functions, that is called when the Deferred is resolved or rejected. - * @param alwaysCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. - * @see \`{@link https://api.jquery.com/deferred.always/ }\` - * @since 1.6 - */ - always(alwaysCallback: TypeOrArray>, - ...alwaysCallbacks: Array>>): this; - /** - * Add handlers to be called when the Deferred object is resolved. - * - * @param doneCallback A function, or array of functions, that are called when the Deferred is resolved. - * @param doneCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. - * @see \`{@link https://api.jquery.com/deferred.done/ }\` - * @since 1.5 - */ - done(doneCallback: TypeOrArray>, - ...doneCallbacks: Array>>): this; - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failCallback A function, or array of functions, that are called when the Deferred is rejected. - * @param failCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. - * @see \`{@link https://api.jquery.com/deferred.fail/ }\` - * @since 1.5 - */ - fail(failCallback: TypeOrArray>, - ...failCallbacks: Array>>): this; - /** - * Add handlers to be called when the Deferred object generates progress notifications. - * - * @param progressCallback A function, or array of functions, to be called when the Deferred generates progress notifications. - * @param progressCallbacks Optional additional functions, or arrays of functions, to be called when the Deferred generates - * progress notifications. - * @see \`{@link https://api.jquery.com/deferred.progress/ }\` - * @since 1.7 - */ - progress(progressCallback: TypeOrArray>, - ...progressCallbacks: Array>>): this; - /** - * Return a Deferred's Promise object. - * - * @param target Object onto which the promise methods have to be attached - * @see \`{@link https://api.jquery.com/deferred.promise/ }\` - * @since 1.5 - */ - promise(target: TTarget): Promise & TTarget; - /** - * Return a Deferred's Promise object. - * - * @see \`{@link https://api.jquery.com/deferred.promise/ }\` - * @since 1.5 - */ - promise(): Promise; - /** - * Determine the current state of a Deferred object. - * - * @see \`{@link https://api.jquery.com/deferred.state/ }\` - * @since 1.7 - */ - state(): 'pending' | 'resolved' | 'rejected'; - - // #region pipe - - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link JQuery.Deferred.then }\`. - */ - pipe( - doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, - progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link JQuery.Deferred.then }\`. - */ - pipe( - doneFilter: null, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, - progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link JQuery.Deferred.then }\`. - */ - pipe( - doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter: null, - progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link JQuery.Deferred.then }\`. - */ - pipe( - doneFilter: null, - failFilter: null, - progressFilter?: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link JQuery.Deferred.then }\`. - */ - pipe( - doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, - progressFilter?: null): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link JQuery.Deferred.then }\`. - */ - pipe( - doneFilter: null, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, - progressFilter?: null): PromiseBase; - /** - * Utility method to filter and/or chain Deferreds. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` - * @since 1.6 - * @since 1.7 - * - * @deprecated Deprecated since 1.8. Use \`{@link JQuery.Deferred.then }\`. - */ - pipe( - doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter?: null, - progressFilter?: null): PromiseBase; - - // #endregion - - // #region then - - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, - progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: null, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, - progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter: null, - progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: null, - failFilter: null, - progressFilter?: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, - progressFilter?: null): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: null, - failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, - progressFilter?: null): PromiseBase; - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter An optional function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. - * @see \`{@link https://api.jquery.com/deferred.then/ }\` - * @since 1.8 - */ - then( - doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, - failFilter?: null, - progressFilter?: null): PromiseBase; - - // #endregion - - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failFilter A function that is called when the Deferred is rejected. - * @see \`{@link https://api.jquery.com/deferred.catch/ }\` - * @since 3.0 - */ - catch( - failFilter?: ((...t: TJ[]) => PromiseBase | Thenable | ARF) | null): PromiseBase; - } - - namespace Deferred { - interface CallbackBase { - (t: T, u: U, v: V, ...r: R[]): void; - } - - interface Callback3 extends CallbackBase { } - - interface Callback { - (...args: T[]): void; - } - - /** - * @deprecated Use \`{@link JQuery.Deferred.Callback }\`. - */ - interface DoneCallback extends Callback { } - - /** - * @deprecated Use \`{@link JQuery.Deferred.Callback }\`. - */ - interface FailCallback extends Callback { } - - /** - * @deprecated Use \`{@link JQuery.Deferred.Callback }\`. - */ - interface AlwaysCallback extends Callback { } - - /** - * @deprecated Use \`{@link JQuery.Deferred.Callback }\`. - */ - interface ProgressCallback extends Callback { } - } - - // #endregion - - // #region Effects - - type Duration = number | 'fast' | 'slow'; - // TODO: Is the first element always a string or is that specific to the 'fx' queue? - type Queue = { 0: string; } & Array>; - - interface QueueFunction { - (this: TElement, next: () => void): void; - } - - /** - * @see \`{@link https://api.jquery.com/animate/#animate-properties-options }\` - */ - interface EffectsOptions { - /** - * A function to be called when the animation on an element completes or stops without completing (its - * Promise object is either resolved or rejected). - */ - always?(this: TElement, animation: Promise, jumpedToEnd: boolean): void; - /** - * A function that is called once the animation on an element is complete. - */ - complete?(this: TElement): void; - /** - * A function to be called when the animation on an element completes (its Promise object is resolved). - */ - done?(this: TElement, animation: Promise, jumpedToEnd: boolean): void; - /** - * A string or number determining how long the animation will run. - */ - duration?: Duration; - /** - * A string indicating which easing function to use for the transition. - */ - easing?: string; - /** - * A function to be called when the animation on an element fails to complete (its Promise object is rejected). - */ - fail?(this: TElement, animation: Promise, jumpedToEnd: boolean): void; - /** - * A function to be called after each step of the animation, only once per animated element regardless - * of the number of animated properties. - */ - progress?(this: TElement, animation: Promise, progress: number, remainingMs: number): void; - /** - * A Boolean indicating whether to place the animation in the effects queue. If false, the animation - * will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case - * the animation is added to the queue represented by that string. When a custom queue name is used the - * animation does not automatically start; you must call .dequeue("queuename") to start it. - */ - queue?: boolean | string; - /** - * An object containing one or more of the CSS properties defined by the properties argument and their - * corresponding easing functions. - */ - specialEasing?: PlainObject; - /** - * A function to call when the animation on an element begins. - */ - start?(this: TElement, animation: Promise): void; - /** - * A function to be called for each animated property of each animated element. This function provides - * an opportunity to modify the Tween object to change the value of the property before it is set. - */ - step?(this: TElement, now: number, tween: Tween): void; - } - - interface SpeedSettings { - /** - * A string or number determining how long the animation will run. - */ - duration?: Duration; - /** - * A string indicating which easing function to use for the transition. - */ - easing?: string; - /** - * A function to call once the animation is complete. - */ - complete?(this: TElement): void; - } - - // This should be a class but doesn't work correctly under the JQuery namespace. Tween should be an inner class of jQuery. - // Undocumented - // https://github.com/jquery/api.jquery.com/issues/391 - // https://github.com/jquery/api.jquery.com/issues/61 - interface Tween { - easing: string; - elem: TElement; - end: number; - now: number; - options: EffectsOptions; - pos: number; - prop: string; - start: number; - unit: string; - } - - interface AnimationHook { - (fx: Tween): void; - } - - // #endregion - - // #region Events - - // #region Event - - // This should be a class but doesn't work correctly under the JQuery namespace. Event should be an inner class of jQuery. - - // Static members - interface EventStatic { - // tslint:disable-next-line:no-unnecessary-generics - (event: string, properties?: T): Event & T; - // tslint:disable-next-line:no-unnecessary-generics - (properties: T): Event & T; - // tslint:disable-next-line:no-unnecessary-generics - new (event: string, properties?: T): Event & T; - // tslint:disable-next-line:no-unnecessary-generics - new (properties: T): Event & T; - } - - // Instance members - interface Event { - /** - * Indicates whether the META key was pressed when the event fired. - * - * @see \`{@link https://api.jquery.com/event.metaKey/ }\` - * @since 1.0.4 - */ - metaKey: boolean; - /** - * The namespace specified when the event was triggered. - * - * @see \`{@link https://api.jquery.com/event.namespace/ }\` - * @since 1.4.3 - */ - namespace: string; - /** - * The mouse position relative to the left edge of the document. - * - * @see \`{@link https://api.jquery.com/event.pageX/ }\` - * @since 1.0.4 - */ - pageX: number; - /** - * The mouse position relative to the top edge of the document. - * - * @see \`{@link https://api.jquery.com/event.pageY/ }\` - * @since 1.0.4 - */ - pageY: number; - /** - * The last value returned by an event handler that was triggered by this event, unless the value was undefined. - * - * @see \`{@link https://api.jquery.com/event.result/ }\` - * @since 1.3 - */ - result: any; - /** - * The difference in milliseconds between the time the browser created the event and January 1, 1970. - * - * @see \`{@link https://api.jquery.com/event.timeStamp/ }\` - * @since 1.2.6 - */ - timeStamp: number; - /** - * Describes the nature of the event. - * - * @see \`{@link https://api.jquery.com/event.type/ }\` - * @since 1.0 - */ - type: string; - /** - * For key or mouse events, this property indicates the specific key or button that was pressed. - * - * @see \`{@link https://api.jquery.com/event.which/ }\` - * @since 1.1.3 - */ - which: number; - /** - * Returns whether event.preventDefault() was ever called on this event object. - * - * @see \`{@link https://api.jquery.com/event.isDefaultPrevented/ }\` - * @since 1.3 - */ - isDefaultPrevented(): boolean; - /** - * Returns whether event.stopImmediatePropagation() was ever called on this event object. - * - * @see \`{@link https://api.jquery.com/event.isImmediatePropagationStopped/ }\` - * @since 1.3 - */ - isImmediatePropagationStopped(): boolean; - /** - * Returns whether event.stopPropagation() was ever called on this event object. - * - * @see \`{@link https://api.jquery.com/event.isPropagationStopped/ }\` - * @since 1.3 - */ - isPropagationStopped(): boolean; - /** - * If this method is called, the default action of the event will not be triggered. - * - * @see \`{@link https://api.jquery.com/event.preventDefault/ }\` - * @since 1.0 - */ - preventDefault(): void; - /** - * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. - * - * @see \`{@link https://api.jquery.com/event.stopImmediatePropagation/ }\` - * @since 1.3 - */ - stopImmediatePropagation(): void; - /** - * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. - * - * @see \`{@link https://api.jquery.com/event.stopPropagation/ }\` - * @since 1.0 - */ - stopPropagation(): void; - } - - // Generic members - interface Event extends Partial> { - /** - * The current DOM element within the event bubbling phase. - * - * @see \`{@link https://api.jquery.com/event.currentTarget/ }\` - * @since 1.3 - */ - currentTarget: TTarget; - /** - * An optional object of data passed to an event method when the current executing handler is bound. - * - * @see \`{@link https://api.jquery.com/event.data/ }\` - * @since 1.1 - */ - data: TData; - /** - * The element where the currently-called jQuery event handler was attached. - * - * @see \`{@link https://api.jquery.com/event.delegateTarget/ }\` - * @since 1.7 - */ - delegateTarget: TTarget; - originalEvent: _Event; - /** - * The other DOM element involved in the event, if any. - * - * @see \`{@link https://api.jquery.com/event.relatedTarget/ }\` - * @since 1.1.4 - */ - relatedTarget: TTarget | null; - /** - * The DOM element that initiated the event. - * - * @see \`{@link https://api.jquery.com/event.target/ }\` - * @since 1.0 - */ - target: TTarget; - } - - interface EventLike { - type: string; - } - - // #endregion - - interface EventHandler extends EventHandlerBase> { } - - interface EventHandlerBase { - // Extra parameters can be passed from trigger() - (this: TContext, t: T, ...args: any[]): void | false | any; - } - - // #endregion - - interface NameValuePair { - name: string; - value: string; - } - - interface Coordinates { - left: number; - top: number; - } - - // Workaround for TypeScript 2.3 which does not have support for weak types handling. - type CoordinatesPartial = - Pick | - Pick | - { [key: string]: never; }; - - interface ValHook { - get?(elem: TElement): any; - set?(elem: TElement, value: any): any; - } -} - -// #region Legacy types - -// tslint:disable-next-line:no-empty-interface -interface JQueryCallback extends JQuery.Callbacks { } -interface JQueryDeferred extends JQuery.Deferred { } -// tslint:disable-next-line:no-empty-interface -interface JQueryEventConstructor extends JQuery.EventStatic { } -interface JQueryDeferred extends JQuery.Deferred { } -// tslint:disable-next-line:no-empty-interface -interface JQueryAjaxSettings extends JQuery.AjaxSettings { } -interface JQueryAnimationOptions extends JQuery.EffectsOptions { } -// tslint:disable-next-line:no-empty-interface -interface JQueryCoordinates extends JQuery.Coordinates { } -interface JQueryGenericPromise extends JQuery.Thenable { } -// tslint:disable-next-line:no-empty-interface -interface JQueryXHR extends JQuery.jqXHR { } -interface JQueryPromise extends JQuery.Promise { } -// tslint:disable-next-line:no-empty-interface -interface JQuerySerializeArrayElement extends JQuery.NameValuePair { } - -/** - * @deprecated Deprecated since 1.9. See \`{@link https://api.jquery.com/jQuery.support/ }\`. - */ -// tslint:disable-next-line:no-empty-interface -interface JQuerySupport extends JQuery.PlainObject { } - -// Legacy types that are not represented in the current type definitions are marked deprecated. - -/** - * @deprecated Use \`{@link JQuery.Deferred.Callback }\` or \`{@link JQuery.Deferred.CallbackBase }\`. - */ -interface JQueryPromiseCallback { - (value?: T, ...args: any[]): void; -} -/** - * @deprecated Use \`{@link JQueryStatic.param JQueryStatic['param']}\`. - */ -interface JQueryParam { - /** - * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. - * - * @param obj An array or object to serialize. - * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. - */ - (obj: any, traditional?: boolean): string; -} -/** - * @deprecated Use \`{@link JQuery.Event }\`. - */ -interface BaseJQueryEventObject extends Event { - /** - * The current DOM element within the event bubbling phase. - * @see \`{@link https://api.jquery.com/event.currentTarget/ }\` - */ - currentTarget: Element; - /** - * An optional object of data passed to an event method when the current executing handler is bound. - * @see \`{@link https://api.jquery.com/event.data/ }\` - */ - data: any; - /** - * The element where the currently-called jQuery event handler was attached. - * @see \`{@link https://api.jquery.com/event.delegateTarget/ }\` - */ - delegateTarget: Element; - /** - * Returns whether event.preventDefault() was ever called on this event object. - * @see \`{@link https://api.jquery.com/event.isDefaultPrevented/ }\` - */ - isDefaultPrevented(): boolean; - /** - * Returns whether event.stopImmediatePropagation() was ever called on this event object. - * @see \`{@link https://api.jquery.com/event.isImmediatePropagationStopped/ }\` - */ - isImmediatePropagationStopped(): boolean; - /** - * Returns whether event.stopPropagation() was ever called on this event object. - * @see \`{@link https://api.jquery.com/event.isPropagationStopped/ }\` - */ - isPropagationStopped(): boolean; - /** - * The namespace specified when the event was triggered. - * @see \`{@link https://api.jquery.com/event.namespace/ }\` - */ - namespace: string; - /** - * The browser's original Event object. - * @see \`{@link https://api.jquery.com/category/events/event-object/ }\` - */ - originalEvent: Event; - /** - * If this method is called, the default action of the event will not be triggered. - * @see \`{@link https://api.jquery.com/event.preventDefault/ }\` - */ - preventDefault(): any; - /** - * The other DOM element involved in the event, if any. - * @see \`{@link https://api.jquery.com/event.relatedTarget/ }\` - */ - relatedTarget: Element; - /** - * The last value returned by an event handler that was triggered by this event, unless the value was undefined. - * @see \`{@link https://api.jquery.com/event.result/ }\` - */ - result: any; - /** - * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. - * @see \`{@link https://api.jquery.com/event.stopImmediatePropagation/ }\` - */ - stopImmediatePropagation(): void; - /** - * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. - * @see \`{@link https://api.jquery.com/event.stopPropagation/ }\` - */ - stopPropagation(): void; - /** - * The DOM element that initiated the event. - * @see \`{@link https://api.jquery.com/event.target/ }\` - */ - target: Element; - /** - * The mouse position relative to the left edge of the document. - * @see \`{@link https://api.jquery.com/event.pageX/ }\` - */ - pageX: number; - /** - * The mouse position relative to the top edge of the document. - * @see \`{@link https://api.jquery.com/event.pageY/ }\` - */ - pageY: number; - /** - * For key or mouse events, this property indicates the specific key or button that was pressed. - * @see \`{@link https://api.jquery.com/event.which/ }\` - */ - which: number; - /** - * Indicates whether the META key was pressed when the event fired. - * @see \`{@link https://api.jquery.com/event.metaKey/ }\` - */ - metaKey: boolean; -} -/** - * @deprecated Use \`{@link JQuery.Event }\`. - */ -interface JQueryInputEventObject extends BaseJQueryEventObject { - altKey: boolean; - ctrlKey: boolean; - metaKey: boolean; - shiftKey: boolean; -} -/** - * @deprecated Use \`{@link JQuery.Event }\`. - */ -interface JQueryMouseEventObject extends JQueryInputEventObject { - button: number; - clientX: number; - clientY: number; - offsetX: number; - offsetY: number; - pageX: number; - pageY: number; - screenX: number; - screenY: number; -} -/** - * @deprecated Use \`{@link JQuery.Event }\`. - */ -interface JQueryKeyEventObject extends JQueryInputEventObject { - char: any; - charCode: number; - key: any; - keyCode: number; -} -/** - * @deprecated Use \`{@link JQuery.Event }\`. - */ -interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { } -/** - * @deprecated - */ -interface JQueryPromiseOperator { - (callback1: JQuery.TypeOrArray>, - ...callbacksN: Array>>): JQueryPromise; -} -/** - * @deprecated Internal. See \`{@link https://github.com/jquery/api.jquery.com/issues/912 }\`. - */ -interface JQueryEasingFunction { - (percent: number): number; -} -/** - * @deprecated Internal. See \`{@link https://github.com/jquery/api.jquery.com/issues/912 }\`. - */ -interface JQueryEasingFunctions { - [name: string]: JQueryEasingFunction; - linear: JQueryEasingFunction; - swing: JQueryEasingFunction; -} - -// #endregion +export = jQuery; diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index 43371f96c3..515715bf14 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -3,6 +3,91 @@ function JQueryStatic() { const jq: JQueryStatic = $; } + function ajaxSettings() { + // $ExpectType AjaxSettings + $.ajaxSettings; + } + + function Animation() { + // $ExpectType AnimationStatic + $.Animation; + } + + function Callbacks() { + // $ExpectType CallbacksStatic + $.Callbacks; + } + + function cssHooks() { + // $ExpectType CSSHooks + $.cssHooks; + } + + function cssNumber() { + // $ExpectType PlainObject + $.cssNumber; + } + + function Deferred() { + // $ExpectType DeferredStatic + $.Deferred; + } + + function easing() { + // $ExpectType Easings + $.easing; + } + + function Event() { + // $ExpectType EventStatic + $.Event; + } + + function event() { + // $ExpectType EventExtensions + $.event; + } + + function expr() { + // $ExpectType Selectors + $.expr; + } + + function fn() { + // $ExpectType JQuery + $.fn; + } + + function fx() { + // $ExpectType Effects + $.fx; + } + + function ready() { + // $ExpectType Thenable + $.ready; + } + + function support() { + // $ExpectType PlainObject + $.support; + } + + function timers() { + // $ExpectType TickFunction[] + $.timers; + } + + function Tween() { + // $ExpectType TweenStatic + $.Tween; + } + + function valHooks() { + // $ExpectType ValHooks + $.valHooks; + } + function call_signature() { // $ExpectType JQuery $('

      ', new Document()); @@ -111,123 +196,6 @@ function JQueryStatic() { } } - function ajaxSettings() { - // $ExpectType AjaxSettings - $.ajaxSettings; - } - - function Event() { - // $ExpectType EventStatic - $.Event; - } - - function cssHooks() { - // $ExpectType PlainObject> - $.cssHooks; - } - - function cssNumber() { - // $ExpectType PlainObject - $.cssNumber; - } - - function fn() { - // $ExpectType JQuery - $.fn; - } - - function fx() { - function interval() { - // $ExpectType number - $.fx.interval; - } - - function off() { - // $ExpectType boolean - $.fx.off; - } - - function step() { - // $ExpectType PlainObject> - $.fx.step; - } - } - - function ready() { - // $ExpectType Thenable - $.ready; - } - - function support() { - // $ExpectType PlainObject - $.support; - } - - function valHooks() { - // $ExpectType PlainObject> - $.valHooks; - } - - function Callbacks() { - // $ExpectType Callbacks - $.Callbacks('once'); - - // $ExpectType Callbacks - $.Callbacks(); - } - - function Deferred() { - function call_signature() { - // $ExpectType Deferred - $.Deferred(function(deferred) { - // $ExpectType Deferred - this; - // $ExpectType Deferred - deferred; - }); - - // $ExpectType Deferred - $.Deferred(); - - // $ExpectType Deferred - $.Deferred(function(deferred) { - // $ExpectType Deferred - this; - // $ExpectType Deferred - deferred; - }); - - // $ExpectType Deferred - $.Deferred(); - - // $ExpectType Deferred - $.Deferred(function(deferred) { - // $ExpectType Deferred - this; - // $ExpectType Deferred - deferred; - }); - - // $ExpectType Deferred - $.Deferred(); - - // $ExpectType Deferred - $.Deferred(function(deferred) { - // $ExpectType Deferred - this; - // $ExpectType Deferred - deferred; - }); - - // $ExpectType Deferred - $.Deferred(); - } - - function exceptionHook() { - $.Deferred.exceptionHook = undefined; - } - } - function ajax() { // $ExpectType jqXHR $.ajax('url', { @@ -325,6 +293,13 @@ function JQueryStatic() { $.camelCase('foo-bar'); } + function cleanData() { + const elems: ArrayLike = {} as any; + + // $ExpectType void + $.cleanData(elems); + } + function contains() { // $ExpectType boolean $.contains(new HTMLElement(), new HTMLElement()); @@ -332,21 +307,27 @@ function JQueryStatic() { function css() { // $ExpectType any - $.css(new HTMLElement(), {}); + $.css(new HTMLElement(), 'borderRadius'); } function data() { - // $ExpectType any - $.data(new HTMLElement(), 'myKey', undefined); + const element: Element | Document | Window | JQuery.PlainObject = {} as any; + + const value: string | undefined = {} as any; + // $ExpectError + $.data(element, 'myKey', value); // $ExpectType "myValue" - $.data(new HTMLElement(), 'myKey', 'myValue'); + $.data(element, 'myKey', 'myValue'); // $ExpectType any - $.data(new HTMLElement(), 'myKey'); + $.data(element, 'myKey', undefined); // $ExpectType any - $.data(new HTMLElement()); + $.data(element, 'myKey'); + + // $ExpectType any + $.data(element); } function dequeue() { @@ -482,6 +463,9 @@ function JQueryStatic() { // $ExpectType { name: string; } & EventTarget $.extend(true, t, u); + // $ExpectType JQueryStatic & { name: string; } + $.extend(true, t); + // $ExpectType any $.extend(true, t, u, v, w, x, y, z, a); @@ -503,6 +487,9 @@ function JQueryStatic() { // $ExpectType { name: string; } & EventTarget $.extend(t, u); + // $ExpectType JQueryStatic & { name: string; } + $.extend(t); + // $ExpectType any $.extend(t, u, v, w, x, y, z, a); } @@ -624,6 +611,11 @@ function JQueryStatic() { // $ExpectType jqXHR jqXHR; }); + + // $ExpectType jqXHR + $.getScript({ + url: 'url', + }); } function globalEval() { @@ -654,8 +646,10 @@ function JQueryStatic() { } function hasData() { + const element: Element | Document | Window | JQuery.PlainObject = {} as any; + // $ExpectType boolean - $.hasData(new HTMLElement()); + $.hasData(element); } function holdReady() { @@ -706,24 +700,31 @@ function JQueryStatic() { } function isNumeric() { - function type_guard(obj: boolean | number) { - if ($.isNumeric(obj)) { - // $ExpectType number - obj; - } else { - // $ExpectType boolean - obj; - } - } + // $ExpectType boolean + $.isNumeric(123); // true + + // $ExpectType boolean + $.isNumeric(0 / 0); // false + + // $ExpectType boolean + $.isNumeric('123'); // true + + // $ExpectType boolean + $.isNumeric('1s3'); // false } function isPlainObject() { - function type_guard(obj: object) { - if ($.isPlainObject(obj)) { - // $ExpectType PlainObject - obj; - } - } + // $ExpectType boolean + $.isPlainObject({}); // true + + // $ExpectType boolean + $.isPlainObject(new Object()); // true + + // $ExpectType boolean + $.isPlainObject(document); // false + + // $ExpectType boolean + $.isPlainObject(Object.create(null)); // true } function isWindow() { @@ -892,6 +893,13 @@ function JQueryStatic() { $.noConflict(); } + function nodeName() { + const node: Node = undefined!; + + // $ExpectType boolean + $.nodeName(node, 'name'); + } + function noop() { // $ExpectType undefined $.noop(); @@ -1031,23 +1039,25 @@ function JQueryStatic() { } function proxy() { - interface I1 { kind: 'I1'; } - interface I2 { kind: 'I2'; } - interface I3 { kind: 'I3'; } - interface I4 { kind: 'I4'; } - interface I5 { kind: 'I5'; } - interface I6 { kind: 'I6'; } - interface I7 { kind: 'I7'; } - interface I8 { kind: 'I8'; } + interface JContext { kind: 'JContext'; } + interface J1 { kind: 'J1'; } + interface J2 { kind: 'J2'; } + interface J3 { kind: 'J3'; } + interface J4 { kind: 'J4'; } + interface J5 { kind: 'J5'; } + interface J6 { kind: 'J6'; } + interface J7 { kind: 'J7'; } + interface J8 { kind: 'J8'; } - const a: I8 = {} as any; - const b: I7 = {} as any; - const c: I6 = {} as any; - const d: I5 = {} as any; - const e: I4 = {} as any; - const f: I3 = {} as any; - const g: I2 = {} as any; - const h: I2 = {} as any; + const context: JContext = {} as any; + const a: J8 = {} as any; + const b: J7 = {} as any; + const c: J6 = {} as any; + const d: J5 = {} as any; + const e: J4 = {} as any; + const f: J3 = {} as any; + const g: J2 = {} as any; + const h: J1 = {} as any; type A = typeof a; type B = typeof b; @@ -1056,9 +1066,8 @@ function JQueryStatic() { type E = typeof e; type F = typeof f; type G = typeof g; - type H = typeof h; - // (fn, null) + // (funÑtion, null) { // $ExpectType () => void $.proxy((a, b, c, d, e, f, g) => { }, null, a, b, c, d, e, f, g); @@ -1084,203 +1093,203 @@ function JQueryStatic() { // $ExpectType () => void $.proxy(() => { }, null); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1) => { }, null, a, b, c, d); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1) => { }, null, a, b, c, d); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, t: I1) => { }, null, a, b, c); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, t: J1) => { }, null, a, b, c); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, t: I1) => { }, null, a, b); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, t: J1) => { }, null, a, b); - // $ExpectType (t: I1) => void - $.proxy((a: A, t: I1) => { }, null, a); + // $ExpectType (t: J1) => void + $.proxy((a: A, t: J1) => { }, null, a); - // $ExpectType (t: I1) => void - $.proxy((t: I1) => { }, null); + // $ExpectType (t: J1) => void + $.proxy((t: J1) => { }, null); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, t: I1, u: I2) => { }, null, a, b); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, t: J1, u: J2) => { }, null, a, b); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, t: I1, u: I2) => { }, null, a); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, t: J1, u: J2) => { }, null, a); - // $ExpectType (t: I1, u: I2) => void - $.proxy((t: I1, u: I2) => { }, null); + // $ExpectType (t: J1, u: J2) => void + $.proxy((t: J1, u: J2) => { }, null); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3) => { }, null, a, b); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3) => { }, null, a, b); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, t: I1, u: I2, v: I3) => { }, null, a); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, t: J1, u: J2, v: J3) => { }, null, a); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((t: I1, u: I2, v: I3) => { }, null); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((t: J1, u: J2, v: J3) => { }, null); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4) => { }, null, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4) => { }, null, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4) => { }, null, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4) => { }, null, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((t: I1, u: I2, v: I3, w: I4) => { }, null); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((t: J1, u: J2, v: J3, w: J4) => { }, null); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5) => { }, null); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5) => { }, null); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, null); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, null); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, null); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, null); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null); // $ExpectType (...args: any[]) => void - $.proxy((a, b, c, d, e, f, g, h, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, null, a, b, c, d, e, f, g, h); + $.proxy((a, b, c, d, e, f, g, h, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, null, a, b, c, d, e, f, g, h); } - // (fn, undefined) + // (funÑtion, undefined) { // $ExpectType () => void $.proxy((a, b, c, d, e, f, g) => { }, undefined, a, b, c, d, e, f, g); @@ -1306,428 +1315,647 @@ function JQueryStatic() { // $ExpectType () => void $.proxy(() => { }, undefined); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, c: C, t: I1) => { }, undefined, a, b, c); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, c: C, t: J1) => { }, undefined, a, b, c); - // $ExpectType (t: I1) => void - $.proxy((a: A, b: B, t: I1) => { }, undefined, a, b); + // $ExpectType (t: J1) => void + $.proxy((a: A, b: B, t: J1) => { }, undefined, a, b); - // $ExpectType (t: I1) => void - $.proxy((a: A, t: I1) => { }, undefined, a); + // $ExpectType (t: J1) => void + $.proxy((a: A, t: J1) => { }, undefined, a); - // $ExpectType (t: I1) => void - $.proxy((t: I1) => { }, undefined); + // $ExpectType (t: J1) => void + $.proxy((t: J1) => { }, undefined); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, b: B, t: I1, u: I2) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, b: B, t: J1, u: J2) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2) => void - $.proxy((a: A, t: I1, u: I2) => { }, undefined, a); + // $ExpectType (t: J1, u: J2) => void + $.proxy((a: A, t: J1, u: J2) => { }, undefined, a); - // $ExpectType (t: I1, u: I2) => void - $.proxy((t: I1, u: I2) => { }, undefined); + // $ExpectType (t: J1, u: J2) => void + $.proxy((t: J1, u: J2) => { }, undefined); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((a: A, t: I1, u: I2, v: I3) => { }, undefined, a); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((a: A, t: J1, u: J2, v: J3) => { }, undefined, a); - // $ExpectType (t: I1, u: I2, v: I3) => void - $.proxy((t: I1, u: I2, v: I3) => { }, undefined); + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy((t: J1, u: J2, v: J3) => { }, undefined); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4) => { }, undefined, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4) => { }, undefined, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4) => void - $.proxy((t: I1, u: I2, v: I3, w: I4) => { }, undefined); + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy((t: J1, u: J2, v: J3, w: J4) => { }, undefined); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5) => { }, undefined); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5) => { }, undefined); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, undefined); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => { }, undefined); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, undefined); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) => { }, undefined); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b, c, d, e, f, g); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b, c, d, e, f, g); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b, c, d, e, f); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b, c, d, e, f); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b, c, d, e); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b, c, d, e); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b, c, d); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b, c, d); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b, c); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b, c); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a); - // $ExpectType (t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined); + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy((t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined); // $ExpectType (...args: any[]) => void - $.proxy((a, b, c, d, e, f, g, h, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, undefined, a, b, c, d, e, f, g, h); + $.proxy((a, b, c, d, e, f, g, h, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) => { }, undefined, a, b, c, d, e, f, g, h); } - // (fn, context) + // (funÑtion, context) { - // $ExpectType (this: {}) => void - $.proxy((a, b, c, d, e, f, g) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}) => void - $.proxy((a, b, c, d, e, f) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}) => void - $.proxy((a, b, c, d, e) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}) => void - $.proxy((a, b, c, d) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}) => void - $.proxy((a, b, c) => { }, {}, a, b, c); - - // $ExpectType (this: {}) => void - $.proxy((a, b) => { }, {}, a, b); - - // $ExpectType (this: {}) => void - $.proxy((a) => { }, {}, a); - - // $ExpectType (this: {}) => void - $.proxy(() => { }, {}); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, b: B, c: C, t: I1) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, b: B, t: I1) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((a: A, t: I1) => { }, {}, a); - - // $ExpectType (this: {}, t: I1) => void - $.proxy((t: I1) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, b: B, t: I1, u: I2) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((a: A, t: I1, u: I2) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2) => void - $.proxy((t: I1, u: I2) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((a: A, t: I1, u: I2, v: I3) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3) => void - $.proxy((t: I1, u: I2, v: I3) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4) => void - $.proxy((t: I1, u: I2, v: I3, w: I4) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7) => { }, {}); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b, c, d, e, f, g); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, f: F, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b, c, d, e, f); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, e: E, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b, c, d, e); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, d: D, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b, c, d); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, c: C, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b, c); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, b: B, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((a: A, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a); - - // $ExpectType (this: {}, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, ...args: any[]) => void - $.proxy((t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}); - - // $ExpectType (this: {}, ...args: any[]) => void - $.proxy((a, b, c, d, e, f, g, h, t: I1, u: I2, v: I3, w: I4, x: I5, y: I6, z: I7, _: I8) => { }, {}, a, b, c, d, e, f, g, h); + // $ExpectType () => void + $.proxy(function(a, b, c, d, e, f, g) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType () => void + $.proxy(function(a, b, c, d, e, f) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType () => void + $.proxy(function(a, b, c, d, e) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType () => void + $.proxy(function(a, b, c, d) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType () => void + $.proxy(function(a, b, c) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType () => void + $.proxy(function(a, b) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType () => void + $.proxy(function(a) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType () => void + $.proxy(function() { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, b: B, c: C, t: J1) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, b: B, t: J1) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1) => void + $.proxy(function(a: A, t: J1) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1) => void + $.proxy(function(t: J1) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, b: B, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(a: A, t: J1, u: J2) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2) => void + $.proxy(function(t: J1, u: J2) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, b: B, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(a: A, t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2, v: J3) => void + $.proxy(function(t: J1, u: J2, v: J3) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, b: B, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(a: A, t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4) => void + $.proxy(function(t: J1, u: J2, v: J3, w: J4) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(a: A, t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5) => void + $.proxy(function(t: J1, u: J2, v: J3, w: J4, x: J5) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) => void + $.proxy(function(t: J1, u: J2, v: J3, w: J4, x: J5, y: J6) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, g: G, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, f: F, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, e: E, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, d: D, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b, c, d); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, c: C, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b, c); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, b: B, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(a: A, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a); + + // $ExpectType (t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, ...args: any[]) => void + $.proxy(function(t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context); + + // $ExpectType (...args: any[]) => void + $.proxy(function(a, b, c, d, e, f, g, h, t: J1, u: J2, v: J3, w: J4, x: J5, y: J6, z: J7, _: J8) { + // $ExpectType JContext + this; + }, context, a, b, c, d, e, f, g, h); } - // $ExpectType (this: { myFunc: () => undefined; }, ...args: any[]) => any + // $ExpectType (...args: any[]) => any $.proxy({ myFunc: $.noop }, 'myFunc', 1, 2); - // $ExpectType (this: { myFunc: () => undefined; }, ...args: any[]) => any + // $ExpectType (...args: any[]) => any $.proxy({ myFunc: $.noop }, 'myFunc'); } @@ -1762,11 +1990,13 @@ function JQueryStatic() { } function removeData() { - // $ExpectType void - $.removeData(new HTMLElement(), 'test1'); + const element: Element | Document | Window | JQuery.PlainObject = {} as any; // $ExpectType void - $.removeData(new HTMLElement()); + $.removeData(element, 'test1'); + + // $ExpectType void + $.removeData(element); } function speed() { @@ -1804,6 +2034,10 @@ function JQueryStatic() { } }); + // Weak type test. This may be removed if the TypeScript requirement is increased to 2.4+. + // $ExpectError + $.speed(false); + // $ExpectType EffectsOptions $.speed(); } @@ -1829,15 +2063,15 @@ function JQueryStatic() { } function when() { - interface I1 { kind: 'I1'; } - interface I2 { kind: 'I2'; } - interface I3 { kind: 'I3'; } - interface I4 { kind: 'I4'; } - interface I5 { kind: 'I5'; } - interface I6 { kind: 'I6'; } - interface I7 { kind: 'I7'; } - interface I8 { kind: 'I8'; } - interface I9 { kind: 'I9'; } + interface J1 { kind: 'J1'; } + interface J2 { kind: 'J2'; } + interface J3 { kind: 'J3'; } + interface J4 { kind: 'J4'; } + interface J5 { kind: 'J5'; } + interface J6 { kind: 'J6'; } + interface J7 { kind: 'J7'; } + interface J8 { kind: 'J8'; } + interface J9 { kind: 'J9'; } function Promise3() { const t = $.ajax() as JQuery.jqXHR; @@ -1987,22 +2221,22 @@ function JQueryStatic() { } function Promise() { - const p1: JQuery.Promise = {} as any; - const p2: JQuery.Promise = {} as any; - const p3: JQuery.Promise = {} as any; + const p1: JQuery.Promise = {} as any; + const p2: JQuery.Promise = {} as any; + const p3: JQuery.Promise = {} as any; // 3 parameters { const w = $.when(p1, p2, p3); w.then((a, b, c) => { - a; // $ExpectType I1 - b; // $ExpectType I2 - c; // $ExpectType I3 + a; // $ExpectType J1 + b; // $ExpectType J2 + c; // $ExpectType J3 }, (a, b, c) => { - a; // $ExpectType I2 - b; // $ExpectType I3 - c; // $ExpectType I4 + a; // $ExpectType J2 + b; // $ExpectType J3 + c; // $ExpectType J4 }, (a, b, c) => { a; // $ExpectType never b; // $ExpectType never @@ -2015,11 +2249,11 @@ function JQueryStatic() { const w = $.when(p1, p2); w.then((a, b) => { - a; // $ExpectType I1 - b; // $ExpectType I2 + a; // $ExpectType J1 + b; // $ExpectType J2 }, (a, b) => { - a; // $ExpectType I2 - b; // $ExpectType I3 + a; // $ExpectType J2 + b; // $ExpectType J3 }, (a, b) => { a; // $ExpectType never b; // $ExpectType never @@ -2031,9 +2265,9 @@ function JQueryStatic() { const w = $.when(p1); w.then(a => { - a; // $ExpectType I1 + a; // $ExpectType J1 }, a => { - a; // $ExpectType I2 + a; // $ExpectType J2 }, a => { a; // $ExpectType never }); @@ -2041,18 +2275,18 @@ function JQueryStatic() { } function Thenable() { - const t1: JQuery.Thenable = {} as any; - const t2: JQuery.Thenable = {} as any; - const t3: JQuery.Thenable = {} as any; + const t1: JQuery.Thenable = {} as any; + const t2: JQuery.Thenable = {} as any; + const t3: JQuery.Thenable = {} as any; // 3 parameters { const w = $.when(t1, t2, t3); w.then((a, b, c) => { - a; // $ExpectType I1 - b; // $ExpectType I2 - c; // $ExpectType I3 + a; // $ExpectType J1 + b; // $ExpectType J2 + c; // $ExpectType J3 }, (a, b, c) => { a; // $ExpectType any b; // $ExpectType any @@ -2069,8 +2303,8 @@ function JQueryStatic() { const w = $.when(t1, t2); w.then((a, b) => { - a; // $ExpectType I1 - b; // $ExpectType I2 + a; // $ExpectType J1 + b; // $ExpectType J2 }, (a, b) => { a; // $ExpectType any b; // $ExpectType any @@ -2085,7 +2319,7 @@ function JQueryStatic() { const w = $.when(t1); w.then(a => { - a; // $ExpectType I1 + a; // $ExpectType J1 }, a => { a; // $ExpectType any }, a => { @@ -2610,12 +2844,29 @@ function JQuery() { } function outerHeight() { + const value: string | number = undefined!; + + // $ExpectType JQuery + $('p').outerHeight(value, true); + // $ExpectType JQuery $('p').outerHeight('200px'); // $ExpectType JQuery $('p').outerHeight(400); + // $ExpectType JQuery + $('p').outerHeight(function(index, height) { + // $ExpectType HTMLElement + this; + // $ExpectType number + index; + // $ExpectType number + height; + + return '200px'; + }, false); + // $ExpectType JQuery $('p').outerHeight(function(index, height) { // $ExpectType HTMLElement @@ -2718,12 +2969,29 @@ function JQuery() { } function outerWidth() { + const value: string | number = undefined!; + + // $ExpectType JQuery + $('p').outerWidth(value, true); + // $ExpectType JQuery $('p').outerWidth('200px'); // $ExpectType JQuery $('p').outerWidth(400); + // $ExpectType JQuery + $('p').outerWidth(function(index, width) { + // $ExpectType HTMLElement + this; + // $ExpectType number + index; + // $ExpectType number + width; + + return '200px'; + }, false); + // $ExpectType JQuery $('p').outerWidth(function(index, width) { // $ExpectType HTMLElement @@ -2930,8 +3198,9 @@ function JQuery() { function data() { function data() { - // $ExpectType any - $('p').data('myData', undefined); + const value: string | undefined = {} as any; + // $ExpectError + $('p').data('myData', value); // $ExpectType JQuery $('p').data('myData', {}); @@ -2942,6 +3211,9 @@ function JQuery() { myData2: false }); + // $ExpectType any + $('p').data('myData', undefined); + // $ExpectType any $('p').data('myData'); @@ -3611,7 +3883,7 @@ function JQuery() { function events() { // [bind() overloads] https://github.com/jquery/api.jquery.com/issues/1048 function bind() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').bind('myEvent', 'myData', function(event) { @@ -3622,8 +3894,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').bind('myEvent', 'myData', function(this: I1, event) { - // $ExpectType I1 + $('p').bind('myEvent', 'myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3638,8 +3910,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').bind('myEvent', function(this: I1, event) { - // $ExpectType I1 + $('p').bind('myEvent', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3657,8 +3929,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3673,7 +3945,7 @@ function JQuery() { } function delegate() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('table').delegate('td', 'myEvent', 'myData', function(event) { @@ -3684,8 +3956,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').delegate('td', 'myEvent', 'myData', function(this: I1, event) { - // $ExpectType I1 + $('table').delegate('td', 'myEvent', 'myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3700,8 +3972,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').delegate('td', 'myEvent', function(this: I1, event) { - // $ExpectType I1 + $('table').delegate('td', 'myEvent', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3719,8 +3991,8 @@ function JQuery() { event; }, myEvent2: false, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3733,11 +4005,11 @@ function JQuery() { function defaultContext_customData(this: HTMLElement, event: JQuery.Event) { } - function customContext_defaultData(this: I1, event: JQuery.Event) { } + function customContext_defaultData(this: J1, event: JQuery.Event) { } - function customContext_customData(this: I1, event: JQuery.Event) { } + function customContext_customData(this: J1, event: JQuery.Event) { } - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('table').off('myEvent', 'td', defaultContext_defaultData); @@ -3801,7 +4073,7 @@ function JQuery() { } function on() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('table').on('myEvent', 'td', 'myData', function(event) { @@ -3820,8 +4092,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').on('myEvent', 'td', 'myData', function(this: I1, event) { - // $ExpectType I1 + $('table').on('myEvent', 'td', 'myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3844,8 +4116,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').on('myEvent', null, 'myData', function(this: I1, event) { - // $ExpectType I1 + $('table').on('myEvent', null, 'myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3868,8 +4140,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').on('myEvent', 'td', function(this: I1, event) { - // $ExpectType I1 + $('table').on('myEvent', 'td', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3895,8 +4167,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').on('myEvent', 3, function(this: I1, event) { - // $ExpectType I1 + $('table').on('myEvent', 3, function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3943,8 +4215,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').on('myEvent', function(this: I1, event) { - // $ExpectType I1 + $('table').on('myEvent', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3962,8 +4234,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3979,8 +4251,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -3996,8 +4268,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4013,8 +4285,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4030,8 +4302,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4040,7 +4312,7 @@ function JQuery() { } function one() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('table').one('myEvent', 'td', 'myData', function(event) { @@ -4051,8 +4323,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').one('myEvent', 'td', 'myData', function(this: I1, event) { - // $ExpectType I1 + $('table').one('myEvent', 'td', 'myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4067,8 +4339,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').one('myEvent', null, 'myData', function(this: I1, event) { - // $ExpectType I1 + $('table').one('myEvent', null, 'myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4083,8 +4355,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').one('myEvent', 'td', function(this: I1, event) { - // $ExpectType I1 + $('table').one('myEvent', 'td', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4102,8 +4374,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').one('myEvent', 3, function(this: I1, event) { - // $ExpectType I1 + $('table').one('myEvent', 3, function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4118,8 +4390,8 @@ function JQuery() { }); // $ExpectType JQuery - $('table').one('myEvent', function(this: I1, event) { - // $ExpectType I1 + $('table').one('myEvent', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4137,8 +4409,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4154,8 +4426,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4171,8 +4443,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4188,8 +4460,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4205,8 +4477,8 @@ function JQuery() { // $ExpectType Event event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + myEvent3(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4227,6 +4499,9 @@ function JQuery() { // $ExpectType JQuery $('p').trigger('myEvent', 3); + // $ExpectType JQuery + $('p').trigger('myEvent', true); + // $ExpectType JQuery $('p').trigger($.Event('myEvent'), ['Custom', 'Event']); @@ -4238,6 +4513,9 @@ function JQuery() { // $ExpectType JQuery $('p').trigger($.Event('myEvent'), 3); + + // $ExpectType JQuery + $('p').trigger($.Event('myEvent'), true); } function triggerHandler() { @@ -4253,6 +4531,9 @@ function JQuery() { // $ExpectType any $('p').triggerHandler('myEvent', 3); + // $ExpectType any + $('p').triggerHandler('myEvent', true); + // $ExpectType any $('p').triggerHandler($.Event('myEvent'), ['Custom', 'Event']); @@ -4264,6 +4545,9 @@ function JQuery() { // $ExpectType any $('p').triggerHandler($.Event('myEvent'), 3); + + // $ExpectType any + $('p').triggerHandler($.Event('myEvent'), true); } function unbind() { @@ -4271,11 +4555,11 @@ function JQuery() { function defaultContext_customData(this: HTMLElement, event: JQuery.Event) { } - function customContext_defaultData(this: I1, event: JQuery.Event) { } + function customContext_defaultData(this: J1, event: JQuery.Event) { } - function customContext_customData(this: I1, event: JQuery.Event) { } + function customContext_customData(this: J1, event: JQuery.Event) { } - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').unbind('myEvent', defaultContext_defaultData); @@ -4307,11 +4591,11 @@ function JQuery() { function defaultContext_customData(this: HTMLElement, event: JQuery.Event) { } - function customContext_defaultData(this: I1, event: JQuery.Event) { } + function customContext_defaultData(this: J1, event: JQuery.Event) { } - function customContext_customData(this: I1, event: JQuery.Event) { } + function customContext_customData(this: J1, event: JQuery.Event) { } - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('table').undelegate('td', 'click', defaultContext_defaultData); @@ -4348,7 +4632,7 @@ function JQuery() { } function blur() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').blur('myData', function(event) { @@ -4359,8 +4643,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').blur('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').blur('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4375,8 +4659,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').blur(function(this: I1, event) { - // $ExpectType I1 + $('p').blur(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4390,7 +4674,7 @@ function JQuery() { } function change() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').change('myData', function(event) { @@ -4401,8 +4685,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').change('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').change('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4417,8 +4701,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').change(function(this: I1, event) { - // $ExpectType I1 + $('p').change(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4432,7 +4716,7 @@ function JQuery() { } function click() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').click('myData', function(event) { @@ -4443,8 +4727,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').click('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').click('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4459,8 +4743,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').click(function(this: I1, event) { - // $ExpectType I1 + $('p').click(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4474,7 +4758,7 @@ function JQuery() { } function contextmenu() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').contextmenu('myData', function(event) { @@ -4485,8 +4769,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').contextmenu('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').contextmenu('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4501,8 +4785,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').contextmenu(function(this: I1, event) { - // $ExpectType I1 + $('p').contextmenu(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4516,7 +4800,7 @@ function JQuery() { } function dblclick() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').dblclick('myData', function(event) { @@ -4527,8 +4811,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').dblclick('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').dblclick('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4543,8 +4827,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').dblclick(function(this: I1, event) { - // $ExpectType I1 + $('p').dblclick(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4558,7 +4842,7 @@ function JQuery() { } function focus() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').focus('myData', function(event) { @@ -4569,8 +4853,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').focus('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').focus('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4585,8 +4869,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').focus(function(this: I1, event) { - // $ExpectType I1 + $('p').focus(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4600,7 +4884,7 @@ function JQuery() { } function focusin() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').focusin('myData', function(event) { @@ -4611,8 +4895,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').focusin('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').focusin('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4627,8 +4911,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').focusin(function(this: I1, event) { - // $ExpectType I1 + $('p').focusin(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4642,7 +4926,7 @@ function JQuery() { } function focusout() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').focusout('myData', function(event) { @@ -4653,8 +4937,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').focusout('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').focusout('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4669,8 +4953,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').focusout(function(this: I1, event) { - // $ExpectType I1 + $('p').focusout(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4684,7 +4968,7 @@ function JQuery() { } function keydown() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').keydown('myData', function(event) { @@ -4695,8 +4979,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').keydown('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').keydown('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4711,8 +4995,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').keydown(function(this: I1, event) { - // $ExpectType I1 + $('p').keydown(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4726,7 +5010,7 @@ function JQuery() { } function keypress() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').keypress('myData', function(event) { @@ -4737,8 +5021,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').keypress('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').keypress('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4753,8 +5037,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').keypress(function(this: I1, event) { - // $ExpectType I1 + $('p').keypress(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4768,7 +5052,7 @@ function JQuery() { } function keyup() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').keyup('myData', function(event) { @@ -4779,8 +5063,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').keyup('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').keyup('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4795,8 +5079,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').keyup(function(this: I1, event) { - // $ExpectType I1 + $('p').keyup(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4810,7 +5094,7 @@ function JQuery() { } function mousedown() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mousedown('myData', function(event) { @@ -4821,8 +5105,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mousedown('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mousedown('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4837,8 +5121,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mousedown(function(this: I1, event) { - // $ExpectType I1 + $('p').mousedown(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4852,7 +5136,7 @@ function JQuery() { } function mouseenter() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mouseenter('myData', function(event) { @@ -4863,8 +5147,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseenter('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mouseenter('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4879,8 +5163,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseenter(function(this: I1, event) { - // $ExpectType I1 + $('p').mouseenter(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4894,7 +5178,7 @@ function JQuery() { } function mouseleave() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mouseleave('myData', function(event) { @@ -4905,8 +5189,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseleave('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mouseleave('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4921,8 +5205,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseleave(function(this: I1, event) { - // $ExpectType I1 + $('p').mouseleave(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4936,7 +5220,7 @@ function JQuery() { } function mousemove() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mousemove('myData', function(event) { @@ -4947,8 +5231,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mousemove('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mousemove('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4963,8 +5247,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mousemove(function(this: I1, event) { - // $ExpectType I1 + $('p').mousemove(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -4978,7 +5262,7 @@ function JQuery() { } function mouseout() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mouseout('myData', function(event) { @@ -4989,8 +5273,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseout('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mouseout('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5005,8 +5289,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseout(function(this: I1, event) { - // $ExpectType I1 + $('p').mouseout(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5020,7 +5304,7 @@ function JQuery() { } function mouseover() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mouseover('myData', function(event) { @@ -5031,8 +5315,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseover('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mouseover('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5047,8 +5331,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseover(function(this: I1, event) { - // $ExpectType I1 + $('p').mouseover(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5062,7 +5346,7 @@ function JQuery() { } function mouseup() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').mouseup('myData', function(event) { @@ -5073,8 +5357,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseup('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').mouseup('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5089,8 +5373,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').mouseup(function(this: I1, event) { - // $ExpectType I1 + $('p').mouseup(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5104,7 +5388,7 @@ function JQuery() { } function resize() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').resize('myData', function(event) { @@ -5115,8 +5399,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').resize('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').resize('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5131,8 +5415,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').resize(function(this: I1, event) { - // $ExpectType I1 + $('p').resize(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5146,7 +5430,7 @@ function JQuery() { } function scroll() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').scroll('myData', function(event) { @@ -5157,8 +5441,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').scroll('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').scroll('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5173,8 +5457,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').scroll(function(this: I1, event) { - // $ExpectType I1 + $('p').scroll(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5188,7 +5472,7 @@ function JQuery() { } function select() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').select('myData', function(event) { @@ -5199,8 +5483,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').select('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').select('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5215,8 +5499,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').select(function(this: I1, event) { - // $ExpectType I1 + $('p').select(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5230,7 +5514,7 @@ function JQuery() { } function submit() { - interface I1 { kind: 'I1'; } + interface J1 { kind: 'J1'; } // $ExpectType JQuery $('p').submit('myData', function(event) { @@ -5241,8 +5525,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').submit('myData', function(this: I1, event) { - // $ExpectType I1 + $('p').submit('myData', function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5257,8 +5541,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').submit(function(this: I1, event) { - // $ExpectType I1 + $('p').submit(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5272,8 +5556,8 @@ function JQuery() { } function hover() { - interface I1 { kind: 'I1'; } - interface I2 { kind: 'I2'; } + interface J1 { kind: 'J1'; } + interface J2 { kind: 'J2'; } // $ExpectType JQuery $('p').hover(function(event) { @@ -5289,8 +5573,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').hover(function(this: I1, event) { - // $ExpectType I1 + $('p').hover(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5307,21 +5591,21 @@ function JQuery() { this; // $ExpectType Event event; - }, function(this: I1, event) { - // $ExpectType I1 + }, function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; }); // $ExpectType JQuery - $('p').hover(function(this: I1, event) { - // $ExpectType I1 + $('p').hover(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; - }, function(this: I2, event) { - // $ExpectType I2 + }, function(this: J2, event) { + // $ExpectType J2 this; // $ExpectType Event event; @@ -5336,8 +5620,8 @@ function JQuery() { }, false); // $ExpectType JQuery - $('p').hover(function(this: I1, event) { - // $ExpectType I1 + $('p').hover(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5352,8 +5636,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').hover(false, function(this: I1, event) { - // $ExpectType I1 + $('p').hover(false, function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -5371,8 +5655,8 @@ function JQuery() { }); // $ExpectType JQuery - $('p').hover(function(this: I1, event) { - // $ExpectType I1 + $('p').hover(function(this: J1, event) { + // $ExpectType J1 this; // $ExpectType Event event; @@ -6526,6 +6810,25 @@ function JQuery() { } } +function JQuery_Selectors() { + function pseudos_colon() { + // $ExpectType PseudoFunctions + $.expr[':']; + } + + function filter() { + // $ExpectType FilterFunctions + $.expr.filter; + } + + function stackoverflow_50727144() { + $.extend($.expr[":"], { + containsCaseInsensitive: (elem: any, i: number, match: any, array: any) => + (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0 + }); + } +} + function JQuery_AjaxSettings() { $.ajax({ accepts: { @@ -6692,172 +6995,6 @@ function JQuery_AjaxSettings() { }); } -function JQuery_Callbacks() { - function add() { - const callbacks = $.Callbacks(); - - // $ExpectType Callbacks - callbacks.add(() => { }, [() => { }], () => { }); - - // $ExpectType Callbacks - callbacks.add(() => { }, [() => { }]); - - // $ExpectType Callbacks - callbacks.add(() => { }, () => { }); - - // $ExpectType Callbacks - callbacks.add(() => { }); - - // $ExpectType Callbacks - callbacks.add([() => { }]); - } - - function disable() { - // $ExpectType Callbacks - $.Callbacks().disable(); - } - - function disabled() { - // $ExpectType boolean - $.Callbacks().disabled(); - } - - function empty() { - // $ExpectType Callbacks - $.Callbacks().empty(); - } - - function fire() { - // $ExpectType Callbacks - $.Callbacks().fire(1); - - // $ExpectType Callbacks - $.Callbacks().fire(); - } - - function fireWith() { - // $ExpectType Callbacks - $.Callbacks().fireWith(window, [1]); - - // $ExpectType Callbacks - $.Callbacks().fireWith(window); - } - - function fired() { - // $ExpectType boolean - $.Callbacks().fired(); - } - - function has() { - // $ExpectType boolean - $.Callbacks().has(() => { }); - - // $ExpectType boolean - $.Callbacks().has(); - } - - function lock() { - // $ExpectType Callbacks - $.Callbacks().lock(); - } - - function locked() { - // $ExpectType boolean - $.Callbacks().locked(); - } - - function remove() { - // $ExpectType Callbacks - $.Callbacks().remove(() => { }, () => { }); - } -} - -function JQuery_EffectsOptions() { - $('p').show({ - always(animation, jumpToEnd) { - // $ExpectType HTMLElement - this; - // $ExpectType Promise - animation; - // $ExpectType boolean - jumpToEnd; - }, - complete() { - // $ExpectType HTMLElement - this; - }, - done(animation, jumpToEnd) { - // $ExpectType HTMLElement - this; - // $ExpectType Promise - animation; - // $ExpectType boolean - jumpToEnd; - }, - duration: 5000, - easing: 'linear', - fail(animation, jumpToEnd) { - // $ExpectType HTMLElement - this; - // $ExpectType Promise - animation; - // $ExpectType boolean - jumpToEnd; - }, - progress(animation, progress, remainingMs) { - // $ExpectType HTMLElement - this; - // $ExpectType Promise - animation; - // $ExpectType number - progress; - // $ExpectType number - remainingMs; - }, - queue: true, - specialEasing: { - width: 'linear', - height: 'easeOutBounce' - }, - start(animation) { - // $ExpectType HTMLElement - this; - // $ExpectType Promise - animation; - }, - step(now, tween) { - // $ExpectType HTMLElement - this; - // $ExpectType number - now; - // $ExpectType Tween - tween; - } - }); -} - -function JQuery_Event() { - function call_signature() { - // $ExpectType Event & Coordinates - $.Event('keydown', $('p').offset()); - - // $ExpectType Event & { type: string; } - $.Event({ - type: 'keydown' - }); - } - - function constructor() { - // $ExpectType Event & Coordinates - new $.Event('keydown', $('p').offset()); - - // $ExpectType Event & { type: string; } - new $.Event({ - type: 'keydown' - }); - } -} - function JQuery_jqXHR() { const p: JQuery.jqXHR = {} as any; @@ -7126,26 +7263,158 @@ function JQuery_jqXHR() { } } +function JQuery_CallbacksStatic() { + // $ExpectType Callbacks + $.Callbacks('once'); + + // $ExpectType Callbacks + $.Callbacks(); +} + +function JQuery_Callbacks() { + function add() { + const callbacks = $.Callbacks(); + + // $ExpectType Callbacks + callbacks.add(() => { }, [() => { }], () => { }); + + // $ExpectType Callbacks + callbacks.add(() => { }, [() => { }]); + + // $ExpectType Callbacks + callbacks.add(() => { }, () => { }); + + // $ExpectType Callbacks + callbacks.add(() => { }); + + // $ExpectType Callbacks + callbacks.add([() => { }]); + } + + function disable() { + // $ExpectType Callbacks + $.Callbacks().disable(); + } + + function disabled() { + // $ExpectType boolean + $.Callbacks().disabled(); + } + + function empty() { + // $ExpectType Callbacks + $.Callbacks().empty(); + } + + function fire() { + // $ExpectType Callbacks + $.Callbacks().fire(1); + + // $ExpectType Callbacks + $.Callbacks().fire(); + } + + function fired() { + // $ExpectType boolean + $.Callbacks().fired(); + } + + function fireWith() { + // $ExpectType Callbacks + $.Callbacks().fireWith(window, [1]); + + // $ExpectType Callbacks + $.Callbacks().fireWith(window); + } + + function has() { + // $ExpectType boolean + $.Callbacks().has(() => { }); + + // $ExpectType boolean + $.Callbacks().has(); + } + + function lock() { + // $ExpectType Callbacks + $.Callbacks().lock(); + } + + function locked() { + // $ExpectType boolean + $.Callbacks().locked(); + } + + function remove() { + // $ExpectType Callbacks + $.Callbacks().remove(() => { }, () => { }); + } +} + +function JQuery_CSSHooks() { + $.cssHooks.borderRadius = { + get(elem, computed, extra) { + // $ExpectedType HTMLElement + elem; + // $ExpectedType any + computed; + // $ExpectedType any + extra; + }, + set(elem, value) { + // $ExpectedType HTMLElement + elem; + // $ExpectedType any + value; + } + }; + + $.cssHooks.borderRadius = { + get(elem, computed, extra) { + // $ExpectedType HTMLElement + elem; + // $ExpectedType any + computed; + // $ExpectedType any + extra; + } + }; + + $.cssHooks.borderRadius = { + set(elem, value) { + // $ExpectedType HTMLElement + elem; + // $ExpectedType any + value; + } + }; + + // Weak type test. This may be removed if the TypeScript requirement is increased to 2.4+. + // $ExpectError + $.cssHooks.borderRadius = function get(elem: HTMLElement, computed: any, extra: any) { + return 1; + }; +} + function JQuery_Promise3() { - interface I1 { kind: 'I1'; } - interface I2 { kind: 'I2'; } - interface I3 { kind: 'I3'; } - interface I4 { kind: 'I4'; } - interface I5 { kind: 'I5'; } - interface I6 { kind: 'I6'; } - interface I7 { kind: 'I7'; } - interface I8 { kind: 'I8'; } - interface I9 { kind: 'I9'; } + interface J1 { kind: 'J1'; } + interface J2 { kind: 'J2'; } + interface J3 { kind: 'J3'; } + interface J4 { kind: 'J4'; } + interface J5 { kind: 'J5'; } + interface J6 { kind: 'J6'; } + interface J7 { kind: 'J7'; } + interface J8 { kind: 'J8'; } + interface J9 { kind: 'J9'; } - // tslint:disable-next-line:ban-types - const p: JQuery.Promise3 = {} as any; - const p1: JQuery.Promise3 = {} as any; - const p2: JQuery.Promise3 = {} as any; - const p3: JQuery.Promise3 = {} as any; + const p: JQuery.Promise3 = {} as any; + const p1: JQuery.Promise3 = {} as any; + const p2: JQuery.Promise3 = {} as any; + const p3: JQuery.Promise3 = {} as any; - const t1: JQuery.Thenable = {} as any; - const t2: JQuery.Thenable = {} as any; - const t3: JQuery.Thenable = {} as any; + const t1: JQuery.Thenable = {} as any; + const t2: JQuery.Thenable = {} as any; + const t3: JQuery.Thenable = {} as any; function then() { p.then((a, b, c) => { @@ -7155,7 +7424,7 @@ function JQuery_Promise3() { }, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }, (a, b, c) => { a; // $ExpectType number b; // $ExpectType boolean @@ -7165,7 +7434,7 @@ function JQuery_Promise3() { p.then(null, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }, (a, b, c) => { a; // $ExpectType number b; // $ExpectType boolean @@ -7195,7 +7464,7 @@ function JQuery_Promise3() { }, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }, null); p.then((a, b, c) => { @@ -7205,19 +7474,19 @@ function JQuery_Promise3() { }, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }); p.then(null, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }, null); p.then(null, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }); p.then((a, b, c) => { @@ -7260,7 +7529,7 @@ function JQuery_Promise3() { }, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }, (a, b, c) => { a; // $ExpectType number b; // $ExpectType boolean @@ -7290,7 +7559,7 @@ function JQuery_Promise3() { }, (a, b, c) => { a; // $ExpectType Error b; // $ExpectType string - c; // $ExpectType Function + c; // $ExpectType Element }, (a, b, c) => { a; // $ExpectType number b; // $ExpectType boolean @@ -7327,7 +7596,7 @@ function JQuery_Promise3() { }); q.then((a) => { - a; // $ExpectType I1 | I2 + a; // $ExpectType J1 | J2 }, (a) => { a; // $ExpectType never }, (a, b, c) => { @@ -7346,17 +7615,17 @@ function JQuery_Promise3() { }); q.then((a, b, c) => { - a; // $ExpectType I1 | I2 - b; // $ExpectType I4 | I5 - c; // $ExpectType I7 | I8 + a; // $ExpectType J1 | J2 + b; // $ExpectType J4 | J5 + c; // $ExpectType J7 | J8 }, (a, b, c) => { - a; // $ExpectType I2 | I3 - b; // $ExpectType I5 | I6 - c; // $ExpectType I8 | I9 + a; // $ExpectType J2 | J3 + b; // $ExpectType J5 | J6 + c; // $ExpectType J8 | J9 }, (a, b, c) => { - a; // $ExpectType I3 | I4 - b; // $ExpectType I6 | I7 - c; // $ExpectType I1 | I9 + a; // $ExpectType J3 | J4 + b; // $ExpectType J6 | J7 + c; // $ExpectType J1 | J9 }); } @@ -7369,7 +7638,7 @@ function JQuery_Promise3() { }); q.then((a) => { - a; // $ExpectType number | I1 + a; // $ExpectType number | J1 }, (a) => { a; // never }, (a, b, c) => { @@ -7388,7 +7657,7 @@ function JQuery_Promise3() { }); q.then((a) => { - a; // $ExpectType number | I1 + a; // $ExpectType number | J1 }, (a) => { a; // never }, (a, b, c) => { @@ -7407,17 +7676,17 @@ function JQuery_Promise3() { }); q.then((a, b, c) => { - a; // $ExpectType number | I1 - b; // $ExpectType I4 - c; // $ExpectType I7 + a; // $ExpectType number | J1 + b; // $ExpectType J4 + c; // $ExpectType J7 }, (a, b, c) => { - a; // $ExpectType I2 - b; // $ExpectType I5 - c; // $ExpectType I8 + a; // $ExpectType J2 + b; // $ExpectType J5 + c; // $ExpectType J8 }, (a, b, c) => { - a; // $ExpectType I3 - b; // $ExpectType I6 - c; // $ExpectType I9 + a; // $ExpectType J3 + b; // $ExpectType J6 + c; // $ExpectType J9 }); } @@ -7430,17 +7699,17 @@ function JQuery_Promise3() { }); q.then((a, b, c) => { - a; // $ExpectType number | I1 - b; // $ExpectType I4 - c; // $ExpectType I7 + a; // $ExpectType number | J1 + b; // $ExpectType J4 + c; // $ExpectType J7 }, (a, b, c) => { - a; // $ExpectType I2 - b; // $ExpectType I5 - c; // $ExpectType I8 + a; // $ExpectType J2 + b; // $ExpectType J5 + c; // $ExpectType J8 }, (a, b, c) => { - a; // $ExpectType I3 - b; // $ExpectType I6 - c; // $ExpectType I9 + a; // $ExpectType J3 + b; // $ExpectType J6 + c; // $ExpectType J9 }); } @@ -7453,17 +7722,17 @@ function JQuery_Promise3() { }); q.then((a, b, c) => { - a; // $ExpectType I1 | I2 - b; // $ExpectType I5 - c; // $ExpectType I8 + a; // $ExpectType J1 | J2 + b; // $ExpectType J5 + c; // $ExpectType J8 }, (a, b, c) => { - a; // $ExpectType I3 - b; // $ExpectType I6 - c; // $ExpectType I9 + a; // $ExpectType J3 + b; // $ExpectType J6 + c; // $ExpectType J9 }, (a, b, c) => { - a; // $ExpectType I4 - b; // $ExpectType I7 - c; // $ExpectType I1 + a; // $ExpectType J4 + b; // $ExpectType J7 + c; // $ExpectType J1 }); } @@ -7476,17 +7745,17 @@ function JQuery_Promise3() { }); q.then((a, b, c) => { - a; // $ExpectType I1 | I2 - b; // $ExpectType I4 - c; // $ExpectType I7 + a; // $ExpectType J1 | J2 + b; // $ExpectType J4 + c; // $ExpectType J7 }, (a, b, c) => { - a; // $ExpectType I2 - b; // $ExpectType I5 - c; // $ExpectType I8 + a; // $ExpectType J2 + b; // $ExpectType J5 + c; // $ExpectType J8 }, (a, b, c) => { - a; // $ExpectType I3 - b; // $ExpectType I6 - c; // $ExpectType I9 + a; // $ExpectType J3 + b; // $ExpectType J6 + c; // $ExpectType J9 }); } } @@ -7505,9 +7774,9 @@ function JQuery_Promise3() { const a = $.ajax('/echo/json').catch(() => { return t1; }); - // $ExpectType PromiseBase + // $ExpectType PromiseBase a; - const b: JQuery.Promise3 = a; + const b: JQuery.Promise3 = a; } { const a = $.ajax('/echo/json').catch(() => { @@ -7812,18 +8081,474 @@ function JQuery_Promise(p: JQuery.Promise) { } } -function JQuery_Deferred() { - interface I1 { kind: 'I1'; } - interface I2 { kind: 'I2'; } - interface I3 { kind: 'I3'; } +function JQuery_DeferredStatic() { + function exceptionHook() { + $.Deferred.exceptionHook = undefined; + } - const d1 = $.Deferred(); + function call_signature() { + // $ExpectType Deferred + $.Deferred(function(deferred) { + // $ExpectType Deferred + this; + // $ExpectType Deferred + deferred; + }); - function promise() { - const target: I1 = {} as any; + // $ExpectType Deferred + $.Deferred(); - d1.promise(target); // $ExpectType Promise & I1 + // $ExpectType Deferred + $.Deferred(function(deferred) { + // $ExpectType Deferred + this; + // $ExpectType Deferred + deferred; + }); - d1.promise(); // $ExpectType Promise + // $ExpectType Deferred + $.Deferred(); + + // $ExpectType Deferred + $.Deferred(function(deferred) { + // $ExpectType Deferred + this; + // $ExpectType Deferred + deferred; + }); + + // $ExpectType Deferred + $.Deferred(); + + // $ExpectType Deferred + $.Deferred(function(deferred) { + // $ExpectType Deferred + this; + // $ExpectType Deferred + deferred; + }); + + // $ExpectType Deferred + $.Deferred(); } } + +function JQuery_Deferred() { + interface J1 { kind: 'J1'; } + interface J2 { kind: 'J2'; } + interface J3 { kind: 'J3'; } + + const d1 = $.Deferred(); + + function promise() { + const target: J1 = {} as any; + + d1.promise(target); // $ExpectType Promise & J1 + + d1.promise(); // $ExpectType Promise + } +} + +function JQuery_EffectsOptions() { + $('p').show({ + always(animation, jumpToEnd) { + // $ExpectType HTMLElement + this; + // $ExpectType Animation + animation; + // $ExpectType boolean + jumpToEnd; + }, + complete() { + // $ExpectType HTMLElement + this; + }, + done(animation, jumpToEnd) { + // $ExpectType HTMLElement + this; + // $ExpectType Animation + animation; + // $ExpectType boolean + jumpToEnd; + }, + duration: 5000, + easing: 'linear', + fail(animation, jumpToEnd) { + // $ExpectType HTMLElement + this; + // $ExpectType Animation + animation; + // $ExpectType boolean + jumpToEnd; + }, + progress(animation, progress, remainingMs) { + // $ExpectType HTMLElement + this; + // $ExpectType Animation + animation; + // $ExpectType number + progress; + // $ExpectType number + remainingMs; + }, + queue: true, + specialEasing: { + width: 'linear', + height: 'easeOutBounce' + }, + start(animation) { + // $ExpectType HTMLElement + this; + // $ExpectType Animation + animation; + }, + step(now, tween) { + // $ExpectType HTMLElement + this; + // $ExpectType number + now; + // $ExpectType Tween + tween; + } + }); +} + +function JQuery_AnimationStatic() { + function call_signature() { + const element: HTMLElement = undefined!; + + // $ExpectType Animation + $.Animation(element, {}, {}); + } + + function prefilter() { + // https://github.com/jquery/api.jquery.com/issues/256 -> http://jsfiddle.net/y4L35/ + { + // $ExpectType void + $.Animation.prefilter(function(element: HTMLElement, properties, options) { + // $ExpectType Animation + this; + // $ExpectType HTMLElement + element; + // $ExpectType PlainObject + properties; + // $ExpectType EffectsOptions + options; + // $ExpectType any + options.removeAfter; + + if (options.removeAfter) { + this.done(() => { + $(element).remove(); + }); + } + }); + + $("#element").hide({ + duration: 500, + removeAfter: true, + complete() { + // 0, because the prefilter done happens first! + console.log($(this).parent().length); + } + }); + } + } + + function tweener() { + // $ExpectType void + $.Animation.tweener('*', function(propName, finalValue) { + // $ExpectType Animation + this; + // $ExpectType string + propName; + // $ExpectType number + finalValue; + + return this.createTween(propName, finalValue); + }); + } +} + +function JQuery_Animation() { + const element: Element = undefined!; + + const animation = $.Animation(element, {}, {}); + + animation.done((anim, jumpedToEnd) => { + // $ExpectType Animation + anim; + // $ExpectType true | undefined + jumpedToEnd; + }); + + animation.fail((anim, jumpedToEnd) => { + // $ExpectType Animation + anim; + // $ExpectType false + jumpedToEnd; + }); + + animation.always((anim, jumpedToEnd) => { + // $ExpectType Animation + anim; + // $ExpectType boolean | undefined + jumpedToEnd; + }); + + animation.progress((anim, progress, remainingMs) => { + // $ExpectType Animation + anim; + // $ExpectType number + progress; + // $ExpectType number + remainingMs; + }); +} + +function JQuery_TweenStatic() { + function propHooks() { + $.Tween.propHooks['myProp'] = { + get(tween) { + // $ExpectType Tween + tween; + + return tween.elem[tween.prop as keyof typeof tween.elem]; + }, + set(tween) { + // $ExpectType Tween + tween; + }, + }; + + // Weak type test. This may be removed if the TypeScript requirement is increased to 2.4+. + // $ExpectError + $.Tween.propHooks['myProp'] = 1; + } + + function call_signature() { + const elem: HTMLElement = undefined!; + + // $ExpectType Tween + $.Tween(elem, {}, 'myProp', 1, 'myEasing', 'myUnit'); + + // $ExpectType Tween + $.Tween(elem, {}, 'myProp', 1, 'myEasing'); + + // $ExpectType Tween + $.Tween(elem, {}, 'myProp', 1); + } +} + +function JQuery_Easings() { + jQuery.easing.easeInCubic = (p) => { + return Math.pow(p, 3); + }; +} + +function JQuery_Effects() { + function interval() { + // $ExpectType number + $.fx.interval; + } + + function off() { + // $ExpectType boolean + $.fx.off; + } + + function step() { + // $ExpectType PlainObject> + $.fx.step; + } + + function stop() { + // $ExpectType () => void + $.fx.stop; + + function override() { + let animating: boolean; + + jQuery.fx.stop = () => { + animating = false; + }; + } + } + + function timer() { + // $ExpectType (tickFunction: TickFunction) => void + $.fx.timer; + + function override() { + let animating: boolean; + const raf: () => void = {} as any; + + jQuery.fx.timer = (timer) => { + // $ExpectType TickFunction + timer; + + if (timer() && jQuery.timers.push(timer) && !animating) { + animating = true; + raf(); + } + }; + } + } +} + +function JQuery_Event() { + function call_signature() { + // $ExpectType Event & Coordinates + $.Event('keydown', $('p').offset()); + + // $ExpectType Event & { type: string; } + $.Event({ + type: 'keydown' + }); + } + + function constructor() { + // $ExpectType Event & Coordinates + new $.Event('keydown', $('p').offset()); + + // $ExpectType Event & { type: string; } + new $.Event({ + type: 'keydown' + }); + } + + // https://stackoverflow.com/questions/49892574/trigger-a-jquery-3-event-with-ctrlkey-set + function stackoverflow_49892574() { + const event = $.Event("keydown"); + event.which = 77; + event.ctrlKey = true; + $(window).trigger(event); + } +} + +function JQuery_EventExtensions() { + function fixHooks() { + jQuery.event.fixHooks.drop = { + props: ['dataTransfer'], + filter(event, originalEvent) { + // $ExpectType Event + event; + // $ExpectType Event + originalEvent; + }, + }; + + // Weak type test. This may be removed if the TypeScript requirement is increased to 2.4+. + // $ExpectError + jQuery.event.fixHooks.drop = ['dataTransfer']; + } + + function special() { + jQuery.event.special.multiclick = { + noBubble: true, + bindType: 'click', + delegateType: 'click', + setup(data, namespaces, eventHandle) { + // $ExpectType EventTarget + this; + // $ExpectType any + data; + // $ExpectType string + namespaces; + // $ExpectType EventHandler + eventHandle; + + return false; + }, + teardown() { + // $ExpectType EventTarget + this; + + return false; + }, + add(handleObj) { + // $ExpectType EventTarget + this; + // $ExpectType HandleObject + handleObj; + }, + remove(handleObj) { + // $ExpectType EventTarget + this; + // $ExpectType HandleObject + handleObj; + }, + trigger(event, data) { + // $ExpectType EventTarget + this; + // $ExpectType Event + event; + // $ExpectType any + data; + + return false; + }, + _default(event, data) { + // $ExpectType Event + event; + // $ExpectType any + data; + + return false; + }, + handle(event, data) { + // $ExpectType Event & { handleObj: HandleObject; } + event; + // $ExpectType any + data; + }, + preDispatch(event) { + // $ExpectType EventTarget + this; + // $ExpectType Event + event; + + return false; + }, + postDispatch(event) { + // $ExpectType EventTarget + this; + // $ExpectType Event + event; + } + }; + + // Weak type test. This may be removed if the TypeScript requirement is increased to 2.4+. + // $ExpectError + jQuery.event.special.multiclick = 1; + } +} + +declare namespace JQuery { + interface ValHooks { + textarea: ValHook; + } +} + +function JQuery_ValHooks() { + jQuery.valHooks.textarea = { + get(elem) { + // $ExpectType HTMLTextAreaElement + elem; + + return elem.value.replace(/\r?\n/g, "\r\n"); + }, + set(elem) { + // $ExpectType HTMLTextAreaElement + elem; + + return elem.value; + } + }; + + // Weak type test. This may be removed if the TypeScript requirement is increased to 2.4+. + // $ExpectError + jQuery.valHooks.textarea = function get(elem: HTMLTextAreaElement) { + return elem.value.replace(/\r?\n/g, "\r\n"); + }; +} diff --git a/types/jquery/legacy.d.ts b/types/jquery/legacy.d.ts new file mode 100644 index 0000000000..a3a98b936c --- /dev/null +++ b/types/jquery/legacy.d.ts @@ -0,0 +1,201 @@ +// tslint:disable:no-irregular-whitespace + +// tslint:disable-next-line:no-empty-interface +interface JQueryCallback extends JQuery.Callbacks { } +interface JQueryDeferred extends JQuery.Deferred { } +// tslint:disable-next-line:no-empty-interface +interface JQueryEventConstructor extends JQuery.EventStatic { } +interface JQueryDeferred extends JQuery.Deferred { } +// tslint:disable-next-line:no-empty-interface +interface JQueryAjaxSettings extends JQuery.AjaxSettings { } +interface JQueryAnimationOptions extends JQuery.EffectsOptions { } +// tslint:disable-next-line:no-empty-interface +interface JQueryCoordinates extends JQuery.Coordinates { } +interface JQueryGenericPromise extends JQuery.Thenable { } +// tslint:disable-next-line:no-empty-interface +interface JQueryXHR extends JQuery.jqXHR { } +interface JQueryPromise extends JQuery.Promise { } +// tslint:disable-next-line:no-empty-interface +interface JQuerySerializeArrayElement extends JQuery.NameValuePair { } + +/** + * @deprecated ​ Deprecated since 1.9. See \`{@link https://api.jquery.com/jQuery.support/ }\`. + */ +// tslint:disable-next-line:no-empty-interface +interface JQuerySupport extends JQuery.PlainObject { } + +// Legacy types that are not represented in the current type definitions are marked deprecated. + +/** + * @deprecated ​ Deprecated. Use \`{@link JQuery.Deferred.Callback }\` or \`{@link JQuery.Deferred.CallbackBase }\`. + */ +interface JQueryPromiseCallback { + // tslint:disable-next-line:callable-types + (value?: T, ...args: any[]): void; +} +/** + * @deprecated ​ Deprecated. Use \`{@link JQueryStatic.param JQueryStatic['param']}\`. + */ +interface JQueryParam { + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * @param obj An array or object to serialize. + * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. + */ + // tslint:disable-next-line:callable-types + (obj: any, traditional?: boolean): string; +} +/** + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\`. + */ +interface BaseJQueryEventObject extends Event { + /** + * The current DOM element within the event bubbling phase. + * @see \`{@link https://api.jquery.com/event.currentTarget/ }\` + */ + currentTarget: Element; + /** + * An optional object of data passed to an event method when the current executing handler is bound. + * @see \`{@link https://api.jquery.com/event.data/ }\` + */ + data: any; + /** + * The element where the currently-called jQuery event handler was attached. + * @see \`{@link https://api.jquery.com/event.delegateTarget/ }\` + */ + delegateTarget: Element; + /** + * Returns whether event.preventDefault() was ever called on this event object. + * @see \`{@link https://api.jquery.com/event.isDefaultPrevented/ }\` + */ + isDefaultPrevented(): boolean; + /** + * Returns whether event.stopImmediatePropagation() was ever called on this event object. + * @see \`{@link https://api.jquery.com/event.isImmediatePropagationStopped/ }\` + */ + isImmediatePropagationStopped(): boolean; + /** + * Returns whether event.stopPropagation() was ever called on this event object. + * @see \`{@link https://api.jquery.com/event.isPropagationStopped/ }\` + */ + isPropagationStopped(): boolean; + /** + * The namespace specified when the event was triggered. + * @see \`{@link https://api.jquery.com/event.namespace/ }\` + */ + namespace: string; + /** + * The browser's original Event object. + * @see \`{@link https://api.jquery.com/category/events/event-object/ }\` + */ + originalEvent: Event; + /** + * If this method is called, the default action of the event will not be triggered. + * @see \`{@link https://api.jquery.com/event.preventDefault/ }\` + */ + preventDefault(): any; + /** + * The other DOM element involved in the event, if any. + * @see \`{@link https://api.jquery.com/event.relatedTarget/ }\` + */ + relatedTarget: Element; + /** + * The last value returned by an event handler that was triggered by this event, unless the value was undefined. + * @see \`{@link https://api.jquery.com/event.result/ }\` + */ + result: any; + /** + * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. + * @see \`{@link https://api.jquery.com/event.stopImmediatePropagation/ }\` + */ + stopImmediatePropagation(): void; + /** + * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. + * @see \`{@link https://api.jquery.com/event.stopPropagation/ }\` + */ + stopPropagation(): void; + /** + * The DOM element that initiated the event. + * @see \`{@link https://api.jquery.com/event.target/ }\` + */ + target: Element; + /** + * The mouse position relative to the left edge of the document. + * @see \`{@link https://api.jquery.com/event.pageX/ }\` + */ + pageX: number; + /** + * The mouse position relative to the top edge of the document. + * @see \`{@link https://api.jquery.com/event.pageY/ }\` + */ + pageY: number; + /** + * For key or mouse events, this property indicates the specific key or button that was pressed. + * @see \`{@link https://api.jquery.com/event.which/ }\` + */ + which: number; + /** + * Indicates whether the META key was pressed when the event fired. + * @see \`{@link https://api.jquery.com/event.metaKey/ }\` + */ + metaKey: boolean; +} +/** + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\`. + */ +interface JQueryInputEventObject extends BaseJQueryEventObject { + altKey: boolean; + ctrlKey: boolean; + metaKey: boolean; + shiftKey: boolean; +} +/** + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\`. + */ +interface JQueryMouseEventObject extends JQueryInputEventObject { + button: number; + clientX: number; + clientY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; +} +/** + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\`. + */ +interface JQueryKeyEventObject extends JQueryInputEventObject { + char: any; + charCode: number; + key: any; + keyCode: number; +} +/** + * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\`. + */ +interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { } +/** + * @deprecated ​ Deprecated. + */ +interface JQueryPromiseOperator { + // tslint:disable-next-line:callable-types + (callback1: JQuery.TypeOrArray>, + ...callbacksN: Array>>): JQueryPromise; +} +/** + * @deprecated ​ Deprecated. Internal. See \`{@link https://github.com/jquery/api.jquery.com/issues/912 }\`. + */ +interface JQueryEasingFunction { + // tslint:disable-next-line:callable-types + (percent: number): number; +} +/** + * @deprecated ​ Deprecated. Internal. See \`{@link https://github.com/jquery/api.jquery.com/issues/912 }\`. + */ +interface JQueryEasingFunctions { + [name: string]: JQueryEasingFunction; + linear: JQueryEasingFunction; + swing: JQueryEasingFunction; +} diff --git a/types/jquery/misc.d.ts b/types/jquery/misc.d.ts new file mode 100644 index 0000000000..7b09b6a4dc --- /dev/null +++ b/types/jquery/misc.d.ts @@ -0,0 +1,5012 @@ +// tslint:disable:jsdoc-format +// tslint:disable:max-line-length +// tslint:disable:no-irregular-whitespace + +declare namespace JQuery { + type TypeOrArray = T | T[]; + type Node = Element | Text | Comment | DocumentFragment; + + /** + * A string is designated htmlString in jQuery documentation when it is used to represent one or more DOM elements, typically to be created and inserted in the document. When passed as an argument of the jQuery() function, the string is identified as HTML if it starts with ) and is parsed as such until the final > character. Prior to jQuery 1.9, a string was considered to be HTML if it contained anywhere within the string. + */ + type htmlString = string; + /** + * A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most cases, the DOM document present in all browsers, but can also be an XML document received via Ajax. + */ + type Selector = string; + + /** + * The PlainObject type is a JavaScript object containing zero or more key-value pairs. The plain object is, in other words, an Object object. It is designated "plain" in jQuery documentation to distinguish it from other kinds of JavaScript objects: for example, null, user-defined arrays, and host objects such as document, all of which have a typeof value of "object." + * + * **Note**: The type declaration of PlainObject is imprecise. It includes host objects and user-defined arrays which do not match jQuery's definition. + */ + interface PlainObject { + [key: string]: T; + } + + interface Selectors extends Sizzle.Selectors { + /** + * @deprecated ​ Deprecated since 3.0. Use \`{@link Selectors#pseudos }\`. + * + * **Cause**: The standard way to add new custom selectors through jQuery is `jQuery.expr.pseudos`. These two other aliases are deprecated, although they still work as of jQuery 3.0. + * + * **Solution**: Rename any of the older usage to `jQuery.expr.pseudos`. The functionality is identical. + */ + ':': Sizzle.Selectors.PseudoFunctions; + /** + * @deprecated ​ Deprecated since 3.0. Use \`{@link Selectors#pseudos }\`. + * + * **Cause**: The standard way to add new custom selectors through jQuery is `jQuery.expr.pseudos`. These two other aliases are deprecated, although they still work as of jQuery 3.0. + * + * **Solution**: Rename any of the older usage to `jQuery.expr.pseudos`. The functionality is identical. + */ + filter: Sizzle.Selectors.FilterFunctions; + } + + // region Ajax + // #region Ajax + + interface AjaxSettings extends Ajax.AjaxSettingsBase { + /** + * A string containing the URL to which the request is sent. + */ + url?: string; + } + + interface UrlAjaxSettings extends Ajax.AjaxSettingsBase { + /** + * A string containing the URL to which the request is sent. + */ + url: string; + } + + namespace Ajax { + type SuccessTextStatus = 'success' | 'notmodified' | 'nocontent'; + type ErrorTextStatus = 'timeout' | 'error' | 'abort' | 'parsererror'; + type TextStatus = SuccessTextStatus | ErrorTextStatus; + + type SuccessCallback = (this: TContext, data: any, textStatus: SuccessTextStatus, jqXHR: jqXHR) => void; + + type ErrorCallback = (this: TContext, jqXHR: jqXHR, textStatus: ErrorTextStatus, errorThrown: string) => void; + + type CompleteCallback = (this: TContext, jqXHR: jqXHR, textStatus: TextStatus) => void; + + /** + * @see \`{@link https://api.jquery.com/jquery.ajax/#jQuery-ajax-settings }\` + */ + interface AjaxSettingsBase { + /** + * A set of key/value pairs that map a given dataType to its MIME type, which gets sent in the Accept request header. This header tells the server what kind of response it will accept in return. + */ + accepts?: PlainObject; + /** + * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done(). + */ + async?: boolean; + /** + * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. + */ + beforeSend?(this: TContext, jqXHR: jqXHR, settings: this): false | void; + /** + * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. + */ + cache?: boolean; + /** + * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "nocontent", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + complete?: TypeOrArray>; + /** + * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. + */ + contents?: PlainObject; + /** + * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). As of jQuery 1.6 you can pass false to tell jQuery to not set any content type header. Note: The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. Note: For cross-domain requests, setting the content type to anything other than application/x-www-form-urlencoded, multipart/form-data, or text/plain will trigger the browser to send a preflight OPTIONS request to the server. + */ + contentType?: string | false; + /** + * This object will be the context of all Ajax-related callbacks. By default, the context is an object that represents the Ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). + */ + context?: TContext; + /** + * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. + */ + converters?: PlainObject<((value: any) => any) | true>; + /** + * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. + */ + crossDomain?: boolean; + /** + * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). + */ + data?: PlainObject | string; + /** + * A function to be used to handle the raw response data of XMLHttpRequest. This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. + */ + dataFilter?(data: string, type: string): any; + /** + * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). The available types (and the result passed as the first argument to your success callback) are: + * + * "xml": Returns a XML document that can be processed via jQuery. + * + * "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM. + * + * "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, _=[TIMESTAMP], to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests. + * + * "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests are converted to "jsonp" unless the request includes jsonp: false in its request options. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.) + * + * "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true. + * + * "text": A plain text string. + * + * multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml". Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml. + */ + dataType?: 'xml' | 'html' | 'script' | 'json' | 'jsonp' | 'text' | string; + /** + * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. + */ + error?: TypeOrArray>; + /** + * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. + */ + global?: boolean; + /** + * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. + */ + headers?: PlainObject; + /** + * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. + */ + ifModified?: boolean; + /** + * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. + */ + isLocal?: boolean; + /** + * Override the callback function name in a JSONP request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" }. If you don't trust the target of your Ajax requests, consider setting the jsonp property to false for security reasons. + */ + jsonp?: string | false; + /** + * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. + */ + jsonpCallback?: string | ((this: TContext) => string); + /** + * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). + */ + method?: string; + /** + * A mime type to override the XHR mime type. + */ + mimeType?: string; + /** + * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + password?: string; + /** + * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. + */ + processData?: boolean; + /** + * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. + */ + scriptCharset?: string; + /** + * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. + * + * If the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. + */ + statusCode?: StatusCodeCallbacks; + /** + * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter or the dataFilter callback function, if specified; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + success?: TypeOrArray>; + /** + * Set a timeout (in milliseconds) for the request. A value of 0 means there will be no timeout. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. + */ + timeout?: number; + /** + * Set this to true if you wish to use the traditional style of param serialization. + */ + traditional?: boolean; + /** + * An alias for method. You should use type if you're using versions of jQuery prior to 1.9.0. + */ + type?: string; + /** + * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + username?: string; + // ActiveXObject requires "lib": ["scripthost"] which consumers would also require + /** + * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. + */ + xhr?(): XMLHttpRequest; + /** + * An object of fieldName-fieldValue pairs to set on the native XHR object. + * + * In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. + */ + xhrFields?: XHRFields; + } + + // region StatusCodeCallbacks + // #region StatusCodeCallbacks + + type StatusCodeCallbacks = { + // region Success Status Codes + // #region Success Status Codes + + // jQuery treats 2xx and 304 status codes as a success + + 200?: SuccessCallback; + 201?: SuccessCallback; + 202?: SuccessCallback; + 203?: SuccessCallback; + 204?: SuccessCallback; + 205?: SuccessCallback; + 206?: SuccessCallback; + 207?: SuccessCallback; + 208?: SuccessCallback; + 209?: SuccessCallback; + 210?: SuccessCallback; + 211?: SuccessCallback; + 212?: SuccessCallback; + 213?: SuccessCallback; + 214?: SuccessCallback; + 215?: SuccessCallback; + 216?: SuccessCallback; + 217?: SuccessCallback; + 218?: SuccessCallback; + 219?: SuccessCallback; + 220?: SuccessCallback; + 221?: SuccessCallback; + 222?: SuccessCallback; + 223?: SuccessCallback; + 224?: SuccessCallback; + 225?: SuccessCallback; + 226?: SuccessCallback; + 227?: SuccessCallback; + 228?: SuccessCallback; + 229?: SuccessCallback; + 230?: SuccessCallback; + 231?: SuccessCallback; + 232?: SuccessCallback; + 233?: SuccessCallback; + 234?: SuccessCallback; + 235?: SuccessCallback; + 236?: SuccessCallback; + 237?: SuccessCallback; + 238?: SuccessCallback; + 239?: SuccessCallback; + 240?: SuccessCallback; + 241?: SuccessCallback; + 242?: SuccessCallback; + 243?: SuccessCallback; + 244?: SuccessCallback; + 245?: SuccessCallback; + 246?: SuccessCallback; + 247?: SuccessCallback; + 248?: SuccessCallback; + 249?: SuccessCallback; + 250?: SuccessCallback; + 251?: SuccessCallback; + 252?: SuccessCallback; + 253?: SuccessCallback; + 254?: SuccessCallback; + 255?: SuccessCallback; + 256?: SuccessCallback; + 257?: SuccessCallback; + 258?: SuccessCallback; + 259?: SuccessCallback; + 260?: SuccessCallback; + 261?: SuccessCallback; + 262?: SuccessCallback; + 263?: SuccessCallback; + 264?: SuccessCallback; + 265?: SuccessCallback; + 266?: SuccessCallback; + 267?: SuccessCallback; + 268?: SuccessCallback; + 269?: SuccessCallback; + 270?: SuccessCallback; + 271?: SuccessCallback; + 272?: SuccessCallback; + 273?: SuccessCallback; + 274?: SuccessCallback; + 275?: SuccessCallback; + 276?: SuccessCallback; + 277?: SuccessCallback; + 278?: SuccessCallback; + 279?: SuccessCallback; + 280?: SuccessCallback; + 281?: SuccessCallback; + 282?: SuccessCallback; + 283?: SuccessCallback; + 284?: SuccessCallback; + 285?: SuccessCallback; + 286?: SuccessCallback; + 287?: SuccessCallback; + 288?: SuccessCallback; + 289?: SuccessCallback; + 290?: SuccessCallback; + 291?: SuccessCallback; + 292?: SuccessCallback; + 293?: SuccessCallback; + 294?: SuccessCallback; + 295?: SuccessCallback; + 296?: SuccessCallback; + 297?: SuccessCallback; + 298?: SuccessCallback; + 299?: SuccessCallback; + 304?: SuccessCallback; + + // #endregion + + // region Error Status Codes + // #region Error Status Codes + + 300?: ErrorCallback; + 301?: ErrorCallback; + 302?: ErrorCallback; + 303?: ErrorCallback; + 305?: ErrorCallback; + 306?: ErrorCallback; + 307?: ErrorCallback; + 308?: ErrorCallback; + 309?: ErrorCallback; + 310?: ErrorCallback; + 311?: ErrorCallback; + 312?: ErrorCallback; + 313?: ErrorCallback; + 314?: ErrorCallback; + 315?: ErrorCallback; + 316?: ErrorCallback; + 317?: ErrorCallback; + 318?: ErrorCallback; + 319?: ErrorCallback; + 320?: ErrorCallback; + 321?: ErrorCallback; + 322?: ErrorCallback; + 323?: ErrorCallback; + 324?: ErrorCallback; + 325?: ErrorCallback; + 326?: ErrorCallback; + 327?: ErrorCallback; + 328?: ErrorCallback; + 329?: ErrorCallback; + 330?: ErrorCallback; + 331?: ErrorCallback; + 332?: ErrorCallback; + 333?: ErrorCallback; + 334?: ErrorCallback; + 335?: ErrorCallback; + 336?: ErrorCallback; + 337?: ErrorCallback; + 338?: ErrorCallback; + 339?: ErrorCallback; + 340?: ErrorCallback; + 341?: ErrorCallback; + 342?: ErrorCallback; + 343?: ErrorCallback; + 344?: ErrorCallback; + 345?: ErrorCallback; + 346?: ErrorCallback; + 347?: ErrorCallback; + 348?: ErrorCallback; + 349?: ErrorCallback; + 350?: ErrorCallback; + 351?: ErrorCallback; + 352?: ErrorCallback; + 353?: ErrorCallback; + 354?: ErrorCallback; + 355?: ErrorCallback; + 356?: ErrorCallback; + 357?: ErrorCallback; + 358?: ErrorCallback; + 359?: ErrorCallback; + 360?: ErrorCallback; + 361?: ErrorCallback; + 362?: ErrorCallback; + 363?: ErrorCallback; + 364?: ErrorCallback; + 365?: ErrorCallback; + 366?: ErrorCallback; + 367?: ErrorCallback; + 368?: ErrorCallback; + 369?: ErrorCallback; + 370?: ErrorCallback; + 371?: ErrorCallback; + 372?: ErrorCallback; + 373?: ErrorCallback; + 374?: ErrorCallback; + 375?: ErrorCallback; + 376?: ErrorCallback; + 377?: ErrorCallback; + 378?: ErrorCallback; + 379?: ErrorCallback; + 380?: ErrorCallback; + 381?: ErrorCallback; + 382?: ErrorCallback; + 383?: ErrorCallback; + 384?: ErrorCallback; + 385?: ErrorCallback; + 386?: ErrorCallback; + 387?: ErrorCallback; + 388?: ErrorCallback; + 389?: ErrorCallback; + 390?: ErrorCallback; + 391?: ErrorCallback; + 392?: ErrorCallback; + 393?: ErrorCallback; + 394?: ErrorCallback; + 395?: ErrorCallback; + 396?: ErrorCallback; + 397?: ErrorCallback; + 398?: ErrorCallback; + 399?: ErrorCallback; + 400?: ErrorCallback; + 401?: ErrorCallback; + 402?: ErrorCallback; + 403?: ErrorCallback; + 404?: ErrorCallback; + 405?: ErrorCallback; + 406?: ErrorCallback; + 407?: ErrorCallback; + 408?: ErrorCallback; + 409?: ErrorCallback; + 410?: ErrorCallback; + 411?: ErrorCallback; + 412?: ErrorCallback; + 413?: ErrorCallback; + 414?: ErrorCallback; + 415?: ErrorCallback; + 416?: ErrorCallback; + 417?: ErrorCallback; + 418?: ErrorCallback; + 419?: ErrorCallback; + 420?: ErrorCallback; + 421?: ErrorCallback; + 422?: ErrorCallback; + 423?: ErrorCallback; + 424?: ErrorCallback; + 425?: ErrorCallback; + 426?: ErrorCallback; + 427?: ErrorCallback; + 428?: ErrorCallback; + 429?: ErrorCallback; + 430?: ErrorCallback; + 431?: ErrorCallback; + 432?: ErrorCallback; + 433?: ErrorCallback; + 434?: ErrorCallback; + 435?: ErrorCallback; + 436?: ErrorCallback; + 437?: ErrorCallback; + 438?: ErrorCallback; + 439?: ErrorCallback; + 440?: ErrorCallback; + 441?: ErrorCallback; + 442?: ErrorCallback; + 443?: ErrorCallback; + 444?: ErrorCallback; + 445?: ErrorCallback; + 446?: ErrorCallback; + 447?: ErrorCallback; + 448?: ErrorCallback; + 449?: ErrorCallback; + 450?: ErrorCallback; + 451?: ErrorCallback; + 452?: ErrorCallback; + 453?: ErrorCallback; + 454?: ErrorCallback; + 455?: ErrorCallback; + 456?: ErrorCallback; + 457?: ErrorCallback; + 458?: ErrorCallback; + 459?: ErrorCallback; + 460?: ErrorCallback; + 461?: ErrorCallback; + 462?: ErrorCallback; + 463?: ErrorCallback; + 464?: ErrorCallback; + 465?: ErrorCallback; + 466?: ErrorCallback; + 467?: ErrorCallback; + 468?: ErrorCallback; + 469?: ErrorCallback; + 470?: ErrorCallback; + 471?: ErrorCallback; + 472?: ErrorCallback; + 473?: ErrorCallback; + 474?: ErrorCallback; + 475?: ErrorCallback; + 476?: ErrorCallback; + 477?: ErrorCallback; + 478?: ErrorCallback; + 479?: ErrorCallback; + 480?: ErrorCallback; + 481?: ErrorCallback; + 482?: ErrorCallback; + 483?: ErrorCallback; + 484?: ErrorCallback; + 485?: ErrorCallback; + 486?: ErrorCallback; + 487?: ErrorCallback; + 488?: ErrorCallback; + 489?: ErrorCallback; + 490?: ErrorCallback; + 491?: ErrorCallback; + 492?: ErrorCallback; + 493?: ErrorCallback; + 494?: ErrorCallback; + 495?: ErrorCallback; + 496?: ErrorCallback; + 497?: ErrorCallback; + 498?: ErrorCallback; + 499?: ErrorCallback; + 500?: ErrorCallback; + 501?: ErrorCallback; + 502?: ErrorCallback; + 503?: ErrorCallback; + 504?: ErrorCallback; + 505?: ErrorCallback; + 506?: ErrorCallback; + 507?: ErrorCallback; + 508?: ErrorCallback; + 509?: ErrorCallback; + 510?: ErrorCallback; + 511?: ErrorCallback; + 512?: ErrorCallback; + 513?: ErrorCallback; + 514?: ErrorCallback; + 515?: ErrorCallback; + 516?: ErrorCallback; + 517?: ErrorCallback; + 518?: ErrorCallback; + 519?: ErrorCallback; + 520?: ErrorCallback; + 521?: ErrorCallback; + 522?: ErrorCallback; + 523?: ErrorCallback; + 524?: ErrorCallback; + 525?: ErrorCallback; + 526?: ErrorCallback; + 527?: ErrorCallback; + 528?: ErrorCallback; + 529?: ErrorCallback; + 530?: ErrorCallback; + 531?: ErrorCallback; + 532?: ErrorCallback; + 533?: ErrorCallback; + 534?: ErrorCallback; + 535?: ErrorCallback; + 536?: ErrorCallback; + 537?: ErrorCallback; + 538?: ErrorCallback; + 539?: ErrorCallback; + 540?: ErrorCallback; + 541?: ErrorCallback; + 542?: ErrorCallback; + 543?: ErrorCallback; + 544?: ErrorCallback; + 545?: ErrorCallback; + 546?: ErrorCallback; + 547?: ErrorCallback; + 548?: ErrorCallback; + 549?: ErrorCallback; + 550?: ErrorCallback; + 551?: ErrorCallback; + 552?: ErrorCallback; + 553?: ErrorCallback; + 554?: ErrorCallback; + 555?: ErrorCallback; + 556?: ErrorCallback; + 557?: ErrorCallback; + 558?: ErrorCallback; + 559?: ErrorCallback; + 560?: ErrorCallback; + 561?: ErrorCallback; + 562?: ErrorCallback; + 563?: ErrorCallback; + 564?: ErrorCallback; + 565?: ErrorCallback; + 566?: ErrorCallback; + 567?: ErrorCallback; + 568?: ErrorCallback; + 569?: ErrorCallback; + 570?: ErrorCallback; + 571?: ErrorCallback; + 572?: ErrorCallback; + 573?: ErrorCallback; + 574?: ErrorCallback; + 575?: ErrorCallback; + 576?: ErrorCallback; + 577?: ErrorCallback; + 578?: ErrorCallback; + 579?: ErrorCallback; + 580?: ErrorCallback; + 581?: ErrorCallback; + 582?: ErrorCallback; + 583?: ErrorCallback; + 584?: ErrorCallback; + 585?: ErrorCallback; + 586?: ErrorCallback; + 587?: ErrorCallback; + 588?: ErrorCallback; + 589?: ErrorCallback; + 590?: ErrorCallback; + 591?: ErrorCallback; + 592?: ErrorCallback; + 593?: ErrorCallback; + 594?: ErrorCallback; + 595?: ErrorCallback; + 596?: ErrorCallback; + 597?: ErrorCallback; + 598?: ErrorCallback; + 599?: ErrorCallback; + + // #endregion + } & { + // Status codes not listed require type annotations when defining the callback + [index: number]: SuccessCallback | ErrorCallback; + }; + + // #endregion + + // Writable properties on XMLHttpRequest + interface XHRFields extends Partial> { + msCaching?: string; + } + } + + interface Transport { + send(headers: PlainObject, completeCallback: Transport.SuccessCallback): void; + abort(): void; + } + + namespace Transport { + type SuccessCallback = (status: number, statusText: Ajax.TextStatus, responses?: PlainObject, headers?: string) => void; + } + + /** + * @see \`{@link https://api.jquery.com/jquery.ajax/#jqXHR }\` + */ + interface jqXHR extends Promise3, never, + Ajax.SuccessTextStatus, Ajax.ErrorTextStatus, never, + jqXHR, string, never>, + Pick, + Partial> { + responseJSON?: any; + + /** + * Determine the current state of a Deferred object. + * @see \`{@link https://api.jquery.com/deferred.state/ }\` + * @since 1.7 + */ + state(): 'pending' | 'resolved' | 'rejected'; + statusCode(map: Ajax.StatusCodeCallbacks): void; + } + + namespace jqXHR { + interface DoneCallback> extends Deferred.Callback3 { } + + interface FailCallback extends Deferred.Callback3 { } + + interface AlwaysCallback> extends Deferred.Callback3 { } + } + + // #endregion + + // region Callbacks + // #region Callbacks + + interface CallbacksStatic { + /** + * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. + * @param flags An optional list of space-separated flags that change how the callback list behaves. + * @see \`{@link https://api.jquery.com/jQuery.Callbacks/ }\` + * @since 1.7 + */ + // tslint:disable-next-line:ban-types callable-types no-unnecessary-generics + (flags?: string): Callbacks; + } + + // tslint:disable-next-line:ban-types + interface Callbacks { + /** + * Add a callback or a collection of callbacks to a callback list. + * @param callback A function, or array of functions, that are to be added to the callback list. + * @param callbacks A function, or array of functions, that are to be added to the callback list. + * @see \`{@link https://api.jquery.com/callbacks.add/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.add() to add new callbacks to a callback list: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo: " + value ); +}; +​ +// Another function to also be added to the list +var bar = function( value ) { + console.log( "bar: " + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the function "foo" to the list +callbacks.add( foo ); +​ +// Fire the items on the list +callbacks.fire( "hello" ); +// Outputs: "foo: hello" +​ +// Add the function "bar" to the list +callbacks.add( bar ); +​ +// Fire the items on the list again +callbacks.fire( "world" ); +​ +// Outputs: +// "foo: world" +// "bar: world" +``` + */ + add(callback: TypeOrArray, ...callbacks: Array>): this; + /** + * Disable a callback list from doing anything more. + * @see \`{@link https://api.jquery.com/callbacks.disable/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.disable() to disable further calls to a callback list: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the above function to the list +callbacks.add( foo ); +​ +// Fire the items on the list +callbacks.fire( "foo" ); +// Outputs: foo +​ +// Disable further calls being possible +callbacks.disable(); +​ +// Attempt to fire with "foobar" as an argument +callbacks.fire( "foobar" ); +// foobar isn't output +``` + */ + disable(): this; + /** + * Determine if the callbacks list has been disabled. + * @see \`{@link https://api.jquery.com/callbacks.disabled/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.disabled() to determine if the callbacks list has been disabled: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo:" + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the logging function to the callback list +callbacks.add( foo ); +​ +// Fire the items on the list, passing an argument +callbacks.fire( "hello" ); +// Outputs "foo: hello" +​ +// Disable the callbacks list +callbacks.disable(); +​ +// Test the disabled state of the list +console.log ( callbacks.disabled() ); +// Outputs: true +``` + */ + disabled(): boolean; + /** + * Remove all of the callbacks from a list. + * @see \`{@link https://api.jquery.com/callbacks.empty/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.empty() to empty a list of callbacks: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value1, value2 ) { + console.log( "foo: " + value1 + "," + value2 ); +}; +​ +// Another function to also be added to the list +var bar = function( value1, value2 ) { + console.log( "bar: " + value1 + "," + value2 ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the two functions +callbacks.add( foo ); +callbacks.add( bar ); +​ +// Empty the callbacks list +callbacks.empty(); +​ +// Check to ensure all callbacks have been removed +console.log( callbacks.has( foo ) ); +// false +console.log( callbacks.has( bar ) ); +// false +``` + */ + empty(): this; + /** + * Call all of the callbacks with the given arguments. + * @param args The argument or list of arguments to pass back to the callback list. + * @see \`{@link https://api.jquery.com/callbacks.fire/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.fire() to invoke the callbacks in a list with any arguments that have been passed: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo:" + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the function "foo" to the list +callbacks.add( foo ); +​ +// Fire the items on the list +callbacks.fire( "hello" ); // Outputs: "foo: hello" +callbacks.fire( "world" ); // Outputs: "foo: world" +​ +// Add another function to the list +var bar = function( value ){ + console.log( "bar:" + value ); +}; +​ +// Add this function to the list +callbacks.add( bar ); +​ +// Fire the items on the list again +callbacks.fire( "hello again" ); +// Outputs: +// "foo: hello again" +// "bar: hello again" +``` + */ + fire(...args: any[]): this; + /** + * Determine if the callbacks have already been called at least once. + * @see \`{@link https://api.jquery.com/callbacks.fired/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.fired() to determine if the callbacks in a list have been called at least once: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo:" + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the function "foo" to the list +callbacks.add( foo ); +​ +// Fire the items on the list +callbacks.fire( "hello" ); // Outputs: "foo: hello" +callbacks.fire( "world" ); // Outputs: "foo: world" +​ +// Test to establish if the callbacks have been called +console.log( callbacks.fired() ); +``` + */ + fired(): boolean; + /** + * Call all callbacks in a list with the given context and arguments. + * @param context A reference to the context in which the callbacks in the list should be fired. + * @param args An argument, or array of arguments, to pass to the callbacks in the list. + * @see \`{@link https://api.jquery.com/callbacks.fireWith/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.fireWith() to fire a list of callbacks with a specific context and an array of arguments: +```javascript +// A sample logging function to be added to a callbacks list +var log = function( value1, value2 ) { + console.log( "Received: " + value1 + "," + value2 ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the log method to the callbacks list +callbacks.add( log ); +​ +// Fire the callbacks on the list using the context "window" +// and an arguments array +​ +callbacks.fireWith( window, [ "foo","bar" ] ); +// Outputs: "Received: foo, bar" +``` + */ + fireWith(context: object, args?: ArrayLike): this; + /** + * Determine whether or not the list has any callbacks attached. If a callback is provided as an argument, determine whether it is in a list. + * @param callback The callback to search for. + * @see \`{@link https://api.jquery.com/callbacks.has/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.has() to check if a callback list contains a specific callback: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value1, value2 ) { + console.log( "Received: " + value1 + "," + value2 ); +}; +​ +// A second function which will not be added to the list +var bar = function( value1, value2 ) { + console.log( "foobar" ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the log method to the callbacks list +callbacks.add( foo ); +​ +// Determine which callbacks are in the list +console.log( callbacks.has( foo ) ); +// true +console.log( callbacks.has( bar ) ); +// false +``` + */ + has(callback?: T): boolean; + /** + * Lock a callback list in its current state. + * @see \`{@link https://api.jquery.com/callbacks.lock/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.lock() to lock a callback list to avoid further changes being made to the list state: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo:" + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the logging function to the callback list +callbacks.add( foo ); +​ +// Fire the items on the list, passing an argument +callbacks.fire( "hello" ); +// Outputs "foo: hello" +​ +// Lock the callbacks list +callbacks.lock(); +​ +// Try firing the items again +callbacks.fire( "world" ); +​ +// As the list was locked, no items were called, +// so "world" isn't logged +``` + * @example ​ ````Use callbacks.lock() to lock a callback list with "memory," and then resume using the list: +```html + + + + + callbacks.lock demo + + + +​ +
      +​ + +​ + + +``` + */ + lock(): this; + /** + * Determine if the callbacks list has been locked. + * @see \`{@link https://api.jquery.com/callbacks.locked/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.locked() to determine the lock-state of a callback list: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo: " + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the logging function to the callback list +callbacks.add( foo ); +​ +// Fire the items on the list, passing an argument +callbacks.fire( "hello" ); +// Outputs "foo: hello" +​ +// Lock the callbacks list +callbacks.lock(); +​ +// Test the lock-state of the list +console.log ( callbacks.locked() ); +// true +``` + */ + locked(): boolean; + /** + * Remove a callback or a collection of callbacks from a callback list. + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + * @see \`{@link https://api.jquery.com/callbacks.remove/ }\` + * @since 1.7 + * @example ​ ````Use callbacks.remove() to remove callbacks from a callback list: +```javascript +// A sample logging function to be added to a callbacks list +var foo = function( value ) { + console.log( "foo: " + value ); +}; +​ +var callbacks = $.Callbacks(); +​ +// Add the function "foo" to the list +callbacks.add( foo ); +​ +// Fire the items on the list +callbacks.fire( "hello" ); +// Outputs: "foo: hello" +​ +// Remove "foo" from the callback list +callbacks.remove( foo ); +​ +// Fire the items on the list again +callbacks.fire( "world" ); +​ +// Nothing output as "foo" is no longer in the list +``` + */ + remove(...callbacks: T[]): this; + } + + // #endregion + + // region CSS hooks + // #region CSS hooks + + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type CSSHook = + Partial<_CSSHook> & ( + Pick<_CSSHook, 'get'> | + Pick<_CSSHook, 'set'> + ); + + interface _CSSHook { + get(elem: TElement, computed: any, extra: any): any; + set(elem: TElement, value: any): void; + } + + interface CSSHooks { + // Set to HTMLElement to minimize breaks but should probably be Element. + [propertyName: string]: CSSHook; + } + + // #endregion + + // region Deferred + // #region Deferred + + /** + * Any object that has a then method. + */ + interface Thenable extends PromiseLike { } + + // NOTE: This is a private copy of the global Promise interface. It is used by JQuery.PromiseBase to indicate compatibility with other Promise implementations. + // The global Promise interface cannot be used directly as it may be modified, as in the case of @types/bluebird-global. + /** + * Represents the completion of an asynchronous operation + */ + interface _Promise { + readonly [Symbol.toStringTag]: "Promise"; + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onrejected?: ((reason: any) => TResult2 | PromiseLike) | null): _Promise; + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | null): _Promise; + } + + // Type parameter guide + // -------------------- + // Each type parameter represents a parameter in one of the three possible callbacks. + // + // The first letter indicates which position the parameter is in. + // + // T = A = 1st position + // U = B = 2nd position + // V = C = 3rd position + // S = R = rest position + // + // The second letter indicates which whether it is a [R]esolve, Re[J]ect, or [N]otify value. + // + // The third letter indicates whether the value is returned in the [D]one filter, [F]ail filter, or [P]rogress filter. + + /** + * This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, progress, state and promise) to prevent users from changing the state of the Deferred. + * @see \`{@link https://api.jquery.com/Types/#Promise }\` + */ + interface PromiseBase extends _Promise, PromiseLike { + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * @param alwaysCallback A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + * @see \`{@link https://api.jquery.com/deferred.always/ }\` + * @since 1.6 + * @example ​ ````Since the jQuery.get() method returns a jqXHR object, which is derived from a Deferred object, we can attach a callback for both success and error using the deferred.always() method. +```javascript +$.get( "test.php" ).always(function() { + alert( "$.get completed with success or error callback arguments" ); +}); +``` + */ + always(alwaysCallback: TypeOrArray>, + ...alwaysCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object is resolved. + * @param doneCallback A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + * @see \`{@link https://api.jquery.com/deferred.done/ }\` + * @since 1.5 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach a success callback using the .done() method. +```javascript +$.get( "test.php" ).done(function() { + alert( "$.get succeeded" ); +}); +``` + * @example ​ ````Resolve a Deferred object when the user clicks a button, triggering a number of callback functions: +```html + + + + + deferred.done demo + + + +​ + +

      Ready...

      +​ + +​ + + +``` + */ + done(doneCallback: TypeOrArray>, + ...doneCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object is rejected. + * @param failCallback A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + * @see \`{@link https://api.jquery.com/deferred.fail/ }\` + * @since 1.5 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred, you can attach a success and failure callback using the deferred.done() and deferred.fail() methods. +```javascript +$.get( "test.php" ) + .done(function() { + alert( "$.get succeeded" ); + }) + .fail(function() { + alert( "$.get failed!" ); + }); +``` + */ + fail(failCallback: TypeOrArray>, + ...failCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * @param progressCallback A function, or array of functions, to be called when the Deferred generates progress notifications. + * @param progressCallbacks Optional additional functions, or arrays of functions, to be called when the Deferred generates + * progress notifications. + * @see \`{@link https://api.jquery.com/deferred.progress/ }\` + * @since 1.7 + */ + progress(progressCallback: TypeOrArray>, + ...progressCallbacks: Array>>): this; + /** + * Return a Deferred's Promise object. + * @param target Object onto which the promise methods have to be attached + * @see \`{@link https://api.jquery.com/deferred.promise/ }\` + * @since 1.5 + * @example ​ ````Create a Deferred and set two timer-based functions to either resolve or reject the Deferred after a random interval. Whichever one fires first "wins" and will call one of the callbacks. The second timeout has no effect since the Deferred is already complete (in a resolved or rejected state) from the first timeout action. Also set a timer-based progress notification function, and call a progress handler that adds "working..." to the document body. +```javascript +function asyncEvent() { + var dfd = jQuery.Deferred(); +​ + // Resolve after a random interval + setTimeout(function() { + dfd.resolve( "hurray" ); + }, Math.floor( 400 + Math.random() * 2000 ) ); +​ + // Reject after a random interval + setTimeout(function() { + dfd.reject( "sorry" ); + }, Math.floor( 400 + Math.random() * 2000 ) ); +​ + // Show a "working..." message every half-second + setTimeout(function working() { + if ( dfd.state() === "pending" ) { + dfd.notify( "working... " ); + setTimeout( working, 500 ); + } + }, 1 ); +​ + // Return the Promise so caller can't change the Deferred + return dfd.promise(); +} +​ +// Attach a done, fail, and progress handler for the asyncEvent +$.when( asyncEvent() ).then( + function( status ) { + alert( status + ", things are going well" ); + }, + function( status ) { + alert( status + ", you fail this time" ); + }, + function( status ) { + $( "body" ).append( status ); + } +); +``` + */ + promise(target: TTarget): this & TTarget; + /** + * Return a Deferred's Promise object. + * @see \`{@link https://api.jquery.com/deferred.promise/ }\` + * @since 1.5 + * @example ​ ````Use the target argument to promote an existing object to a Promise: +```javascript +// Existing object +var obj = { + hello: function( name ) { + alert( "Hello " + name ); + } + }, + // Create a Deferred + defer = $.Deferred(); +​ +// Set object as a promise +defer.promise( obj ); +​ +// Resolve the deferred +defer.resolve( "John" ); +​ +// Use the object as a Promise +obj.done(function( name ) { + obj.hello( name ); // Will alert "Hello John" +}).hello( "Karl" ); // Will alert "Hello Karl" +``` + */ + promise(): this; + /** + * Determine the current state of a Deferred object. + * @see \`{@link https://api.jquery.com/deferred.state/ }\` + * @since 1.7 + */ + state(): 'pending' | 'resolved' | 'rejected'; + + // region pipe + // #region pipe + + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, + progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: null, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, + progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter: null, + progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: null, + failFilter: null, + progressFilter?: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, + progressFilter?: null): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: null, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | AJF, + progressFilter?: null): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter?: null, + progressFilter?: null): PromiseBase; + + // #endregion + + // region then + // #region then + + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. +```javascript +$.get( "test.php" ).then( + function() { + alert( "$.get succeeded" ); + }, function() { + alert( "$.get failed!" ); + } +); +``` + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, + progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: null, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, + progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter: null, + progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: null, + failFilter: null, + progressFilter?: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. +```javascript +$.get( "test.php" ).then( + function() { + alert( "$.get succeeded" ); + }, function() { + alert( "$.get failed!" ); + } +); +``` + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, + progressFilter?: null): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: null, + failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF, + progressFilter?: null): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase | Thenable | ARD, + failFilter?: null, + progressFilter?: null): PromiseBase; + + // #endregion + + /** + * Add handlers to be called when the Deferred object is rejected. + * @param failFilter A function that is called when the Deferred is rejected. + * @see \`{@link https://api.jquery.com/deferred.catch/ }\` + * @since 3.0 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can rejection handlers using the .catch method. +```javascript +$.get( "test.php" ) + .then( function() { + alert( "$.get succeeded" ); + } ) + .catch( function() { + alert( "$.get failed!" ); + } ); +``` + */ + catch( + failFilter?: ((t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase | Thenable | ARF) | null): PromiseBase; + } + + /** + * This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, progress, state and promise) to prevent users from changing the state of the Deferred. + * @see \`{@link https://api.jquery.com/Types/#Promise }\` + */ + interface Promise3 extends PromiseBase { } + + /** + * This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, progress, state and promise) to prevent users from changing the state of the Deferred. + * @see \`{@link https://api.jquery.com/Types/#Promise }\` + */ + interface Promise2 extends PromiseBase { } + + /** + * This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, progress, state and promise) to prevent users from changing the state of the Deferred. + * @see \`{@link https://api.jquery.com/Types/#Promise }\` + */ + interface Promise extends PromiseBase { } + + interface DeferredStatic { + // https://jquery.com/upgrade-guide/3.0/#callback-exit + exceptionHook: any; + /** + * A factory function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. + * @param beforeStart A function that is called just before the constructor returns. + * @see \`{@link https://api.jquery.com/jQuery.Deferred/ }\` + * @since 1.5 + */ + (beforeStart?: (this: Deferred, deferred: Deferred) => void): Deferred; + } + + interface Deferred { + /** + * Call the progressCallbacks on a Deferred object with the given args. + * @param args Optional arguments that are passed to the progressCallbacks. + * @see \`{@link https://api.jquery.com/deferred.notify/ }\` + * @since 1.7 + */ + notify(...args: TN[]): this; + /** + * Call the progressCallbacks on a Deferred object with the given context and args. + * @param context Context passed to the progressCallbacks as the this object. + * @param args An optional array of arguments that are passed to the progressCallbacks. + * @see \`{@link https://api.jquery.com/deferred.notifyWith/ }\` + * @since 1.7 + */ + notifyWith(context: object, args?: ArrayLike): this; + /** + * Reject a Deferred object and call any failCallbacks with the given args. + * @param args Optional arguments that are passed to the failCallbacks. + * @see \`{@link https://api.jquery.com/deferred.reject/ }\` + * @since 1.5 + */ + reject(...args: TJ[]): this; + /** + * Reject a Deferred object and call any failCallbacks with the given context and args. + * @param context Context passed to the failCallbacks as the this object. + * @param args An optional array of arguments that are passed to the failCallbacks. + * @see \`{@link https://api.jquery.com/deferred.rejectWith/ }\` + * @since 1.5 + */ + rejectWith(context: object, args?: ArrayLike): this; + /** + * Resolve a Deferred object and call any doneCallbacks with the given args. + * @param args Optional arguments that are passed to the doneCallbacks. + * @see \`{@link https://api.jquery.com/deferred.resolve/ }\` + * @since 1.5 + */ + resolve(...args: TR[]): this; + /** + * Resolve a Deferred object and call any doneCallbacks with the given context and args. + * @param context Context passed to the doneCallbacks as the this object. + * @param args An optional array of arguments that are passed to the doneCallbacks. + * @see \`{@link https://api.jquery.com/deferred.resolveWith/ }\` + * @since 1.5 + */ + resolveWith(context: object, args?: ArrayLike): this; + + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * @param alwaysCallback A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + * @see \`{@link https://api.jquery.com/deferred.always/ }\` + * @since 1.6 + * @example ​ ````Since the jQuery.get() method returns a jqXHR object, which is derived from a Deferred object, we can attach a callback for both success and error using the deferred.always() method. +```javascript +$.get( "test.php" ).always(function() { + alert( "$.get completed with success or error callback arguments" ); +}); +``` + */ + always(alwaysCallback: TypeOrArray>, + ...alwaysCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object is resolved. + * @param doneCallback A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + * @see \`{@link https://api.jquery.com/deferred.done/ }\` + * @since 1.5 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach a success callback using the .done() method. +```javascript +$.get( "test.php" ).done(function() { + alert( "$.get succeeded" ); +}); +``` + * @example ​ ````Resolve a Deferred object when the user clicks a button, triggering a number of callback functions: +```html + + + + + deferred.done demo + + + +​ + +

      Ready...

      +​ + +​ + + +``` + */ + done(doneCallback: TypeOrArray>, + ...doneCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object is rejected. + * @param failCallback A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + * @see \`{@link https://api.jquery.com/deferred.fail/ }\` + * @since 1.5 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred, you can attach a success and failure callback using the deferred.done() and deferred.fail() methods. +```javascript +$.get( "test.php" ) + .done(function() { + alert( "$.get succeeded" ); + }) + .fail(function() { + alert( "$.get failed!" ); + }); +``` + */ + fail(failCallback: TypeOrArray>, + ...failCallbacks: Array>>): this; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * @param progressCallback A function, or array of functions, to be called when the Deferred generates progress notifications. + * @param progressCallbacks Optional additional functions, or arrays of functions, to be called when the Deferred generates + * progress notifications. + * @see \`{@link https://api.jquery.com/deferred.progress/ }\` + * @since 1.7 + */ + progress(progressCallback: TypeOrArray>, + ...progressCallbacks: Array>>): this; + /** + * Return a Deferred's Promise object. + * @param target Object onto which the promise methods have to be attached + * @see \`{@link https://api.jquery.com/deferred.promise/ }\` + * @since 1.5 + * @example ​ ````Use the target argument to promote an existing object to a Promise: +```javascript +// Existing object +var obj = { + hello: function( name ) { + alert( "Hello " + name ); + } + }, + // Create a Deferred + defer = $.Deferred(); +​ +// Set object as a promise +defer.promise( obj ); +​ +// Resolve the deferred +defer.resolve( "John" ); +​ +// Use the object as a Promise +obj.done(function( name ) { + obj.hello( name ); // Will alert "Hello John" +}).hello( "Karl" ); // Will alert "Hello Karl" +``` + */ + promise(target: TTarget): Promise & TTarget; + /** + * Return a Deferred's Promise object. + * @see \`{@link https://api.jquery.com/deferred.promise/ }\` + * @since 1.5 + * @example ​ ````Create a Deferred and set two timer-based functions to either resolve or reject the Deferred after a random interval. Whichever one fires first "wins" and will call one of the callbacks. The second timeout has no effect since the Deferred is already complete (in a resolved or rejected state) from the first timeout action. Also set a timer-based progress notification function, and call a progress handler that adds "working..." to the document body. +```javascript +function asyncEvent() { + var dfd = jQuery.Deferred(); +​ + // Resolve after a random interval + setTimeout(function() { + dfd.resolve( "hurray" ); + }, Math.floor( 400 + Math.random() * 2000 ) ); +​ + // Reject after a random interval + setTimeout(function() { + dfd.reject( "sorry" ); + }, Math.floor( 400 + Math.random() * 2000 ) ); +​ + // Show a "working..." message every half-second + setTimeout(function working() { + if ( dfd.state() === "pending" ) { + dfd.notify( "working... " ); + setTimeout( working, 500 ); + } + }, 1 ); +​ + // Return the Promise so caller can't change the Deferred + return dfd.promise(); +} +​ +// Attach a done, fail, and progress handler for the asyncEvent +$.when( asyncEvent() ).then( + function( status ) { + alert( status + ", things are going well" ); + }, + function( status ) { + alert( status + ", you fail this time" ); + }, + function( status ) { + $( "body" ).append( status ); + } +); +``` + */ + promise(): Promise; + /** + * Determine the current state of a Deferred object. + * @see \`{@link https://api.jquery.com/deferred.state/ }\` + * @since 1.7 + */ + state(): 'pending' | 'resolved' | 'rejected'; + + // region pipe + // #region pipe + + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, + progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: null, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, + progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter: null, + progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: null, + failFilter: null, + progressFilter?: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, + progressFilter?: null): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: null, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | AJF, + progressFilter?: null): PromiseBase; + /** + * Utility method to filter and/or chain Deferreds. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.pipe/ }\` + * @since 1.6 + * @since 1.7 + * @deprecated ​ Deprecated since 1.8. Use \`{@link then }\`. + * + * **Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function. + * + * **Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0. + * @example ​ ````Filter resolve value: +```javascript +var defer = $.Deferred(), + filtered = defer.pipe(function( value ) { + return value * 2; + }); +​ +defer.resolve( 5 ); +filtered.done(function( value ) { + alert( "Value is ( 2*5 = ) 10: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.pipe(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + pipe( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter?: null, + progressFilter?: null): PromiseBase; + + // #endregion + + // region then + // #region then + + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. +```javascript +$.get( "test.php" ).then( + function() { + alert( "$.get succeeded" ); + }, function() { + alert( "$.get failed!" ); + } +); +``` + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, + progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: null, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, + progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter: null, + progressFilter: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: null, + failFilter: null, + progressFilter?: (...t: TN[]) => PromiseBase | Thenable | ANP): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. +```javascript +$.get( "test.php" ).then( + function() { + alert( "$.get succeeded" ); + }, function() { + alert( "$.get failed!" ); + } +); +``` + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, + progressFilter?: null): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter reject value: +```javascript +var defer = $.Deferred(), + filtered = defer.then( null, function( value ) { + return value * 3; + }); +​ +defer.reject( 6 ); +filtered.fail(function( value ) { + alert( "Value is ( 3*6 = ) 18: " + value ); +}); +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: null, + failFilter: (...t: TJ[]) => PromiseBase | Thenable | ARF, + progressFilter?: null): PromiseBase; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * @param doneFilter An optional function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. + * @see \`{@link https://api.jquery.com/deferred.then/ }\` + * @since 1.8 + * @example ​ ````Filter the resolve value: +```html + + + + + deferred.then demo + + + +​ + +

      +​ + +​ + + +``` + * @example ​ ````Chain tasks: +```javascript +var request = $.ajax( url, { dataType: "json" } ), + chained = request.then(function( data ) { + return $.ajax( url2, { data: { user: data.userId } } ); + }); +​ +chained.done(function( data ) { + // data retrieved from url2 as provided by the first request +}); +``` + */ + then( + doneFilter: (...t: TR[]) => PromiseBase | Thenable | ARD, + failFilter?: null, + progressFilter?: null): PromiseBase; + + // #endregion + + /** + * Add handlers to be called when the Deferred object is rejected. + * @param failFilter A function that is called when the Deferred is rejected. + * @see \`{@link https://api.jquery.com/deferred.catch/ }\` + * @since 3.0 + * @example ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can rejection handlers using the .catch method. +```javascript +$.get( "test.php" ) + .then( function() { + alert( "$.get succeeded" ); + } ) + .catch( function() { + alert( "$.get failed!" ); + } ); +``` + */ + catch( + failFilter?: ((...t: TJ[]) => PromiseBase | Thenable | ARF) | null): PromiseBase; + } + + namespace Deferred { + type CallbackBase = (t: T, u: U, v: V, ...r: R[]) => void; + + interface Callback3 extends CallbackBase { } + + type Callback = (...args: T[]) => void; + + /** + * @deprecated ​ Deprecated. Use \`{@link Callback }\`. + */ + interface DoneCallback extends Callback { } + + /** + * @deprecated ​ Deprecated. Use \`{@link Callback }\`. + */ + interface FailCallback extends Callback { } + + /** + * @deprecated ​ Deprecated. Use \`{@link Callback }\`. + */ + interface AlwaysCallback extends Callback { } + + /** + * @deprecated ​ Deprecated. Use \`{@link Callback }\`. + */ + interface ProgressCallback extends Callback { } + } + + // #endregion + + // region Effects + // #region Effects + + type Duration = number | 'fast' | 'slow'; + + /** + * @see \`{@link https://api.jquery.com/animate/#animate-properties-options }\` + */ + interface EffectsOptions extends PlainObject { + /** + * A function to be called when the animation on an element completes or stops without completing (its Promise object is either resolved or rejected). + */ + always?(this: TElement, animation: Animation, jumpedToEnd: boolean): void; + /** + * A function that is called once the animation on an element is complete. + */ + complete?(this: TElement): void; + /** + * A function to be called when the animation on an element completes (its Promise object is resolved). + */ + done?(this: TElement, animation: Animation, jumpedToEnd: boolean): void; + /** + * A string or number determining how long the animation will run. + */ + duration?: Duration; + /** + * A string indicating which easing function to use for the transition. + */ + easing?: string; + /** + * A function to be called when the animation on an element fails to complete (its Promise object is rejected). + */ + fail?(this: TElement, animation: Animation, jumpedToEnd: boolean): void; + /** + * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. + */ + progress?(this: TElement, animation: Animation, progress: number, remainingMs: number): void; + /** + * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. + */ + queue?: boolean | string; + /** + * An object containing one or more of the CSS properties defined by the properties argument and their corresponding easing functions. + */ + specialEasing?: PlainObject; + /** + * A function to call when the animation on an element begins. + */ + start?(this: TElement, animation: Animation): void; + /** + * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. + */ + step?(this: TElement, now: number, tween: Tween): void; + } + + // region Animation + // #region Animation + + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + interface AnimationStatic { + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + (element: TElement, props: PlainObject, opts: EffectsOptions): Animation; + /** + * During the initial setup, `jQuery.Animation` will call any callbacks that have been registered through `jQuery.Animation.prefilter( function( element, props, opts ) )`. + * @param callback The prefilter will have `this` set to an animation object, and you can modify any of the `props` or + * `opts` however you need. The prefilter _may_ return its own promise which also implements `stop()`, + * in which case, processing of prefilters stops. If the prefilter is not trying to override the animation + * entirely, it should return `undefined` or some other falsy value. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#prefilters }\` + * @since 1.8 + */ + prefilter( + callback: (this: Animation, element: TElement, props: PlainObject, opts: EffectsOptions) => Animation | _Falsy | void, + prepend?: boolean + ): void; + /** + * A "Tweener" is a function responsible for creating a tween object, and you might want to override these if you want to implement complex values ( like a clip/transform array matrix ) in a single property. + * + * You can override the default process for creating a tween in order to provide your own tween object by using `jQuery.Animation.tweener( props, callback( prop, value ) )`. + * @param props A space separated list of properties to be passed to your tweener, or `"*"` if it should be called + * for all properties. + * @param callback The callback will be called with `this` being an `Animation` object. The tweener function will + * generally start with `var tween = this.createTween( prop, value );`, but doesn't nessecarily need to + * use the `jQuery.Tween()` factory. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweeners }\` + * @since 1.8 + */ + tweener(props: string, callback: Tweener): void; + } + + /** + * The promise will be resolved when the animation reaches its end, and rejected when terminated early. The context of callbacks attached to the promise will be the element, and the arguments will be the `Animation` object and a boolean `jumpedToEnd` which when true means the animation was stopped with `gotoEnd`, when `undefined` the animation completed naturally. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + interface Animation extends Promise3< + Animation, Animation, Animation, + true | undefined, false, number, + never, never, number + > { + /** + * The duration specified in ms + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + duration: number; + /** + * The element being animatied + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + elem: TElement; + /** + * The final value of each property animating + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + props: PlainObject; + /** + * The animation options + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + opts: EffectsOptions; + /** + * The original properties before being filtered + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + originalProps: PlainObject; + /** + * The original options before being filtered + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + originalOpts: EffectsOptions; + /** + * The numeric value of `new Date()` when the animation began + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + startTime: number; + /** + * The animations tweens. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + tweens: Array>; + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + createTween(propName: string, finalValue: number): Tween; + /** + * Stops the animation early, optionally going to the end. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#animation-factory }\` + * @since 1.8 + */ + stop(gotoEnd: boolean): this; + } + + /** + * A "Tweener" is a function responsible for creating a tween object, and you might want to override these if you want to implement complex values ( like a clip/transform array matrix ) in a single property. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweeners }\` + * @since 1.8 + */ + type Tweener = (this: Animation, propName: string, finalValue: number) => Tween; + + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + interface TweenStatic { + /** + * `jQuery.Tween.propHooks[ prop ]` is a hook point that replaces `jQuery.fx.step[ prop ]` (which is being deprecated.) These hooks are used by the tween to get and set values on elements. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tween-hooks }\` + * @since 1.8 + * @example +```javascript +jQuery.Tween.propHooks[ property ] = { + get: function( tween ) { + // get tween.prop from tween.elem and return it + }, + set: function( tween ) { + // set tween.prop on tween.elem to tween.now + tween.unit + } +} +``` + */ + propHooks: PropHooks; + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + (elem: TElement, options: EffectsOptions, prop: string, end: number, easing?: string, unit?: string): Tween; + } + + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + // This should be a class but doesn't work correctly under the JQuery namespace. Tween should be an inner class of jQuery. + interface Tween { + /** + * The easing used + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + easing: string; + /** + * The element being animated + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + elem: TElement; + /** + * The ending value of the tween + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + end: number; + /** + * The current value of the tween + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + now: number; + /** + * A reference to the animation options + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + options: EffectsOptions; + // Undocumented. Is this intended to be public? + pos?: number; + /** + * The property being animated + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + prop: string; + /** + * The starting value of the tween + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + start: number; + /** + * The CSS unit for the tween + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + unit: string; + /** + * Reads the current value for property from the element + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + cur(): any; + /** + * Updates the value for the property on the animated elemd. + * @param progress A number from 0 to 1. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tweens }\` + * @since 1.8 + */ + run(progress: number): this; + } + + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tween-hooks }\` + * @since 1.8 + */ + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type PropHook = { + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tween-hooks }\` + * @since 1.8 + */ + get(tween: Tween): any; + } | { + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tween-hooks }\` + * @since 1.8 + */ + set(tween: Tween): void; + } | { + [key: string]: never; + }; + + /** + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#tween-hooks }\` + * @since 1.8 + */ + interface PropHooks { + [property: string]: PropHook; + } + + // #endregion + + // region Easing + // #region Easing + + type EasingMethod = (percent: number) => number; + + interface Easings { + [name: string]: EasingMethod; + } + + // #endregion + + // region Effects (fx) + // #region Effects (fx) + + interface Effects { + /** + * The rate (in milliseconds) at which animations fire. + * @see \`{@link https://api.jquery.com/jQuery.fx.interval/ }\` + * @since 1.4.3 + * @deprecated ​ Deprecated since 3.0. See \`{@link https://api.jquery.com/jQuery.fx.interval/ }\`. + * + * **Cause**: As of jQuery 3.0 the `jQuery.fx.interval` property can be used to change the animation interval only on browsers that do not support the `window.requestAnimationFrame()` method. That is currently only Internet Explorer 9 and the Android Browser. Once support is dropped for these browsers, the property will serve no purpose and it will be removed. + * + * **Solution**: Find and remove code that changes or uses `jQuery.fx.interval`. If the value is being used by code in your page or a plugin, the code may be making assumptions that are no longer valid. The default value of `jQuery.fx.interval` is `13` (milliseconds), which could be used instead of accessing this property. + * @example ​ ````Cause all animations to run with less frames. +```html + + + + + jQuery.fx.interval demo + + + + +​ +

      +
      +​ + + + +``` + */ + interval: number; + /** + * Globally disable all animations. + * @see \`{@link https://api.jquery.com/jQuery.fx.off/ }\` + * @since 1.3 + * @example ​ ````Toggle animation on and off +```html + + + + + jQuery.fx.off demo + + + + +​ + + +
      +​ + + + +``` + */ + off: boolean; + /** + * @deprecated ​ Deprecated since 1.8. Use \`{@link Tween.propHooks jQuery.Tween.propHooks}\`. + * + * `jQuery.fx.step` functions are being replaced by `jQuery.Tween.propHooks` and may eventually be removed, but are still supported via the default tween propHook. + */ + step: PlainObject>; + /** + * _overridable_ Clears up the `setInterval` + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#plugging-in-a-different-timer-loop }\` + * @since 1.8 + */ + stop(): void; + /** + * Calls `.run()` on each object in the `jQuery.timers` array, removing it from the array if `.run()` returns a falsy value. Calls `jQuery.fx.stop()` whenever there are no timers remaining. + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#plugging-in-a-different-timer-loop }\` + * @since 1.8 + */ + tick(): void; + /** + * _overridable_ Creates a `setInterval` if one doesn't already exist, and pushes `tickFunction` to the `jQuery.timers` array. `tickFunction` should also have `anim`, `elem`, and `queue` properties that reference the animation object, animated element, and queue option to facilitate `jQuery.fn.stop()` + * + * By overriding `fx.timer` and `fx.stop` you should be able to implement any animation tick behaviour you desire. (like using `requestAnimationFrame` instead of `setTimeout`.) + * + * There is an example of overriding the timer loop in \`{@link https://github.com/gnarf37/jquery-requestAnimationFrame jquery.requestAnimationFrame}\` + * @see \`{@link https://gist.github.com/gnarf/54829d408993526fe475#plugging-in-a-different-timer-loop }\` + * @since 1.8 + */ + timer(tickFunction: TickFunction): void; + } + + /** + * @deprecated ​ Deprecated since 1.8. Use \`{@link Tween.propHooks jQuery.Tween.propHooks}\`. + * + * `jQuery.fx.step` functions are being replaced by `jQuery.Tween.propHooks` and may eventually be removed, but are still supported via the default tween propHook. + */ + type AnimationHook = (fx: Tween) => void; + + interface TickFunction { + anim: Animation; + elem: TElement; + queue: boolean | string; + (): any; + } + + // #endregion + + // region Queue + // #region Queue + + // TODO: Is the first element always a string or is that specific to the 'fx' queue? + type Queue = { 0: string; } & Array>; + + type QueueFunction = (this: TElement, next: () => void) => void; + + // #endregion + + // region Speed + // #region Speed + + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type SpeedSettings = { + /** + * A string or number determining how long the animation will run. + */ + duration: Duration; + } | { + /** + * A string indicating which easing function to use for the transition. + */ + easing: string; + } | { + /** + * A function to call once the animation is complete. + */ + complete(this: TElement): void; + } | { + [key: string]: never; + }; + + // #endregion + + // #endregion + + // region Events + // #region Events + + // region Event + // #region Event + + // This should be a class but doesn't work correctly under the JQuery namespace. Event should be an inner class of jQuery. + + // Static members + interface EventStatic { + // tslint:disable-next-line:no-unnecessary-generics + (event: string, properties?: T): Event & T; + // tslint:disable-next-line:no-unnecessary-generics + (properties: T): Event & T; + // tslint:disable-next-line:no-unnecessary-generics + new (event: string, properties?: T): Event & T; + // tslint:disable-next-line:no-unnecessary-generics + new (properties: T): Event & T; + } + + // Instance members + interface Event { + // region Copied properties + // #region Copied properties + + // region Event + // #region Event + + bubbles?: boolean; + cancelable?: boolean; + eventPhase?: number; + + // #endregion + + // region UIEvent + // #region UIEvent + + detail?: number; + view?: Window; + + // #endregion + + // region MouseEvent + // #region MouseEvent + + button?: number; + buttons?: number; + clientX?: number; + clientY?: number; + offsetX?: number; + offsetY?: number; + /** + * The mouse position relative to the left edge of the document. + * @see \`{@link https://api.jquery.com/event.pageX/ }\` + * @since 1.0.4 + * @example ​ ````Show the mouse position relative to the left and top edges of the document (within this iframe). +```html + + + + + event.pageX demo + + + + +​ +
      +​ + +​ + + +``` + */ + pageX: number; + /** + * The mouse position relative to the top edge of the document. + * @see \`{@link https://api.jquery.com/event.pageY/ }\` + * @since 1.0.4 + * @example ​ ````Show the mouse position relative to the left and top edges of the document (within this iframe). +```html + + + + + event.pageY demo + + + + +​ +
      +​ + +​ + + +``` + */ + pageY: number; + screenX?: number; + screenY?: number; + /** @deprecated */ + toElement?: Element; + + // #endregion + + // region PointerEvent + // #region PointerEvent + + pointerId?: number; + pointerType?: string; + + // #endregion + + // region KeyboardEvent + // #region KeyboardEvent + + /** @deprecated */ + char?: string; + /** @deprecated */ + charCode?: number; + key?: string; + /** @deprecated */ + keyCode?: number; + + // #endregion + + // region TouchEvent + // #region TouchEvent + + changedTouches?: TouchList; + targetTouches?: TouchList; + touches?: TouchList; + + // #endregion + + // region MouseEvent, KeyboardEvent, TouchEvent + // #region MouseEvent, KeyboardEvent, TouchEvent + + altKey?: boolean; + ctrlKey?: boolean; + /** + * Indicates whether the META key was pressed when the event fired. + * @see \`{@link https://api.jquery.com/event.metaKey/ }\` + * @since 1.0.4 + * @example ​ ````Determine whether the META key was pressed when the event fired. +```html + + + + + event.metaKey demo + + + + +​ + +
      +​ + +​ + + +``` + */ + metaKey: boolean; + shiftKey?: boolean; + + // #endregion + + // #endregion + + /** + * The namespace specified when the event was triggered. + * @see \`{@link https://api.jquery.com/event.namespace/ }\` + * @since 1.4.3 + * @example ​ ````Determine the event namespace used. +```html + + + + + event.namespace demo + + + +​ + +

      +​ + +​ + + +``` + */ + namespace: string; + /** + * The last value returned by an event handler that was triggered by this event, unless the value was undefined. + * @see \`{@link https://api.jquery.com/event.result/ }\` + * @since 1.3 + * @example ​ ````Display previous handler's return value +```html + + + + + event.result demo + + + +​ + +

      +​ + +​ + + +``` + */ + result: any; + /** + * The difference in milliseconds between the time the browser created the event and January 1, 1970. + * @see \`{@link https://api.jquery.com/event.timeStamp/ }\` + * @since 1.2.6 + * @example ​ ````Display the time since the click handler last executed. +```html + + + + + event.timeStamp demo + + + + +​ +
      Click.
      +​ + +​ + + +``` + */ + timeStamp: number; + /** + * Describes the nature of the event. + * @see \`{@link https://api.jquery.com/event.type/ }\` + * @since 1.0 + * @example ​ ````On all anchor clicks, alert the event type. +```javascript +$( "a" ).click(function( event ) { + alert( event.type ); // "click" +}); +``` + */ + type: string; + /** + * For key or mouse events, this property indicates the specific key or button that was pressed. + * @see \`{@link https://api.jquery.com/event.which/ }\` + * @since 1.1.3 + * @example ​ ````Log which key was depressed. +```html + + + + + event.which demo + + + +​ + +
      +​ + +​ + + +``` + * @example ​ ````Log which mouse button was depressed. +```html + + + + + event.which demo + + + +​ + +
      +​ + +​ + + +``` + */ + which: number; + /** + * Returns whether event.preventDefault() was ever called on this event object. + * @see \`{@link https://api.jquery.com/event.isDefaultPrevented/ }\` + * @since 1.3 + * @example ​ ````Checks whether event.preventDefault() was called. +```javascript +$( "a" ).click(function( event ) { + alert( event.isDefaultPrevented() ); // false + event.preventDefault(); + alert( event.isDefaultPrevented() ); // true +}); +``` + */ + isDefaultPrevented(): boolean; + /** + * Returns whether event.stopImmediatePropagation() was ever called on this event object. + * @see \`{@link https://api.jquery.com/event.isImmediatePropagationStopped/ }\` + * @since 1.3 + * @example ​ ````Checks whether event.stopImmediatePropagation() was called. +```html + + + + + event.isImmediatePropagationStopped demo + + + +​ + +
      + ​ + +​ + + +``` + */ + isImmediatePropagationStopped(): boolean; + /** + * Returns whether event.stopPropagation() was ever called on this event object. + * @see \`{@link https://api.jquery.com/event.isPropagationStopped/ }\` + * @since 1.3 + * @example ​ ````Checks whether event.stopPropagation() was called +```html + + + + + event.isPropagationStopped demo + + + +​ + +
      + ​ + +​ + + +``` + */ + isPropagationStopped(): boolean; + /** + * If this method is called, the default action of the event will not be triggered. + * @see \`{@link https://api.jquery.com/event.preventDefault/ }\` + * @since 1.0 + * @example ​ ````Cancel the default action (navigation) of the click. +```html + + + + + event.preventDefault demo + + + +​ +default click action is prevented +
      +​ + +​ + + +``` + */ + preventDefault(): void; + /** + * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. + * @see \`{@link https://api.jquery.com/event.stopImmediatePropagation/ }\` + * @since 1.3 + * @example ​ ````Prevents other event handlers from being called. +```html + + + + + event.stopImmediatePropagation demo + + + + +​ +

      paragraph

      +
      division
      +​ + +​ + + +``` + */ + stopImmediatePropagation(): void; + /** + * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. + * @see \`{@link https://api.jquery.com/event.stopPropagation/ }\` + * @since 1.0 + * @example ​ ````Kill the bubbling on the click event. +```javascript +$( "p" ).click(function( event ) { + event.stopPropagation(); + // Do something +}); +``` + */ + stopPropagation(): void; + } + + // Generic members + interface Event< + TTarget = EventTarget, + TData = null + > { + /** + * The current DOM element within the event bubbling phase. + * @see \`{@link https://api.jquery.com/event.currentTarget/ }\` + * @since 1.3 + * @example ​ ````Alert that currentTarget matches the `this` keyword. +```javascript +$( "p" ).click(function( event ) { + alert( event.currentTarget === this ); // true +}); +``` + */ + currentTarget: TTarget; + /** + * An optional object of data passed to an event method when the current executing handler is bound. + * @see \`{@link https://api.jquery.com/event.data/ }\` + * @since 1.1 + * @example ​ ````Within a for loop, pass the value of i to the .on() method so that the current iteration's value is preserved. +```html + + + + + event.data demo + + + +​ + + + + + +​ +
      +​ + +​ + + +``` + */ + data: TData; + /** + * The element where the currently-called jQuery event handler was attached. + * @see \`{@link https://api.jquery.com/event.delegateTarget/ }\` + * @since 1.7 + * @example ​ ````When a button in any box class is clicked, change the box's background color to red. +```javascript +$( ".box" ).on( "click", "button", function( event ) { + $( event.delegateTarget ).css( "background-color", "red" ); +}); +``` + */ + delegateTarget: TTarget; + originalEvent: _Event; + /** + * The other DOM element involved in the event, if any. + * @see \`{@link https://api.jquery.com/event.relatedTarget/ }\` + * @since 1.1.4 + * @example ​ ````On mouseout of anchors, alert the element type being entered. +```javascript +$( "a" ).mouseout(function( event ) { + alert( event.relatedTarget.nodeName ); // "DIV" +}); +``` + */ + relatedTarget: TTarget | null; + /** + * The DOM element that initiated the event. + * @see \`{@link https://api.jquery.com/event.target/ }\` + * @since 1.0 + * @example ​ ````Display the tag's name on click +```html + + + + + event.target demo + + + + +​ +
      +
      +

      + click +

      +
      +​ + +​ + + +``` + * @example ​ ````Implements a simple event delegation: The click handler is added to an unordered list, and the children of its li children are hidden. Clicking one of the li children toggles (see toggle()) their children. +```html + + + + + event.target demo + + + +​ +
        +
      • item 1 +
          +
        • sub item 1-a
        • +
        • sub item 1-b
        • +
        +
      • +
      • item 2 +
          +
        • sub item 2-a
        • +
        • sub item 2-b
        • +
        +
      • +
      +​ + +​ + + +``` + */ + target: TTarget; + } + + interface EventLike { + type: string; + } + + // #endregion + + interface EventHandler extends EventHandlerBase> { } + + // Extra parameters can be passed from trigger() + type EventHandlerBase = (this: TContext, t: T, ...args: any[]) => any; + + // region Event extensions + // #region Event extensions + + interface EventExtensions { + /** + * jQuery defines an \`{@link https://api.jquery.com/category/events/event-object/ Event object}\` that represents a cross-browser subset of the information available when an event occurs. The `jQuery.event.props` property is an array of string names for properties that are always copied when jQuery processes a native browser event. (Events fired in code by `.trigger()` do not use this list, since the code can construct a `jQuery.Event` object with the needed values and trigger using that object.) + * + * To add a property name to this list, use `jQuery.event.props.push( "newPropertyName" )`. However, be aware that every event processed by jQuery will now attempt to copy this property name from the native browser event to jQuery's constructed event. If the property does not exist for that event type, it will get an undefined value. Adding many properties to this list can significantly reduce event delivery performance, so for infrequently-needed properties it is more efficient to use the value directly from `event.originalEvent` instead. If properties must be copied, you are strongly advised to use `jQuery.event.fixHooks` as of version 1.7. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#jquery-event-props-array }\` + */ + props: string[]; + /** + * The `fixHooks` interface provides a per-event-type way to extend or normalize the event object that jQuery creates when it processes a _native_ browser event. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#jquery-event-fixhooks-object }\` + */ + fixHooks: FixHooks; + /** + * The jQuery special event hooks are a set of per-event-name functions and properties that allow code to control the behavior of event processing within jQuery. The mechanism is similar to `fixHooks` in that the special event information is stored in `jQuery.event.special.NAME`, where `NAME` is the name of the special event. Event names are case sensitive. + * + * As with `fixHooks`, the special event hooks design assumes it will be very rare that two unrelated pieces of code want to process the same event name. Special event authors who need to modify events with existing hooks will need to take precautions to avoid introducing unwanted side-effects by clobbering those hooks. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#special-event-hooks }\` + */ + special: SpecialEventHooks; + } + + // region Fix hooks + // #region Fix hooks + + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type FixHook = { + /** + * Strings representing properties that should be copied from the browser's event object to the jQuery event object. If omitted, no additional properties are copied beyond the standard ones that jQuery copies and normalizes (e.g. `event.target` and `event.relatedTarget`). + */ + props: string[]; + } | { + /** + * jQuery calls this function after it constructs the `jQuery.Event` object, copies standard properties from `jQuery.event.props`, and copies the `fixHooks`-specific props (if any) specified above. The function can create new properties on the event object or modify existing ones. The second argument is the browser's native event object, which is also available in `event.originalEvent`. + * + * Note that for all events, the browser's native event object is available in `event.originalEvent`; if the jQuery event handler examines the properties there instead of jQuery's normalized `event` object, there is no need to create a `fixHooks` entry to copy or modify the properties. + * @example ​ ````For example, to set a hook for the "drop" event that copies the `dataTransfer` property, assign an object to `jQuery.event.fixHooks.drop`: +```javascript +jQuery.event.fixHooks.drop = { + props: [ "dataTransfer" ] +}; +``` + +Since fixHooks is an advanced feature and rarely used externally, jQuery does not include code or +interfaces to deal with conflict resolution. If there is a chance that some other code may be assigning +`fixHooks` to the same events, the code should check for an existing hook and take appropriate measures. +A simple solution might look like this: + +```javascript +if ( jQuery.event.fixHooks.drop ) { + throw new Error( "Someone else took the jQuery.event.fixHooks.drop hook!" ); +} + +jQuery.event.fixHooks.drop = { + props: [ "dataTransfer" ] +}; +``` + +When there are known cases of different plugins wanting to attach to the drop hook, this solution might be more appropriate: + +```javascript +var existingHook = jQuery.event.fixHooks.drop; + +if ( !existingHook ) { + jQuery.event.fixHooks.drop = { + props: [ "dataTransfer" ] + }; +} else { + if ( existingHook.props ) { + existingHook.props.push( "dataTransfer" ); + } else { + existingHook.props = [ "dataTransfer" ]; + } +} +``` + */ + filter(event: Event, originalEvent: _Event): void; + } | { + [key: string]: never; + }; + + /** + * The `fixHooks` interface provides a per-event-type way to extend or normalize the event object that jQuery creates when it processes a _native_ browser event. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#jquery-event-fixhooks-object }\` + */ + interface FixHooks { + [event: string]: FixHook; + } + + // #endregion + + // region Special event hooks + // #region Special event hooks + + /** + * The jQuery special event hooks are a set of per-event-name functions and properties that allow code to control the behavior of event processing within jQuery. The mechanism is similar to `fixHooks` in that the special event information is stored in `jQuery.event.special.NAME`, where `NAME` is the name of the special event. Event names are case sensitive. + * + * As with `fixHooks`, the special event hooks design assumes it will be very rare that two unrelated pieces of code want to process the same event name. Special event authors who need to modify events with existing hooks will need to take precautions to avoid introducing unwanted side-effects by clobbering those hooks. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#special-event-hooks }\` + */ + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type SpecialEventHook = { + /** + * Indicates whether this event type should be bubbled when the `.trigger()` method is called; by default it is `false`, meaning that a triggered event will bubble to the element's parents up to the document (if attached to a document) and then to the window. Note that defining `noBubble` on an event will effectively prevent that event from being used for delegated events with `.trigger()`. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#nobubble-boolean }\` + */ + noBubble: boolean; + } | { + /** + * When defined, these string properties specify that a special event should be handled like another event type until the event is delivered. The `bindType` is used if the event is attached directly, and the `delegateType` is used for delegated events. These types are generally DOM event types, and _should not_ be a special event themselves. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#bindtype-string-delegatetype-string }\` + */ + bindType: string; + } | { + /** + * When defined, these string properties specify that a special event should be handled like another event type until the event is delivered. The `bindType` is used if the event is attached directly, and the `delegateType` is used for delegated events. These types are generally DOM event types, and _should not_ be a special event themselves. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#bindtype-string-delegatetype-string }\` + */ + delegateType: string; + } | { + /** + * The setup hook is called the first time an event of a particular type is attached to an element; this provides the hook an opportunity to do processing that will apply to all events of this type on this element. The `this` keyword will be a reference to the element where the event is being attached and `eventHandle` is jQuery's event handler function. In most cases the `namespaces` argument should not be used, since it only represents the namespaces of the _first_ event being attached; subsequent events may not have this same namespaces. + * + * This hook can perform whatever processing it desires, including attaching its own event handlers to the element or to other elements and recording setup information on the element using the `jQuery.data()` method. If the setup hook wants jQuery to add a browser event (via `addEventListener` or `attachEvent`, depending on browser) it should return `false`. In all other cases, jQuery will not add the browser event, but will continue all its other bookkeeping for the event. This would be appropriate, for example, if the event was never fired by the browser but invoked by `.trigger()`. To attach the jQuery event handler in the setup hook, use the `eventHandle` argument. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#setup-function-data-object-namespaces-eventhandle-function }\` + */ + setup(this: TTarget, data: TData, namespaces: string, eventHandle: EventHandler): void | false; + } | { + /** + * The teardown hook is called when the final event of a particular type is removed from an element. The `this` keyword will be a reference to the element where the event is being cleaned up. This hook should return `false` if it wants jQuery to remove the event from the browser's event system (via `removeEventListener` or `detachEvent`). In most cases, the setup and teardown hooks should return the same value. + * + * If the setup hook attached event handlers or added data to an element through a mechanism such as `jQuery.data()`, the teardown hook should reverse the process and remove them. jQuery will generally remove the data and events when an element is totally removed from the document, but failing to remove data or events on teardown will cause a memory leak if the element stays in the document. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#teardown-function }\` + */ + teardown(this: TTarget): void | false; + } | { + /** + * Each time an event handler is added to an element through an API such as `.on()`, jQuery calls this hook. The `this` keyword will be the element to which the event handler is being added, and the `handleObj` argument is as described in the section above. The return value of this hook is ignored. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#add-function-handleobj }\` + */ + add(this: TTarget, handleObj: HandleObject): void; + } | { + /** + * When an event handler is removed from an element using an API such as `.off()`, this hook is called. The `this` keyword will be the element where the handler is being removed, and the `handleObj` argument is as described in the section above. The return value of this hook is ignored. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#remove-function-handleobj }\` + */ + remove(this: TTarget, handleObj: HandleObject): void; + } | { + /** + * Called when the `.trigger()` or `.triggerHandler()` methods are used to trigger an event for the special type from code, as opposed to events that originate from within the browser. The `this` keyword will be the element being triggered, and the event argument will be a `jQuery.Event` object constructed from the caller's input. At minimum, the event type, data, namespace, and target properties are set on the event. The data argument represents additional data passed by `.trigger()` if present. + * + * The trigger hook is called early in the process of triggering an event, just after the `jQuery.Event` object is constructed and before any handlers have been called. It can process the triggered event in any way, for example by calling `event.stopPropagation()` or `event.preventDefault()` before returning. If the hook returns `false`, jQuery does not perform any further event triggering actions and returns immediately. Otherwise, it performs the normal trigger processing, calling any event handlers for the element and bubbling the event (unless propagation is stopped in advance or `noBubble` was specified for the special event) to call event handlers attached to parent elements. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#trigger-function-event-jquery-event-data-object }\` + */ + trigger(this: TTarget, event: Event, data: TData): void | false; + } | { + /** + * When the `.trigger()` method finishes running all the event handlers for an event, it also looks for and runs any method on the target object by the same name unless of the handlers called `event.preventDefault()`. So, `.trigger( "submit" )` will execute the `submit()` method on the element if one exists. When a `_default` hook is specified, the hook is called just prior to checking for and executing the element's default method. If this hook returns the value `false` the element's default method will be called; otherwise it is not. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#_default-function-event-jquery-event-data-object }\` + */ + _default(event: Event, data: TData): void | false; + } | { + /** + * jQuery calls a handle hook when the event has occurred and jQuery would normally call the user's event handler specified by `.on()` or another event binding method. If the hook exists, jQuery calls it _instead_ of that event handler, passing it the event and any data passed from `.trigger()` if it was not a native event. The `this` keyword is the DOM element being handled, and `event.handleObj` property has the detailed event information. + * + * Based in the information it has, the handle hook should decide whether to call the original handler function which is in `event.handleObj.handler`. It can modify information in the event object before calling the original handler, but _must restore_ that data before returning or subsequent unrelated event handlers may act unpredictably. In most cases, the handle hook should return the result of the original handler, but that is at the discretion of the hook. The handle hook is unique in that it is the only special event function hook that is called under its original special event name when the type is mapped using `bindType` and `delegateType`. For that reason, it is almost always an error to have anything other than a handle hook present if the special event defines a `bindType` and `delegateType`, since those other hooks will never be called. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#handle-function-event-jquery-event-data-object }\` + */ + handle(this: TTarget, event: Event & { handleObj: HandleObject; }, ...data: TData[]): void; + } | { + preDispatch(this: TTarget, event: Event): false | void; + } | { + postDispatch(this: TTarget, event: Event): void; + } | { + [key: string]: never; + }; + + interface SpecialEventHooks { + [event: string]: SpecialEventHook; + } + + /** + * Many of the special event hook functions below are passed a `handleObj` object that provides more information about the event, how it was attached, and its current state. This object and its contents should be treated as read-only data, and only the properties below are documented for use by special event handlers. + * @see \`{@link https://learn.jquery.com/events/event-extensions/#the-handleobj-object }\` + */ + interface HandleObject { + /** + * The type of event, such as `"click"`. When special event mapping is used via `bindType` or `delegateType`, this will be the mapped type. + */ + readonly type: string; + /** + * The original type name regardless of whether it was mapped via `bindType` or `delegateType`. So when a "pushy" event is mapped to "click" its `origType` would be "pushy". + */ + readonly origType: string; + /** + * Namespace(s), if any, provided when the event was attached, such as `"myPlugin"`. When multiple namespaces are given, they are separated by periods and sorted in ascending alphabetical order. If no namespaces are provided, this property is an empty string. + */ + readonly namespace: string; + /** + * For delegated events, this is the selector used to filter descendant elements and determine if the handler should be called. For directly bound events, this property is `null`. + */ + readonly selector: string | undefined | null; + /** + * The data, if any, passed to jQuery during event binding, e.g. `{ myData: 42 }`. If the data argument was omitted or `undefined`, this property is `undefined` as well. + */ + readonly data: TData; + /** + * Event handler function passed to jQuery during event binding. If `false` was passed during event binding, the handler refers to a single shared function that simply returns `false`. + */ + readonly handler: EventHandler; + } + + // #endregion + + // #endregion + + // #endregion + + interface NameValuePair { + name: string; + value: string; + } + + // region Coordinates + // #region Coordinates + + interface Coordinates { + left: number; + top: number; + } + + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type CoordinatesPartial = + Pick | + Pick | + { [key: string]: never; }; + + // #endregion + + // region Val hooks + // #region Val hooks + + // Workaround for TypeScript 2.3 which does not have support for weak types handling. + type ValHook = { + get(elem: TElement): any; + } | { + set(elem: TElement, value: any): any; + } | { + [key: string]: never; + }; + + interface ValHooks { + // Set to HTMLElement to minimize breaks but should probably be Element. + [nodeName: string]: ValHook; + } + + // #endregion + + type _Falsy = false | null | undefined | 0 | '' | typeof document.all; +} + +declare const jQuery: JQueryStatic; +declare const $: JQueryStatic; + +// Used by JQuery.Event +type _Event = Event; + +// region ES5 compatibility +// #region ES5 compatibility + +// Forward declaration of `Iterable`. +// tslint:disable-next-line:no-empty-interface +interface Iterable { } + +interface SymbolConstructor { + /** + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. + */ + readonly toStringTag: symbol; +} + +declare var Symbol: SymbolConstructor; + +// #endregion diff --git a/types/jquery/test/example-tests.ts b/types/jquery/test/example-tests.ts index 60fbd431bb..7ecb1733a7 100644 --- a/types/jquery/test/example-tests.ts +++ b/types/jquery/test/example-tests.ts @@ -2334,7 +2334,9 @@ function examples() { } function jQuery_contains_0() { + // tslint:disable-next-line no-unnecessary-type-assertion $.contains(document.documentElement!, document.body); // true + // tslint:disable-next-line no-unnecessary-type-assertion $.contains(document.body, document.documentElement!); // false } diff --git a/types/jquery/test/learn-tests.ts b/types/jquery/test/learn-tests.ts index ef52084da5..8ef5eb2cfa 100644 --- a/types/jquery/test/learn-tests.ts +++ b/types/jquery/test/learn-tests.ts @@ -7,7 +7,8 @@ interface JQuery { } interface GreenifyPlugin { - (this: JQuery): void; + // tslint:disable-next-line:callable-types + (this: JQuery): void; } jQuery.fn.greenify = function() { @@ -15,3 +16,63 @@ jQuery.fn.greenify = function() { }; jQuery("a").greenify(); // Makes all the links green. + +// https://learn.jquery.com/events/event-extensions/ + +// Events + +function fixHooks() { + function setHook() { + jQuery.event.fixHooks.drop = { + props: ["dataTransfer"] + }; + } + + function conflictResolution() { + if (jQuery.event.fixHooks.drop) { + throw new Error("Someone else took the jQuery.event.fixHooks.drop hook!"); + } + + jQuery.event.fixHooks.drop = { + props: ["dataTransfer"] + }; + } +} + +function special() { + function defineSpecialEvent() { + jQuery.event.special.pushy = { + bindType: "click", + delegateType: "click" + }; + } + + function handleObj() { + jQuery.event.special.multiclick = { + delegateType: "click", + bindType: "click", + handle(event) { + const handleObj = event.handleObj; + const targetData = jQuery.data(event.target); + let ret = null; + + // If a multiple of the click count, run the handler + targetData.clicks = (targetData.clicks || 0) + 1; + + if (targetData.clicks % event.data.clicks === 0) { + event.type = handleObj.origType; + ret = handleObj.handler.apply(this, arguments); + event.type = handleObj.type; + return ret; + } + } + }; + + // Sample usage + $("p").on("multiclick", { + clicks: 3 + }, () => { + alert("clicked 3 times"); + }); + } +} diff --git a/types/jquery/test/longdesc-tests.ts b/types/jquery/test/longdesc-tests.ts index 5275191b5b..bb3bb4c83c 100644 --- a/types/jquery/test/longdesc-tests.ts +++ b/types/jquery/test/longdesc-tests.ts @@ -1,3 +1,4 @@ +// tslint:disable:ban-types // tslint:disable:no-var-keyword // tslint:disable:object-literal-key-quotes // tslint:disable:object-literal-shorthand @@ -951,8 +952,10 @@ function longdesc() { function jquery_ajax_transport_2() { $.ajaxTransport('script', function(options, originalOptions, jqXHR) { + let transport: JQuery.Transport = undefined!; + // Will only be called for script requests - return {} as JQuery.Transport; + return transport; }); } @@ -1291,7 +1294,7 @@ function longdesc() { if (borderRadius && borderRadius !== 'borderRadius') { $.cssHooks.borderRadius = { get: function(elem, computed, extra) { - return $.css(elem, borderRadius); + return $.css(elem, borderRadius!); }, set: function(elem, value) { ( elem.style)[borderRadius!] = value; @@ -1341,7 +1344,7 @@ function longdesc() { function jquery_css_hooks_6() { $.fx.step.someCSSProp = function(fx) { - $.cssHooks.someCSSProp.set(fx.elem as HTMLElement, fx.now + fx.unit); + $.cssHooks.someCSSProp.set!(fx.elem as HTMLElement, fx.now + fx.unit); }; } diff --git a/types/jquery/tsconfig.json b/types/jquery/tsconfig.json index 86c99c452f..8b159bc81f 100644 --- a/types/jquery/tsconfig.json +++ b/types/jquery/tsconfig.json @@ -20,6 +20,7 @@ }, "files": [ "index.d.ts", + "dist/jquery.slim.d.ts", "jquery-tests.ts", "test/example-tests.ts", "test/longdesc-tests.ts", diff --git a/types/jquery/tslint.json b/types/jquery/tslint.json index 93e1f3e072..f93cf8562a 100644 --- a/types/jquery/tslint.json +++ b/types/jquery/tslint.json @@ -1,12 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "callable-types": false, - "interface-name": false, - "no-any-union": false, - "no-declare-current-package": false, - - "ban-types": false, - "no-object-literal-type-assertion": false - } + "extends": "dtslint/dt.json" } diff --git a/types/jquery/v1/jquery-tests.ts b/types/jquery/v1/jquery-tests.ts index d00c075125..bb13b8c215 100644 --- a/types/jquery/v1/jquery-tests.ts +++ b/types/jquery/v1/jquery-tests.ts @@ -2715,7 +2715,7 @@ function test_fn_extend() { } function test_jquery() { - var a = { what: "A regular JS object" }, + var a: any = { what: "A regular JS object" }, b = $('body'); if (a.jquery) { alert(' a is a jQuery object! '); diff --git a/types/jquery/v2/index.d.ts b/types/jquery/v2/index.d.ts index 2f9a79adf4..1b1d9cf75f 100644 --- a/types/jquery/v2/index.d.ts +++ b/types/jquery/v2/index.d.ts @@ -824,7 +824,7 @@ interface JQueryStatic { * @see {@link https://api.jquery.com/jQuery.ajaxTransport/} */ ajaxTransport(dataType: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; - + ajaxSettings: JQueryAjaxSettings; /** @@ -1403,16 +1403,6 @@ interface JQueryStatic { */ unique(array: T[]): T[]; - /** - * Parses a string into an array of DOM nodes. - * - * @param data HTML string to be parsed - * @param context DOM element to serve as the context in which the HTML fragment will be created - * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string - * @see {@link https://api.jquery.com/jQuery.parseHTML/} - */ - parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; - /** * Parses a string into an array of DOM nodes. * @@ -3286,7 +3276,7 @@ interface JQuery { * @name toArray * @see {@link https://api.jquery.com/toArray/} */ - toArray(): HTMLElement[]; + toArray(): Element[]; /** * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. @@ -3353,13 +3343,13 @@ interface JQuery { * @param index A zero-based integer indicating which element to retrieve. * @see {@link https://api.jquery.com/get/#get-index} */ - get(index: number): HTMLElement; + get(index: number): Element; /** * Retrieve the elements matched by the jQuery object. * @alias toArray * @see {@link https://api.jquery.com/get/#get} */ - get(): HTMLElement[]; + get(): Element[]; /** * Search for a given element from among the matched elements. @@ -3385,7 +3375,7 @@ interface JQuery { * @see {@link https://api.jquery.com/selector/} */ selector: string; - [index: number]: HTMLElement; + [index: number]: Element; /** * Add elements to the set of matched elements. diff --git a/types/jquery/v2/jquery-tests.ts b/types/jquery/v2/jquery-tests.ts index d00c075125..01a06c62a8 100644 --- a/types/jquery/v2/jquery-tests.ts +++ b/types/jquery/v2/jquery-tests.ts @@ -2715,7 +2715,7 @@ function test_fn_extend() { } function test_jquery() { - var a = { what: "A regular JS object" }, + var a: any = { what: "A regular JS object" }, b = $('body'); if (a.jquery) { alert(' a is a jQuery object! '); @@ -3554,3 +3554,11 @@ function test_promise_then_not_return_deferred() { promise = promise.fail(); promise = promise.always(); } + +function test_element() { + const itemEl = $('#item')[0]; + $('li').toArray().indexOf(itemEl); + $('li').get().indexOf(itemEl); + let otherItemEl = $('li').get(0); + otherItemEl = itemEl; +} diff --git a/types/jqueryui/index.d.ts b/types/jqueryui/index.d.ts index 7dca429ce4..cc164360c0 100644 --- a/types/jqueryui/index.d.ts +++ b/types/jqueryui/index.d.ts @@ -64,6 +64,7 @@ declare namespace JQueryUI { * The item selected from the menu, if any. Otherwise the property is null */ item?: any; + content?: any; } interface AutocompleteEvent { @@ -1856,7 +1857,9 @@ interface JQuery { tabs(): JQuery; tabs(methodName: 'destroy'): void; tabs(methodName: 'disable'): void; + tabs(methodName: 'disable', index: number): void; tabs(methodName: 'enable'): void; + tabs(methodName: 'enable', index: number): void; tabs(methodName: 'load', index: number): void; tabs(methodName: 'refresh'): void; tabs(methodName: 'widget'): JQuery; diff --git a/types/jqueryui/tslint.json b/types/jqueryui/tslint.json index 22ecc7ce6f..ca9116c788 100644 --- a/types/jqueryui/tslint.json +++ b/types/jqueryui/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/js-beautify/js-beautify-tests.ts b/types/js-beautify/js-beautify-tests.ts index f421052503..34cd9d8f13 100644 --- a/types/js-beautify/js-beautify-tests.ts +++ b/types/js-beautify/js-beautify-tests.ts @@ -4,9 +4,9 @@ bCss = js_beautify.css_beautify("body{display:none;}"); let bHtml = js_beautify.html("
      "); bHtml = js_beautify.html_beautify("
      "); -let optHtml = {}; -let optCss = {}; -let optjs = {}; +let optHtml: HTMLBeautifyOptions = {}; +let optCss: CSSBeautifyOptions = {}; +let optjs: JsBeautifyOptions = {}; var simple: string = js_beautify("console.log('Hello world!');"); var full: string = js_beautify( diff --git a/types/js-money/tslint.json b/types/js-money/tslint.json index 3db14f85ea..42522eff7e 100644 --- a/types/js-money/tslint.json +++ b/types/js-money/tslint.json @@ -1 +1,9 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + // All are TODOs + "dt-header": false, + "eofline": false, + "no-unnecessary-qualifier": false + } +} diff --git a/types/js-search/tslint.json b/types/js-search/tslint.json index a41bf5d19a..d67ffb3a73 100644 --- a/types/js-search/tslint.json +++ b/types/js-search/tslint.json @@ -17,6 +17,7 @@ "max-line-length": false, "member-access": false, "new-parens": false, + "no-angle-bracket-type-assertion": false, "no-any-union": false, "no-boolean-literal-compare": false, "no-conditional-assignment": false, diff --git a/types/jschannel/index.d.ts b/types/jschannel/index.d.ts index 42145531ea..ba1ce6f61d 100644 --- a/types/jschannel/index.d.ts +++ b/types/jschannel/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for jschannel 1.0 // Project: https://github.com/yochannah/jschannel // Definitions by: Yitzchok Gottlieb +// McFlat // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -25,7 +26,7 @@ export interface Message { } export interface ChannelConfiguration { - window: any; + window: Window; origin: string; scope: string; debugOutput?: boolean; diff --git a/types/jschannel/jschannel-tests.ts b/types/jschannel/jschannel-tests.ts index eabd150bf2..c618eea253 100644 --- a/types/jschannel/jschannel-tests.ts +++ b/types/jschannel/jschannel-tests.ts @@ -1,3 +1,3 @@ import { build } from 'jschannel'; -build({ window: null, origin: "*", scope: "testScope"}); +build({ window, origin: "*", scope: "testScope"}); diff --git a/types/jschannel/tsconfig.json b/types/jschannel/tsconfig.json index 58b8ca059e..e8988e8fe1 100644 --- a/types/jschannel/tsconfig.json +++ b/types/jschannel/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, @@ -20,4 +21,4 @@ "index.d.ts", "jschannel-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/jsdom/index.d.ts b/types/jsdom/index.d.ts index 1aa9750fbc..dec74af1ba 100644 --- a/types/jsdom/index.d.ts +++ b/types/jsdom/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jsdom 11.12 +// Type definitions for jsdom 12.2 // Project: https://github.com/tmpvar/jsdom#readme // Definitions by: Leonard Thieu // Johan Palmfjord @@ -65,7 +65,7 @@ export interface Options { */ includeNodeLocations?: boolean; runScripts?: 'dangerously' | 'outside-only'; - resources?: 'usable'; + resources?: 'usable' | ResourceLoader; virtualConsole?: VirtualConsole; cookieJar?: CookieJar; beforeParse?(window: DOMWindow): void; @@ -287,3 +287,22 @@ export interface ReconfigureSettings { windowTop?: DOMWindow; url?: string; } + +export interface FetchOptions { + cookieJar?: CookieJar; + referrer?: string; + accept?: string; + element?: HTMLScriptElement | HTMLLinkElement | HTMLIFrameElement | HTMLImageElement; +} + +export interface ResourceLoaderConstructorOptions { + strictSSL?: boolean; + proxy?: string; + userAgent?: string; +} + +export class ResourceLoader { + fetch(url: string, options: FetchOptions): Promise | null; + + constructor(obj?: ResourceLoaderConstructorOptions); +} diff --git a/types/jsdom/jsdom-tests.ts b/types/jsdom/jsdom-tests.ts index da82b2db7c..d20232e36f 100644 --- a/types/jsdom/jsdom-tests.ts +++ b/types/jsdom/jsdom-tests.ts @@ -1,4 +1,4 @@ -import { JSDOM, VirtualConsole, CookieJar, FromUrlOptions, FromFileOptions, DOMWindow } from 'jsdom'; +import { JSDOM, VirtualConsole, CookieJar, FromUrlOptions, FromFileOptions, DOMWindow, ResourceLoader, FetchOptions } from 'jsdom'; import { CookieJar as ToughCookieJar, MemoryCookieStore } from 'tough-cookie'; import { Script } from 'vm'; @@ -82,6 +82,7 @@ function test_serialize() { dom.serialize() === 'hello'; // Contrast with: + // tslint:disable-next-line no-unnecessary-type-assertion dom.window.document.documentElement!.outerHTML === 'hello'; } @@ -168,3 +169,16 @@ function test_fragment_serialization() { } } } + +function test_custom_resource_loader() { + class CustomResourceLoader extends ResourceLoader { + fetch(url: string, options: FetchOptions) { + if (options.element) { + console.log(`Element ${options.element.localName} is requesting the url ${url}`); + } + + return super.fetch(url, options); + } + } + new JSDOM('', { resources: new CustomResourceLoader() }); +} diff --git a/types/jsen/jsen-tests.ts b/types/jsen/jsen-tests.ts index 16cded3688..20264b8818 100644 --- a/types/jsen/jsen-tests.ts +++ b/types/jsen/jsen-tests.ts @@ -2238,7 +2238,7 @@ const doesNotThrow = (func: Function) => { { let schema = { format: 'custom' }, callCount = 0, - options = { + options = { formats: { custom: () => { callCount++; @@ -2275,7 +2275,7 @@ const doesNotThrow = (func: Function) => { maximum: 10 }, callCount = 0, - options = { + options = { formats: { custom: () => { callCount++; @@ -2311,7 +2311,7 @@ const doesNotThrow = (func: Function) => { }, format: 'passwordsMatch' }, - options = { + options = { formats: { passwordsMatch: (obj: any) => { callCount++; diff --git a/types/jsforce/connection.d.ts b/types/jsforce/connection.d.ts index 60716753ae..3bd0ea177b 100644 --- a/types/jsforce/connection.d.ts +++ b/types/jsforce/connection.d.ts @@ -12,6 +12,7 @@ import { Bulk } from './bulk'; import { Cache } from './cache' import { OAuth2, Streaming } from '.'; import { HttpApiOptions } from './http-api' +import { LimitsInfo } from './limits-info'; export type Callback = (err: Error | null, result: T) => void; // The type for these options was determined by looking at the usage @@ -160,9 +161,13 @@ export class Connection extends BaseConnection { login(user: string, password: string, callback?: (err: Error, res: UserInfo) => void): Promise; loginByOAuth2(user: string, password: string, callback?: (err: Error, res: UserInfo) => void): Promise; loginBySoap(user: string, password: string, callback?: (err: Error, res: UserInfo) => void): Promise; + logout(revoke: boolean, callback?: (err: Error, res: undefined) => void): Promise; logout(callback?: (err: Error, res: undefined) => void): Promise; + logoutByOAuth2(revoke: boolean, callback?: (err: Error, res: undefined) => void): Promise; logoutByOAuth2(callback?: (err: Error, res: undefined) => void): Promise; + logoutBySoap(revoke: boolean, callback?: (err: Error, res: undefined) => void): Promise; logoutBySoap(callback?: (err: Error, res: undefined) => void): Promise; + limits(callback?: (err: Error, res: undefined) => void): Promise; } export class Tooling extends BaseConnection { diff --git a/types/jsforce/index.d.ts b/types/jsforce/index.d.ts index c36f39095a..65d5159f61 100644 --- a/types/jsforce/index.d.ts +++ b/types/jsforce/index.d.ts @@ -30,3 +30,4 @@ export * from './salesforce-id'; export * from './salesforce-object'; export * from './streaming'; export * from './topic'; +export * from './limits-info'; diff --git a/types/jsforce/limits-info.d.ts b/types/jsforce/limits-info.d.ts new file mode 100644 index 0000000000..bfeeabe0c3 --- /dev/null +++ b/types/jsforce/limits-info.d.ts @@ -0,0 +1,48 @@ +export interface Limit { + Max: number; + Remaining: number; +} + +export interface PermissionSets extends Limit { + CreateCustom: Limit; +} + +export interface DailyApiRequests extends Limit { + 'Chatter Desktop': Limit; + 'Chatter Mobile for BlackBerry': Limit; + 'Salesforce Files': Limit; + 'Salesforce Marketing Cloud': Limit; + 'Salesforce for Android': Limit; + 'Salesforce for iOS': Limit; + 'SalesforceA': Limit; +} + +export interface LimitsInfo { + ConcurrentAsyncGetReportInstances: Limit; + ConcurrentSyncReportRuns: Limit; + DailyAnalyticsDataflowJobExecutions: Limit; + DailyApiRequests: DailyApiRequests; + DailyAsyncApexExecutions: Limit; + DailyBulkApiRequests: DailyApiRequests; + DailyDurableGenericStreamingApiEvents: Limit; + DailyDurableStreamingApiEvents: Limit; + DailyGenericStreamingApiEvents: DailyApiRequests; + DailyStreamingApiEvents: DailyApiRequests; + DailyWorkflowEmails: Limit; + DataStorageMB: Limit; + DurableStreamingApiConcurrentClients: Limit; + FileStorageMB: Limit; + HourlyAsyncReportRuns: Limit; + HourlyDashboardRefreshes: Limit; + HourlyDashboardResults: Limit; + HourlyDashboardStatuses: Limit; + HourlyODataCallout: Limit; + HourlySyncReportRuns: Limit; + HourlyTimeBasedWorkflow: Limit; + MassEmail: Limit; + MonthlyPlatformEvents: Limit; + Package2VersionCreates: Limit; + PermissionSets: PermissionSets; + SingleEmail: Limit; + StreamingApiConcurrentClients: Limit; +} diff --git a/types/jsforce/tslint.json b/types/jsforce/tslint.json index 3b1f082eb2..43829466b8 100644 --- a/types/jsforce/tslint.json +++ b/types/jsforce/tslint.json @@ -2,9 +2,19 @@ "extends": "dtslint/dt.json", "rules": { // TODOs + "array-type": false, "ban-types": false, + "eofline": false, + "max-line-length": false, "no-any-union": false, + "no-empty-interface": false, + "no-redundant-undefined": false, "no-unnecessary-class": false, - "no-unnecessary-generics": false + "no-unnecessary-generics": false, + "semicolon": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "typedef-whitespace": false, + "whitespace": false } } diff --git a/types/json-rpc-random-id/index.d.ts b/types/json-rpc-random-id/index.d.ts new file mode 100644 index 0000000000..14b5ba0ff0 --- /dev/null +++ b/types/json-rpc-random-id/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for json-rpc-random-id 1.0 +// Project: https://github.com/kumavis/json-rpc-random-id#readme +// Definitions by: Micah Riggan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/** + * Returns a function that generates a random number + * This number is to be used with web3 rpc + */ +declare function IdIterator(options?: { + max?: number; + start?: number; +}): () => number; + +export = IdIterator; diff --git a/types/json-rpc-random-id/json-rpc-random-id-tests.ts b/types/json-rpc-random-id/json-rpc-random-id-tests.ts new file mode 100644 index 0000000000..c71a7581e8 --- /dev/null +++ b/types/json-rpc-random-id/json-rpc-random-id-tests.ts @@ -0,0 +1,2 @@ +import jsonRPCRandomID = require("json-rpc-random-id"); +const generateId = jsonRPCRandomID(); diff --git a/types/json-rpc-random-id/tsconfig.json b/types/json-rpc-random-id/tsconfig.json new file mode 100644 index 0000000000..c39a0a4e2b --- /dev/null +++ b/types/json-rpc-random-id/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes":true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "json-rpc-random-id-tests.ts" + ] +} diff --git a/types/json-rpc-random-id/tslint.json b/types/json-rpc-random-id/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/json-rpc-random-id/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/json2csv/tslint.json b/types/json2csv/tslint.json index 3db14f85ea..389fc5f08e 100644 --- a/types/json2csv/tslint.json +++ b/types/json2csv/tslint.json @@ -1 +1,15 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + // All are TODOs + "array-type": false, + "ban-types": false, + "callable-types": false, + "jsdoc-format": false, + "member-access": false, + "no-duplicate-imports": false, + "no-redundant-jsdoc-2": false, + "strict-export-declare-modifiers": false, + "typedef-whitespace": false + } +} diff --git a/types/jsonquery/index.d.ts b/types/jsonquery/index.d.ts new file mode 100644 index 0000000000..48afcf8d0a --- /dev/null +++ b/types/jsonquery/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for jsonquery 0.1 +// Project: https://github.com/eugeneware/jsonquery +// Definitions by: Jim Buck +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +declare function jsonquery(query: jsonquery.Query): NodeJS.ReadWriteStream; + +declare namespace jsonquery { + function match(haystack: T, predicate: Query): boolean; + + type Query = BinaryQueryCondition | QueryValue | PathQuery; + + interface OrQueryCondition { + $or: ReadonlyArray>; + } + + interface AndQueryCondition { + $and: ReadonlyArray>; + } + + type BinaryQueryCondition = OrQueryCondition | AndQueryCondition; + + interface BaseCondition

      { + $lt: P; + $lte: P; + $gt: P; + $gte: P; + $mod: [number, number]; + $ne: P; + $in: ReadonlyArray

      ; + $nin: ReadonlyArray

      ; + $all: ReadonlyArray

      ; + $elemMatch: Partial

      ; + } + + interface PathQuery { + [path: string]: any; + } + + type QueryValue = { + [P in keyof T]?: T[P] | BaseCondition; + }; +} + +export = jsonquery; diff --git a/types/jsonquery/jsonquery-tests.ts b/types/jsonquery/jsonquery-tests.ts new file mode 100644 index 0000000000..904f61d01c --- /dev/null +++ b/types/jsonquery/jsonquery-tests.ts @@ -0,0 +1,120 @@ +import jsonquery = require('jsonquery'); + +interface TestData { + name: string; + number: string; + val: number; + favorites: number[]; + awesome: boolean; + nullify: null; + tree: { + a: number; + b: number; + }; +} + +const testDataInstance: TestData = { + name: "Name 1", + number: "Number 1", + val: 10, + favorites: [10, 20], + awesome: true, + nullify: null, + tree: { + a: 1, + b: 2, + } +}; + +// $ExpectType ReadWriteStream +jsonquery({ number: 'Number 7' }); + +// $ExpectType ReadWriteStream +jsonquery({ number: 'Number 7', val: 70 }); + +// $ExpectType ReadWriteStream +jsonquery({ $or: [ { number: 'Number 7' }, { val: 50 } ] }); + +// $ExpectType ReadWriteStream +jsonquery({ $and: [ { number: 'Number 7' }, { val: 70 } ] }); + +// $ExpectType ReadWriteStream +jsonquery({ $or: [ { $and: [ { number: 'Number 7' }, { val: 70 } ] }, { val: 50 } ] }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $in: [ 70, 50 ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $or: [ { $in: [ 70, 50 ] }, { $in: [ 60, 20 ] } ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $gt: 900 } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $lt: 900 } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $or: [ { $lt: 20 }, { $gt: 950 } ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $and: [ { $gt: 970 }, { $gt: 950 } ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $ne: 900 } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $lte: 900 } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $gte: 900 } }); + +// $ExpectType ReadWriteStream +jsonquery({ favorites: { $all: [50, 60] } }); + +// $ExpectType ReadWriteStream +jsonquery({ tree: { $elemMatch: { a: 1, b: 2 } } }); + +// $ExpectType ReadWriteStream +jsonquery({ 'tree.a': 1 }); + +// $ExpectType ReadWriteStream +jsonquery({ 'tree.a': { $in: [1, 5] } }); + +// $ExpectType ReadWriteStream +jsonquery({ number: /er 7$/ }); + +// $ExpectType ReadWriteStream +jsonquery({ number: { $in: [ /er 7$/, /er 5$/ ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ favorites: { $all: [/^50$/, /^60$/] } }); + +// $ExpectType ReadWriteStream +jsonquery({ tree: { $elemMatch: { a: /^1$/, b: 2 } } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $nin: [ 70, 50 ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ val: { $mod: [ 7, 1 ] } }); + +// $ExpectType ReadWriteStream +jsonquery({ favorites: { $size: 2 } }); + +// $ExpectType ReadWriteStream +jsonquery({ $and: [ { tree: { $exists: true } }, { missing: { $exists: false } } ] }); + +// $ExpectType ReadWriteStream +jsonquery({ $not: { number: 'Number 7', val: 70 } }); + +// $ExpectType ReadWriteStream +jsonquery({ number: { $not: { $nin: ['Number 7'] } } }); + +// $ExpectType ReadWriteStream +jsonquery({ foo: { $all: ['bar'] } }); + +// $ExpectType boolean +jsonquery.match(testDataInstance, { val: 7 }); + +// $ExpectType boolean +jsonquery.match(testDataInstance, { 'tree.a': { $in: [1, 5] } }); diff --git a/types/jsonquery/tsconfig.json b/types/jsonquery/tsconfig.json new file mode 100644 index 0000000000..ffb3eb6209 --- /dev/null +++ b/types/jsonquery/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsonquery-tests.ts" + ] +} diff --git a/types/jsonquery/tslint.json b/types/jsonquery/tslint.json new file mode 100644 index 0000000000..02db66c29b --- /dev/null +++ b/types/jsonquery/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules":{ + "no-unnecessary-generics": false + } +} diff --git a/types/jsonwebtoken/index.d.ts b/types/jsonwebtoken/index.d.ts index f54d3862c9..d1c3aeee5f 100644 --- a/types/jsonwebtoken/index.d.ts +++ b/types/jsonwebtoken/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for jsonwebtoken 7.2.2 +// Type definitions for jsonwebtoken 8.3 // Project: https://github.com/auth0/node-jsonwebtoken // Definitions by: Maxime LUCE , // Daniel Heim , // Brice BERNARD , -// Veli-Pekka Kestilä +// Veli-Pekka Kestilä , +// Daniel Parker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -43,9 +44,9 @@ export interface SignOptions { */ algorithm?: string; keyid?: string; - /** @member {string} - expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ + /** expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ expiresIn?: string | number; - /** @member {string} - expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ + /** expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ notBefore?: string | number; audience?: string | string[]; subject?: string; @@ -67,8 +68,8 @@ export interface VerifyOptions { jwtid?: string; subject?: string; /** - *@deprecated - *@member {string} - Max age of token + * @deprecated + * Max age of token */ maxAge?: string; } @@ -77,28 +78,45 @@ export interface DecodeOptions { complete?: boolean; json?: boolean; } -export type VerifyErrors=JsonWebTokenError | NotBeforeError | TokenExpiredError; -export interface VerifyCallback { - ( - err: VerifyErrors, - decoded: object | string, - ): void; +export type VerifyErrors= JsonWebTokenError | NotBeforeError | TokenExpiredError; +export type VerifyCallback = ( + err: VerifyErrors, + decoded: object | string, +) => void; + +export type SignCallback = ( + err: Error, encoded: string +) => void; + +export interface JwtHeader { + alg: string; + typ?: string; + kid?: string; + jku?: string; + x5u?: string; + x5t?: string; } -export interface SignCallback { - (err: Error, encoded: string): void; -} +export type SigningKeyCallback = ( + err: any, + signingKey?: Secret, +) => void; + +export type GetPublicKeyOrSecret = ( + header: JwtHeader, + callback: SigningKeyCallback +) => void; export type Secret = string | Buffer | { key: string; passphrase: string }; /** * Synchronously sign the given payload into a JSON Web Token string - * @param {String|Object|Buffer} payload - Payload to sign, could be an literal, buffer or string - * @param {String|Buffer} secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. - * @param {SignOptions} [options] - Options for the signature - * @returns {String} The JSON Web Token string + * payload - Payload to sign, could be an literal, buffer or string + * secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. + * [options] - Options for the signature + * returns - The JSON Web Token string */ -export declare function sign( +export function sign( payload: string | Buffer | object, secretOrPrivateKey: Secret, options?: SignOptions, @@ -106,17 +124,17 @@ export declare function sign( /** * Sign the given payload into a JSON Web Token string - * @param {String|Object|Buffer} payload - Payload to sign, could be an literal, buffer or string - * @param {String|Buffer} secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. - * @param {SignOptions} [options] - Options for the signature - * @param {Function} callback - Callback to get the encoded token on + * payload - Payload to sign, could be an literal, buffer or string + * secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. + * [options] - Options for the signature + * callback - Callback to get the encoded token on */ -export declare function sign( +export function sign( payload: string | Buffer | object, secretOrPrivateKey: Secret, callback: SignCallback, ): void; -export declare function sign( +export function sign( payload: string | Buffer | object, secretOrPrivateKey: Secret, options: SignOptions, @@ -125,16 +143,12 @@ export declare function sign( /** * Synchronously verify given token using a secret or a public key to get a decoded token - * @param {String} token - JWT string to verify - * @param {String|Buffer} secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA. - * @param {VerifyOptions} [options] - Options for the verification - * @returns The decoded token. + * token - JWT string to verify + * secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA. + * [options] - Options for the verification + * returns - The decoded token. */ -export declare function verify( - token: string, - secretOrPublicKey: string | Buffer, -): object | string; -export declare function verify( +export function verify( token: string, secretOrPublicKey: string | Buffer, options?: VerifyOptions, @@ -142,31 +156,32 @@ export declare function verify( /** * Asynchronously verify given token using a secret or a public key to get a decoded token - * @param {String} token - JWT string to verify - * @param {String|Buffer} secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA. - * @param {VerifyOptions} [options] - Options for the verification - * @param {Function} callback - Callback to get the decoded token on + * token - JWT string to verify + * secretOrPublicKey - A string or buffer containing either the secret for HMAC algorithms, + * or the PEM encoded public key for RSA and ECDSA. If jwt.verify is called asynchronous, + * secretOrPublicKey can be a function that should fetch the secret or public key + * [options] - Options for the verification + * callback - Callback to get the decoded token on */ -export declare function verify( +export function verify( token: string, - secretOrPublicKey: string | Buffer, + secretOrPublicKey: string | Buffer | GetPublicKeyOrSecret, callback?: VerifyCallback, ): void; -export declare function verify( +export function verify( token: string, - secretOrPublicKey: string | Buffer, + secretOrPublicKey: string | Buffer | GetPublicKeyOrSecret, options?: VerifyOptions, callback?: VerifyCallback, ): void; /** * Returns the decoded payload without verifying if the signature is valid. - * @param {String} token - JWT string to decode - * @param {DecodeOptions} [options] - Options for decoding - * @returns {Object} The decoded Token + * token - JWT string to decode + * [options] - Options for decoding + * returns - The decoded Token */ -export declare function decode( +export function decode( token: string, options?: DecodeOptions, ): null | { [key: string]: any } | string; - diff --git a/types/jsonwebtoken/jsonwebtoken-tests.ts b/types/jsonwebtoken/jsonwebtoken-tests.ts index f20fbba5cc..5884ff6d63 100644 --- a/types/jsonwebtoken/jsonwebtoken-tests.ts +++ b/types/jsonwebtoken/jsonwebtoken-tests.ts @@ -7,10 +7,10 @@ import jwt = require("jsonwebtoken"); import fs = require("fs"); -var token: string; -var cert: Buffer; +let token: string; +let cert: Buffer; -interface ITestObject { +interface TestObject { foo: string; } @@ -44,10 +44,10 @@ const secret = { key: privKey.toString(), passphrase: "keypwd" }; token = jwt.sign(testObject, secret, { algorithm: "RS256" }); // the algorithm option is mandatory in this case // sign asynchronously -jwt.sign(testObject, cert, { algorithm: "RS256" }, function( +jwt.sign(testObject, cert, { algorithm: "RS256" }, ( err: Error, token: string, -) { +) => { console.log(token); }); @@ -56,57 +56,70 @@ jwt.sign(testObject, cert, { algorithm: "RS256" }, function( * https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback */ // verify a token symmetric -jwt.verify(token, "shhhhh", function(err, decoded) { - const result = decoded as ITestObject; +jwt.verify(token, "shhhhh", (err, decoded) => { + const result = decoded as TestObject; console.log(result.foo); // bar }); // use external time for verifying -jwt.verify(token, 'shhhhh', { clockTimestamp: 1 }, function(err, decoded) { - const result = decoded as ITestObject +jwt.verify(token, 'shhhhh', { clockTimestamp: 1 }, (err, decoded) => { + const result = decoded as TestObject; - console.log(result.foo) // bar + console.log(result.foo); // bar }); // invalid token -jwt.verify(token, "wrong-secret", function(err, decoded) { +jwt.verify(token, "wrong-secret", (err, decoded) => { // err // decoded undefined }); // verify a token asymmetric cert = fs.readFileSync("public.pem"); // get public key -jwt.verify(token, cert, function(err, decoded) { - const result = decoded as ITestObject; +jwt.verify(token, cert, (err, decoded) => { + const result = decoded as TestObject; + + console.log(result.foo); // bar +}); + +// verify a token assymetric with async key fetch function +function getKey(header: jwt.JwtHeader, callback: jwt.SigningKeyCallback) { + cert = fs.readFileSync("public.pem"); + + callback(null, cert); +} + +jwt.verify(token, getKey, (err, decoded) => { + const result = decoded as TestObject; console.log(result.foo); // bar }); // verify audience cert = fs.readFileSync("public.pem"); // get public key -jwt.verify(token, cert, { audience: "urn:foo" }, function(err, decoded) { +jwt.verify(token, cert, { audience: "urn:foo" }, (err, decoded) => { // if audience mismatch, err == invalid audience }); // verify issuer cert = fs.readFileSync("public.pem"); // get public key -jwt.verify(token, cert, { audience: "urn:foo", issuer: "urn:issuer" }, function( +jwt.verify(token, cert, { audience: "urn:foo", issuer: "urn:issuer" }, ( err, decoded, -) { +) => { // if issuer mismatch, err == invalid issuer }); // verify algorithm cert = fs.readFileSync("public.pem"); // get public key -jwt.verify(token, cert, { algorithms: ["RS256"] }, function(err, decoded) { +jwt.verify(token, cert, { algorithms: ["RS256"] }, (err, decoded) => { // if algorithm mismatch, err == invalid algorithm }); // verify without expiration check cert = fs.readFileSync("public.pem"); // get public key -jwt.verify(token, cert, { ignoreExpiration: true }, function(err, decoded) { +jwt.verify(token, cert, { ignoreExpiration: true }, (err, decoded) => { // if ignoreExpration == false and token is expired, err == expired token }); @@ -114,7 +127,7 @@ jwt.verify(token, cert, { ignoreExpiration: true }, function(err, decoded) { * jwt.decode * https://github.com/auth0/node-jsonwebtoken#jwtdecodetoken */ -var decoded = jwt.decode(token); +let decoded = jwt.decode(token); decoded = jwt.decode(token, { complete: false }); diff --git a/types/jsonwebtoken/tslint.json b/types/jsonwebtoken/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/jsonwebtoken/tslint.json +++ b/types/jsonwebtoken/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/jspath/index.d.ts b/types/jspath/index.d.ts new file mode 100644 index 0000000000..3c5ae53121 --- /dev/null +++ b/types/jspath/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for jspath 0.4 +// Project: https://github.com/dfilatov/jspath +// Definitions by: Piot Roszatycki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * @param path path expression + * @param data input JSON document + * @param replacement substitutions + */ +export function apply(path: string, data: any, replacement?: any): any[]; diff --git a/types/jspath/jspath-tests.ts b/types/jspath/jspath-tests.ts new file mode 100644 index 0000000000..84e6f1c0e4 --- /dev/null +++ b/types/jspath/jspath-tests.ts @@ -0,0 +1,62 @@ +import * as JSPath from 'jspath'; + +// tslint:disable:object-literal-key-quotes + +JSPath.apply( + '.automobiles{.maker === "Honda" && .year > 2009}.model', + { + "automobiles" : [ + { "maker" : "Nissan", "model" : "Teana", "year" : 2011 }, + { "maker" : "Honda", "model" : "Jazz", "year" : 2010 }, + { "maker" : "Honda", "model" : "Civic", "year" : 2007 }, + { "maker" : "Toyota", "model" : "Yaris", "year" : 2008 }, + { "maker" : "Honda", "model" : "Accord", "year" : 2011 } + ], + "motorcycles" : [{ "maker" : "Honda", "model" : "ST1300", "year" : 2012 }] + } +); + +const doc = { + "books" : [ + { + "id" : 1, + "title" : "Clean Code", + "author" : { "name" : "Robert C. Martin" }, + "price" : 17.96 + }, + { + "id" : 2, + "title" : "Maintainable JavaScript", + "author" : { "name" : "Nicholas C. Zakas" }, + "price" : 10 + }, + { + "id" : 3, + "title" : "Agile Software Development", + "author" : { "name" : "Robert C. Martin" }, + "price" : 20 + }, + { + "id" : 4, + "title" : "JavaScript: The Good Parts", + "author" : { "name" : "Douglas Crockford" }, + "price" : 15.67 + } + ] +}; + +JSPath.apply('.books.author', doc); + +JSPath.apply('.books.author.name', doc); + +JSPath.apply('.books..name', doc); + +JSPath.apply('.books{.author.name === "Robert C. Martin"}.title', doc); + +JSPath.apply('.books{.price < 17}.title', doc); + +const path = '.books{.author.name === $author}.title'; + +JSPath.apply(path, doc, { author : 'Nicholas C. Zakas' }); + +JSPath.apply(path, doc, { author : ['Robert C. Martin', 'Douglas Crockford'] }); diff --git a/types/jspath/tsconfig.json b/types/jspath/tsconfig.json new file mode 100644 index 0000000000..38ab91e172 --- /dev/null +++ b/types/jspath/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jspath-tests.ts" + ] +} diff --git a/types/jspath/tslint.json b/types/jspath/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jspath/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jspdf/index.d.ts b/types/jspdf/index.d.ts index e393e5fba1..63789a7093 100644 --- a/types/jspdf/index.d.ts +++ b/types/jspdf/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for jsPDF v1.1.135 +// Type definitions for jsPDF 1.2 // Project: https://github.com/MrRio/jsPDF // Definitions by: Amber Schühmacher +// Kevin Gonnord +// Jackie Weng // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module 'jspdf' { @@ -32,7 +34,9 @@ declare module 'jspdf' { 'scaleFactor':number; 'pageSize': { width:number; + getWidth: () => number; height:number; + getHeight: () => number; }; 'output'(type:any, options:any):any; 'getNumberOfPages'():number; @@ -42,7 +46,7 @@ declare module 'jspdf' { 'getPageInfo'(pageNumberOneBased:number):any; 'getCurrentPageInfo'():any; }; - addPage(sizes?: number[]):jsPDF; + addPage(format?: string | number[], orientation?: 'p'|'portrait'|'l'|'landscape'): jsPDF; setPage(n:number):jsPDF; insertPage(beforePage:number):jsPDF; movePage(targetPage:number, beforePage:number):jsPDF; @@ -90,6 +94,7 @@ declare module 'jspdf' { * - split_text_to_size * - SVG * - total_pages + * - vfs */ // jsPDF plugin: addHTML @@ -201,8 +206,13 @@ declare module 'jspdf' { // jsPDF plugin: total_pages putTotalPages(pageExpression:string):jsPDF; + + // jsPDF plugin: vfs + existsFileInVFS(filename:string):boolean; + addFileToVFS(filename:string, filecontent:string):jsPDF; + getFileFromVFS(filename:string):string; } - + namespace jsPDF {} export = jsPDF; diff --git a/types/jspdf/jspdf-tests.ts b/types/jspdf/jspdf-tests.ts index 0f31005af9..ab6dd3a82a 100644 --- a/types/jspdf/jspdf-tests.ts +++ b/types/jspdf/jspdf-tests.ts @@ -13,6 +13,18 @@ function test_simple_two_page_document() { doc.save('Test.pdf'); } +function test_add_pages_with_different_format() { + var doc = new jsPDF(); + doc.text(20, 20, 'Hello world!'); + doc.addPage('a5', 'l'); + doc.text(20, 20, 'Do you like that?'); + doc.addPage('c6'); + doc.text(20, 20, 'Do you like that?'); + doc.addPage([595.28, 841.89]); + doc.text(20, 20, 'Do you like that?'); + doc.save('Test.pdf'); +} + function test_landscape() { var doc = new jsPDF('landscape'); doc.text(20, 20, 'Hello landscape world!'); diff --git a/types/jspdf/tslint.json b/types/jspdf/tslint.json index a41bf5d19a..a0357daa61 100644 --- a/types/jspdf/tslint.json +++ b/types/jspdf/tslint.json @@ -7,7 +7,6 @@ "ban-types": false, "callable-types": false, "comment-format": false, - "dt-header": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jsreport-html-embedded-in-docx/index.d.ts b/types/jsreport-html-embedded-in-docx/index.d.ts new file mode 100644 index 0000000000..6570649fb4 --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for jsreport-html-embedded-in-docx 1.0 +// Project: https://github.com/jsreport/jsreport-html-embedded-in-docx +// Definitions by: taoqf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { ExtensionDefinition } from 'jsreport-core'; + +declare module 'jsreport-core' { + interface Template { + recipe: 'html-embedded-in-docx' | string; + } +} + +declare function JsReportHtmlEmbeddedInDocx(): ExtensionDefinition; + +export = JsReportHtmlEmbeddedInDocx; diff --git a/types/jsreport-html-embedded-in-docx/jsreport-html-embedded-in-docx-tests.ts b/types/jsreport-html-embedded-in-docx/jsreport-html-embedded-in-docx-tests.ts new file mode 100644 index 0000000000..296553bdf7 --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/jsreport-html-embedded-in-docx-tests.ts @@ -0,0 +1,17 @@ +import JsReport = require('jsreport-core'); +import JsreportHtml2docx = require('jsreport-html-embedded-in-docx'); + +const jsreport = JsReport(); +jsreport.use(JsreportHtml2docx()); + +(async () => { + const content = `

      Hello

      `; + await jsreport.init(); + await jsreport.render({ + template: { + content, + engine: 'none', + recipe: 'html-embedded-in-docx' + } + }); +})(); diff --git a/types/jsreport-html-embedded-in-docx/tsconfig.json b/types/jsreport-html-embedded-in-docx/tsconfig.json new file mode 100644 index 0000000000..812be786ee --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "strictFunctionTypes": true, + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsreport-html-embedded-in-docx-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jsreport-html-embedded-in-docx/tslint.json b/types/jsreport-html-embedded-in-docx/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jss/css.d.ts b/types/jss/css.d.ts index 2d5e89139a..9bed74d702 100644 --- a/types/jss/css.d.ts +++ b/types/jss/css.d.ts @@ -3,7 +3,7 @@ import { Observable } from 'indefinite-observable'; import * as csstype from 'csstype'; -type Length = string | number; +export type Length = string | number; export type ObservableProperties

      = { [K in keyof P]: P[K] | Observable diff --git a/types/just-debounce-it/index.d.ts b/types/just-debounce-it/index.d.ts new file mode 100644 index 0000000000..248f6a27f8 --- /dev/null +++ b/types/just-debounce-it/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for just-debounce-it 1.1 +// Project: https://github.com/angus-c/just#readme +// Definitions by: Aziz Khambati +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +type ArgumentTypes = F extends (...args: infer A) => any ? A : never; + +/*~ This declaration specifies that the function + *~ is the exported object from the file + */ +export = debounce; + +declare function debounce( + fn: T, + wait?: 0, + callFirst?: boolean +): T; + +declare function debounce( + fn: T, + wait: number, + callFirst: true +): T; + +declare function debounce( + fn: T, + wait: number, + callFirst?: false +): (...args: ArgumentTypes) => void; diff --git a/types/just-debounce-it/just-debounce-it-tests.ts b/types/just-debounce-it/just-debounce-it-tests.ts new file mode 100644 index 0000000000..32dd33c9e7 --- /dev/null +++ b/types/just-debounce-it/just-debounce-it-tests.ts @@ -0,0 +1,23 @@ +import debounce = require("just-debounce-it"); + +const doThings = () => 1; + +const num: number = debounce(doThings)(); +const num2: number = debounce(doThings, 0)(); +const num3: number = debounce(doThings, 0, true)(); +const num4: number = debounce(doThings, 0, false)(); +const num5: number = debounce(doThings, 1000, true)(); + +// $ExpectType void +debounce(doThings, 1000)(); + +const exclaim = (a: string) => a + '!'; + +const str: string = debounce(exclaim)('hey'); +const str2: string = debounce(exclaim, 0)('hi'); +const str3: string = debounce(exclaim, 0, true)('hi'); +const str4: string = debounce(exclaim, 0, false)('hi'); +const str5: string = debounce(exclaim, 1000, true)('hooray'); + +// $ExpectType void +debounce(exclaim, 1000)('hello'); diff --git a/types/just-debounce-it/tsconfig.json b/types/just-debounce-it/tsconfig.json new file mode 100644 index 0000000000..d1a7dbd8b0 --- /dev/null +++ b/types/just-debounce-it/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "just-debounce-it-tests.ts" + ] +} diff --git a/types/just-debounce-it/tslint.json b/types/just-debounce-it/tslint.json new file mode 100644 index 0000000000..5bc412fb1e --- /dev/null +++ b/types/just-debounce-it/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": false + } +} diff --git a/types/just-pick/index.d.ts b/types/just-pick/index.d.ts new file mode 100644 index 0000000000..04836648cc --- /dev/null +++ b/types/just-pick/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for just-pick 2.1 +// Project: https://github.com/angus-c/just#readme +// Definitions by: Peter Safranek +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +declare function pick(obj: T, select: U[]): Pick; + +declare function pick(obj: T, select1: U, ...selectn: U[]): Pick; + +export = pick; diff --git a/types/just-pick/just-pick-tests.ts b/types/just-pick/just-pick-tests.ts new file mode 100644 index 0000000000..8f675a010c --- /dev/null +++ b/types/just-pick/just-pick-tests.ts @@ -0,0 +1,26 @@ +import pick = require("just-pick"); + +const a = "a"; +const b = "b"; +const c = "c"; +const obj = { a, b }; + +pick(obj, []); // $ExpectType Pick<{ a: string; b: string; }, never> +pick(obj, [a]); // $ExpectType Pick<{ a: string; b: string; }, "a"> +pick(obj, [a, a]); // $ExpectType Pick<{ a: string; b: string; }, "a"> +pick(obj, [a, b]); // $ExpectType Pick<{ a: string; b: string; }, "a" | "b"> +pick(obj, [a, b, c]); // $ExpectError + +pick(obj, a); // $ExpectType Pick<{ a: string; b: string; }, "a"> +pick(obj, a, a); // $ExpectType Pick<{ a: string; b: string; }, "a"> +pick(obj, a, b); // $ExpectType Pick<{ a: string; b: string; }, "a" | "b"> +pick(obj, a, b, c); // $ExpectError + +pick(); // $ExpectError +pick(obj); // $ExpectError +pick(obj, 0); // $ExpectError +pick(obj, false); // $ExpectError +pick(obj, null); // $ExpectError +pick(obj, undefined); // $ExpectError +pick(obj, {}); // $ExpectError +pick(obj, () => {}); // $ExpectError diff --git a/types/just-pick/tsconfig.json b/types/just-pick/tsconfig.json new file mode 100644 index 0000000000..860c7fa95d --- /dev/null +++ b/types/just-pick/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "just-pick-tests.ts" + ] +} diff --git a/types/just-pick/tslint.json b/types/just-pick/tslint.json new file mode 100644 index 0000000000..702f9354fc --- /dev/null +++ b/types/just-pick/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "file-name-casing": false + } +} diff --git a/types/jwt-express/tslint.json b/types/jwt-express/tslint.json index 3db14f85ea..1c36270d47 100644 --- a/types/jwt-express/tslint.json +++ b/types/jwt-express/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-angle-bracket-type-assertion": false + } +} diff --git a/types/karma-chai-sinon/index.d.ts b/types/karma-chai-sinon/index.d.ts index 1ce2672b23..0b14373a99 100644 --- a/types/karma-chai-sinon/index.d.ts +++ b/types/karma-chai-sinon/index.d.ts @@ -2,10 +2,10 @@ // Project: https://github.com/tubalmartin/karma-chai-sinon // Definitions by: Václav Ostrožlík // Definitions: https://github.com/borisyankov/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.0 /// -import Sinon = require("sinon"); +import Sinon = require('sinon'); declare global { var should: Chai.Should; diff --git a/types/karma-jasmine/index.d.ts b/types/karma-jasmine/index.d.ts index 46b7978251..73ca7a480e 100644 --- a/types/karma-jasmine/index.d.ts +++ b/types/karma-jasmine/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/karma-runner/karma-jasmine // Definitions by: Michel Salib // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.8 /// diff --git a/types/karma/index.d.ts b/types/karma/index.d.ts index 4b71c0a723..ba258f0997 100644 --- a/types/karma/index.d.ts +++ b/types/karma/index.d.ts @@ -1,15 +1,17 @@ -// Type definitions for karma 1.7 +// Type definitions for karma 3.0 // Project: https://github.com/karma-runner/karma // Definitions by: Tanguy Krotoff // James Garbutt +// Yaroslav Admin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 /// -// See Karma public API https://karma-runner.github.io/0.13/dev/public-api.html +// See Karma public API https://karma-runner.github.io/latest/dev/public-api.html import Promise = require('bluebird'); import https = require('https'); +import { Appender } from 'log4js'; declare namespace karma { interface Karma { @@ -57,17 +59,17 @@ declare namespace karma { interface LauncherStatic { generateId(): string; - //TODO: injector should be of type `di.Injector` + // TODO: injector should be of type `di.Injector` new (emitter: NodeJS.EventEmitter, injector: any): Launcher; } interface Launcher { Launcher: LauncherStatic; - //TODO: Can this return value ever be typified? + // TODO: Can this return value ever be typified? launch(names: string[], protocol: string, hostname: string, port: number, urlRoot: string): any[]; - kill(id: string, callback: Function): boolean; + kill(id: string, callback: () => void): boolean; restart(id: string): boolean; - killAll(callback: Function): void; + killAll(callback: () => void): void; areAllCaptured(): boolean; markCaptured(id: string): void; } @@ -80,15 +82,13 @@ declare namespace karma { run(options?: ConfigOptions | ConfigFile, callback?: ServerCallback): void; } - interface Stopper { /** - * This function will signal a running server to stop. The equivalent of karma stop. - */ + * This function will signal a running server to stop. The equivalent of karma stop. + */ stop(options?: ConfigOptions, callback?: ServerCallback): void; } - interface TestResults { disconnected: boolean; error: boolean; @@ -98,6 +98,8 @@ declare namespace karma { } interface Server extends NodeJS.EventEmitter { + // TODO: Figure out how to convert Server to class and remove suppression + // tslint:disable-next-line:no-misused-new new (options?: ConfigOptions | ConfigFile, callback?: ServerCallback): Server; /** * Start the server @@ -113,23 +115,21 @@ declare namespace karma { */ refreshFiles(): Promise; - on(event: string, listener: Function): this; + on(event: string, listener: (...args: any[]) => void): this; /** * Listen to the 'run_complete' event. */ on(event: 'run_complete', listener: (browsers: any, results: TestResults) => void): this; - ///** - // * Backward-compatibility with karma-intellij bundled with WebStorm. - // * Deprecated since version 0.13, to be removed in 0.14 - // */ - //static start(): void; + /** + * Backward-compatibility with karma-intellij bundled with WebStorm. + * Deprecated since version 0.13, to be removed in 0.14 + */ + // static start(): void; } - interface ServerCallback { - (exitCode: number): void; - } + type ServerCallback = (exitCode: number) => void; interface Config { set: (config: ConfigOptions) => void; @@ -144,16 +144,6 @@ declare namespace karma { configFile: string; } - // taken from log4js 1.x typings which are gone... - interface Log4jsAppenderConfigBase { - type: string; - category?: string; - layout?: { - type: string; - [key: string]: any - } - } - interface ConfigOptions { /** * @description Enable or disable watching files and executing the tests whenever one of these files changes. @@ -258,7 +248,7 @@ declare namespace karma { * @default [] * @description List of files/patterns to load in the browser. */ - files?: (FilePattern | string)[]; + files?: Array; /** * @default [] * @description List of test frameworks you want to use. Typically, you will set this to ['jasmine'], ['mocha'] or ['qunit']... @@ -294,7 +284,7 @@ declare namespace karma { * @default [{type: 'console'}] * @description A list of log appenders to be used. See the documentation for [log4js] for more information. */ - loggers?: Log4jsAppenderConfigBase[]; + loggers?: { [name: string]: Appender } | Appender[]; /** * @default [] * @description List of names of additional middleware you want the @@ -342,7 +332,7 @@ declare namespace karma { * but your interactive debugging does not. * */ - preprocessors?: { [name: string]: string | string[] } + preprocessors?: { [name: string]: string | string[] }; /** * @default 'http:' * Possible Values: @@ -359,7 +349,7 @@ declare namespace karma { * @default {} * @description A map of path-proxy pairs. */ - proxies?: { [path: string]: string } + proxies?: { [path: string]: string }; /** * @default true * @description Whether or not Karma or any browsers should raise an error when an inavlid SSL certificate is found. diff --git a/types/karma/karma-tests.ts b/types/karma/karma-tests.ts index a8adc36f45..4114a77b02 100644 --- a/types/karma/karma-tests.ts +++ b/types/karma/karma-tests.ts @@ -1,39 +1,34 @@ import gulp = require('gulp'); import karma = require('karma'); - function runKarma(singleRun: boolean): void { // MEMO: `start` method is deprecated since 0.13. It will be removed in 0.14. karma.server.start({ configFile: __dirname + '/karma.conf.js', - singleRun: singleRun + singleRun }); } gulp.task('test:unit:karma', gulp.parallel('build:test:unit', () => runKarma(true))); - - karma.server.start({port: 9876}, (exitCode: number) => { console.log('Karma has exited with ' + exitCode); process.exit(exitCode); }); - karma.runner.run({port: 9876}, (exitCode: number) => { console.log('Karma has exited with ' + exitCode); process.exit(exitCode); }); -karma.stopper.stop({port: 9876}, function(exitCode) { +karma.stopper.stop({port: 9876}, (exitCode) => { if (exitCode === 0) { - console.log('Server stop as initiated') + console.log('Server stop as initiated'); } - process.exit(exitCode) + process.exit(exitCode); }); -//var Server = require('karma').Server; => cannot use this syntax otherwise Server is of type any -var server = new karma.Server({logLevel: 'debug', port: 9876}, function(exitCode: number) { +const server = new karma.Server({logLevel: 'debug', port: 9876}, (exitCode: number) => { console.log('Karma has exited with ' + exitCode); process.exit(exitCode); }); @@ -42,7 +37,7 @@ server.start(); server.refreshFiles(); -server.on('browser_register', function (browser: any) { +server.on('browser_register', (browser: any) => { console.log('A new browser was registered'); }); @@ -54,19 +49,15 @@ server.on('run_complete', (browsers, results) => { results.success = 10; }); -//var runner = require('karma').runner; => cannot use this syntax otherwise runner is of type any -karma.runner.run({port: 9876}, function(exitCode: number) { +karma.runner.run({port: 9876}, (exitCode: number) => { console.log('Karma has exited with ' + exitCode); process.exit(exitCode); }); -// +const captured: boolean = karma.launcher.areAllCaptured(); -var captured: boolean = karma.launcher.areAllCaptured(); - - -// Example of configuration file karma.conf.ts, see http://karma-runner.github.io/0.13/config/configuration-file.html -module.exports = function(config: karma.Config) { +// Example of configuration file karma.conf.ts, see http://karma-runner.github.io/latest/config/configuration-file.html +module.exports = (config: karma.Config) => { config.set({ logLevel: config.LOG_DEBUG, basePath: '..', @@ -83,6 +74,10 @@ module.exports = function(config: karma.Config) { } ], + loggers: { + custom: { type: 'file', filename: 'log.txt' } + }, + reporters: [ 'progress', 'coverage' diff --git a/types/http-proxy-middleware/package.json b/types/karma/package.json similarity index 65% rename from types/http-proxy-middleware/package.json rename to types/karma/package.json index 0aa4cf368f..3daac433d0 100644 --- a/types/http-proxy-middleware/package.json +++ b/types/karma/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "winston": "^3.0.0" + "log4js": "^3.0.0" } } diff --git a/types/karma/tslint.json b/types/karma/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/karma/tslint.json +++ b/types/karma/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/karma/v1/index.d.ts b/types/karma/v1/index.d.ts new file mode 100644 index 0000000000..4b71c0a723 --- /dev/null +++ b/types/karma/v1/index.d.ts @@ -0,0 +1,485 @@ +// Type definitions for karma 1.7 +// Project: https://github.com/karma-runner/karma +// Definitions by: Tanguy Krotoff +// James Garbutt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +// See Karma public API https://karma-runner.github.io/0.13/dev/public-api.html +import Promise = require('bluebird'); +import https = require('https'); + +declare namespace karma { + interface Karma { + /** + * `start` method is deprecated since 0.13. It will be removed in 0.14. + * Please use + * + * server = new Server(config, [done]) + * server.start() + * + * instead. + */ + server: DeprecatedServer; + Server: Server; + runner: Runner; + stopper: Stopper; + launcher: Launcher; + VERSION: string; + constants: Constants; + } + + interface Constants { + VERSION: string; + DEFAULT_PORT: number; + DEFAULT_HOSTNAME: string; + DEFAULT_LISTEN_ADDR: string; + LOG_DISABLE: string; + LOG_ERROR: string; + LOG_WARN: string; + LOG_INFO: string; + LOG_DEBUG: string; + LOG_LOG: string; + LOG_PRIORITIES: string[]; + COLOR_PATTERN: string; + NO_COLOR_PATTERN: string; + CONSOLE_APPENDER: { + type: string; + layout: { + type: string; + pattern: string; + }; + }; + EXIT_CODE: string; + } + + interface LauncherStatic { + generateId(): string; + //TODO: injector should be of type `di.Injector` + new (emitter: NodeJS.EventEmitter, injector: any): Launcher; + } + + interface Launcher { + Launcher: LauncherStatic; + //TODO: Can this return value ever be typified? + launch(names: string[], protocol: string, hostname: string, port: number, urlRoot: string): any[]; + kill(id: string, callback: Function): boolean; + restart(id: string): boolean; + killAll(callback: Function): void; + areAllCaptured(): boolean; + markCaptured(id: string): void; + } + + interface DeprecatedServer { + start(options?: any, callback?: ServerCallback): void; + } + + interface Runner { + run(options?: ConfigOptions | ConfigFile, callback?: ServerCallback): void; + } + + + interface Stopper { + /** + * This function will signal a running server to stop. The equivalent of karma stop. + */ + stop(options?: ConfigOptions, callback?: ServerCallback): void; + } + + + interface TestResults { + disconnected: boolean; + error: boolean; + exitCode: number; + failed: number; + success: number; + } + + interface Server extends NodeJS.EventEmitter { + new (options?: ConfigOptions | ConfigFile, callback?: ServerCallback): Server; + /** + * Start the server + */ + start(): void; + /** + * Get properties from the injector + * @param token + */ + get(token: string): any; + /** + * Force a refresh of the file list + */ + refreshFiles(): Promise; + + on(event: string, listener: Function): this; + + /** + * Listen to the 'run_complete' event. + */ + on(event: 'run_complete', listener: (browsers: any, results: TestResults) => void): this; + + ///** + // * Backward-compatibility with karma-intellij bundled with WebStorm. + // * Deprecated since version 0.13, to be removed in 0.14 + // */ + //static start(): void; + } + + interface ServerCallback { + (exitCode: number): void; + } + + interface Config { + set: (config: ConfigOptions) => void; + LOG_DISABLE: string; + LOG_ERROR: string; + LOG_WARN: string; + LOG_INFO: string; + LOG_DEBUG: string; + } + + interface ConfigFile { + configFile: string; + } + + // taken from log4js 1.x typings which are gone... + interface Log4jsAppenderConfigBase { + type: string; + category?: string; + layout?: { + type: string; + [key: string]: any + } + } + + interface ConfigOptions { + /** + * @description Enable or disable watching files and executing the tests whenever one of these files changes. + * @default true + */ + autoWatch?: boolean; + /** + * @description When Karma is watching the files for changes, it tries to batch multiple changes into a single run + * so that the test runner doesn't try to start and restart running tests more than it should. + * The configuration setting tells Karma how long to wait (in milliseconds) after any changes have occurred + * before starting the test process again. + * @default 250 + */ + autoWatchBatchDelay?: number; + /** + * @default '' + * @description The root path location that will be used to resolve all relative paths defined in files and exclude. + * If the basePath configuration is a relative path then it will be resolved to + * the __dirname of the configuration file. + */ + basePath?: string; + /** + * @default 2000 + * @description How long does Karma wait for a browser to reconnect (in ms). + *

      + * With a flaky connection it is pretty common that the browser disconnects, + * but the actual test execution is still running without any problems. Karma does not treat a disconnection + * as immediate failure and will wait browserDisconnectTimeout (ms). + * If the browser reconnects during that time, everything is fine. + *

      + */ + browserDisconnectTimeout?: number; + /** + * @default 0 + * @description The number of disconnections tolerated. + *

      + * The disconnectTolerance value represents the maximum number of tries a browser will attempt + * in the case of a disconnection. Usually any disconnection is considered a failure, + * but this option allows you to define a tolerance level when there is a flaky network link between + * the Karma server and the browsers. + *

      + */ + browserDisconnectTolerance?: number; + /** + * @default 10000 + * @description How long will Karma wait for a message from a browser before disconnecting from it (in ms). + *

      + * If, during test execution, Karma does not receive any message from a browser within + * browserNoActivityTimeout (ms), it will disconnect from the browser + *

      + */ + browserNoActivityTimeout?: number; + /** + * @default [] + * Possible Values: + *
        + *
      • Chrome (launcher comes installed with Karma)
      • + *
      • ChromeCanary (launcher comes installed with Karma)
      • + *
      • PhantomJS (launcher comes installed with Karma)
      • + *
      • Firefox (launcher requires karma-firefox-launcher plugin)
      • + *
      • Opera (launcher requires karma-opera-launcher plugin)
      • + *
      • Internet Explorer (launcher requires karma-ie-launcher plugin)
      • + *
      • Safari (launcher requires karma-safari-launcher plugin)
      • + *
      + * @description A list of browsers to launch and capture. When Karma starts up, it will also start up each browser + * which is placed within this setting. Once Karma is shut down, it will shut down these browsers as well. + * You can capture any browser manually by opening the browser and visiting the URL where + * the Karma web server is listening (by default it is http://localhost:9876/). + */ + browsers?: string[]; + /** + * @default 60000 + * @description Timeout for capturing a browser (in ms). + *

      + * The captureTimeout value represents the maximum boot-up time allowed for a + * browser to start and connect to Karma. If any browser does not get captured within the timeout, Karma + * will kill it and try to launch it again and, after three attempts to capture it, Karma will give up. + *

      + */ + captureTimeout?: number; + client?: ClientOptions; + /** + * @default true + * @description Enable or disable colors in the output (reporters and logs). + */ + colors?: boolean; + /** + * @default 'Infinity' + * @description How many browsers Karma launches in parallel. + * Especially on services like SauceLabs and Browserstack, it makes sense only to launch a limited + * amount of browsers at once, and only start more when those have finished. Using this configuration, + * you can specify how many browsers should be running at once at any given point in time. + */ + concurrency?: number; + customLaunchers?: { [key: string]: CustomLauncher }; + /** + * @default [] + * @description List of files/patterns to exclude from loaded files. + */ + exclude?: string[]; + /** + * @default [] + * @description List of files/patterns to load in the browser. + */ + files?: (FilePattern | string)[]; + /** + * @default [] + * @description List of test frameworks you want to use. Typically, you will set this to ['jasmine'], ['mocha'] or ['qunit']... + * Please note just about all frameworks in Karma require an additional plugin/framework library to be installed (via NPM). + */ + frameworks?: string[]; + /** + * @default 'localhost' + * @description Hostname to be used when capturing browsers. + */ + hostname?: string; + /** + * @default {} + * @description Options object to be used by Node's https class. + * Object description can be found in the + * [NodeJS.org API docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener) + */ + httpsServerOptions?: https.ServerOptions; + /** + * @default config.LOG_INFO + * Possible values: + *
        + *
      • config.LOG_DISABLE
      • + *
      • config.LOG_ERROR
      • + *
      • config.LOG_WARN
      • + *
      • config.LOG_INFO
      • + *
      • config.LOG_DEBUG
      • + *
      + * @description Level of logging. + */ + logLevel?: string; + /** + * @default [{type: 'console'}] + * @description A list of log appenders to be used. See the documentation for [log4js] for more information. + */ + loggers?: Log4jsAppenderConfigBase[]; + /** + * @default [] + * @description List of names of additional middleware you want the + * Karma server to use. Middleware will be used in the order listed. + * You must have installed the middleware via a plugin/framework + * (either inline or via NPM). Additional information can be found in + * [plugins](http://karma-runner.github.io/2.0/config/plugins.html). + * The plugin must provide an express/connect middleware function + * (details about this can be found in the + * [Express](http://expressjs.com/guide/using-middleware.html) docs). + */ + middleware?: string[]; + /** + * @default {} + * @description Redefine default mapping from file extensions to MIME-type. + * Set property name to required MIME, provide Array of extensions (without dots) as it's value. + */ + mime?: {[type: string]: string[]}; + /** + * @default ['karma-*'] + * @description List of plugins to load. A plugin can be a string (in which case it will be required + * by Karma) or an inlined plugin - Object. + * By default, Karma loads all sibling NPM modules which have a name starting with karma-*. + * Note: Just about all plugins in Karma require an additional library to be installed (via NPM). + */ + plugins?: any[]; + /** + * @default 9876 + * @description The port where the web server will be listening. + */ + port?: number; + /** + * @default {'**\/*.coffee': 'coffee'} + * @description A map of preprocessors to use. + * + * Preprocessors can be loaded through [plugins]. + * + * Note: Just about all preprocessors in Karma (other than CoffeeScript and some other defaults) + * require an additional library to be installed (via NPM). + * + * Be aware that preprocessors may be transforming the files and file types that are available at run time. For instance, + * if you are using the "coverage" preprocessor on your source files, if you then attempt to interactively debug + * your tests, you'll discover that your expected source code is completely changed from what you expected. Because + * of that, you'll want to engineer this so that your automated builds use the coverage entry in the "reporters" list, + * but your interactive debugging does not. + * + */ + preprocessors?: { [name: string]: string | string[] } + /** + * @default 'http:' + * Possible Values: + *
        + *
      • http:
      • + *
      • https:
      • + *
      + * @description Protocol used for running the Karma webserver. + * Determines the use of the Node http or https class. + * Note: Using 'https:' requires you to specify httpsServerOptions. + */ + protocol?: string; + /** + * @default {} + * @description A map of path-proxy pairs. + */ + proxies?: { [path: string]: string } + /** + * @default true + * @description Whether or not Karma or any browsers should raise an error when an inavlid SSL certificate is found. + */ + proxyValidateSSL?: boolean; + /** + * @default 0 + * @description Karma will report all the tests that are slower than given time limit (in ms). + * This is disabled by default (since the default value is 0). + */ + reportSlowerThan?: number; + /** + * @default ['progress'] + * Possible Values: + *
        + *
      • dots
      • + *
      • progress
      • + *
      + * @description A list of reporters to use. + * Additional reporters, such as growl, junit, teamcity or coverage can be loaded through plugins. + * Note: Just about all additional reporters in Karma (other than progress) require an additional library to be installed (via NPM). + */ + reporters?: string[]; + /** + * @default false + * @description Continuous Integration mode. + * If true, Karma will start and capture all configured browsers, run tests and then exit with an exit code of 0 or 1 depending + * on whether all tests passed or any tests failed. + */ + singleRun?: boolean; + /** + * @default ['polling', 'websocket'] + * @description An array of allowed transport methods between the browser and testing server. This configuration setting + * is handed off to [socket.io](http://socket.io/) (which manages the communication + * between browsers and the testing server). + */ + transports?: string[]; + /** + * @default '/' + * @description The base url, where Karma runs. + * All of Karma's urls get prefixed with the urlRoot. This is helpful when using proxies, as + * sometimes you might want to proxy a url that is already taken by Karma. + */ + urlRoot?: string; + } + + interface ClientOptions { + /** + * @default undefined + * @description When karma run is passed additional arguments on the command-line, they + * are passed through to the test adapter as karma.config.args (an array of strings). + * The client.args option allows you to set this value for actions other than run. + * How this value is used is up to your test adapter - you should check your adapter's + * documentation to see how (and if) it uses this value. + */ + args?: string[]; + /** + * @default true + * @description Run the tests inside an iFrame or a new window + * If true, Karma runs the tests inside an iFrame. If false, Karma runs the tests in a new window. Some tests may not run in an + * iFrame and may need a new window to run. + */ + useIframe?: boolean; + /** + * @default true + * @description Capture all console output and pipe it to the terminal. + */ + captureConsole?: boolean; + /** + * @default false + * @description Run the tests on the same window as the client, without using iframe or a new window + */ + runInParent?: boolean; + /** + * @default true + * @description Clear the context window + * If true, Karma clears the context window upon the completion of running the tests. + * If false, Karma does not clear the context window upon the completion of running the tests. + * Setting this to false is useful when embedding a Jasmine Spec Runner Template. + */ + clearContext?: boolean; + } + + interface FilePattern { + /** + * The pattern to use for matching. This property is mandatory. + */ + pattern: string; + /** + * @default true + * @description If autoWatch is true all files that have set watched to true will be watched + * for changes. + */ + watched?: boolean; + /** + * @default true + * @description Should the files be included in the browser using header necessary for Browser Monitoring. - * - * This script must be manually injected into your templates, as high as possible - * in the header, but _after_ any X-UA-COMPATIBLE HTTP-EQUIV meta tags. - * Otherwise you may hurt IE! - * - * This method must be called _during_ a transaction, and must be called every - * time you want to generate the headers. - * - * Do *not* reuse the headers between users, or even between requests. - */ - getBrowserTimingHeader(): string; +/** + * If the URL for a transaction matches the provided pattern, ignore the transaction attached to that URL. + * + * Useful for filtering socket.io connections and other long-polling requests out of your agents to keep + * them from distorting an app's apdex or mean response time. + * + * Example: + * + * newrelic.addIgnoringRule('^/socket\\.io/') + */ +export function addIgnoringRule(pattern: RegExp | string): void; - /** - * Instrument a particular method to improve visibility into a transaction, - * or optionally turn it into a metric. - * - * The name defines a name for the segment. This name will be visible in transaction traces and - * as a new metric in the New Relic UI. - * The record flag defines whether the segment should be recorded as a metric. - * The handler is the function you want to track as a segment. - * The optional callback is a function passed to the handler to fire after its work is done. - * - * The agent begins timing the segment when startSegment is called. - * The segment is ended when either the handler finishes executing, or callback is fired, if it is provided. - * If a promise is returned from the handler, the segment's ending will be tied to that promise resolving or rejecting. - */ - startSegment>(name: string, record: boolean, handler: T): T; - startSegment any>(name: string, record: boolean, handler: (cb?: C) => T, callback?: C): T; +/** + * Get the header necessary for Browser Monitoring. + * + * This script must be manually injected into your templates, as high as possible + * in the header, but _after_ any X-UA-COMPATIBLE HTTP-EQUIV meta tags. + * Otherwise you may hurt IE! + * + * This method must be called _during_ a transaction, and must be called every + * time you want to generate the headers. + * + * Do *not* reuse the headers between users, or even between requests. + */ +export function getBrowserTimingHeader(): string; - /** - * Instrument a particular callback to improve visibility into a transaction. - * - * Use this API call to improve instrumentation of a particular method, or to track work across asynchronous - * boundaries by calling createTracer() in both the target function and its parent asynchronous function. - * - * The name will be visible in transaction traces and as a new metric in the New Relic UI. - * - * The agent begins timing the segment when createTracer is called, and ends the segment when the callback - * defined by the callback argument finishes executing. - * - * @deprecated - * This method has been deprecated in favor of newrelic.startSegment() - */ - createTracer any>(name: string, handle: T): T; +/** + * Instrument a particular method to improve visibility into a transaction, + * or optionally turn it into a metric. + * + * The name defines a name for the segment. This name will be visible in transaction traces and + * as a new metric in the New Relic UI. + * The record flag defines whether the segment should be recorded as a metric. + * The handler is the function you want to track as a segment. + * The optional callback is a function passed to the handler to fire after its work is done. + * + * The agent begins timing the segment when startSegment is called. + * The segment is ended when either the handler finishes executing, or callback is fired, if it is provided. + * If a promise is returned from the handler, the segment's ending will be tied to that promise resolving or rejecting. + */ +export function startSegment>(name: string, record: boolean, handler: T): T; +export function startSegment any>(name: string, record: boolean, handler: (cb?: C) => T, callback?: C): T; - /** - * Creates and starts a web transaction to record work done in the handle supplied. - * - * This transaction will run until the handle - * synchronously returns UNLESS: - * 1. The handle function returns a promise, where the end of the - * transaction will be tied to the end of the promise returned. - * 2. `getTransaction` is called in the handle, flagging the - * transaction as externally handled. In this case the transaction - * will be ended when `TransactionHandle#end` is called in the user's code. - * - * @example - * var newrelic = require('newrelic') - * newrelic.startWebTransaction('/some/url/path', function() { - * var transaction = newrelic.getTransaction() - * setTimeout(function() { - * // do some work - * transaction.end() - * }, 100) - * }) - * - * The `url` is used to name and group related transactions in APM, - * so it should be a generic name and not include any variable parameters. - */ - startWebTransaction(url: string, handle: (...args: any[]) => any): any; +/** + * Instrument a particular callback to improve visibility into a transaction. + * + * Use this API call to improve instrumentation of a particular method, or to track work across asynchronous + * boundaries by calling createTracer() in both the target function and its parent asynchronous function. + * + * The name will be visible in transaction traces and as a new metric in the New Relic UI. + * + * The agent begins timing the segment when createTracer is called, and ends the segment when the callback + * defined by the callback argument finishes executing. + * + * @deprecated + * This method has been deprecated in favor of newrelic.startSegment() + */ +export function createTracer any>(name: string, handle: T): T; - /** - * Creates and starts a background transaction to record work done in the handle supplied. - * - * This transaction will run until the handle - * synchronously returns UNLESS: - * 1. The handle function returns a promise, where the end of the - * transaction will be tied to the end of the promise returned. - * 2. `API#getTransaction` is called in the handle, flagging the - * transaction as externally handled. In this case the transaction - * will be ended when `TransactionHandle#end` is called in the user's code. - * - * @example - * var newrelic = require('newrelic') - * newrelic.startBackgroundTransaction('Red October', 'Subs', function() { - * var transaction = newrelic.getTransaction() - * setTimeout(function() { - * // do some work - * transaction.end() - * }, 100) - * }) - * - * The `url` is used to name and group related transactions in APM, - * so it should be a generic name and not include any variable parameters. - * - * The optional `group can be used for grouping background transactions in APM. - * For more information see: - * https://docs.newrelic.com/docs/apm/applications-menu/monitoring/transactions-page#txn-type-dropdown - */ - startBackgroundTransaction(name: string, handle: (...args: any[]) => any): any; - startBackgroundTransaction(name: string, group: string, handle: (...args: any[]) => any): any; +/** + * Creates and starts a web transaction to record work done in the handle supplied. + * + * This transaction will run until the handle + * synchronously returns UNLESS: + * 1. The handle function returns a promise, where the end of the + * transaction will be tied to the end of the promise returned. + * 2. `getTransaction` is called in the handle, flagging the + * transaction as externally handled. In this case the transaction + * will be ended when `TransactionHandle#end` is called in the user's code. + * + * @example + * var newrelic = require('newrelic') + * newrelic.startWebTransaction('/some/url/path', function() { + * var transaction = newrelic.getTransaction() + * setTimeout(function() { + * // do some work + * transaction.end() + * }, 100) + * }) + * + * The `url` is used to name and group related transactions in APM, + * so it should be a generic name and not include any variable parameters. + */ +export function startWebTransaction(url: string, handle: (...args: any[]) => any): any; - /** - * End the current web or background custom transaction. - * - * This method requires being in the correct transaction context when called. - */ - endTransaction(): void; +/** + * Creates and starts a background transaction to record work done in the handle supplied. + * + * This transaction will run until the handle + * synchronously returns UNLESS: + * 1. The handle function returns a promise, where the end of the + * transaction will be tied to the end of the promise returned. + * 2. `API#getTransaction` is called in the handle, flagging the + * transaction as externally handled. In this case the transaction + * will be ended when `TransactionHandle#end` is called in the user's code. + * + * @example + * var newrelic = require('newrelic') + * newrelic.startBackgroundTransaction('Red October', 'Subs', function() { + * var transaction = newrelic.getTransaction() + * setTimeout(function() { + * // do some work + * transaction.end() + * }, 100) + * }) + * + * The `url` is used to name and group related transactions in APM, + * so it should be a generic name and not include any variable parameters. + * + * The optional `group can be used for grouping background transactions in APM. + * For more information see: + * https://docs.newrelic.com/docs/apm/applications-menu/monitoring/transactions-page#txn-type-dropdown + */ +export function startBackgroundTransaction(name: string, handle: (...args: any[]) => any): any; +export function startBackgroundTransaction(name: string, group: string, handle: (...args: any[]) => any): any; - /** - * Record an event-based metric, usually associated with a particular duration. - * - * The `name` must be a string following standard metric naming rules. The `value` will - * usually be a number, but it can also be an object. - * * When `value` is a numeric value, it should represent the magnitude of a measurement - * associated with an event; for example, the duration for a particular method call. - * * When `value` is an object, it must contain count, total, min, max, and sumOfSquares - * keys, all with number values. This form is useful to aggregate metrics on your own - * and report them periodically; for example, from a setInterval. These values will - * be aggregated with any previously collected values for the same metric. The names - * of these keys match the names of the keys used by the platform API. - */ - recordMetric(name: string, value: number | Metric): void; +/** + * End the current web or background custom transaction. + * + * This method requires being in the correct transaction context when called. + */ +export function endTransaction(): void; - /** - * Update a metric that acts as a simple counter. - * - * The count of the selected metric will be incremented by the specified amount, defaulting to 1. - */ - incrementMetric(name: string, value?: number): void; +/** + * Record an event-based metric, usually associated with a particular duration. + * + * The `name` must be a string following standard metric naming rules. The `value` will + * usually be a number, but it can also be an object. + * * When `value` is a numeric value, it should represent the magnitude of a measurement + * associated with an event; for example, the duration for a particular method call. + * * When `value` is an object, it must contain count, total, min, max, and sumOfSquares + * keys, all with number values. This form is useful to aggregate metrics on your own + * and report them periodically; for example, from a setInterval. These values will + * be aggregated with any previously collected values for the same metric. The names + * of these keys match the names of the keys used by the platform API. + */ +export function recordMetric(name: string, value: number | Metric): void; - /** - * Record an event-based metric, usually associated with a particular duration. - * - * `eventType` must be an alphanumeric string less than 255 characters. - * The keys of `attributes` must be shorter than 255 characters. - */ - recordCustomEvent(eventType: string, attributes: { [keys: string]: boolean | number | string }): void; +/** + * Update a metric that acts as a simple counter. + * + * The count of the selected metric will be incremented by the specified amount, defaulting to 1. + */ +export function incrementMetric(name: string, value?: number): void; - /** - * Registers an instrumentation function. - * - * The provided onRequire callback will be fired when the given module is loaded with require. - * The moduleName parameter should be the string that will be passed to require; - * for example, 'express' or 'amqplib/callback_api'. - * - * The optional onError callback is called if the onRequire parameters throws an error. - * This is useful for debugging your instrumentation. - * - * Use this method to: - * - Add instrumentation for modules not currently instrumented by New Relic. - * - Instrument your own code. - * - Replace the Node.js agent's built-in instrumentation with your own. - */ - instrument: Instrument; +/** + * Record an event-based metric, usually associated with a particular duration. + * + * `eventType` must be an alphanumeric string less than 255 characters. + * The keys of `attributes` must be shorter than 255 characters. + */ +export function recordCustomEvent(eventType: string, attributes: { [keys: string]: boolean | number | string }): void; - /** - * Sets an instrumentation callback for a datastore module. - * - * This method is just like `instrument`, except it provides a datastore-service-specialized shim. - */ - instrumentDatastore: Instrument; +/** + * Registers an instrumentation function. + * + * The provided onRequire callback will be fired when the given module is loaded with require. + * The moduleName parameter should be the string that will be passed to require; + * for example, 'express' or 'amqplib/callback_api'. + * + * The optional onError callback is called if the onRequire parameters throws an error. + * This is useful for debugging your instrumentation. + * + * Use this method to: + * - Add instrumentation for modules not currently instrumented by New Relic. + * - Instrument your own code. + * - Replace the Node.js agent's built-in instrumentation with your own. + */ +export const instrument: Instrument; - /** - * Sets an instrumentation callback for a web framework module. - * - * This method is just like `instrument`, except it provides a web-framework-specialized shim. - */ - instrumentWebframework: Instrument; +/** + * Sets an instrumentation callback for a datastore module. + * + * This method is just like `instrument`, except it provides a datastore-service-specialized shim. + */ +export const instrumentDatastore: Instrument; - /** - * Sets an instrumentation callback for a message service client module. - * - * This method is just like `instrument`, except it provides a message-service-specialized shim. - */ - instrumentMessages: Instrument; +/** + * Sets an instrumentation callback for a web framework module. + * + * This method is just like `instrument`, except it provides a web-framework-specialized shim. + */ +export const instrumentWebframework: Instrument; - /** - * Gracefully shuts down the agent. - * - * If `collectPendingData` is true, the agent will send any pending data to the collector - * before shutting down. Defaults to `false`. - */ - shutdown(cb?: (error?: Error) => void): void; - shutdown(options?: { collectPendingData?: boolean, timeout?: number }, cb?: (error?: Error) => void): void; - } +/** + * Sets an instrumentation callback for a message service client module. + * + * This method is just like `instrument`, except it provides a message-service-specialized shim. + */ +export const instrumentMessages: Instrument; - interface Instrument { - (opts: { moduleName: string, onRequire: () => void, onError?: (err: Error) => void }): void; - (moduleName: string, onRequire: () => void, onError?: (err: Error) => void): void; - } +/** + * Gracefully shuts down the agent. + * + * If `collectPendingData` is true, the agent will send any pending data to the collector + * before shutting down. Defaults to `false`. + */ +export function shutdown(cb?: (error?: Error) => void): void; +export function shutdown(options?: { collectPendingData?: boolean, timeout?: number }, cb?: (error?: Error) => void): void; - interface Metric { - count: number; - total: number; - min: number; - max: number; - sumOfSquares: number; - } - - interface TransactionHandle { - /** - * End the transaction. - */ - end(callback?: () => any): void; - - /** - * Mark the transaction to be ignored. - */ - ignore(): void; - } +export interface Instrument { + (opts: { moduleName: string, onRequire: () => void, onError?: (err: Error) => void }): void; + (moduleName: string, onRequire: () => void, onError?: (err: Error) => void): void; +} + +export interface Metric { + count: number; + total: number; + min: number; + max: number; + sumOfSquares: number; +} + +export interface TransactionHandle { + /** + * End the transaction. + */ + end(callback?: () => any): void; + + /** + * Mark the transaction to be ignored. + */ + ignore(): void; } -declare const api: newrelic.NewRelicAPI; -export = api; diff --git a/types/newrelic/newrelic-tests.ts b/types/newrelic/newrelic-tests.ts index 3f99152c66..29eabfeb21 100644 --- a/types/newrelic/newrelic-tests.ts +++ b/types/newrelic/newrelic-tests.ts @@ -14,7 +14,9 @@ newrelic.setDispatcher("foo", "42"); // $ExpectType void newrelic.setControllerName("foo", "GET"); // $ExpectType void newrelic.addCustomAttribute("foo", "bar"); // $ExpectType void +newrelic.addCustomAttribute("foo", 42); // $ExpectType void newrelic.addCustomAttributes({ foo: "bar", baz: "bang" }); // $ExpectType void +newrelic.addCustomAttributes({ foo: "bar", baz: 42 }); // $ExpectType void newrelic.setIgnoreTransaction(true); // $ExpectType void diff --git a/types/next-redux-saga/index.d.ts b/types/next-redux-saga/index.d.ts new file mode 100644 index 0000000000..b7575fba16 --- /dev/null +++ b/types/next-redux-saga/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for next-redux-saga 3.0 +// Project: https://github.com/bmealhouse/next-redux-saga +// Definitions by: Leo Cavalcante +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ComponentType } from "react"; + +declare function nextReduxSaga

      (arg: { async: boolean }): ((BaseComponent: ComponentType

      ) => ComponentType

      ); +declare function nextReduxSaga

      (arg: ComponentType

      ): ComponentType

      ; + +export = nextReduxSaga; diff --git a/types/next-redux-saga/next-redux-saga-tests.tsx b/types/next-redux-saga/next-redux-saga-tests.tsx new file mode 100644 index 0000000000..c905971457 --- /dev/null +++ b/types/next-redux-saga/next-redux-saga-tests.tsx @@ -0,0 +1,65 @@ +import * as React from 'react'; +import withRedux from 'next-redux-wrapper'; +import withReduxSaga from 'next-redux-saga'; +import { createStore, Reducer, Store, AnyAction } from 'redux'; + +interface InitialState { + foo: string; +} + +const reducer: Reducer = (state: InitialState = { foo: '' }, action: AnyAction): InitialState => { + switch (action.type) { + case 'FOO': + return { ...state, foo: action.payload }; + default: + return state; + } +}; + +const makeStore = (initialState: InitialState): Store => { + return createStore(reducer, initialState); +}; + +interface OwnProps { + bar: string; +} + +interface Props { + foo: string; + custom: string; +} + +class Page extends React.Component { + static getInitialProps({ store, isServer, pathname, query }: any) { + store.dispatch({ type: 'FOO', payload: 'foo' }); + return { custom: 'custom' }; + } + render() { + return ( +

      +
      Prop from Redux {this.props.foo}
      +
      Prop from getInitialProps {this.props.custom}
      +
      + ); + } +} + +type ConnectStateProps = Props; +type DispatchProps = Props; +type MergedProps = Props; + +// Test various typings + +const Com1 = withRedux( + (initialState: InitialState, options) => { + if (options.isServer || options.req || options.query || options.res) { + const a = 1; + } + return createStore(reducer, initialState); + }, +)(withReduxSaga({ async: true })(Page)); + +const Com2 = withRedux(makeStore)(withReduxSaga(Page)); + +const com1Instance = (); +const com2Instance = (); diff --git a/types/next-redux-saga/package.json b/types/next-redux-saga/package.json new file mode 100644 index 0000000000..6d68bf2f9b --- /dev/null +++ b/types/next-redux-saga/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "redux": "^3.6.0" + } +} diff --git a/types/next-redux-saga/tsconfig.json b/types/next-redux-saga/tsconfig.json new file mode 100644 index 0000000000..2f57e82a4e --- /dev/null +++ b/types/next-redux-saga/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "next-redux-saga-tests.tsx" + ] +} diff --git a/types/next-redux-saga/tslint.json b/types/next-redux-saga/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/next-redux-saga/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/next-server/asset.d.ts b/types/next-server/asset.d.ts new file mode 100644 index 0000000000..d021de3929 --- /dev/null +++ b/types/next-server/asset.d.ts @@ -0,0 +1,2 @@ +export function setAssetPrefix(url: string): void; +export default function(path: string): string; diff --git a/types/next-server/config.d.ts b/types/next-server/config.d.ts new file mode 100644 index 0000000000..d2cc3cf6e2 --- /dev/null +++ b/types/next-server/config.d.ts @@ -0,0 +1,6 @@ +export interface RuntimeConfig { + serverRuntimeConfig: any; + publicRuntimeConfig?: any; +} +export function setConfig(configValue: any): void; +export default function(): RuntimeConfig; diff --git a/types/next-server/constants.d.ts b/types/next-server/constants.d.ts new file mode 100644 index 0000000000..d2dc74dad0 --- /dev/null +++ b/types/next-server/constants.d.ts @@ -0,0 +1,23 @@ +export const PHASE_EXPORT: string; +export const PHASE_PRODUCTION_BUILD: string; +export const PHASE_PRODUCTION_SERVER: string; +export const PHASE_DEVELOPMENT_SERVER: string; +export const PAGES_MANIFEST: string; +export const BUILD_MANIFEST: string; +export const REACT_LOADABLE_MANIFEST: string; +export const SERVER_DIRECTORY: string; +export const CONFIG_FILE: string; +export const BUILD_ID_FILE: string; +export const BLOCKED_PAGES: string[]; + +export const CLIENT_STATIC_FILES_PATH: string; +export const CLIENT_STATIC_FILES_RUNTIME: string; +export const CLIENT_STATIC_FILES_RUNTIME_PATH: string; +/** static/runtime/main.js */ +export const CLIENT_STATIC_FILES_RUNTIME_MAIN: string; +/** static/runtime/webpack.js */ +export const CLIENT_STATIC_FILES_RUNTIME_WEBPACK: string; +/** matches static//pages/.js */ +export const IS_BUNDLED_PAGE_REGEX: RegExp; +/** matches static//pages/:page*.js */ +export const ROUTE_NAME_REGEX: RegExp; diff --git a/types/next-server/dynamic.d.ts b/types/next-server/dynamic.d.ts new file mode 100644 index 0000000000..38a85bf77e --- /dev/null +++ b/types/next-server/dynamic.d.ts @@ -0,0 +1,42 @@ +import * as React from "react"; +import { + LoadableComponent, + CommonOptions as LoadableOptions, + LoadingComponentProps as LoadableLoadingComponentProps +} from "react-loadable"; + +type Omit = Pick>; + +type AsyncComponent

      = Promise>; +type AsyncComponentLoader

      = () => AsyncComponent

      ; +type ModuleMapping = Record; +type LoadedModuleMapping = Record; + +interface NextDynamicOptions

      extends Omit { + modules?: () => ModuleMapping; // overridden + loading?: LoadableOptions["loading"]; // optional + loader?: AsyncComponentLoader

      ; // optional, overriden + render?: (props: P, loaded: LoadedModuleMapping) => React.ReactNode; // optional, overriden + ssr?: boolean; + loadableGenerated?: { + webpack?: any; + modules?: any; + }; +} + +type DynamicComponent

      = React.ComponentType

      & LoadableComponent; + +/** + * Overloaded dynamic function. + * https://github.com/zeit/next.js/blob/7.0.0/lib/dynamic.js#L55 + */ +declare function dynamic

      ( + options: AsyncComponent

      | NextDynamicOptions

      +): DynamicComponent

      ; +declare function dynamic

      ( + asyncModule: AsyncComponent

      , + options: NextDynamicOptions

      +): DynamicComponent

      ; + +export type LoadingComponentProps = LoadableLoadingComponentProps; +export default dynamic; diff --git a/types/next-server/head.d.ts b/types/next-server/head.d.ts new file mode 100644 index 0000000000..8a8be730f8 --- /dev/null +++ b/types/next-server/head.d.ts @@ -0,0 +1,8 @@ +import * as React from "react"; + +export function defaultHead(className?: string): JSX.Element[]; +export default class Head extends React.Component { + static canUseDOM: boolean; + static peek(): Array>; + static rewind(): Array>; +} diff --git a/types/next-server/index.d.ts b/types/next-server/index.d.ts new file mode 100644 index 0000000000..6e8fcd3ed6 --- /dev/null +++ b/types/next-server/index.d.ts @@ -0,0 +1,125 @@ +// Type definitions for next-server 7.0 +// Project: https://github.com/zeit/next.js/packages/next-server +// Definitions by: Drew Hays +// Brice BERNARD +// James Hegedus +// Resi Respati +// Scott Jones +// Joao Vieira +// AJ Livingston +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +import * as http from "http"; +import { NextConfig } from "./next-config"; +import { UrlLike, DefaultQuery } from "./router"; + +declare namespace next { + interface RenderOptions { + staticMarkup: boolean; + distDir: string; + buildId: string; + generateETags: boolean; + runtimeConfig?: Record; + } + + /** + * Options passed to the Server constructor in Node.js. + */ + interface ServerOptions { + dev?: boolean; + dir?: string; + staticMarkup?: boolean; + quiet?: boolean; + conf?: NextConfig; + } + + interface ServerRoute

      { + match(pathname: string, params?: Partial

      ): P | false; + fn(req: http.IncomingMessage, res: http.ServerResponse, params: P, parsedUrl: UrlLike): Promise; + } + + interface ServerRouter { + routes: ServerRoute[]; + add(route: ServerRoute): void; + match(req: http.IncomingMessage, res: http.ServerResponse, parsedUrl: UrlLike): (() => Promise) | undefined; + } + + /** + * Next.js server instance API. + */ + interface Server { + dir: string; + quiet: boolean; + router: ServerRouter; + nextConfig: NextConfig; + distDir: string; + buildId: string; + renderOpts: RenderOptions; + + currentPhase(): string; + handleRequest( + req: http.IncomingMessage, + res: http.ServerResponse, + parsedUrl?: UrlLike + ): Promise; + getRequestHandler(): ( + req: http.IncomingMessage, + res: http.ServerResponse, + parsedUrl?: UrlLike + ) => Promise; + + setAssetPrefix(prefix: string): void; + prepare(): Promise; + close(): Promise; + setImmutableAssetCacheControl(res: http.ServerResponse): void; + generateRoutes(): ServerRoute[]; + run(req: http.IncomingMessage, res: http.ServerResponse, parsedUrl: UrlLike): Promise; + + render( + req: http.IncomingMessage, + res: http.ServerResponse, + pathname: string, + query?: DefaultQuery, + parsedUrl?: UrlLike + ): Promise; + renderToHTML( + req: http.IncomingMessage, + res: http.ServerResponse, + pathname: string, + query?: DefaultQuery + ): Promise; + renderError( + err: any, + req: http.IncomingMessage, + res: http.ServerResponse, + pathname: string, + query?: DefaultQuery + ): Promise; + renderErrorToHTML( + err: any, + req: http.IncomingMessage, + res: http.ServerResponse, + pathname: string, + query?: DefaultQuery + ): Promise; + render404( + req: http.IncomingMessage, + res: http.ServerResponse, + parsedUrl?: UrlLike + ): Promise; + + serveStatic( + req: http.IncomingMessage, + res: http.ServerResponse, + path: string + ): Promise; + isServeableUrl(path: string): boolean; + readBuildId(): string; + } +} + +declare function next(options?: next.ServerOptions): next.Server; +export = next; diff --git a/types/next-server/link.d.ts b/types/next-server/link.d.ts new file mode 100644 index 0000000000..520868f05f --- /dev/null +++ b/types/next-server/link.d.ts @@ -0,0 +1,17 @@ +import * as url from "url"; +import * as React from "react"; +import { UrlLike } from "./router"; + +export interface LinkProps { + prefetch?: boolean; + shallow?: boolean; + scroll?: boolean; + replace?: boolean; + onError?(error: any): void; + href?: string | UrlLike; + as?: string | UrlLike; + passHref?: boolean; + children: React.ReactElement; +} + +export default class Link extends React.Component {} diff --git a/types/next-server/next-config.d.ts b/types/next-server/next-config.d.ts new file mode 100644 index 0000000000..5a542abf29 --- /dev/null +++ b/types/next-server/next-config.d.ts @@ -0,0 +1,23 @@ +/** + * Next.js config schema. + * https://github.com/zeit/next.js/blob/7.0.0/server/config.js#L9 + */ +export interface NextConfig { + webpack?: any; + webpackDevMiddleware?: any; + poweredByHeader?: boolean; + distDir?: string; + assetPrefix?: string; + configOrigin?: string; + useFileSystemPublicRoutes?: boolean; + generateBuildId?: () => string; + generateEtags?: boolean; + pageExtensions?: string[]; + publicRuntimeConfig?: object; + serverRuntimeConfig?: object; + + // Plugin can define their own keys. + [key: string]: any; +} + +export default function(phase: string, dir: string, customConfig?: NextConfig): NextConfig; diff --git a/types/next-server/router.d.ts b/types/next-server/router.d.ts new file mode 100644 index 0000000000..af946608df --- /dev/null +++ b/types/next-server/router.d.ts @@ -0,0 +1,100 @@ +import * as React from "react"; +import * as url from "url"; + +type EventName = + | "routeChangeStart" + | "routeChangeComplete" + | "routeChangeError" + | "beforeHistoryChange" + | "hashChangeStart" + | "hashChangeComplete"; + +interface RouteChangeError { + cancelled: boolean; +} + +type EventHandler = (url: string) => any; +type ErrorEventHandler = (err: RouteChangeError, url: string) => any; + +export type UrlLike = url.UrlObject | url.Url; + +export interface EventChangeOptions { + shallow?: boolean; + [key: string]: any; +} + +export type PopStateCallback = (state: any) => boolean | undefined; + +export type RouterCallback = () => void; + +export type DefaultQuery = Record; + +export interface RouterProps { + // url property fields + readonly pathname: string; + readonly route: string; + readonly asPath?: string; + readonly query?: Q; + + // property fields + readonly components: { + [key: string]: { Component: React.ComponentType; err: any }; + }; + + // core method fields + back(): void; + beforePopState(cb: PopStateCallback): boolean; + prefetch(url: string): Promise>; + push( + url: string | UrlLike, + as?: string | UrlLike, + options?: EventChangeOptions + ): Promise; + reload(route: string): Promise; + replace( + url: string | UrlLike, + as?: string | UrlLike, + options?: EventChangeOptions + ): Promise; + + // events (deprecated soonish) + onBeforeHistoryChange?(as: string): void; + onHashChangeStart?(url: string): void; + onHashChangeComplete?(url: string): void; + onRouteChangeComplete?(url: string): void; + onRouteChangeError?(error: RouteChangeError, url: string): void; + onRouteChangeStart?(url: string): void; + + // events API (6.1.1+) + readonly events: { + on: (eventName: EventName, handler: EventHandler | ErrorEventHandler) => void; + off: (eventName: EventName, handler: (url: string) => any) => void; + }; +} + +export interface SingletonRouter extends RouterProps { + router: RouterProps | null; + readyCallbacks: RouterCallback[]; + ready(cb: RouterCallback): void; +} + +export interface WithRouterProps { + router?: SingletonRouter; +} + +/** + * Remove properties `K` from `T`. + * + * @internal + */ +export type Omit = T extends any ? Pick> : never; + +// Manually disabling the no-unnecessary-generics rule so users can +// retain type inference if they wrap their component in withRouter +// without defining props explicitly +export function withRouter( + Component: React.ComponentType> +): React.ComponentType>>; + +declare const Router: SingletonRouter; +export default Router; diff --git a/types/next-server/test/next-server-constants-tests.ts b/types/next-server/test/next-server-constants-tests.ts new file mode 100644 index 0000000000..6ebade7c9f --- /dev/null +++ b/types/next-server/test/next-server-constants-tests.ts @@ -0,0 +1,30 @@ +import { + PHASE_DEVELOPMENT_SERVER, + IS_BUNDLED_PAGE_REGEX +} from "next-server/constants"; + +const isIndexPage = IS_BUNDLED_PAGE_REGEX.test( + "static/CjW0mFnyG80HdP4eSUiy7/pages/index.js" +); + +// Example taken from: https://github.com/cyrilwanner/next-compose-plugins/blob/a25b313899638912cc9defc0be072f4fe4a1e855/README.md +const config = (nextConfig: any = {}) => { + return { + ...nextConfig, + + // define in which phases this plugin should get applied. + // you can also use multiple phases or negate them. + // however, users can still overwrite them in their configuration if they really want to. + phases: [PHASE_DEVELOPMENT_SERVER], + + webpack(config: any, options: any) { + // do something here which only gets applied during development server phase + + if (typeof nextConfig.webpack === "function") { + return nextConfig.webpack(config, options); + } + + return config; + } + }; +}; diff --git a/types/next-server/test/next-server-dynamic-tests.tsx b/types/next-server/test/next-server-dynamic-tests.tsx new file mode 100644 index 0000000000..b6e0b86fe6 --- /dev/null +++ b/types/next-server/test/next-server-dynamic-tests.tsx @@ -0,0 +1,65 @@ +import * as React from "react"; +import dynamic, { LoadingComponentProps } from "next-server/dynamic"; + +// You'd typically do this via import('./MyComponent') +interface MyComponentProps { + foo: string; +} +const MyComponent: React.StatelessComponent = () =>

      I'm async!
      ; +const asyncComponent = Promise.resolve(MyComponent); + +// Examples from +// https://github.com/zeit/next.js/#dynamic-import + +const LoadingComponent: React.StatelessComponent = ({ + isLoading, + error +}) =>

      loading...

      ; + +// 1. Basic Usage (Also does SSR) +const DynamicComponent = dynamic(asyncComponent); +const dynamicComponentJSX = ; + +// 2. With Custom Loading Component +const DynamicComponentWithCustomLoading = dynamic(asyncComponent, { + loading: LoadingComponent +}); +const dynamicComponentWithCustomLoadingJSX = ; + +// 3. With No SSR +const DynamicComponentWithNoSSR = dynamic(asyncComponent, { + ssr: false +}); + +// 4. With Multiple Modules At Once +const HelloBundle = dynamic({ + modules: () => { + const components = { + Hello1: asyncComponent, + Hello2: asyncComponent + }; + + return components; + }, + render: (props, { Hello1, Hello2 }) => ( +
      +

      {props.foo}

      + + +
      + ) +}); +const helloBundleJSX = ; + +// 5. With plain Loadable options +const LoadableComponent = dynamic({ + loader: () => asyncComponent, + loading: LoadingComponent, + delay: 200, + timeout: 10000 +}); + +// 6. No loading +const DynamicComponentWithNoLoading = dynamic(asyncComponent, { + loading: () => null +}); diff --git a/types/next-server/test/next-server-head-tests.tsx b/types/next-server/test/next-server-head-tests.tsx new file mode 100644 index 0000000000..bea5643cad --- /dev/null +++ b/types/next-server/test/next-server-head-tests.tsx @@ -0,0 +1,11 @@ +import Head, * as head from "next-server/head"; +import * as React from "react"; + +const elements: JSX.Element[] = head.defaultHead(); +const jsx = {elements}; + +if (!Head.canUseDOM) { + Head.rewind().map(x => [x.key, x.props, x.type]); +} + +Head.peek().map(x => [x.key, x.props, x.type]); diff --git a/types/next-server/test/next-server-link-tests.tsx b/types/next-server/test/next-server-link-tests.tsx new file mode 100644 index 0000000000..3d34ac54b4 --- /dev/null +++ b/types/next-server/test/next-server-link-tests.tsx @@ -0,0 +1,23 @@ +import Link from "next-server/link"; +import * as React from "react"; + +const links = ( +
      + { + console.log("Handled error!", e); + }} + prefetch + replace + scroll + shallow + > + Gotta link to somewhere! + + + All props are optional! + +
      +); diff --git a/types/next-server/test/next-server-router-tests.tsx b/types/next-server/test/next-server-router-tests.tsx new file mode 100644 index 0000000000..356a3be559 --- /dev/null +++ b/types/next-server/test/next-server-router-tests.tsx @@ -0,0 +1,157 @@ +import Router, { withRouter, WithRouterProps } from "next-server/router"; +import * as React from "react"; +import * as qs from "querystring"; + +Router.readyCallbacks.push(() => { + console.log("I'll get called when the router initializes."); +}); +Router.ready(() => { + console.log( + "I'll get called immediately if the router initializes, or when it eventually does.", + ); +}); + +// Access readonly properties of the router. + +Object.keys(Router.components).forEach(key => { + const c = Router.components[key]; + c.err.isAnAny; + + return ; +}); + +function split(routeLike: string) { + routeLike.split("/").forEach(part => { + console.log("path part: ", part); + }); +} + +if (Router.asPath) { + split(Router.asPath); + split(Router.asPath); +} + +split(Router.pathname); + +const query = `?${qs.stringify(Router.query)}`; + +// Assign some callback methods. +Router.events.on('routeChangeStart', (url: string) => console.log("Route is starting to change.", url)); +Router.events.on('beforeHistoryChange', (as: string) => console.log("History hasn't changed yet.", as)); +Router.events.on('routeChangeComplete', (url: string) => console.log("Route change is complete.", url)); +Router.events.on('routeChangeError', (err: any, url: string) => console.log("Route change errored.", err, url)); + +// Call methods on the router itself. +Router.reload("/route").then(() => console.log("route was reloaded")); +Router.back(); +Router.beforePopState(({ url }) => !!url); + +Router.push("/route").then((success: boolean) => + console.log("route push success: ", success), +); +Router.push("/route", "/asRoute").then((success: boolean) => + console.log("route push success: ", success), +); +Router.push("/route", "/asRoute", { shallow: false }).then((success: boolean) => + console.log("route push success: ", success), +); + +Router.replace("/route").then((success: boolean) => + console.log("route replace success: ", success), +); +Router.replace("/route", "/asRoute").then((success: boolean) => + console.log("route replace success: ", success), +); +Router.replace("/route", "/asRoute", { + shallow: false, +}).then((success: boolean) => console.log("route replace success: ", success)); + +Router.prefetch("/route").then(Component => { + const element = ; +}); + +interface TestComponentProps extends WithRouterProps { + testValue: string; +} + +class TestComponent extends React.Component { + state = { ready: false }; + + constructor(props: TestComponentProps) { + super(props); + if (props.router) { + props.router.ready(() => { + this.setState({ ready: true }); + }); + } + } + + render() { + return ( +
      +

      {this.state.ready ? 'Ready' : 'Not Ready'}

      +

      Route: {this.props.router ? this.props.router.route : ""}

      +

      Another prop: {this.props.testValue}

      +
      + ); + } +} + +withRouter(TestComponent); + +interface TestComponent2Props extends WithRouterProps { + testValue: string; +} + +class TestComponent2 extends React.Component { + state = { ready: false }; + + constructor(props: TestComponent2Props) { + super(props); + if (props.router) { + props.router.ready(() => { + this.setState({ ready: true }); + }); + } + } + + render() { + return ( +
      +

      {this.state.ready ? 'Ready' : 'Not Ready'}

      +

      Route: {this.props.router ? this.props.router.route : ""}

      +

      Another prop: {this.props.testValue}

      +
      + ); + } +} + +const TestComponent2WithRouter = withRouter(TestComponent2); +const res = ; + +interface TestSFCQuery { + test?: string; +} + +interface TestSFCProps extends WithRouterProps { + testProp: string; +} + +const TestSFC: React.SFC = ({ router }) => { + return
      {router && router.query && router.query.test}
      ; +}; +const TestSFCComponent = withRouter(TestSFC); + +const res2 = ; + +const TestSFC2 = withRouter(({ router }) => { + return
      {router && router.query && router.query.test}
      ; +}); + +const res3 = ; + +const TestSFC3 = withRouter(({ router }) => { + return
      {router && router.query && router.query.test}
      ; +}); + +const res4 = ; diff --git a/types/next-server/test/next-server-tests.ts b/types/next-server/test/next-server-tests.ts new file mode 100644 index 0000000000..7b4bfcca74 --- /dev/null +++ b/types/next-server/test/next-server-tests.ts @@ -0,0 +1,92 @@ +import createServer = require("next-server"); +import * as http from "http"; +import * as url from "url"; + +const defaultServer: createServer.Server = createServer(); +const server = createServer({ + dir: "..", + quiet: true, + conf: { + distDir: "./dist", + useFileSystemPublicRoutes: false, + anotherProperty: { + key: true + } + } +}); + +const devServer = createServer({ + dev: true, + dir: "..", + quiet: true, + conf: { + distDir: "./dist", + useFileSystemPublicRoutes: false, + anotherProperty: { + key: true + } + } +}); + +const { + dir, + quiet, + router, + nextConfig, + distDir, + buildId + } = server; + const { assetPrefix } = nextConfig; + const voidFunc = () => {}; + +server.prepare().then(voidFunc); +server.close().then(voidFunc); + +const parsedUrl = url.parse("https://www.example.com"); +const handler = server.getRequestHandler(); + +function handle(req: http.IncomingMessage, res: http.ServerResponse) { + handler(req, res); + handler(req, res, parsedUrl).then(voidFunc); + server.run(req, res, parsedUrl).then(voidFunc); + + server.render(req, res, "/path/to/resource").then(voidFunc); + server.render(req, res, "/path/to/resource", {}, parsedUrl).then(voidFunc); + server + .render(req, res, "/path/to/resource", { key: "value" }, parsedUrl) + .then(voidFunc); + server + .renderError(new Error(), req, res, "/path/to/resource") + .then(voidFunc); + server + .renderError(new Error(), req, res, "/path/to/resource", { + key: "value", + }) + .then(voidFunc); + server + .renderError( + "this can be an error, too!", + req, + res, + "/path/to/resource", + { key: "value" }, + ) + .then(voidFunc); + server.render404(req, res, parsedUrl).then(voidFunc); + + server + .renderToHTML(req, res, "/path/to/resource", { foo: "bar" }) + .then(x => x.split("\n")); + server + .renderErrorToHTML(new Error(), req, res, "/path/to/resource", { + foo: "bar", + }) + .then(x => x.split("\n")); + + server.serveStatic(req, res, "/path/to/thing").then(voidFunc); + + let b: boolean; + b = server.isServeableUrl("/path/to/thing"); + + const s: string = server.readBuildId(); +} diff --git a/types/next-server/tsconfig.json b/types/next-server/tsconfig.json new file mode 100644 index 0000000000..4d72dadef2 --- /dev/null +++ b/types/next-server/tsconfig.json @@ -0,0 +1,38 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "target": "es6", + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "asset.d.ts", + "config.d.ts", + "constants.d.ts", + "dynamic.d.ts", + "head.d.ts", + "link.d.ts", + "next-config.d.ts", + "router.d.ts", + "test/next-server-tests.ts", + "test/next-server-constants-tests.ts", + "test/next-server-head-tests.tsx", + "test/next-server-link-tests.tsx", + "test/next-server-dynamic-tests.tsx", + "test/next-server-router-tests.tsx" + ] +} diff --git a/types/next-server/tslint.json b/types/next-server/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/next-server/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/next/app.d.ts b/types/next/app.d.ts index eea2af428b..392b997f89 100644 --- a/types/next/app.d.ts +++ b/types/next/app.d.ts @@ -19,6 +19,14 @@ export interface NextAppContext { ctx: NextContext; } +/** + * Initial Props returned from base App class. + * https://github.com/zeit/next.js/blob/7.0.0/lib/app.js#L16 + */ +export interface DefaultAppIProps { + pageProps: any; +} + /** * Props passed to the App component. * Component and pageProps are dynamic - cannot infer type. @@ -28,19 +36,23 @@ export interface NextAppContext { export interface AppProps { Component: NextComponentType>; router: RouterProps; - pageProps: any; } /** * App component type. Differs from the default type because the context it passes * to getInitialProps and the props is passes to the component are different. * + * @template P Component props. * @template IP Initial props returned from getInitialProps. * @template C Context passed to getInitialProps. */ -export type AppComponentType = NextComponentType; +export type AppComponentType

      = NextComponentType< + P & AppProps, + IP, + C +>; export class Container extends React.Component {} -export default class App

      extends React.Component

      { - static getInitialProps(context: NextAppContext): Promise<{ pageProps: any }>; +export default class App

      extends React.Component

      { + static getInitialProps(context: NextAppContext): Promise; } diff --git a/types/next/config.d.ts b/types/next/config.d.ts index 1b2e330bb0..f9fea12cbd 100644 --- a/types/next/config.d.ts +++ b/types/next/config.d.ts @@ -1 +1,2 @@ -export default function(): {serverRuntimeConfig: any, publicRuntimeConfig: any}; +export * from 'next-server/config'; +export { default } from 'next-server/config'; diff --git a/types/next/constants.d.ts b/types/next/constants.d.ts new file mode 100644 index 0000000000..d0d2e2361e --- /dev/null +++ b/types/next/constants.d.ts @@ -0,0 +1 @@ +export * from 'next-server/constants'; diff --git a/types/next/document.d.ts b/types/next/document.d.ts index 8296a8f136..9ac8985cdf 100644 --- a/types/next/document.d.ts +++ b/types/next/document.d.ts @@ -3,14 +3,9 @@ import { NextContext, NextComponentType } from "."; import { DefaultQuery } from "./router"; export interface RenderPageResponse { - buildManifest: { [key: string]: any }; - chunks: { - names: string[]; - filenames: string[]; - }; + buildManifest: Record; html?: string; - head: Array>; - errorHtml: string; + head?: Array>; } export interface PageProps { @@ -38,24 +33,43 @@ export interface NextDocumentContext exte } /** - * Props passed to the Document component. + * Initial Props returned from base Document class. + * https://github.com/zeit/next.js/blob/7.0.0/server/document.js#L16 */ -export interface DocumentProps { - __NEXT_DATA__?: any; - dev?: boolean; - chunks?: { - names: string[]; - filenames: string[]; +export interface DefaultDocumentIProps extends RenderPageResponse { + styles?: React.ReactNode; +} + +/** + * Props passed to the Document component. + * https://github.com/zeit/next.js/blob/7.0.0/server/render.js#L165 + */ +export interface DocumentProps { + __NEXT_DATA__: { + props: any; + page: string; + pathname: string; + query: Q; + buildId: string; + assetPrefix?: string; + runtimeConfig?: any; + nextExport?: boolean; + err?: any; + [key: string]: any; }; - html?: string; - head?: Array>; - errorHtml?: string; - styles?: Array>; - [key: string]: any; + dev: boolean; + dir?: string; + staticMarkup: boolean; + buildManifest: Record; + devFiles: string[]; + files: string[]; + dynamicImports: string[]; + assetPrefix: string; } /** * Props supported by the Head component. + * https://github.com/zeit/next.js/blob/7.0.0/server/document.js#L42 */ export interface HeadProps { nonce?: string; @@ -64,6 +78,7 @@ export interface HeadProps { /** * Props supported by the NextScript component. + * https://github.com/zeit/next.js/blob/7.0.0/server/document.js#L141 */ export interface NextScriptProps { nonce?: string; @@ -74,11 +89,12 @@ export interface NextScriptProps { * Document component type. Differs from the default type because the context it passes * to getInitialProps and the props is passes to the component are different. * + * @template P Component props. * @template IP Initial props returned from getInitialProps. * @template C Context passed to getInitialProps. */ -export type DocumentComponentType = NextComponentType< - IP & DocumentProps, +export type DocumentComponentType

      = NextComponentType< + P & DocumentProps, IP, C >; @@ -86,6 +102,10 @@ export type DocumentComponentType = NextCompon export class Head extends React.Component {} export class Main extends React.Component {} export class NextScript extends React.Component {} -export default class Document

      extends React.Component

      { - static getInitialProps(context: NextDocumentContext): DocumentProps; +export default class Document

      extends React.Component< + P & DefaultDocumentIProps & DocumentProps +> { + static getInitialProps( + context: NextDocumentContext + ): DefaultDocumentIProps | Promise; } diff --git a/types/next/dynamic.d.ts b/types/next/dynamic.d.ts index 62d53f1e72..0b10e6238e 100644 --- a/types/next/dynamic.d.ts +++ b/types/next/dynamic.d.ts @@ -1,29 +1,2 @@ -import * as React from "react"; - -export interface DynamicOptions { - loading?: React.ComponentType; - ssr?: boolean; - modules?( - props: TCProps & TLProps, - ): { [key: string]: Promise> }; - render?( - props: TCProps & TLProps, - modules: { [key: string]: React.ComponentType }, - ): void; -} - -export class SameLoopPromise extends Promise { - constructor( - executor: ( - resolve: (value?: T) => void, - reject: (reason?: any) => void, - ) => void, - ); - setResult(value: T): void; - setError(value: any): void; - runIfNeeded(): void; -} -export default function( - componentPromise: Promise>, - options?: DynamicOptions, -): React.ComponentType; +export * from 'next-server/dynamic'; +export { default } from 'next-server/dynamic'; diff --git a/types/next/error.d.ts b/types/next/error.d.ts index d05d25b9c8..8ad2226f07 100644 --- a/types/next/error.d.ts +++ b/types/next/error.d.ts @@ -1,2 +1,14 @@ import * as React from "react"; -export default class extends React.Component<{ statusCode: number }> {} +import { NextContext } from "."; + +/** + * Initial props returned from base Error class. + * https://github.com/zeit/next.js/blob/7.0.0/lib/error.js#L7 + */ +export interface DefaultErrorIProps { + statusCode: number; +} + +export default class Error

      extends React.Component

      { + static getInitialProps(context: NextContext): Promise | DefaultErrorIProps; +} diff --git a/types/next/head.d.ts b/types/next/head.d.ts index 24fab7a076..616f88775c 100644 --- a/types/next/head.d.ts +++ b/types/next/head.d.ts @@ -1,8 +1,2 @@ -import * as React from "react"; - -export function defaultHead(): JSX.Element[]; -export default class extends React.Component { - static canUseDOM: boolean; - static peek(): Array>; - static rewind(): Array>; -} +export * from 'next-server/head'; +export { default } from 'next-server/head'; diff --git a/types/next/index.d.ts b/types/next/index.d.ts index f4b7affedd..4dc0b49d07 100644 --- a/types/next/index.d.ts +++ b/types/next/index.d.ts @@ -1,11 +1,12 @@ -// Type definitions for next 6.1 -// Project: https://github.com/zeit/next.js +// Type definitions for next 7.0 +// Project: https://github.com/zeit/next.js/packages/next // Definitions by: Drew Hays // Brice BERNARD // James Hegedus // Resi Respati // Scott Jones // Joao Vieira +// AJ Livingston // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -13,23 +14,27 @@ import * as http from "http"; import * as url from "url"; - +import { Server as NextServer, ServerOptions as NextServerOptions, RenderOptions } from 'next-server'; +import { NextConfig as NextServerConfig } from 'next-server/next-config'; import { Response as NodeResponse } from "node-fetch"; - -import { SingletonRouter, DefaultQuery } from "./router"; +import { SingletonRouter, DefaultQuery, UrlLike } from "./router"; declare namespace next { + // Moved to next-server + type NextConfig = NextServerConfig; + type Server = NextServer; + type ServerOptions = NextServerOptions; + // End Moved to next-server + // Deprecated type QueryStringMapObject = DefaultQuery; type ServerConfig = NextConfig; // End Deprecated - type UrlLike = url.UrlObject | url.Url; - /** * Context object used in methods like `getInitialProps()` - * https://github.com/zeit/next.js/blob/6.1.1/server/render.js#L77 - * https://github.com/zeit/next.js/blob/6.1.1/readme.md#fetching-data-and-component-lifecycle + * https://github.com/zeit/next.js/blob/7.0.0/server/render.js#L97 + * https://github.com/zeit/next.js/blob/7.0.0/README.md#fetching-data-and-component-lifecycle * * @template Q Query object schema. */ @@ -51,130 +56,22 @@ declare namespace next { } /** - * Next.js config schema. - * https://github.com/zeit/next.js/blob/6.1.1/server/config.js#L10 + * Next.js dev server instance API. */ - interface NextConfig { - webpack?: any; - webpackDevMiddleware?: any; - poweredByHeader?: boolean; - distDir?: string; - assetPrefix?: string; - configOrigin?: string; - useFileSystemPublicRoutes?: boolean; - generateBuildId?: () => string; - generateEtags?: boolean; - pageExtensions?: string[]; - publicRuntimeConfig?: object; - serverRuntimeConfig?: object; - - // Plugin can define their own keys. - [key: string]: any; - } - - /** - * Options passed to the Server constructor in Node.js. - * https://github.com/zeit/next.js/blob/6.1.1/server/index.js#L30 - */ - interface ServerOptions { - dir?: string; - dev?: boolean; - staticMarkup?: boolean; - quiet?: boolean; - conf?: NextConfig; - } - - /** - * Next.js server instance API. - */ - interface Server { - // From constructor - // https://github.com/zeit/next.js/blob/6.1.1/server/index.js#L30 - dir: string; - dev: boolean; - quiet: boolean; - router: SingletonRouter; - http: null | http.Server; - nextConfig: NextConfig; - distDir: string; - buildId: string; + interface DevServer extends Server { hotReloader: any; - renderOpts: { - dev: string; - staticMarkup: boolean; - distDir: string; + renderOpts: RenderOptions & { + dev: true; hotReloader: any; - buildId: string; - availableChunks: object; - generateETags: boolean; - runtimeConfig?: object; }; getHotReloader( dir: string, options: { quiet: boolean; config: NextConfig; buildId: string } ): any; - handleRequest( - req: http.IncomingMessage, - res: http.ServerResponse, - parsedUrl?: UrlLike - ): Promise; - getRequestHandler(): ( - req: http.IncomingMessage, - res: http.ServerResponse, - parsedUrl?: UrlLike - ) => Promise; - setAssetPrefix(prefix: string): void; - prepare(): Promise; - close(): Promise; - defineRoutes(): Promise; - start(): Promise; - run(req: http.IncomingMessage, res: http.ServerResponse, parsedUrl: UrlLike): Promise; - - render( - req: http.IncomingMessage, - res: http.ServerResponse, - pathname: string, - query?: DefaultQuery, - parsedUrl?: UrlLike - ): Promise; - renderToHTML( - req: http.IncomingMessage, - res: http.ServerResponse, - pathname: string, - query?: DefaultQuery - ): Promise; - renderError( - err: any, - req: http.IncomingMessage, - res: http.ServerResponse, - pathname: string, - query?: DefaultQuery - ): Promise; - renderErrorToHTML( - err: any, - req: http.IncomingMessage, - res: http.ServerResponse, - pathname: string, - query?: DefaultQuery - ): Promise; - render404( - req: http.IncomingMessage, - res: http.ServerResponse, - parsedUrl?: UrlLike - ): Promise; - - serveStatic( - req: http.IncomingMessage, - res: http.ServerResponse, - path: string - ): Promise; - isServeableUrl(path: string): boolean; - readBuildId(): string; - handleBuildId(buildId: string, res: http.ServerResponse): boolean; + addExportPathMapRoutes(): Promise; getCompilationError(): Promise; - send404(res: http.ServerResponse): void; } /** @@ -221,5 +118,6 @@ declare namespace next { } } +declare function next(options?: next.ServerOptions & { dev: true }): next.DevServer; declare function next(options?: next.ServerOptions): next.Server; export = next; diff --git a/types/next/link.d.ts b/types/next/link.d.ts index 36c2e33546..04c383e914 100644 --- a/types/next/link.d.ts +++ b/types/next/link.d.ts @@ -1,17 +1,8 @@ -import * as url from "url"; -import * as React from "react"; +import { LinkProps } from 'next-server/link'; -export type UrlLike = url.UrlObject | url.Url; -export interface LinkState { - prefetch?: boolean; - shallow?: boolean; - scroll?: boolean; - replace?: boolean; - onError?(error: any): void; - href?: string | UrlLike; - as?: string | UrlLike; - passHref?: boolean; - children: React.ReactElement; -} +// Deprecated +export type LinkState = LinkProps; +// End Deprecated -export default class extends React.Component {} +export * from 'next-server/link'; +export { default } from 'next-server/link'; diff --git a/types/next/router.d.ts b/types/next/router.d.ts index 2039b213f8..8fd3df698b 100644 --- a/types/next/router.d.ts +++ b/types/next/router.d.ts @@ -1,94 +1,2 @@ -import * as React from "react"; -import * as url from "url"; - -type UrlLike = url.UrlObject | url.Url; - -type EventName = 'routeChangeStart' - | 'routeChangeComplete' - | 'routeChangeError' - | 'beforeHistoryChange' - | 'hashChangeStart' - | 'hashChangeComplete'; - -interface RouteChangeError { - cancelled: boolean; -} - -type EventHandler = (url: string) => any; -type ErrorEventHandler = (err: RouteChangeError, url: string) => any; - -export interface EventChangeOptions { - shallow?: boolean; - [key: string]: any; -} - -export type PopStateCallback = (state: any) => boolean | undefined; - -export type RouterCallback = () => void; - -export type DefaultQuery = Record; - -export interface RouterProps { - // url property fields - readonly pathname: string; - readonly route: string; - readonly asPath?: string; - readonly query?: Q; - - // property fields - readonly components: { - [key: string]: { Component: React.ComponentType; err: any }; - }; - - // core method fields - back(): void; - beforePopState(cb: PopStateCallback): boolean; - prefetch(url: string): Promise>; - push( - url: string | UrlLike, - as?: string | UrlLike, - options?: EventChangeOptions, - ): Promise; - reload(route: string): Promise; - replace( - url: string | UrlLike, - as?: string | UrlLike, - options?: EventChangeOptions, - ): Promise; - - // events (deprecated soonish) - onAppUpdated?(nextRoute: string): void; - onBeforeHistoryChange?(as: string): void; - onHashChangeStart?(url: string): void; - onHashChangeComplete?(url: string): void; - onRouteChangeComplete?(url: string): void; - onRouteChangeError?(error: RouteChangeError, url: string): void; - onRouteChangeStart?(url: string): void; - - // events API (6.1.1+) - readonly events: { - on: (eventName: EventName, handler: EventHandler | ErrorEventHandler) => void; - off: (eventName: EventName, handler: (url: string) => any) => void; - }; -} - -export interface SingletonRouter extends RouterProps { - router: RouterProps | null; - readyCallbacks: RouterCallback[]; - ready(cb: RouterCallback): void; -} - -export interface WithRouterProps { - router: SingletonRouter; -} - -// Manually disabling the no-unnecessary-generics rule so users can -// retain type inference if they warp their component in withRouter -// without defining props explicitly -export function withRouter( - // tslint:disable-next-line:no-unnecessary-generics - Component: React.ComponentType>, -): React.ComponentType; - -declare const Router: SingletonRouter; -export default Router; +export * from 'next-server/router'; +export { default } from 'next-server/router'; diff --git a/types/next/test/next-app-tests.tsx b/types/next/test/next-app-tests.tsx index 8cf3e30655..eaa2c0ad07 100644 --- a/types/next/test/next-app-tests.tsx +++ b/types/next/test/next-app-tests.tsx @@ -2,8 +2,8 @@ import * as React from "react"; import App, { Container, NextAppContext, AppProps, AppComponentType } from "next/app"; import { DefaultQuery } from "next/router"; -interface NextComponentProps { - example: string; +interface TestAppProps { + pageProps: any; } interface TypedQuery extends DefaultQuery { @@ -21,10 +21,10 @@ class TestApp extends App { } } -class TestAppWithProps extends App { +class TestAppWithProps extends App { static async getInitialProps({ Component, router, ctx }: NextAppContext) { const pageProps = Component.getInitialProps && (await Component.getInitialProps(ctx)); - return { pageProps, example: "foobar" }; + return { pageProps }; } render() { @@ -55,8 +55,8 @@ interface TestProps { } // Stateful HOC that adds props to wrapped component. Similar to what withRedux does. -// tslint:disable-next-line no-unnecessary-generics -const withExample =

      (App: AppComponentType

      ) => +// tslint:disable-next-line no-unnecessary-generics, use-default-type-parameter +const withExample =

      (App: AppComponentType

      ) => class extends React.Component

      { test: string; @@ -79,7 +79,7 @@ const withExample =

      (App: AppComponentType

      ) // Basic stateless HOC. Similar to what withAuth would do. // tslint:disable-next-line no-unnecessary-generics -const withBasic =

      (App: AppComponentType) => +const withBasic =

      (App: AppComponentType) => class extends React.Component

      { static async getInitialProps(context: C) { const pageProps = App.getInitialProps && (await App.getInitialProps(context)); diff --git a/types/next/test/next-constants-tests.ts b/types/next/test/next-constants-tests.ts new file mode 100644 index 0000000000..64413ea97c --- /dev/null +++ b/types/next/test/next-constants-tests.ts @@ -0,0 +1,30 @@ +import { + PHASE_DEVELOPMENT_SERVER, + IS_BUNDLED_PAGE_REGEX +} from "next/constants"; + +const isIndexPage = IS_BUNDLED_PAGE_REGEX.test( + "static/CjW0mFnyG80HdP4eSUiy7/pages/index.js" +); + +// Example taken from: https://github.com/cyrilwanner/next-compose-plugins/blob/a25b313899638912cc9defc0be072f4fe4a1e855/README.md +const config = (nextConfig: any = {}) => { + return { + ...nextConfig, + + // define in which phases this plugin should get applied. + // you can also use multiple phases or negate them. + // however, users can still overwrite them in their configuration if they really want to. + phases: [PHASE_DEVELOPMENT_SERVER], + + webpack(config: any, options: any) { + // do something here which only gets applied during development server phase + + if (typeof nextConfig.webpack === "function") { + return nextConfig.webpack(config, options); + } + + return config; + } + }; +}; diff --git a/types/next/test/next-document-tests.tsx b/types/next/test/next-document-tests.tsx index 40f01adfef..bf7ccf036d 100644 --- a/types/next/test/next-document-tests.tsx +++ b/types/next/test/next-document-tests.tsx @@ -1,47 +1,77 @@ -import Document, { DocumentProps, Enhancer, Head, Main, NextScript, NextDocumentContext, PageProps } from 'next/document'; +import Document, { + DocumentProps, + Enhancer, + Head, + Main, + NextScript, + NextDocumentContext, + PageProps +} from "next/document"; import * as React from "react"; -const basicResults = ( - - - - -

      - - -); +interface WithUrlProps { + url: string; +} -const withNonce = ( - - - - -); - -class MyDoc extends Document { - static async getInitialProps({ renderPage }: NextDocumentContext) { - // without callback - const _page = renderPage(); - - // with callback - const enhancer: Enhancer = (App) => (props) => (); - const { html, head, errorHtml, chunks, buildManifest } = renderPage(enhancer); - - const style = {}; - - return { html, head, errorHtml, chunks, buildManifest, style }; +class MyDocumentDefault extends Document { + static async getInitialProps(ctx: NextDocumentContext) { + const initialProps = await Document.getInitialProps(ctx); + return { ...initialProps }; } render() { return ( + + + +
      + + + + ); + } +} + +class MyDoc extends Document { + static getInitialProps({ req, renderPage }: NextDocumentContext) { + // without callback + const _page = renderPage(); + + // with callback + const enhancer: Enhancer = App => props => ; + const { html, head, buildManifest } = renderPage(enhancer); + + const styles = [